mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 00:26:03 +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:
parent
9e00945af4
commit
e79970b963
@ -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 alias ".$alias);
|
||||||
$cmdret= CommandAttr(undef,"$devname room LIGHTIFY");
|
$cmdret= CommandAttr(undef,"$devname room LIGHTIFY");
|
||||||
$cmdret= CommandAttr(undef,"$devname IODev $name");
|
$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++;
|
$autocreated++;
|
||||||
}
|
}
|
||||||
@ -416,11 +420,10 @@ Log 3, "$alias: $id:$short, type?: $type, onoff: $onoff, dim: $dim, ct: $ct, rgb
|
|||||||
sat => int( $s * 254 ),
|
sat => int( $s * 254 ),
|
||||||
bri => int( $v * 254 ),
|
bri => int( $v * 254 ),
|
||||||
|
|
||||||
ct => int(1000000/$ct),
|
|
||||||
|
|
||||||
bri => int($dim/100*254),
|
bri => int($dim/100*254),
|
||||||
} };
|
} };
|
||||||
|
|
||||||
|
$json->{state}->{ct} = int(1000000/$ct) if( $ct );
|
||||||
|
|
||||||
HUEDevice_Parse( $chash, $json );
|
HUEDevice_Parse( $chash, $json );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user