From 40074a3db67e3c400d6588ae6a3d31199a505334 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 27 May 2022 11:44:59 +0200 Subject: [PATCH] add lona readings --- CHANGED | 2 +- FHEM/74_GardenaSmartDevice.pm | 24 ++++++++++++++++++------ controls_GardenaSmartDevice.txt | 4 ++-- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/CHANGED b/CHANGED index ebe0585..e3be7a0 100644 --- a/CHANGED +++ b/CHANGED @@ -1 +1 @@ - fix lona + Reviewed-on: https://git.cooltux.net/FHEM/mod-GardenaSmart/pulls/58 diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index 2ffdf20..b4ca0a3 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -776,13 +776,25 @@ sub WriteReadings { if ( ref( $propertie->{value} ) eq "HASH" ) { while ( my ( $r, $v ) = each %{ $propertie->{value} } ) { - readingsBulkUpdate( - $hash, - $decode_json->{abilities}[$abilities]{name} . '-' +^ if ( ref( $v ) ne "HASH" ) { + readingsBulkUpdate( + $hash, + $decode_json->{abilities}[$abilities]{name} . '-' + . $propertie->{name} . '_' + . $r, + RigReadingsValue( $hash, $v ) + ); + } else { + while ( my ( $i_r, $i_v ) = each %{ $v } ) { + readingsBulkUpdate( + $hash, + $decode_json->{abilities}[$abilities]{name} . '-' . $propertie->{name} . '_' - . $r, - RigReadingsValue( $hash, $v ) - ); + . $r . '_' . $i_r, + RigReadingsValue( $hash, $i_v ) + ); + } + } } } } diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index aa00f56..61935f2 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2022-05-17_20:53:29 49913 FHEM/73_GardenaSmartBridge.pm -UPD 2022-05-17_11:06:17 66211 FHEM/74_GardenaSmartDevice.pm +UPD 2022-05-27_11:41:32 49913 FHEM/73_GardenaSmartBridge.pm +UPD 2022-05-27_11:44:30 66807 FHEM/74_GardenaSmartDevice.pm