2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-08 13:24:56 +00:00

30_LIGHTIFY.pm: handle rgb only lights, try to set correct subtype in autocreate

git-svn-id: https://svn.fhem.de/fhem/trunk@7972 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2015-02-14 12:42:27 +00:00
parent 9e00945af4
commit e79970b963

View File

@ -397,7 +397,11 @@ Log 3, "$alias: $id:$short, type?: $type, onoff: $onoff, dim: $dim, ct: $ct, rgb
$cmdret= CommandAttr(undef,"$devname alias ".$alias);
$cmdret= CommandAttr(undef,"$devname room LIGHTIFY");
$cmdret= CommandAttr(undef,"$devname IODev $name");
$cmdret= CommandAttr(undef,"$devname subType extcolordimmer");
my $subtype = 'extcolordimmer';
$subtype = 'colordimmer' if( $type eq '08' );
$subtype = 'ctdimmer' if( $type eq '0A' );
$cmdret= CommandAttr(undef,"$devname subType $subtype");
$autocreated++;
}
@ -416,11 +420,10 @@ Log 3, "$alias: $id:$short, type?: $type, onoff: $onoff, dim: $dim, ct: $ct, rgb
sat => int( $s * 254 ),
bri => int( $v * 254 ),
ct => int(1000000/$ct),
bri => int($dim/100*254),
} };
$json->{state}->{ct} = int(1000000/$ct) if( $ct );
HUEDevice_Parse( $chash, $json );
}