[alpa] extendetState: fix irrigatiopn time stuff

This commit is contained in:
Sebastian
2022-06-23 11:37:04 +02:00
parent ab2e990ffb
commit bbf9919ad3
3 changed files with 9 additions and 6 deletions

View File

@ -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'