31_HUEDevice.pm: fixed sensor update (thanks choenig)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@19554 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2019-06-05 11:29:27 +00:00
parent fad63ba5b3
commit ec0711ed2a

View File

@ -1328,9 +1328,6 @@ HUEDevice_Parse($$)
$lastupdated_local = $lastupdated;
}
$hash->{lastupdated} = $lastupdated;
$hash->{lastupdated_local} = $lastupdated_local;
$readings{state} = $state->{status} if( defined($state->{status}) );
$readings{state} = $state->{flag}?'1':'0' if( defined($state->{flag}) );
$readings{state} = $state->{open}?'open':'closed' if( defined($state->{open}) );
@ -1370,6 +1367,9 @@ HUEDevice_Parse($$)
Log3 $name, 4, "$name: lastupdated: $lastupdated, hash->{lastupdated}: $hash->{lastupdated}, lastupdated_local: $lastupdated_local, offsetUTC: $offset";
Log3 $name, 5, "$name: ". Dumper $result if($HUEDevice_hasDataDumper);
$hash->{lastupdated} = $lastupdated;
$hash->{lastupdated_local} = $lastupdated_local;
if( scalar keys %readings ) {
readingsBeginUpdate($hash);