From c6ee46489bb1fa0abc29152215dcbfac26927b19 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 10 Jul 2022 20:16:07 +0200 Subject: [PATCH] [fix] state , initial nearst fallback, paused untel readded - paused_until is UTC no bug -> calc for state in localtim --- CHANGED | 2 +- FHEM/74_GardenaSmartDevice.pm | 13 ++++++++----- controls_GardenaSmartDevice.txt | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGED b/CHANGED index bbbfd2d..2203b05 100644 --- a/CHANGED +++ b/CHANGED @@ -1 +1 @@ - [enhancement] - scheudiles handling wc,ic24,pump, next schedule, permanenlty cloesd + [fix] Garbage at end of string in strptime diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index 2d27b6f..a1e3325 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -959,7 +959,7 @@ sub setState { } else { $nearst_irrigation = ReadingsVal($name, 'scheduling-scheduled_watering_next_start', ''); } - Log3 $name, 3, "[DEBUG] - nearst 2: $nearst_irrigation"; + Log3 $name, 3, "[DEBUG] - choosed nearst: $nearst_irrigation"; ###### @@ -1022,16 +1022,19 @@ sub setState { ? sprintf( (RigReadingsValue($hash, 'will be irrigated %.f minutes remaining.')), $longest_duration/60) # zu : - ( $has_schedule ) + ( $has_schedule + && $nearst_irrigation ne '2999-12-12 12:00') # zeitplan aktiv - # ? ( $nearst_irrigation eq '2038-01-18 00:00') + # ? ( $nearst_irrigation eq '2038-01-18 00:00') sprintf( RigReadingsValue($hash, 'paused until %s') , $nearst_irrigation) ? ( $nearst_irrigation eq RigReadingsValue( $hash, 'n/a') || $nearst_irrigation =~ '2038-01-18.*') # dauerhaft pausiert ? sprintf( (RigReadingsValue($hash, 'closed') .'. '.RigReadingsValue($hash , 'schedule permanently paused')) ) # naechster zeutplan - : sprintf( (RigReadingsValue($hash, 'closed') .'. '.RigReadingsValue($hash, 'next watering: %s')), $nearst_irrigation ) + : (ReadingsVal($name, 'scheduling-scheduled_watering_next_start', '') eq RigReadingsValue($hash, 'n/a')) + ? sprintf( RigReadingsValue($hash, 'paused until %s') , $nearst_irrigation) + : sprintf( (RigReadingsValue($hash, 'closed') .'. '.RigReadingsValue($hash, 'next watering: %s')), $nearst_irrigation ) # zeitplan pausiert - : RigReadingsValue($hash, 'closed') + : RigReadingsValue($hash, 'closed') ; # state offline | override $state_string = 'offline' if ($online_state eq 'offline'); diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 0324260..c624819 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ UPD 2022-07-01_16:13:02 49241 FHEM/73_GardenaSmartBridge.pm -UPD 2022-07-08_15:37:45 75905 FHEM/74_GardenaSmartDevice.pm +UPD 2022-07-10_20:11:36 76264 FHEM/74_GardenaSmartDevice.pm