mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-01 07:19:24 +00:00
31_HUEDevice.pm: use reported rgb value if available
git-svn-id: https://svn.fhem.de/fhem/trunk@18336 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
14c36ae7cf
commit
106d569288
@ -1400,6 +1400,10 @@ HUEDevice_Parse($$)
|
|||||||
my $alert = $state->{alert};
|
my $alert = $state->{alert};
|
||||||
my $effect = $state->{effect};
|
my $effect = $state->{effect};
|
||||||
|
|
||||||
|
my $rgb = undef;
|
||||||
|
$rgb = $state->{rgb} if( defined($state->{rgb}) );
|
||||||
|
|
||||||
|
|
||||||
if( defined($colormode) && $colormode ne $hash->{helper}{colormode} ) {readingsBulkUpdate($hash,"colormode",$colormode);}
|
if( defined($colormode) && $colormode ne $hash->{helper}{colormode} ) {readingsBulkUpdate($hash,"colormode",$colormode);}
|
||||||
if( defined($bri) && $bri != $hash->{helper}{bri} ) {readingsBulkUpdate($hash,"bri",$bri);}
|
if( defined($bri) && $bri != $hash->{helper}{bri} ) {readingsBulkUpdate($hash,"bri",$bri);}
|
||||||
if( defined($ct) && $ct != $hash->{helper}{ct} ) {
|
if( defined($ct) && $ct != $hash->{helper}{ct} ) {
|
||||||
@ -1417,6 +1421,8 @@ HUEDevice_Parse($$)
|
|||||||
if( defined($alert) && $alert ne $hash->{helper}{alert} ) {readingsBulkUpdate($hash,"alert",$alert);}
|
if( defined($alert) && $alert ne $hash->{helper}{alert} ) {readingsBulkUpdate($hash,"alert",$alert);}
|
||||||
if( defined($effect) && $effect ne $hash->{helper}{effect} ) {readingsBulkUpdate($hash,"effect",$effect);}
|
if( defined($effect) && $effect ne $hash->{helper}{effect} ) {readingsBulkUpdate($hash,"effect",$effect);}
|
||||||
|
|
||||||
|
if( defined($rgb) && $rgb ne $hash->{helper}{rgb} ) {readingsBulkUpdate($hash,"rgb",$rgb);}
|
||||||
|
|
||||||
my $s = '';
|
my $s = '';
|
||||||
my $pct = -1;
|
my $pct = -1;
|
||||||
if( $on )
|
if( $on )
|
||||||
@ -1461,6 +1467,8 @@ HUEDevice_Parse($$)
|
|||||||
$hash->{helper}{alert} = $alert if( defined($alert) );
|
$hash->{helper}{alert} = $alert if( defined($alert) );
|
||||||
$hash->{helper}{effect} = $effect if( defined($effect) );
|
$hash->{helper}{effect} = $effect if( defined($effect) );
|
||||||
|
|
||||||
|
$hash->{helper}{rgb} = $rgb if( defined($rgb) );
|
||||||
|
|
||||||
$hash->{helper}{pct} = $pct;
|
$hash->{helper}{pct} = $pct;
|
||||||
|
|
||||||
my $changed = $hash->{CHANGED}?1:0;
|
my $changed = $hash->{CHANGED}?1:0;
|
||||||
@ -1469,7 +1477,7 @@ HUEDevice_Parse($$)
|
|||||||
|
|
||||||
readingsEndUpdate($hash,1);
|
readingsEndUpdate($hash,1);
|
||||||
|
|
||||||
if( defined($colormode) ) {
|
if( defined($colormode) && !defined($rgb) ) {
|
||||||
my $rgb = CommandGet("","$name rgb");
|
my $rgb = CommandGet("","$name rgb");
|
||||||
if( $rgb ne $hash->{helper}{rgb} ) { readingsSingleUpdate($hash,"rgb", $rgb,1); };
|
if( $rgb ne $hash->{helper}{rgb} ) { readingsSingleUpdate($hash,"rgb", $rgb,1); };
|
||||||
$hash->{helper}{rgb} = $rgb;
|
$hash->{helper}{rgb} = $rgb;
|
||||||
|
Loading…
Reference in New Issue
Block a user