mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-07 22:29:19 +00:00
30_HUEBridge.pm: fixed onoff handling for createGroupReadings
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@16172 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
35fb738a74
commit
c693c3772d
@ -1089,13 +1089,13 @@ HUEBridge_updateGroups($$)
|
|||||||
$readings{pct} = 0;
|
$readings{pct} = 0;
|
||||||
$readings{state} = 'off';
|
$readings{state} = 'off';
|
||||||
}
|
}
|
||||||
|
$readings{onoff} = $readings{on}?'1':'0';
|
||||||
|
delete $readings{on};
|
||||||
|
|
||||||
readingsBeginUpdate($chash);
|
readingsBeginUpdate($chash);
|
||||||
foreach my $key ( keys %readings ) {
|
foreach my $key ( keys %readings ) {
|
||||||
if( defined($readings{$key}) ) {
|
if( defined($readings{$key}) ) {
|
||||||
my $reading = $key;
|
readingsBulkUpdate($chash, $key, $readings{$key}, 1) if( !defined($chash->{helper}{$key}) || $chash->{helper}{$key} ne $readings{$key} );
|
||||||
$reading = 'onoff' if( $reading eq 'on' );
|
|
||||||
readingsBulkUpdate($chash, $reading, $readings{$key}, 1) if( !defined($chash->{helper}{$key}) || $chash->{helper}{$key} ne $readings{$key} );
|
|
||||||
$chash->{helper}{$key} = $readings{$key};
|
$chash->{helper}{$key} = $readings{$key};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user