mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 10:46:53 +00:00
73_NUKIBridge: 74_NUKIDevice decode_json() in a eval
git-svn-id: https://svn.fhem.de/fhem/trunk@16284 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
90a2bbe010
commit
bc8e46047c
@ -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.
|
||||
- bugfix: 73_NUKIBridge/74_NUKIDevice: decode_json() in a eval
|
||||
- Update: 73_AMADCommBridge/74AMADDevice: 4.2 new Version with Tasker Support
|
||||
- bugfix: 14_CUL_TCM97001: Fix temperature reading
|
||||
- bugfix: 49_SSCam: V3.3.0, code review, API bug fix of runview lastrec,
|
||||
|
@ -46,7 +46,7 @@ use JSON;
|
||||
|
||||
use HttpUtils;
|
||||
|
||||
my $version = "0.6.1";
|
||||
my $version = "0.6.2";
|
||||
my $bridgeapi = "1.5";
|
||||
|
||||
|
||||
@ -477,7 +477,11 @@ sub NUKIBridge_ResponseProcessing($$$) {
|
||||
return "NUKIBridge ($name) - invalid json detected: $json";
|
||||
}
|
||||
|
||||
$decode_json = decode_json($json);
|
||||
my $decode_json = eval{decode_json($json)};
|
||||
if($@){
|
||||
Log3 $name, 3, "NUKIBridge ($name) - JSON error while request: $@";
|
||||
return;
|
||||
}
|
||||
|
||||
if( ref($decode_json) eq "ARRAY" and scalar(@{$decode_json}) > 0 and $path eq "list" ) {
|
||||
|
||||
@ -745,7 +749,11 @@ sub NUKIBridge_CallBlocking($$$) {
|
||||
}
|
||||
|
||||
|
||||
my $decode_json = decode_json($data);
|
||||
my $decode_json = eval{decode_json($data)};
|
||||
if($@){
|
||||
Log3 $name, 3, "NUKIBridge ($name) - JSON error while request: $@";
|
||||
return;
|
||||
}
|
||||
|
||||
return undef if( !$decode_json );
|
||||
|
||||
|
@ -33,7 +33,7 @@ use warnings;
|
||||
use JSON;
|
||||
|
||||
|
||||
my $version = "0.6.1";
|
||||
my $version = "0.6.2";
|
||||
|
||||
|
||||
|
||||
@ -414,7 +414,11 @@ sub NUKIDevice_Parse($$) {
|
||||
|
||||
#########################################
|
||||
#### verarbeiten des JSON Strings #######
|
||||
my $decode_json = decode_json($result);
|
||||
my $decode_json = eval{decode_json($result)};
|
||||
if($@){
|
||||
Log3 $name, 3, "NUKIDevice ($name) - JSON error while request: $@";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if( ref($decode_json) ne "HASH" ) {
|
||||
@ -527,7 +531,11 @@ sub NUKIDevice_CGI() {
|
||||
return "NUKIDevice ($name) - invalid json detected: $json";
|
||||
}
|
||||
|
||||
my $decode_json = decode_json($json);
|
||||
my $decode_json = eval{decode_json($json)};
|
||||
if($@){
|
||||
Log3 $name, 3, "NUKIDevice ($name) - JSON error while request: $@";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if( ref($decode_json) eq "HASH" ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user