From 775219b0342c4f234eae3090272cf1e255abac12 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Fri, 17 Apr 2020 12:01:25 +0200 Subject: [PATCH] add extra Slat Device and SlatCmd Code, add new Attribut ASC_SlatPosCmd_SlatDevice --- 73_AutoShuttersControl.pm | 51 ++++++--------------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/73_AutoShuttersControl.pm b/73_AutoShuttersControl.pm index 015e5da..c425203 100644 --- a/73_AutoShuttersControl.pm +++ b/73_AutoShuttersControl.pm @@ -4404,51 +4404,18 @@ sub _SetCmdFn { . $shutters->getLastDrive ); my $driveCommand = $shutters->getPosSetCmd . ' ' . $posValue; - my $slatPos = undef; + my $slatPos = -1; if ( $shutters->getShadingPositionAssignment ne 'none' && $shutters->getShadingPositionAssignment =~ m{\A[a-zA-Z]+\z}xms ) { $driveCommand = _DetermineSlatCmd( $driveCommand, $posValue ); - -# $driveCommand = -# $posValue == $shutters->getShadingPos -# && $shutters->getShadingPositionAssignment ne 'none' ? $shutters->getShadingPositionAssignment -# : $posValue == $shutters->getVentilatePos -# && $shutters->getVentilatePositionAssignment ne 'none' ? $shutters->getVentilatePositionAssignment -# : $posValue == $shutters->getOpenPos -# && $shutters->getOpenPositionAssignment ne 'none' ? $shutters->getOpenPositionAssignment -# : $posValue == $shutters->getClosedPos -# && $shutters->getClosedPositionAssignment ne 'none' ? $shutters->getClosedPositionAssignment -# : $posValue == $shutters->getSleepPos -# && $shutters->getSleepPositionAssignment ne 'none' ? $shutters->getSleepPositionAssignment -# : $posValue == $shutters->getComfortOpenPos -# && $shutters->getComfortOpenPositionAssignment ne 'none' ? $shutters->getComfortOpenPositionAssignment -# : $posValue == $shutters->getAntiFreezePos -# && $shutters->getAntiFreezePosAssignment ne 'none' ? $shutters->getAntiFreezePosAssignment -# : $driveCommand; } elsif ($shutters->getShadingPositionAssignment ne 'none' && $shutters->getShadingPositionAssignment =~ m{\A\d{1,3}\z}xms ) { + $slatPos = _DetermineSlatCmd( $slatPos, $posValue ); - -# $slatPos = -# $posValue == $shutters->getShadingPos -# && $shutters->getShadingPositionAssignment ne 'none' ? $shutters->getShadingPositionAssignment -# : $posValue == $shutters->getVentilatePos -# && $shutters->getVentilatePositionAssignment ne 'none' ? $shutters->getVentilatePositionAssignment -# : $posValue == $shutters->getOpenPos -# && $shutters->getOpenPositionAssignment ne 'none' ? $shutters->getOpenPositionAssignment -# : $posValue == $shutters->getClosedPos -# && $shutters->getClosedPositionAssignment ne 'none' ? $shutters->getClosedPositionAssignment -# : $posValue == $shutters->getSleepPos -# && $shutters->getSleepPositionAssignment ne 'none' ? $shutters->getSleepPositionAssignment -# : $posValue == $shutters->getComfortOpenPos -# && $shutters->getComfortOpenPositionAssignment ne 'none' ? $shutters->getComfortOpenPositionAssignment -# : $posValue == $shutters->getAntiFreezePos -# && $shutters->getAntiFreezePosAssignment ne 'none' ? $shutters->getAntiFreezePosAssignment -# : $slatPos; } CommandSet( undef, @@ -4465,13 +4432,11 @@ sub _SetCmdFn { : $shuttersDev ) . ' ' - . ( - $shutters->getSlatPosCmd ne 'none' ? $shutters->getSlatPosCmd - : $shutters->getPosCmd - ) + . $shutters->getSlatPosCmd . ' ' . $slatPos - ) if ( defined($slatPos) ); + ) if ( $slatPos > -1 + && $shutters->getSlatPosCmd ne 'none' ); $shutters->setSelfDefenseAbsent( 0, 0 ) if (!$shutters->getSelfDefenseAbsent @@ -5705,7 +5670,7 @@ sub getSlatPosCmd { my $self = shift; return $self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice} - ->{uptime} + ->{poscmd} if ( exists( $self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice} @@ -5749,7 +5714,7 @@ sub getSlatDevice { ); $shutters->getSlatPosCmd; - return ( $self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice} ); + return ( $self->{ $self->{shuttersDev} }->{ASC_SlatPosCmd_SlatDevice}->{device} ); } sub getPrivacyUpTime { @@ -8620,7 +8585,7 @@ sub getBlockAscDrivesAfterManual { ], "release_status": "testing", "license": "GPL_2", - "version": "v0.9.3", + "version": "v0.9.4", "author": [ "Marko Oldenburg " ],