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

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@8979 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme1968
2015-07-26 08:00:10 +00:00
parent d28b90eca3
commit dfce64b1b0

View File

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