[fix] state , initial nearst fallback, paused untel readded - paused_until is UTC no bug -> calc for state in localtim

This commit is contained in:
Sebastian 2022-07-10 20:16:07 +02:00
parent 97540ef9c4
commit c6ee46489b
3 changed files with 10 additions and 7 deletions

View File

@ -1 +1 @@
[enhancement] - scheudiles handling wc,ic24,pump, next schedule, permanenlty cloesd [fix] Garbage at end of string in strptime

View File

@ -959,7 +959,7 @@ sub setState {
} else { } else {
$nearst_irrigation = ReadingsVal($name, 'scheduling-scheduled_watering_next_start', ''); $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) ? sprintf( (RigReadingsValue($hash, 'will be irrigated %.f minutes remaining.')), $longest_duration/60)
# zu # zu
: :
( $has_schedule ) ( $has_schedule
&& $nearst_irrigation ne '2999-12-12 12:00')
# zeitplan aktiv # 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.*') ? ( $nearst_irrigation eq RigReadingsValue( $hash, 'n/a') || $nearst_irrigation =~ '2038-01-18.*')
# dauerhaft pausiert # dauerhaft pausiert
? sprintf( (RigReadingsValue($hash, 'closed') .'. '.RigReadingsValue($hash , 'schedule permanently paused')) ) ? sprintf( (RigReadingsValue($hash, 'closed') .'. '.RigReadingsValue($hash , 'schedule permanently paused')) )
# naechster zeutplan # 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 # zeitplan pausiert
: RigReadingsValue($hash, 'closed') : RigReadingsValue($hash, 'closed')
; ;
# state offline | override # state offline | override
$state_string = 'offline' if ($online_state eq 'offline'); $state_string = 'offline' if ($online_state eq 'offline');

View File

@ -1,2 +1,2 @@
UPD 2022-07-01_16:13:02 49241 FHEM/73_GardenaSmartBridge.pm 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