From 472fe88ac01f404e39769740f29b07f46afc0ad6 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 2 Mar 2023 11:30:19 +0100 Subject: [PATCH 01/12] feat: test --- FHEM/74_GardenaSmartDevice.pm | 6 +++++- controls_GardenaSmartDevice.txt | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index 3cb021f..fc3ec10 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -67,6 +67,8 @@ use Time::Local; use Time::Piece; use Time::Seconds; +use SetExtensions; + # try to use JSON::MaybeXS wrapper # for chance of better performance + open code eval { @@ -561,6 +563,7 @@ sub Set { $abilities = 'winter_settings'; $service_id = $hash->{helper}->{'winter_mode_id'}; } + else { my $list = ''; @@ -613,7 +616,8 @@ sub Set { # all devices has abilitie to fall a sleep $list .= ' winter_mode:awake,hibernate'; - return "Unknown argument $cmd, choose one of $list"; + return SetExtensions($hash, $list, $name, $cmd, @aArg); + # return "Unknown argument $cmd, choose one of $list"; } $hash->{helper}{deviceAction} = $payload; diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 7e270a2..a81a6d6 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-01-10_09:49:28 49646 FHEM/73_GardenaSmartBridge.pm -UPD 2023-01-10_09:49:45 126305 FHEM/74_GardenaSmartDevice.pm +UPD 2023-03-02_11:14:34 49646 FHEM/73_GardenaSmartBridge.pm +UPD 2023-03-02_11:24:07 126390 FHEM/74_GardenaSmartDevice.pm From 608719ba2f374095b8b7ab1a56091042123259d9 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 2 Mar 2023 11:58:29 +0100 Subject: [PATCH 02/12] feat: add setextention --- FHEM/74_GardenaSmartDevice.pm | 5 +++-- controls_GardenaSmartDevice.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index fc3ec10..30f4285 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -144,7 +144,8 @@ BEGIN { modules IOWrite defs - makeDeviceName) + makeDeviceName + SetExtensions) ); } @@ -616,7 +617,7 @@ sub Set { # all devices has abilitie to fall a sleep $list .= ' winter_mode:awake,hibernate'; - return SetExtensions($hash, $list, $name, $cmd, @aArg); + return SetExtensions($hash, $list, $name, $cmd, @$aArg); # return "Unknown argument $cmd, choose one of $list"; } diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index a81a6d6..0806fbc 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ UPD 2023-03-02_11:14:34 49646 FHEM/73_GardenaSmartBridge.pm -UPD 2023-03-02_11:24:07 126390 FHEM/74_GardenaSmartDevice.pm +UPD 2023-03-02_11:44:46 126415 FHEM/74_GardenaSmartDevice.pm From 3e540471d52d09445d9bcb097359b51e1519340a Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 2 Mar 2023 11:58:58 +0100 Subject: [PATCH 03/12] feat: changelog --- CHANGELOG.md | 56 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80b9f53..2e0e684 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,34 @@ -### docs: change verson numbers (HEAD -> patch-changeVersion) +### feat: add setextention (HEAD -> patch_setExtention) +>Thu, 2 Mar 2023 11:58:29 +0100 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### feat: test (origin/patch_setExtention) +>Thu, 2 Mar 2023 11:30:19 +0100 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### docs: add changelog file (tag: v2.6.0, origin/patch-changeVersion) +>Tue, 10 Jan 2023 09:51:23 +0100 + +>Author: Marko Oldenburg (fhemdevelopment@cooltux.net) + +>Commiter: Marko Oldenburg (fhemdevelopment@cooltux.net) + + + + +### docs: change verson numbers >Tue, 10 Jan 2023 09:50:36 +0100 >Author: Marko Oldenburg (fhemdevelopment@cooltux.net) @@ -9,7 +39,7 @@ change modul versions -### test: add hooks (origin/patch-changeVersion) +### test: add hooks >Tue, 10 Jan 2023 09:48:39 +0100 >Author: Marko Oldenburg (fhemdevelopment@cooltux.net) @@ -20,7 +50,7 @@ hooks for commit test and create changelog -### [translaten] - add commandref translation +### [translaten] - add commandref translation (origin/patch-fix_commandref_spell, patch-fix_commandref_spell) >Sun, 18 Sep 2022 08:52:43 +0200 >Author: Sebastian (em@ail.tld) @@ -40,7 +70,7 @@ hooks for commit test and create changelog -### [enhancement] - commandref +### [enhancement] - commandref (origin/patch-wc_rest_valve_and_additinal_commandref, patch-wc_rest_valve_and_additinal_commandref) >Tue, 6 Sep 2022 12:32:40 +0200 >Author: Sebastian (em@ail.tld) @@ -90,7 +120,7 @@ hooks for commit test and create changelog -### [fix] - upper/lower case +### [fix] - upper/lower case (origin/patch-offline_status_startup_undefined, patch-offline_status_startup_undefined) >Thu, 11 Aug 2022 14:25:19 +0200 >Author: Sebastian (em@ail.tld) @@ -380,7 +410,7 @@ hooks for commit test and create changelog -### readd lost setter webinterface +### readd lost setter webinterface (origin/patch-dev_merge_failed_electronic_pressure_pump, patch-dev_merge_failed_electronic_pressure_pump) >Wed, 13 Jul 2022 20:56:47 +0200 >Author: Sebastian (em@ail.tld) @@ -401,7 +431,7 @@ hooks for commit test and create changelog -### „FHEM/74_GardenaSmartDevice.pm“ ändern +### „FHEM/74_GardenaSmartDevice.pm“ ändern (origin/patch_electronic_pressure_pump_water_pump_name_mistake) >Tue, 12 Jul 2022 20:09:33 +0200 >Author: Sebastian Schwaz (sebastianschwarz@noreply@cooltux.net) @@ -621,7 +651,7 @@ hooks for commit test and create changelog -### [fix] - setter procedure +### [fix] - setter procedure (origin/patch_pressure_pump_setlist, patch_pressure_pump_setlist) >Wed, 29 Jun 2022 20:32:00 +0200 >Author: Sebastian (em@ail.tld) @@ -771,7 +801,7 @@ hooks for commit test and create changelog -### patch lono. eventuell recrusive readings einbauen. waterpump rechtschreibfehler mit fixed +### patch lono. eventuell recrusive readings einbauen. waterpump rechtschreibfehler mit fixed (origin/patch_lona, patch_lona) >Sat, 25 Jun 2022 12:58:59 +0200 >Author: Sebastian (em@ail.tld) @@ -1151,7 +1181,7 @@ hooks for commit test and create changelog -### lona +### lona (origin/patch_waterpump, patch_waterpump) >Tue, 17 May 2022 20:53:37 +0200 >Author: Sebastian (em@ail.tld) @@ -1541,7 +1571,7 @@ hooks for commit test and create changelog -### round minutes in irregation +### round minutes in irregation (origin/patch_water_control) >Tue, 12 Apr 2022 08:40:40 +0200 >Author: Sebastian (em@ail.tld) @@ -1681,7 +1711,7 @@ hooks for commit test and create changelog -### fix state +### fix state (origin/patch_add_sensor2) >Tue, 5 Apr 2022 09:23:34 +0200 >Author: Sebastian (em@ail.tld) @@ -1711,7 +1741,7 @@ hooks for commit test and create changelog -### fix ic24 +### fix ic24 (origin/patch_ic24_schedule) >Tue, 29 Mar 2022 16:35:58 +0200 >Author: Sebastian (em@ail.tld) From abb325b448378856fe40a024483f9ba8c44711b3 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 3 Oct 2023 22:40:58 +0200 Subject: [PATCH 04/12] test: versions pump --- FHEM/73_GardenaSmartBridge.pm | 6 +++--- FHEM/74_GardenaSmartDevice.pm | 6 +++--- controls_GardenaSmartDevice.txt | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index 1797313..e81c945 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -75,9 +75,9 @@ eval { use IO::Socket::SSL; 1 } # try to use JSON::MaybeXS wrapper # for chance of better performance + open code eval { - require JSON::MaybeXS; - import JSON::MaybeXS qw( decode_json encode_json ); - 1; + require JSON::MaybeXS; + import JSON::MaybeXS qw( decode_json encode_json ); + 1; } or do { # try to use JSON wrapper diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index 30f4285..2ebdd64 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -72,9 +72,9 @@ use SetExtensions; # try to use JSON::MaybeXS wrapper # for chance of better performance + open code eval { - require JSON::MaybeXS; - import JSON::MaybeXS qw( decode_json encode_json ); - 1; + require JSON::MaybeXS; + import JSON::MaybeXS qw( decode_json encode_json ); + 1; } or do { # try to use JSON wrapper diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 0806fbc..5bbb9c8 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-03-02_11:14:34 49646 FHEM/73_GardenaSmartBridge.pm -UPD 2023-03-02_11:44:46 126415 FHEM/74_GardenaSmartDevice.pm +UPD 2023-10-03_22:40:17 49640 FHEM/73_GardenaSmartBridge.pm +UPD 2023-10-03_22:40:44 126409 FHEM/74_GardenaSmartDevice.pm From 7dfa0b2ddad1a55ab0e26c5c92cbb5fb0f1ba9e2 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 12 Oct 2023 21:52:51 +0200 Subject: [PATCH 05/12] test: gateway readings changed by gardena --- CHANGELOG.md | 24 ++++++++++++++++++++++-- FHEM/73_GardenaSmartBridge.pm | 4 ++-- controls_GardenaSmartDevice.txt | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e0e684..eee81c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,24 @@ -### feat: add setextention (HEAD -> patch_setExtention) +### test: versions pump (HEAD -> patch_mucki) +>Tue, 3 Oct 2023 22:40:58 +0200 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### feat: changelog (origin/patch_setExtention, patch_setExtention) +>Thu, 2 Mar 2023 11:58:58 +0100 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### feat: add setextention >Thu, 2 Mar 2023 11:58:29 +0100 >Author: Sebastian (em@ail.tld) @@ -8,7 +28,7 @@ -### feat: test (origin/patch_setExtention) +### feat: test >Thu, 2 Mar 2023 11:30:19 +0100 >Author: Sebastian (em@ail.tld) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index e81c945..e475137 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -1064,9 +1064,9 @@ sub WriteReadings { if ( ( $decode_json->{abilities}[0]{properties} - [$properties]{name} eq 'ethernet_status' + [$properties]{name} eq 'ethernet_statusO' || $decode_json->{abilities}[0]{properties} - [$properties]{name} eq 'wifi_status' + [$properties]{name} eq 'wifi_statusO' ) && ref($v) eq 'HASH' ) diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 5bbb9c8..c14af7b 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-10-03_22:40:17 49640 FHEM/73_GardenaSmartBridge.pm +UPD 2023-10-12_21:52:18 49642 FHEM/73_GardenaSmartBridge.pm UPD 2023-10-03_22:40:44 126409 FHEM/74_GardenaSmartDevice.pm From 7385959b38f46f724dba20034979d4cbe2149f37 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 21 Oct 2023 20:21:31 +0200 Subject: [PATCH 06/12] test: changed published gateway informations --- CHANGELOG.md | 12 +++++++++++- FHEM/73_GardenaSmartBridge.pm | 18 ++++++++++-------- controls_GardenaSmartDevice.txt | 2 +- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eee81c9..77f306d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ -### test: versions pump (HEAD -> patch_mucki) +### test: gateway readings changed by gardena (HEAD -> patch_mucki) +>Thu, 12 Oct 2023 21:52:51 +0200 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: versions pump (origin/patch_mucki) >Tue, 3 Oct 2023 22:40:58 +0200 >Author: Sebastian (em@ail.tld) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index e475137..e6a0635 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -1064,9 +1064,9 @@ sub WriteReadings { if ( ( $decode_json->{abilities}[0]{properties} - [$properties]{name} eq 'ethernet_statusO' + [$properties]{name} eq 'ethernet_status' || $decode_json->{abilities}[0]{properties} - [$properties]{name} eq 'wifi_statusO' + [$properties]{name} eq 'wifi_status' ) && ref($v) eq 'HASH' ) @@ -1074,14 +1074,15 @@ sub WriteReadings { if ( $decode_json->{abilities}[0]{properties} [$properties]{name} eq 'ethernet_status' ) { - readingsBulkUpdateIfChanged( $hash, - 'ethernet_status-mac', $v->{mac} ); readingsBulkUpdateIfChanged( $hash, 'ethernet_status-ip', $v->{ip} ) if ( ref( $v->{ip} ) ne 'HASH' ); readingsBulkUpdateIfChanged( $hash, 'ethernet_status-isconnected', - $v->{isConnected} ); + $v->{is_connected} ); + # obsolet, not published anymore + # readingsBulkUpdateIfChanged( $hash, + # 'ethernet_status-mac', $v->{mac} ); } elsif ( $decode_json->{abilities}[0]{properties} [$properties]{name} eq 'wifi_status' ) @@ -1089,13 +1090,14 @@ sub WriteReadings { readingsBulkUpdateIfChanged( $hash, 'wifi_status-ssid', $v->{ssid} ) if ( ref( $v->{ssid} ) ne 'HASH' ); + # obsolet, not published anymore + # readingsBulkUpdateIfChanged( $hash, + # 'wifi_status-mac', $v->{mac} ); readingsBulkUpdateIfChanged( $hash, - 'wifi_status-mac', $v->{mac} ); + 'wifi_status-isconnected', $v->{is_connected} ); readingsBulkUpdateIfChanged( $hash, 'wifi_status-ip', $v->{ip} ) if ( ref( $v->{ip} ) ne 'HASH' ); - readingsBulkUpdateIfChanged( $hash, - 'wifi_status-isconnected', $v->{isConnected} ); readingsBulkUpdateIfChanged( $hash, 'wifi_status-signal', $v->{signal} ); } diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index c14af7b..ec47b39 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-10-12_21:52:18 49642 FHEM/73_GardenaSmartBridge.pm +UPD 2023-10-21_20:21:09 49772 FHEM/73_GardenaSmartBridge.pm UPD 2023-10-03_22:40:44 126409 FHEM/74_GardenaSmartDevice.pm From 13de67f570a28be84c83c56cd1e04329e57a87e8 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 23 Oct 2023 22:04:31 +0200 Subject: [PATCH 07/12] test: fix wifi status if is_connected --- CHANGELOG.md | 14 ++++++++++++-- FHEM/73_GardenaSmartBridge.pm | 11 +++++++---- controls_GardenaSmartDevice.txt | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f306d..a87f35d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ -### test: gateway readings changed by gardena (HEAD -> patch_mucki) +### test: changed published gateway informations (HEAD -> patch_mucki) +>Sat, 21 Oct 2023 20:21:31 +0200 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: gateway readings changed by gardena (origin/patch_mucki) >Thu, 12 Oct 2023 21:52:51 +0200 >Author: Sebastian (em@ail.tld) @@ -8,7 +18,7 @@ -### test: versions pump (origin/patch_mucki) +### test: versions pump >Tue, 3 Oct 2023 22:40:58 +0200 >Author: Sebastian (em@ail.tld) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index e6a0635..e901e8c 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -1087,19 +1087,22 @@ sub WriteReadings { elsif ( $decode_json->{abilities}[0]{properties} [$properties]{name} eq 'wifi_status' ) { + # obsolet, not published anymore TODO: ask user using wifi readingsBulkUpdateIfChanged( $hash, 'wifi_status-ssid', $v->{ssid} ) - if ( ref( $v->{ssid} ) ne 'HASH' ); - # obsolet, not published anymore + if (( ref( $v->{ssid} ) ne 'HASH' ) + && ( $v->{is_connected} )) ; # readingsBulkUpdateIfChanged( $hash, # 'wifi_status-mac', $v->{mac} ); readingsBulkUpdateIfChanged( $hash, 'wifi_status-isconnected', $v->{is_connected} ); readingsBulkUpdateIfChanged( $hash, 'wifi_status-ip', $v->{ip} ) - if ( ref( $v->{ip} ) ne 'HASH' ); + if (( ref( $v->{ip} ) ne 'HASH' ) + && ( $v->{is_connected} )) ; readingsBulkUpdateIfChanged( $hash, - 'wifi_status-signal', $v->{signal} ); + 'wifi_status-signal', $v->{signal} ) + if ( $v->{is_connected} ) ; } } } diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index ec47b39..271db0c 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-10-21_20:21:09 49772 FHEM/73_GardenaSmartBridge.pm +UPD 2023-10-23_22:03:43 49976 FHEM/73_GardenaSmartBridge.pm UPD 2023-10-03_22:40:44 126409 FHEM/74_GardenaSmartDevice.pm From 82907c73a312d6d8d41171d0ede5746d7654ae7e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 25 Oct 2023 22:16:26 +0200 Subject: [PATCH 08/12] test: cleanup initial error handling --- CHANGELOG.md | 14 ++++++++++++-- FHEM/73_GardenaSmartBridge.pm | 4 +++- controls_GardenaSmartDevice.txt | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a87f35d..de1082f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ -### test: changed published gateway informations (HEAD -> patch_mucki) +### test: fix wifi status if is_connected (HEAD -> patch_mucki) +>Mon, 23 Oct 2023 22:04:31 +0200 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: changed published gateway informations (origin/patch_mucki) >Sat, 21 Oct 2023 20:21:31 +0200 >Author: Sebastian (em@ail.tld) @@ -8,7 +18,7 @@ -### test: gateway readings changed by gardena (origin/patch_mucki) +### test: gateway readings changed by gardena >Thu, 12 Oct 2023 21:52:51 +0200 >Author: Sebastian (em@ail.tld) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index e901e8c..fd1ed52 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -628,7 +628,9 @@ sub ErrorHandling { if ( $param->{code} == 400 ) { if ($decode_json) { if ( ref( $decode_json->{errors} ) eq "ARRAY" - && defined( $decode_json->{errors} ) ) + && exists( $decode_json->{errors} ) ) + # replace defined with exists + # && defined( $decode_json->{errors} ) ) { readingsBulkUpdate( $dhash, diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 271db0c..2aa8521 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-10-23_22:03:43 49976 FHEM/73_GardenaSmartBridge.pm +UPD 2023-10-25_22:16:11 50086 FHEM/73_GardenaSmartBridge.pm UPD 2023-10-03_22:40:44 126409 FHEM/74_GardenaSmartDevice.pm From 98b093bcba1e85b72608a41ce4c2c727a64c2f4a Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 28 Oct 2023 18:02:17 +0200 Subject: [PATCH 09/12] test: debug line --- CHANGELOG.md | 14 ++++++++++++-- FHEM/73_GardenaSmartBridge.pm | 3 +++ controls_GardenaSmartDevice.txt | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de1082f..7dddca3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ -### test: fix wifi status if is_connected (HEAD -> patch_mucki) +### test: cleanup initial error handling (HEAD -> patch_mucki) +>Wed, 25 Oct 2023 22:16:26 +0200 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: fix wifi status if is_connected (origin/patch_mucki) >Mon, 23 Oct 2023 22:04:31 +0200 >Author: Sebastian (em@ail.tld) @@ -8,7 +18,7 @@ -### test: changed published gateway informations (origin/patch_mucki) +### test: changed published gateway informations >Sat, 21 Oct 2023 20:21:31 +0200 >Author: Sebastian (em@ail.tld) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index fd1ed52..035dda1 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -632,6 +632,9 @@ sub ErrorHandling { # replace defined with exists # && defined( $decode_json->{errors} ) ) { + Log3 $name, 4, "[DEBUG] $name - ERROR HANDLING Bridge Parts 2"; + Log3 $name, 4, "[DEBUG] $name - ERROR HANDLING Bridge Parts 1/2".$decode_json->{errors}; + Log3 $name, 4, "[DEBUG] $name - ERROR HANDLING Bridge Parts 2/2".$decode_json->{errors}[0]; readingsBulkUpdate( $dhash, "state", diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 2aa8521..e4eff4d 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-10-25_22:16:11 50086 FHEM/73_GardenaSmartBridge.pm +UPD 2023-10-28_18:01:31 50373 FHEM/73_GardenaSmartBridge.pm UPD 2023-10-03_22:40:44 126409 FHEM/74_GardenaSmartDevice.pm From e15a70ff0bb3c4cf9e3cacce6480b5d0ecd14e7d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 1 Nov 2023 21:04:39 +0100 Subject: [PATCH 10/12] test: fix initial variables --- CHANGELOG.md | 14 ++++++++++++-- FHEM/73_GardenaSmartBridge.pm | 33 +++++++++++++++++---------------- controls_GardenaSmartDevice.txt | 2 +- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dddca3..5459f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ -### test: cleanup initial error handling (HEAD -> patch_mucki) +### test: debug line (HEAD -> patch_mucki) +>Sat, 28 Oct 2023 18:02:17 +0200 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: cleanup initial error handling (origin/patch_mucki) >Wed, 25 Oct 2023 22:16:26 +0200 >Author: Sebastian (em@ail.tld) @@ -8,7 +18,7 @@ -### test: fix wifi status if is_connected (origin/patch_mucki) +### test: fix wifi status if is_connected >Mon, 23 Oct 2023 22:04:31 +0200 >Author: Sebastian (em@ail.tld) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index 035dda1..ed49fbf 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -632,27 +632,28 @@ sub ErrorHandling { # replace defined with exists # && defined( $decode_json->{errors} ) ) { - Log3 $name, 4, "[DEBUG] $name - ERROR HANDLING Bridge Parts 2"; - Log3 $name, 4, "[DEBUG] $name - ERROR HANDLING Bridge Parts 1/2".$decode_json->{errors}; - Log3 $name, 4, "[DEBUG] $name - ERROR HANDLING Bridge Parts 2/2".$decode_json->{errors}[0]; - readingsBulkUpdate( + # $decode_json->{errors} -> ARRAY + # $decode_json->{errors}[0] -> HASH + if (exists ($decode_json->{errors}[0]{error}) ) { + readingsBulkUpdate( $dhash, "state", $decode_json->{errors}[0]{error} . ' ' . $decode_json->{errors}[0]{attribute}, 1 - ); - readingsBulkUpdate( - $dhash, - "lastRequestState", - $decode_json->{errors}[0]{error} . ' ' - . $decode_json->{errors}[0]{attribute}, - 1 - ); - Log3 $dname, 5, - "GardenaSmartBridge ($dname) - RequestERROR: " - . $decode_json->{errors}[0]{error} . " " - . $decode_json->{errors}[0]{attribute}; + ); + readingsBulkUpdate( + $dhash, + "lastRequestState", + $decode_json->{errors}[0]{error} . ' ' + . $decode_json->{errors}[0]{attribute}, + 1 + ); + Log3 $dname, 5, + "GardenaSmartBridge ($dname) - RequestERROR: " + . $decode_json->{errors}[0]{error} . " " + . $decode_json->{errors}[0]{attribute}; + } # fi exists error } } else { diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index e4eff4d..daa2f5f 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-10-28_18:01:31 50373 FHEM/73_GardenaSmartBridge.pm +UPD 2023-11-01_20:57:32 50330 FHEM/73_GardenaSmartBridge.pm UPD 2023-10-03_22:40:44 126409 FHEM/74_GardenaSmartDevice.pm From de58578a2db34027ccc9a93d862fd1d1316acbbd Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 5 Nov 2023 21:52:24 +0100 Subject: [PATCH 11/12] test: smartdevice variable wintermode initializied Bridge consolidiert wifi/ethernet --- CHANGELOG.md | 14 ++++++++-- FHEM/73_GardenaSmartBridge.pm | 45 ++++++++------------------------- FHEM/74_GardenaSmartDevice.pm | 4 +-- controls_GardenaSmartDevice.txt | 4 +-- 4 files changed, 26 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5459f78..c3120e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ -### test: debug line (HEAD -> patch_mucki) +### test: fix initial variables (HEAD -> patch_mucki) +>Wed, 1 Nov 2023 21:04:39 +0100 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: debug line (origin/patch_mucki) >Sat, 28 Oct 2023 18:02:17 +0200 >Author: Sebastian (em@ail.tld) @@ -8,7 +18,7 @@ -### test: cleanup initial error handling (origin/patch_mucki) +### test: cleanup initial error handling >Wed, 25 Oct 2023 22:16:26 +0200 >Author: Sebastian (em@ail.tld) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index ed49fbf..05e0d76 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -1076,41 +1076,16 @@ sub WriteReadings { ) && ref($v) eq 'HASH' ) - { - if ( $decode_json->{abilities}[0]{properties} - [$properties]{name} eq 'ethernet_status' ) - { - readingsBulkUpdateIfChanged( $hash, - 'ethernet_status-ip', $v->{ip} ) - if ( ref( $v->{ip} ) ne 'HASH' ); - readingsBulkUpdateIfChanged( $hash, - 'ethernet_status-isconnected', - $v->{is_connected} ); - # obsolet, not published anymore - # readingsBulkUpdateIfChanged( $hash, - # 'ethernet_status-mac', $v->{mac} ); + { + if ($v->{is_connected} ) { + readingsBulkUpdateIfChanged( $hash, + [$properties]{name}.'-ip', $v->{ip} ) + if ( ref( $v->{ip} ) ne 'HASH' ); + readingsBulkUpdateIfChanged( $hash, + [$properties]{name}.'-isconnected', $v->{is_connected} ) + if ( $v->{is_connected} ); } - elsif ( $decode_json->{abilities}[0]{properties} - [$properties]{name} eq 'wifi_status' ) - { - # obsolet, not published anymore TODO: ask user using wifi - readingsBulkUpdateIfChanged( $hash, - 'wifi_status-ssid', $v->{ssid} ) - if (( ref( $v->{ssid} ) ne 'HASH' ) - && ( $v->{is_connected} )) ; - # readingsBulkUpdateIfChanged( $hash, - # 'wifi_status-mac', $v->{mac} ); - readingsBulkUpdateIfChanged( $hash, - 'wifi_status-isconnected', $v->{is_connected} ); - readingsBulkUpdateIfChanged( $hash, - 'wifi_status-ip', $v->{ip} ) - if (( ref( $v->{ip} ) ne 'HASH' ) - && ( $v->{is_connected} )) ; - readingsBulkUpdateIfChanged( $hash, - 'wifi_status-signal', $v->{signal} ) - if ( $v->{is_connected} ) ; - } - } + } # fi ethernet and wifi } $properties--; @@ -1586,7 +1561,7 @@ sub DeletePassword { ], "release_status": "stable", "license": "GPL_2", - "version": "v2.6.0", + "version": "v2.6.1", "author": [ "Marko Oldenburg " ], diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index 2ebdd64..68f4a7d 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -992,7 +992,7 @@ sub WriteReadings { } ; # fi scheduled_events - my $winter_mode; + my $winter_mode = 'awake'; do { #Log3 $name, 1, "Settings pro Device : ".$decode_json->{settings}[$settings]{name}; @@ -2683,7 +2683,7 @@ sub SetPredefinedStartPoints { ], "release_status": "stable", "license": "GPL_2", - "version": "v2.6.0", + "version": "v2.6.1", "author": [ "Marko Oldenburg " ], diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index daa2f5f..f9e0f03 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-11-01_20:57:32 50330 FHEM/73_GardenaSmartBridge.pm -UPD 2023-10-03_22:40:44 126409 FHEM/74_GardenaSmartDevice.pm +UPD 2023-11-05_21:43:22 48810 FHEM/73_GardenaSmartBridge.pm +UPD 2023-11-05_21:51:38 126419 FHEM/74_GardenaSmartDevice.pm From df1830a6703363eb515b6b5fa891b602b672c570 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 12 Nov 2023 19:47:49 +0100 Subject: [PATCH 12/12] fix: missing tree --- CHANGELOG.md | 14 ++++++++++++-- FHEM/73_GardenaSmartBridge.pm | 4 ++-- controls_GardenaSmartDevice.txt | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3120e3..cb5100c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ -### test: fix initial variables (HEAD -> patch_mucki) +### test: smartdevice variable wintermode initializied Bridge consolidiert wifi/ethernet (HEAD -> patch_mucki) +>Sun, 5 Nov 2023 21:52:24 +0100 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: fix initial variables (origin/patch_mucki) >Wed, 1 Nov 2023 21:04:39 +0100 >Author: Sebastian (em@ail.tld) @@ -8,7 +18,7 @@ -### test: debug line (origin/patch_mucki) +### test: debug line >Sat, 28 Oct 2023 18:02:17 +0200 >Author: Sebastian (em@ail.tld) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index 05e0d76..fe21726 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -1079,10 +1079,10 @@ sub WriteReadings { { if ($v->{is_connected} ) { readingsBulkUpdateIfChanged( $hash, - [$properties]{name}.'-ip', $v->{ip} ) + $decode_json->{abilities}[0]{properties}[$properties]{name}.'-ip', $v->{ip} ) if ( ref( $v->{ip} ) ne 'HASH' ); readingsBulkUpdateIfChanged( $hash, - [$properties]{name}.'-isconnected', $v->{is_connected} ) + $decode_json->{abilities}[0]{properties}[$properties]{name}.'-isconnected', $v->{is_connected} ) if ( $v->{is_connected} ); } } # fi ethernet and wifi diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index f9e0f03..a0a0042 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-11-05_21:43:22 48810 FHEM/73_GardenaSmartBridge.pm +UPD 2023-11-12_19:47:27 48890 FHEM/73_GardenaSmartBridge.pm UPD 2023-11-05_21:51:38 126419 FHEM/74_GardenaSmartDevice.pm