diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e0e684..cb5100c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,94 @@ -### feat: add setextention (HEAD -> patch_setExtention) +### 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) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: debug line +>Sat, 28 Oct 2023 18:02:17 +0200 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: cleanup initial error handling +>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 +>Mon, 23 Oct 2023 22:04:31 +0200 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: changed published gateway informations +>Sat, 21 Oct 2023 20:21:31 +0200 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: gateway readings changed by gardena +>Thu, 12 Oct 2023 21:52:51 +0200 + +>Author: Sebastian (em@ail.tld) + +>Commiter: Sebastian (em@ail.tld) + + + + +### test: versions pump +>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 +98,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 1797313..fe21726 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 @@ -628,26 +628,32 @@ 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( + # $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 { @@ -1070,36 +1076,16 @@ sub WriteReadings { ) && ref($v) eq 'HASH' ) - { - 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} ); + { + if ($v->{is_connected} ) { + readingsBulkUpdateIfChanged( $hash, + $decode_json->{abilities}[0]{properties}[$properties]{name}.'-ip', $v->{ip} ) + if ( ref( $v->{ip} ) ne 'HASH' ); + readingsBulkUpdateIfChanged( $hash, + $decode_json->{abilities}[0]{properties}[$properties]{name}.'-isconnected', $v->{is_connected} ) + if ( $v->{is_connected} ); } - elsif ( $decode_json->{abilities}[0]{properties} - [$properties]{name} eq 'wifi_status' ) - { - readingsBulkUpdateIfChanged( $hash, - 'wifi_status-ssid', $v->{ssid} ) - if ( ref( $v->{ssid} ) ne 'HASH' ); - readingsBulkUpdateIfChanged( $hash, - 'wifi_status-mac', $v->{mac} ); - 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} ); - } - } + } # fi ethernet and wifi } $properties--; @@ -1575,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 30f4285..68f4a7d 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 @@ -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 0806fbc..a0a0042 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-11-12_19:47:27 48890 FHEM/73_GardenaSmartBridge.pm +UPD 2023-11-05_21:51:38 126419 FHEM/74_GardenaSmartDevice.pm