Patch beliebigen Fahrbefehl zulassen #53

This commit is contained in:
Marko Oldenburg 2021-10-25 17:51:37 +02:00
parent feba24bf99
commit 096e4ab815
3 changed files with 54 additions and 33 deletions

View File

@ -1,15 +1,15 @@
UPD 2021-10-24_07:33:53 111901 FHEM/73_AutoShuttersControl.pm
UPD 2021-10-24_18:37:41 74468 lib/FHEM/Automation/ShuttersControl.pm
UPD 2021-10-25_17:49:27 75117 lib/FHEM/Automation/ShuttersControl.pm
UPD 2021-10-09_07:12:54 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm
UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.pm
UPD 2021-10-24_07:33:53 31900 lib/FHEM/Automation/ShuttersControl/Shutters.pm
UPD 2021-10-09_07:12:54 25333 lib/FHEM/Automation/ShuttersControl/Shading.pm
UPD 2021-10-25_09:47:08 110681 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
UPD 2021-10-25_10:08:13 110681 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm
UPD 2021-10-09_07:12:54 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm
UPD 2021-10-09_07:12:54 2173 lib/FHEM/Automation/ShuttersControl/Window.pm
UPD 2021-10-09_07:12:54 11739 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm
UPD 2021-10-09_07:12:54 7249 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm
UPD 2021-10-09_07:12:54 52523 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm
UPD 2021-10-25_17:36:18 52649 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm
UPD 2021-10-09_07:12:54 2901 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm
UPD 2021-10-09_07:12:54 3978 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm
UPD 2021-10-09_07:12:54 2286 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm

View File

@ -184,9 +184,7 @@ BEGIN {
delFromAttrList
gettimeofday
InternalTimer
RemoveInternalTimer
computeAlignTime
ReplaceEventMap)
RemoveInternalTimer)
);
#-- Export to main context with different name
@ -265,6 +263,7 @@ our %userAttrList = (
'ASC_RainProtection:on,off' => '-',
'ASC_ExternalTrigger' => '-',
'ASC_Adv:on,off' => '-',
'ASC_CommandTemplate' => '-',
'ASC_SlatPosCmd_SlatDevice' => '-',
);
@ -1769,8 +1768,9 @@ sub _SetCmdFn {
. '. Grund der Fahrt: '
. $shutters->getLastDrive );
my $driveCommand = $shutters->getPosSetCmd . ' ' . $posValue;
my $slatPos = -1;
my $driveCommand = $shutters->getPosSetCmd . ' ' . $posValue;
my $commandTemplate = $shutters->getCommandTemplte;
my $slatPos = -1;
if ( $shutters->getShadingPositionAssignment ne 'none'
|| $shutters->getOpenPositionAssignment ne 'none'
@ -1822,32 +1822,47 @@ sub _SetCmdFn {
}
}
CommandSet( undef,
$shuttersDev
. ':FILTER='
. $shutters->getPosCmd . '!='
. $posValue . ' '
. $driveCommand );
if ( $commandTemplate ne 'none' ) { # Patch von Beta-User Forum https://forum.fhem.de/index.php/topic,123659.0.html
# Nutzervariablen setzen
my %specials = (
'$name' => $shuttersDev,
'$level' => $posValue,
'$slatLevel' => $slatPos
);
$commandTemplate = ::EvalSpecials($commandTemplate, %specials);
# CMD ausführen
::AnalyzeCommandChain( $h, $commandTemplate );
}
else {
CommandSet( undef,
$shuttersDev
. ':FILTER='
. $shutters->getPosCmd . '!='
. $posValue . ' '
. $driveCommand );
InternalTimer(
gettimeofday() + 3,
sub() {
CommandSet(
undef,
(
$shutters->getSlatDevice ne 'none'
? $shutters->getSlatDevice
: $shuttersDev
)
. ' '
. $shutters->getSlatPosCmd . ' '
. $slatPos
);
},
$shuttersDev
)
if ( $slatPos > -1
&& $shutters->getSlatPosCmd ne 'none' );
InternalTimer(
gettimeofday() + 3,
sub() {
CommandSet(
undef,
(
$shutters->getSlatDevice ne 'none'
? $shutters->getSlatDevice
: $shuttersDev
)
. ' '
. $shutters->getSlatPosCmd . ' '
. $slatPos
);
},
$shuttersDev
)
if ( $slatPos > -1
&& $shutters->getSlatPosCmd ne 'none' );
}
$shutters->setSelfDefenseAbsent( 0, 0 )
if (!$shutters->getSelfDefenseAbsent

View File

@ -516,6 +516,12 @@ sub getSelfDefenseAbsentDelay {
return AttrVal( $self->{shuttersDev}, 'ASC_Self_Defense_AbsentDelay', 300 );
}
sub getCommandTemplate {
my $self = shift;
return AttrVal( $self->{shuttersDev}, 'ASC_CommandTemplate', 'none' );
}
sub setWiggleValue {
my $self = shift;
my $attrVal = shift;