From bbf9919ad3f73e921289b6e5d6086774dd5f2df2 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 23 Jun 2022 11:37:04 +0200 Subject: [PATCH] [alpa] extendetState: fix irrigatiopn time stuff --- CHANGED | 2 +- FHEM/74_GardenaSmartDevice.pm | 11 +++++++---- controls_GardenaSmartDevice.txt | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGED b/CHANGED index 8430654..7bd11d7 100644 --- a/CHANGED +++ b/CHANGED @@ -1 +1 @@ - scheduling if event != '' + [alpha] - extendedState - fix next irrigation and irregation left time diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index 77fba9e..fea6284 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -756,10 +756,13 @@ sub WriteReadings { $decode_json->{abilities}[$abilities]{name} . '-' . $propertie->{name} . '_irrigation_left', - sprintf("%.f" ,(RigReadingsValue( - $hash, - $decode_json->{abilities}[$abilities]{timestamp} - "%Y-%m-%d %H:%M:%S")+($propertie->{value}{duration} + 3 )) - Time::Piece::localtime->new ) + sprintf("%.f" , + + Time::Piece::localtime->strptime( + RigReadingsValue( + $hash, + $decode_json->{abilities}[$abilities]{timestamp}), + "%Y-%m-%d %H:%M:%S") +($propertie->{value}{duration} + 3 ) - Time::Piece::localtime->new ) ) if ( defined( $propertie->{value} ) && $decode_json->{abilities}[$abilities]{name} eq 'watering' diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 7210d20..b12b556 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ UPD 2022-06-21_08:17:57 49520 FHEM/73_GardenaSmartBridge.pm -UPD 2022-06-23_11:30:43 70219 FHEM/74_GardenaSmartDevice.pm +UPD 2022-06-23_11:36:38 70324 FHEM/74_GardenaSmartDevice.pm