[fix] - watering_next_start

This commit is contained in:
Sebastian 2022-06-25 16:17:28 +02:00
parent 2cbe907db4
commit 8dd9771033
3 changed files with 8 additions and 4 deletions

View File

@ -1 +1 @@
[fix] - ix state
[alpha] - extendedstate: state fix if empty or not exists

View File

@ -798,8 +798,12 @@ sub WriteReadings {
#ic24 schedules pause until
if ($decode_json->{settings}[$settings]{name} =~ /schedules_paused_until_?\d?$/) {
#my $ventil = substr($decode_json->{settings}[$settings]{name}, -1); # => 1 - 6
# check if empty, clear scheduling-scheduled_watering_next_start_x
readingsBulkUpdateIfChanged( $hash, 'scheduling-'.$decode_json->{settings}[$settings]{name},
$decode_json->{settings}[$settings]{value} );
readingsBulkUpdateIfChanged( $hash, "scheduling-scheduled_watering_next_start_$1", $decode_json->{settings}[$settings]{value}) if ($decode_json->{settings}[$settings]{value} eq '');
# CommandAttr( undef, $name . " scheduling-scheduled_watering_next_start_") if ($decode_json->{settings}[$settings]{value} eq '' )
}
######
@ -904,7 +908,7 @@ sub setState {
$nearst_irrigation = ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, '')
if (
Time::Piece->strptime( ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, ''), "%Y-%m-%d %H:%M") < Time::Piece->strptime( $nearst_irrigation, "%Y-%m-%d %H:%M")
&& $has_scheduling
&& $has_scheduling && Time::Piece->strptime( ReadingsVal($name, 'scheduling-scheduled_watering_next_start_'.$_, ''), "%Y-%m-%d %H:%M") > Time::Pice->new
)
} # fi
}

View File

@ -1,2 +1,2 @@
UPD 2022-06-24_13:45:33 49520 FHEM/73_GardenaSmartBridge.pm
UPD 2022-06-24_18:40:19 69564 FHEM/74_GardenaSmartDevice.pm
UPD 2022-06-25_13:02:19 49520 FHEM/73_GardenaSmartBridge.pm
UPD 2022-06-25_16:17:07 70122 FHEM/74_GardenaSmartDevice.pm