fix state Reading when susscess num
This commit is contained in:
parent
c3a6e83509
commit
eccd624d7b
@ -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);
|
||||
|
||||
|
@ -33,7 +33,7 @@ use warnings;
|
||||
use JSON;
|
||||
|
||||
|
||||
my $version = "0.6.0";
|
||||
my $version = "0.6.1";
|
||||
|
||||
|
||||
|
||||
@ -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" or $decode_json->{success} eq "1") ) {
|
||||
|
||||
$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" or $decode_json->{success} eq "0") ) {
|
||||
|
||||
$state = "error";
|
||||
NUKIDevice_ReadFromNUKIBridge($hash, "lockState", undef, $hash->{NUKIID} );
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user