From 05e5322b42566ceb51154ed2189c386dc526500e Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Sat, 27 Nov 2021 21:32:19 +0100 Subject: [PATCH] change model name for smartlock 3.0 api conform. fix little bugs --- FHEM/74_NUKIDevice.pm | 2 +- controls_NukiSmart.txt | 8 ++++---- lib/FHEM/Devices/Nuki/Device.pm | 20 ++------------------ 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/FHEM/74_NUKIDevice.pm b/FHEM/74_NUKIDevice.pm index 36bee32..4462195 100644 --- a/FHEM/74_NUKIDevice.pm +++ b/FHEM/74_NUKIDevice.pm @@ -50,7 +50,7 @@ sub Initialize($) { $hash->{AttrList} = 'IODev ' - . 'model:opener,smartlock ' + . 'model:smartlock,opener,smartdoor,smartlock3 ' . 'disable:1 ' . $::readingFnAttributes; diff --git a/controls_NukiSmart.txt b/controls_NukiSmart.txt index 1bcbe69..23c5644 100644 --- a/controls_NukiSmart.txt +++ b/controls_NukiSmart.txt @@ -1,4 +1,4 @@ -UPD 2021-11-27_18:02:39 9224 FHEM/73_NUKIBridge.pm -UPD 2021-11-27_18:01:59 7548 FHEM/74_NUKIDevice.pm -UPD 2021-11-27_18:08:11 40444 lib/FHEM/Devices/Nuki/Bridge.pm -UPD 2021-11-27_15:28:59 15728 lib/FHEM/Devices/Nuki/Device.pm +UPD 2021-11-27_21:26:06 9224 FHEM/73_NUKIBridge.pm +UPD 2021-11-27_21:30:28 7569 FHEM/74_NUKIDevice.pm +UPD 2021-11-27_21:26:06 40444 lib/FHEM/Devices/Nuki/Bridge.pm +UPD 2021-11-27_21:32:02 15123 lib/FHEM/Devices/Nuki/Device.pm diff --git a/lib/FHEM/Devices/Nuki/Device.pm b/lib/FHEM/Devices/Nuki/Device.pm index 065dbb5..f07c6cd 100644 --- a/lib/FHEM/Devices/Nuki/Device.pm +++ b/lib/FHEM/Devices/Nuki/Device.pm @@ -107,7 +107,8 @@ if ($@) { my %deviceTypes = ( 0 => 'smartlock', 2 => 'opener', - 4 => 'smartlockNG' + 3 => 'smartdoor', + 4 => 'smartlock3' ); my %modes = ( @@ -448,23 +449,6 @@ sub Parse { "NUKIDevice ($name) - find logical device: $hash->{NAME}" ); return $hash->{NAME}; - - ################## - ## Zwischenlösung so für die Umstellung, kann später gelöscht werden -# if ( ::AttrVal( $name, 'model', '' ) eq '' ) { -# ::CommandDefMod( undef, -# $name -# . ' NUKIDevice ' -# . $hash->{NUKIID} . ' ' -# . $decode_json->{deviceType} ); -# ::CommandAttr( undef, -# $name -# . ' model ' -# . $deviceTypes{ $decode_json->{deviceType} } ); -# ::Log3( $name, 2, "NUKIDevice ($name) - redefined Defmod" ); -# } - - } else { ::Log3( $name, 4, -- 2.45.2