From 3780befa7a55bceb58a65cfa9a7f302a20a5fd17 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 23 Jun 2022 12:11:00 +0200 Subject: [PATCH] dry run --- CHANGED | 2 +- FHEM/74_GardenaSmartDevice.pm | 13 +++++++++++++ controls_GardenaSmartDevice.txt | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGED b/CHANGED index 806a9d2..015ce8a 100644 --- a/CHANGED +++ b/CHANGED @@ -1 +1 @@ - [alpha] extemdedState - fix state + [alpha] - extendetState. fix state diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index 5b70daa..712832b 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -765,6 +765,19 @@ sub WriteReadings { && $decode_json->{abilities}[$abilities]{name} eq 'watering' && $propertie->{value}{duration} > 0 ); + if ( defined( $propertie->{value} ) + && $decode_json->{abilities}[$abilities]{name} eq 'watering' + && $propertie->{value}{duration} > 0 ){ + my $dt = Time::Piece::localtime->strptime( $decode_json->{abilities}[$abilities]{timestamp}, "%Y-%m-%d %H:%M:%S"); + Log3 $name, 2, "[DEBUG] $dt"; + my $ndt = Time::Piece::localtime->new; + Log3 $name, 2, "[DEBUG] $ndt"; + Log3 $name, 2, "[DEBUG] " . $dt + ($propertie->{value}{duration} + 3 ); + Log3 $name, 2, "[DEBUG] " . sprintf("%.f" , + Time::Piece::localtime->strptime( + $decode_json->{abilities}[$abilities]{timestamp}, "%Y-%m-%d %H:%M:%S") + + ($propertie->{value}{duration} + 3 ) - Time::Piece::localtime->new ); + } #2022-06-21T08:56:42.488Z -> 2022-06-21 08:56:48 diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index f102af9..5564072 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_12:08:11 70232 FHEM/74_GardenaSmartDevice.pm +UPD 2022-06-23_12:10:53 71160 FHEM/74_GardenaSmartDevice.pm