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