2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-14 15:39:12 +00:00

31_HUEDevice.pm: fixed missing set list if transitiontime attribute is set, don't sent rgb events if unchanged

git-svn-id: https://svn.fhem.de/fhem/trunk@8979 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2015-07-26 08:00:10 +00:00
parent 2f333aec59
commit 923bd729b1

View File

@ -218,6 +218,7 @@ sub HUEDevice_Define($$)
$hash->{helper}{effect} = '';
$hash->{helper}{percent} = -1;
$hash->{helper}{rgb} = "";
$attr{$name}{devStateIcon} = '{(HUEDevice_devStateIcon($name),"toggle")}' if( !defined( $attr{$name}{devStateIcon} ) );
@ -491,8 +492,8 @@ HUEDevice_Set($@)
HUEDevice_SetParam($name, \%obj, $cmd, $value, $value2);
}
if( !defined($obj{transitiontime} ) ) {
my $transitiontime = AttrVal($name, "transitiontime", undef);
if( %obj && !defined($obj{transitiontime} ) ) {
my $transitiontime = AttrVal($name, "transitiontime", undef);
$obj{transitiontime} = 0 + $transitiontime if( defined( $transitiontime ) );
}
@ -983,7 +984,9 @@ HUEDevice_Parse($$)
readingsEndUpdate($hash,1);
readingsSingleUpdate($hash,"rgb", CommandGet("","$name rgb"),1 );
my $rgb = CommandGet("","$name rgb");
if( $rgb ne $hash->{helper}{rgb} ) { readingsSingleUpdate($hash,"rgb", $rgb,1); };
$hash->{helper}{rgb} = $rgb;
}
1;