2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 04:36:36 +00:00

30_HUEBridge.pm: fixed onoff handling for createGroupReadings

git-svn-id: https://svn.fhem.de/fhem/trunk@16172 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2018-02-14 06:12:26 +00:00
parent a2609b315c
commit bba7e3ffaa

View File

@ -1089,13 +1089,13 @@ HUEBridge_updateGroups($$)
$readings{pct} = 0;
$readings{state} = 'off';
}
$readings{onoff} = $readings{on}?'1':'0';
delete $readings{on};
readingsBeginUpdate($chash);
foreach my $key ( keys %readings ) {
if( defined($readings{$key}) ) {
my $reading = $key;
$reading = 'onoff' if( $reading eq 'on' );
readingsBulkUpdate($chash, $reading, $readings{$key}, 1) if( !defined($chash->{helper}{$key}) || $chash->{helper}{$key} ne $readings{$key} );
readingsBulkUpdate($chash, $key, $readings{$key}, 1) if( !defined($chash->{helper}{$key}) || $chash->{helper}{$key} ne $readings{$key} );
$chash->{helper}{$key} = $readings{$key};
}
}