From feb1e1fdd5229237c4ad64cab56fd4949a2b9026 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Thu, 16 Oct 2025 18:36:58 +0200 Subject: [PATCH] Update Nuki Bridge version and fix callback handling Improved the Nuki Bridge module by updating the version to v2.1.1, indicating a minor enhancement likely related to internal changes or bug fixes. Additionally, in the `Set` and `Get` methods, updated the return conditions to exclude the endpoint from the results when it matches the output from the command handlers. This change ensures that the endpoint is not returned as part of the command responses, which could lead to confusion and unintended behavior for users interacting with the API. These modifications enhance the clarity and reliability of the responses provided by the Nuki Bridge API. --- FHEM/73_NUKIBridge.pm | 2 +- controls_NukiSmart.txt | 8 ++++---- lib/FHEM/Devices/Nuki/Bridge.pm | 14 ++++++++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/FHEM/73_NUKIBridge.pm b/FHEM/73_NUKIBridge.pm index 503734e..4773bae 100644 --- a/FHEM/73_NUKIBridge.pm +++ b/FHEM/73_NUKIBridge.pm @@ -267,7 +267,7 @@ sub Initialize { ], "release_status": "stable", "license": "GPL_2", - "version": "v2.1.0", + "version": "v2.1.1", "x_apiversion": "1.13.0", "author": [ "Marko Oldenburg " diff --git a/controls_NukiSmart.txt b/controls_NukiSmart.txt index 27d1571..0056936 100644 --- a/controls_NukiSmart.txt +++ b/controls_NukiSmart.txt @@ -1,4 +1,4 @@ -UPD 2025-10-14_11:00:54 10358 FHEM/73_NUKIBridge.pm -UPD 2025-10-15_06:53:37 11100 FHEM/74_NUKIDevice.pm -UPD 2025-10-14_11:00:54 42820 lib/FHEM/Devices/Nuki/Bridge.pm -UPD 2025-10-15_06:43:51 16775 lib/FHEM/Devices/Nuki/Device.pm +UPD 2025-10-16_18:36:43 10358 FHEM/73_NUKIBridge.pm +UPD 2025-10-15_06:55:14 11100 FHEM/74_NUKIDevice.pm +UPD 2025-10-16_18:34:25 42928 lib/FHEM/Devices/Nuki/Bridge.pm +UPD 2025-10-15_06:55:14 16775 lib/FHEM/Devices/Nuki/Device.pm diff --git a/lib/FHEM/Devices/Nuki/Bridge.pm b/lib/FHEM/Devices/Nuki/Bridge.pm index 03ba361..c5e7366 100644 --- a/lib/FHEM/Devices/Nuki/Bridge.pm +++ b/lib/FHEM/Devices/Nuki/Bridge.pm @@ -454,21 +454,24 @@ sub Set { return 'usage: callbackRemove' if ( split( m{\s+}xms, $arg ) > 1 ); my $id = defined $arg ? $arg : 0; - $endpoint = 'callback/remove'; $param = '{"param":"' . $id . '"}'; + $endpoint = 'callback/remove'; }, configauth => sub { return 'usage: configAuth' if ( split( m{\s+}xms, $arg ) > 1 ); my $configAuth = 'enable=' . ( $arg eq 'enable' ? 1 : 0 ); - $endpoint = 'configAuth'; $param = '{"param":"' . $configAuth . '"}'; + $endpoint = 'configAuth'; }, ); if ( exists $handlers{$cmd} ) { my $result = $handlers{$cmd}->(); - return $result if defined $result && length $result; + return $result + if defined $result + && length $result + && $result ne $endpoint; } else { my $list = 'info:noArg getDeviceList:noArg '; @@ -507,7 +510,10 @@ sub Get { if ( exists $handlers{$cmd} ) { my $result = $handlers{$cmd}->(); - return $result if defined $result && length $result; + return $result + if defined $result + && length $result + && $result ne $endpoint; } else { my $list = 'callbackList:noArg ';