From 348b1f14f0f1a052642f8cc311f008775dc00d7c Mon Sep 17 00:00:00 2001 From: CoolTux Date: Fri, 12 May 2017 04:10:05 +0000 Subject: [PATCH] 73_NUKIBridge: 74_NUKIDevice, fix Perlwarnings git-svn-id: https://svn.fhem.de/fhem/trunk@14250 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/73_NUKIBridge.pm | 4 ++-- fhem/FHEM/74_NUKIDevice.pm | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 5a94a20fe..22cce123f 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - change: 73_NUKIBridge,74_NUKIDevice: fix Perlwarnings - bugfix: 38_CO20: fixed definition with serial number - bugfix: 32_withings: safer json decoding - feature: 38_netatmo: home notification settings diff --git a/fhem/FHEM/73_NUKIBridge.pm b/fhem/FHEM/73_NUKIBridge.pm index 0ef325827..8b859dfa6 100644 --- a/fhem/FHEM/73_NUKIBridge.pm +++ b/fhem/FHEM/73_NUKIBridge.pm @@ -46,7 +46,7 @@ use JSON; use HttpUtils; -my $version = "0.6.0"; +my $version = "0.6.1"; my $bridgeapi = "1.5"; @@ -372,7 +372,7 @@ sub NUKIBridge_Distribution($$$) { Log3 $name, 5, "NUKIBridge ($name) - Response JSON: $json"; Log3 $name, 5, "NUKIBridge ($name) - Response ERROR: $err"; - Log3 $name, 5, "NUKIBridge ($name) - Response CODE: $param->{code}"; + Log3 $name, 5, "NUKIBridge ($name) - Response CODE: $param->{code}" if( defined($param->{code}) and ($param->{code}) ); readingsBeginUpdate($hash); diff --git a/fhem/FHEM/74_NUKIDevice.pm b/fhem/FHEM/74_NUKIDevice.pm index 52fec3633..419f2b46a 100644 --- a/fhem/FHEM/74_NUKIDevice.pm +++ b/fhem/FHEM/74_NUKIDevice.pm @@ -456,13 +456,13 @@ sub NUKIDevice_WriteReadings($$) { my ($state,$lockState); - if( $decode_json->{success} eq "true" ) { + if( defined($decode_json->{success}) and $decode_json->{success} eq "true" ) { $state = $hash->{helper}{lockAction}; $lockState = $hash->{helper}{lockAction}; NUKIDevice_ReadFromNUKIBridge($hash, "lockState", undef, $hash->{NUKIID} ) if( ReadingsVal($hash->{IODev}->{NAME},'bridgeType','Software') eq 'Software' ); - } elsif ( $decode_json->{success} eq "false" ) { + } elsif ( defined($decode_json->{success}) and $decode_json->{success} eq "false" ) { $state = "error"; NUKIDevice_ReadFromNUKIBridge($hash, "lockState", undef, $hash->{NUKIID} );