From 8d1358ff91446449a4665365eeeef60392c031ab Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Mon, 16 Sep 2019 17:56:34 +0200 Subject: [PATCH 1/5] redesign code --- 73_AutoShuttersControl.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/73_AutoShuttersControl.pm b/73_AutoShuttersControl.pm index 5151ac9..c31b006 100644 --- a/73_AutoShuttersControl.pm +++ b/73_AutoShuttersControl.pm @@ -4357,7 +4357,9 @@ sub getBrightnessAverage { return &FHEM::AutoShuttersControl::_averageBrightness( @{ $self->{ $self->{shuttersDev} }->{BrightnessAverageArray}->{VAL} } ) if ( - scalar( + ref( $self->{ $self->{shuttersDev} }->{BrightnessAverageArray}->{VAL} ) + eq 'ARRAY' + and scalar( @{ $self->{ $self->{shuttersDev} }->{BrightnessAverageArray}->{VAL} } From 123ad8747b952c3176532c7b0e70d99844b98447 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 17 Sep 2019 09:55:18 +0200 Subject: [PATCH 2/5] change timelimit for restart initial frequence --- 73_AutoShuttersControl.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/73_AutoShuttersControl.pm b/73_AutoShuttersControl.pm index c31b006..8e65de9 100644 --- a/73_AutoShuttersControl.pm +++ b/73_AutoShuttersControl.pm @@ -2569,7 +2569,7 @@ sub RenewSunRiseSetShuttersTimer($) { #### Gleichlautende Attribute wo lediglich die Parameter geändert werden sollen müssen bereits in der Funktion ShuttersDeviceScan gelöscht werden #### vorher empfiehlt es sich die dort vergebenen Parameter aus zu lesen um sie dann hier wieder neu zu setzen. Dazu wird das shutters Objekt um einen Eintrag #### 'AttrUpdateChanges' erweitert - if ( ( int( gettimeofday() ) - $::fhem_started ) < 20 + if ( ( int( gettimeofday() ) - $::fhem_started ) < 30 and ReadingsVal( $_, '.ASC_AttrUpdateChanges_' . $hash->{VERSION}, 0 ) == 0 ) From 9e570fc894e3ef5516b777b1a97f7056dd454c30 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Fri, 20 Sep 2019 12:55:01 +0200 Subject: [PATCH 3/5] change code in ShuttersCommandSet --- 73_AutoShuttersControl.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/73_AutoShuttersControl.pm b/73_AutoShuttersControl.pm index 8e65de9..aee7d58 100644 --- a/73_AutoShuttersControl.pm +++ b/73_AutoShuttersControl.pm @@ -2374,7 +2374,11 @@ sub ShuttersCommandSet($$$) { $shutters->setShuttersDev($shuttersDev); if ( - $posValue != $shutters->getShadingPos + $posValue != $shutters->getShadingPos + or ( $posValue == $shutters->getShadingPos + and CheckIfShuttersWindowRecOpen($shuttersDev) == 2 + and $shutters->getShuttersPlace eq 'terrace' + ) and ( ( $shutters->getPartyMode eq 'on' @@ -6656,7 +6660,7 @@ sub getblockAscDrivesAfterManual { "release_status": "under develop", "license": "GPL_2", "version": "v0.6.31", - "x_developmentversion": "v0.6.19.34", + "x_developmentversion": "v0.6.19.35", "author": [ "Marko Oldenburg " ], From d113f02250892082000e9b13cd682e3a92a03a2d Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Fri, 20 Sep 2019 20:38:31 +0200 Subject: [PATCH 4/5] fix partyMode and window open condition --- 73_AutoShuttersControl.pm | 70 ++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/73_AutoShuttersControl.pm b/73_AutoShuttersControl.pm index aee7d58..1cdb550 100644 --- a/73_AutoShuttersControl.pm +++ b/73_AutoShuttersControl.pm @@ -2374,42 +2374,50 @@ sub ShuttersCommandSet($$$) { $shutters->setShuttersDev($shuttersDev); if ( - $posValue != $shutters->getShadingPos - or ( $posValue == $shutters->getShadingPos - and CheckIfShuttersWindowRecOpen($shuttersDev) == 2 - and $shutters->getShuttersPlace eq 'terrace' - ) - and ( - ( - $shutters->getPartyMode eq 'on' - and $ascDev->getPartyMode eq 'on' - ) - or ( + ( + $posValue == $shutters->getShadingPos + and ( CheckIfShuttersWindowRecOpen($shuttersDev) == 2 - and $shutters->getSubTyp eq 'threestate' - and ( $ascDev->getAutoShuttersControlComfort eq 'off' - or $shutters->getComfortOpenPos != $posValue ) - and $shutters->getVentilateOpen eq 'on' - and $shutters->getShuttersPlace eq 'window' - and $shutters->getLockOut ne 'off' - ) - or ( CheckIfShuttersWindowRecOpen($shuttersDev) == 2 - and $shutters->getSubTyp eq 'threestate' - and $ascDev->getAutoShuttersControlComfort eq 'on' - and $shutters->getVentilateOpen eq 'off' - and $shutters->getShuttersPlace eq 'window' - and $shutters->getLockOut ne 'off' ) - or ( - CheckIfShuttersWindowRecOpen($shuttersDev) == 2 + and $shutters->getShuttersPlace eq 'terrace' and ( $shutters->getLockOut eq 'soft' or $shutters->getLockOut eq 'hard' ) and not $shutters->getQueryShuttersPos($posValue) ) - or ( CheckIfShuttersWindowRecOpen($shuttersDev) == 2 - and $shutters->getShuttersPlace eq 'terrace' - and not $shutters->getQueryShuttersPos($posValue) ) - or ( $shutters->getRainProtectionStatus eq 'protected' - and $shutters->getWindProtectionStatus eq 'protected' ) + ) + or ( + $posValue != $shutters->getShadingPos + and ( + ( + $shutters->getPartyMode eq 'on' + and $ascDev->getPartyMode eq 'on' + ) + or ( + CheckIfShuttersWindowRecOpen($shuttersDev) == 2 + and $shutters->getSubTyp eq 'threestate' + and ( $ascDev->getAutoShuttersControlComfort eq 'off' + or $shutters->getComfortOpenPos != $posValue ) + and $shutters->getVentilateOpen eq 'on' + and $shutters->getShuttersPlace eq 'window' + and $shutters->getLockOut ne 'off' + ) + or ( CheckIfShuttersWindowRecOpen($shuttersDev) == 2 + and $shutters->getSubTyp eq 'threestate' + and $ascDev->getAutoShuttersControlComfort eq 'on' + and $shutters->getVentilateOpen eq 'off' + and $shutters->getShuttersPlace eq 'window' + and $shutters->getLockOut ne 'off' ) + or ( + CheckIfShuttersWindowRecOpen($shuttersDev) == 2 + and ( $shutters->getLockOut eq 'soft' + or $shutters->getLockOut eq 'hard' ) + and not $shutters->getQueryShuttersPos($posValue) + ) + or ( CheckIfShuttersWindowRecOpen($shuttersDev) == 2 + and $shutters->getShuttersPlace eq 'terrace' + and not $shutters->getQueryShuttersPos($posValue) ) + or ( $shutters->getRainProtectionStatus eq 'protected' + and $shutters->getWindProtectionStatus eq 'protected' ) + ) ) ) { From f143f06da4e5a4437c44e4c07b30ac3fa4ee1b3c Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Fri, 20 Sep 2019 20:40:15 +0200 Subject: [PATCH 5/5] remove developer version --- 73_AutoShuttersControl.pm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/73_AutoShuttersControl.pm b/73_AutoShuttersControl.pm index 1cdb550..89ff181 100644 --- a/73_AutoShuttersControl.pm +++ b/73_AutoShuttersControl.pm @@ -342,13 +342,8 @@ sub Define($$) { $hash->{MID} = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' ; # eine Ein Eindeutige ID für interne FHEM Belange / nicht weiter wichtig - # ### Versionierung ### - # Stable Version $hash->{VERSION} = version->parse($VERSION)->normal; - # Developer Version - # $hash->{DEV_VERSION} = FHEM::Meta::Get( $hash, 'x_developmentversion' ); - $hash->{NOTIFYDEV} = 'global,' . $name; # Liste aller Devices auf deren Events gehört werden sollen #$hash->{shutters} = $shutters; @@ -6667,8 +6662,7 @@ sub getblockAscDrivesAfterManual { ], "release_status": "under develop", "license": "GPL_2", - "version": "v0.6.31", - "x_developmentversion": "v0.6.19.35", + "version": "v0.6.32", "author": [ "Marko Oldenburg " ],