31_HUEDevice.pm: possible fix for set rgb with tradfri iodev

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20903 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2020-01-07 13:19:57 +00:00
parent 0f7d6e0df4
commit 2435a6fb86

View File

@ -613,8 +613,9 @@ HUEDevice_SetParam($$@)
} elsif( $cmd eq "rgb" && $value =~ m/^(..)(..)(..)/) {
my( $r, $g, $b ) = (hex($1)/255.0, hex($2)/255.0, hex($3)/255.0);
if( $name && ( !defined( AttrVal($name, "model", undef) )
|| AttrVal($name, "model", undef) eq 'LLC020') ) {
if( $name && ( !AttrVal($name, "model", undef)
|| AttrVal($name, "model", undef) eq 'LLC020'
|| ($hash->{IODev} && $hash->{IODev}{TYPE} eq 'tradfri' ) ) ) {
my( $h, $s, $v ) = Color::rgb2hsv($r,$g,$b);
$obj->{'on'} = JSON::true;