fix ReadingsUpdates
This commit is contained in:
parent
1de922f39d
commit
4cce22bd05
@ -407,12 +407,10 @@ sub NUKIDevice_WriteReadings($$) {
|
||||
my $name = $hash->{NAME};
|
||||
|
||||
|
||||
|
||||
############################
|
||||
#### Status des Smartlock
|
||||
|
||||
readingsBeginUpdate($hash);
|
||||
|
||||
|
||||
my $battery;
|
||||
if( defined($decode_json->{batteryCritical}) ) {
|
||||
if( $decode_json->{batteryCritical} eq "false" or $decode_json->{batteryCritical} == 0 ) {
|
||||
@ -424,6 +422,9 @@ sub NUKIDevice_WriteReadings($$) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
readingsBeginUpdate($hash);
|
||||
|
||||
if( defined($hash->{helper}{lockAction}) ) {
|
||||
|
||||
my ($state,$lockState);
|
||||
@ -441,7 +442,6 @@ sub NUKIDevice_WriteReadings($$) {
|
||||
NUKIDevice_ReadFromNUKIBridge($hash, "lockState", undef, $hash->{NUKIID} );
|
||||
}
|
||||
|
||||
|
||||
readingsBulkUpdate( $hash, "state", $state );
|
||||
readingsBulkUpdate( $hash, "lockState", $lockState );
|
||||
readingsBulkUpdate( $hash, "success", $decode_json->{success} );
|
||||
@ -463,6 +463,7 @@ sub NUKIDevice_WriteReadings($$) {
|
||||
|
||||
readingsEndUpdate( $hash, 1 );
|
||||
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user