From 4d968405fd721cc2a90da6d20f1e38adc2bf0bc0 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 18 May 2021 08:42:49 +0200 Subject: [PATCH] change remove InternalTimer Routine for Rain Unprotection --- controls_AutoShuttersControl.txt | 4 +-- .../ShuttersControl/Rainprotection.pm | 32 +++++++++++-------- .../Automation/ShuttersControl/Shutters.pm | 6 ---- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/controls_AutoShuttersControl.txt b/controls_AutoShuttersControl.txt index 5824cda..f6380f2 100644 --- a/controls_AutoShuttersControl.txt +++ b/controls_AutoShuttersControl.txt @@ -2,7 +2,7 @@ UPD 2021-05-17_14:30:37 97974 FHEM/73_AutoShuttersControl.pm UPD 2021-05-17_14:34:49 74350 lib/FHEM/Automation/ShuttersControl.pm UPD 2020-06-22_09:41:40 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm UPD 2020-07-26_17:36:29 2496 lib/FHEM/Automation/ShuttersControl/Roommate.pm -UPD 2021-05-18_08:26:00 32241 lib/FHEM/Automation/ShuttersControl/Shutters.pm +UPD 2021-05-18_08:41:07 31896 lib/FHEM/Automation/ShuttersControl/Shutters.pm UPD 2021-05-17_14:30:37 25329 lib/FHEM/Automation/ShuttersControl/Shading.pm UPD 2021-05-17_14:34:49 108472 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm UPD 2021-02-26_14:36:10 40628 lib/FHEM/Automation/ShuttersControl/Helper.pm @@ -13,4 +13,4 @@ UPD 2021-01-29_10:06:33 52525 lib/FHEM/Automation/ShuttersControl/Shutters/Attr. UPD 2020-06-22_09:41:40 2903 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm UPD 2021-01-29_10:06:33 3980 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm UPD 2020-06-22_09:41:40 2288 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm -UPD 2021-05-18_08:38:16 5582 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm +UPD 2021-05-18_08:42:09 5795 lib/FHEM/Automation/ShuttersControl/Rainprotection.pm diff --git a/lib/FHEM/Automation/ShuttersControl/Rainprotection.pm b/lib/FHEM/Automation/ShuttersControl/Rainprotection.pm index f4e4b19..b87f092 100644 --- a/lib/FHEM/Automation/ShuttersControl/Rainprotection.pm +++ b/lib/FHEM/Automation/ShuttersControl/Rainprotection.pm @@ -129,20 +129,26 @@ sub _RainUnprotected { $FHEM::Automation::ShuttersControl::shutters->setLastDrive( 'rain un-protected'); - $FHEM::Automation::ShuttersControl::shutters->setDriveCmd( - ( - $FHEM::Automation::ShuttersControl::shutters->getIsDay - ? $FHEM::Automation::ShuttersControl::shutters->getLastPos - : ( - $FHEM::Automation::ShuttersControl::shutters - ->getPrivacyDownStatus == 2 - ? $FHEM::Automation::ShuttersControl::shutters - ->getPrivacyDownPos - : $FHEM::Automation::ShuttersControl::shutters - ->getClosedPos - ) + + if ( $shutters->getRainUnprotectionDelayObj ne 'none' ) { + ::Remove::InternalTimer($FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj); + $FHEM::Automation::ShuttersControl::shutters->setRainUnprotectionDelayObj('none'); + } + + $FHEM::Automation::ShuttersControl::shutters->setDriveCmd( + ( + $FHEM::Automation::ShuttersControl::shutters->getIsDay + ? $FHEM::Automation::ShuttersControl::shutters->getLastPos + : ( + $FHEM::Automation::ShuttersControl::shutters + ->getPrivacyDownStatus == 2 + ? $FHEM::Automation::ShuttersControl::shutters + ->getPrivacyDownPos + : $FHEM::Automation::ShuttersControl::shutters + ->getClosedPos ) - ); + ) + ); $FHEM::Automation::ShuttersControl::shutters ->setRainProtectionStatus('unprotected'); diff --git a/lib/FHEM/Automation/ShuttersControl/Shutters.pm b/lib/FHEM/Automation/ShuttersControl/Shutters.pm index 6c9a0b2..6d7ec48 100644 --- a/lib/FHEM/Automation/ShuttersControl/Shutters.pm +++ b/lib/FHEM/Automation/ShuttersControl/Shutters.pm @@ -207,12 +207,6 @@ sub setDriveCmd { . ' - antifreeze mode' ); } } - - ### Rainprotection unprotected Delay Routine - if ( $shutters->getRainUnprotectionDelayObj ne 'none' ) { - ::Remove::InternalTimer($FHEM::Automation::ShuttersControl::shutters->getRainUnprotectionDelayObj); - $FHEM::Automation::ShuttersControl::shutters->setRainUnprotectionDelayObj('none'); - } my %h = ( shuttersDev => $self->{shuttersDev},