change state after set command
This commit is contained in:
parent
870f27b0ac
commit
f415a90768
@ -474,9 +474,9 @@ sub NUKIDevice_WriteReadings($$) {
|
|||||||
############################
|
############################
|
||||||
#### Status des Smartlock
|
#### Status des Smartlock
|
||||||
|
|
||||||
|
if ( defined( $hash->{helper}{lockAction} ) ) {
|
||||||
my $state;
|
my $state;
|
||||||
|
|
||||||
if ( defined( $hash->{helper}{lockAction} ) ) {
|
|
||||||
if (
|
if (
|
||||||
defined( $decode_json->{success} )
|
defined( $decode_json->{success} )
|
||||||
and ( $decode_json->{success} eq 'true'
|
and ( $decode_json->{success} eq 'true'
|
||||||
@ -502,6 +502,7 @@ sub NUKIDevice_WriteReadings($$) {
|
|||||||
$hash->{DEVICETYPE} );
|
$hash->{DEVICETYPE} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$decode_json->{'state'} = $state;
|
||||||
delete $hash->{helper}{lockAction};
|
delete $hash->{helper}{lockAction};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,7 +528,7 @@ sub NUKIDevice_WriteReadings($$) {
|
|||||||
or $t eq 'deviceType'
|
or $t eq 'deviceType'
|
||||||
or $t eq 'paired'
|
or $t eq 'paired'
|
||||||
or $t eq 'batteryCritical' );
|
or $t eq 'batteryCritical' );
|
||||||
readingsBulkUpdate( $hash, $t, $lockStates{$v}{ $hash->{DEVICETYPE} } )
|
readingsBulkUpdate( $hash, $t, ($v =~ m/^[0-9]$/ ? $lockStates{$v}{ $hash->{DEVICETYPE} } : $v) )
|
||||||
if ( $t eq 'state' );
|
if ( $t eq 'state' );
|
||||||
readingsBulkUpdate( $hash, $t, $modes{$v}{ $hash->{DEVICETYPE} } )
|
readingsBulkUpdate( $hash, $t, $modes{$v}{ $hash->{DEVICETYPE} } )
|
||||||
if ( $t eq 'mode' );
|
if ( $t eq 'mode' );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user