closed: #53 Patch beliebigen Fahrbefehl zulassen #54

Merged
marko merged 8 commits from patch-implementationCommandTemplate into devel 2021-10-27 06:37:27 +00:00
3 changed files with 54 additions and 33 deletions
Showing only changes of commit 096e4ab815 - Show all commits

View File

@ -1,15 +1,15 @@
UPD 2021-10-24_07:33:53 111901 FHEM/73_AutoShuttersControl.pm 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 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm
UPD 2021-10-09_07:12:54 2494 lib/FHEM/Automation/ShuttersControl/Roommate.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-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-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 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 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 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 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 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 3978 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm
UPD 2021-10-09_07:12:54 2286 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm UPD 2021-10-09_07:12:54 2286 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm

View File

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

View File

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