2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

31_MilightDevice: Fixed incompatibility with Color::rgb2hsv

git-svn-id: https://svn.fhem.de/fhem/trunk@11177 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markus-m 2016-04-03 11:40:34 +00:00
parent 7c54aa2401
commit ea85a68358
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- bugfix: 31_MilightDevice: Fixed incompatibility with Color::rgb2hsv
- feature: new module 37_fakeRoku.pm to control fhem from a harmony hub - feature: new module 37_fakeRoku.pm to control fhem from a harmony hub
- feature: new module 52_I2C_MMA845X.pm added - feature: new module 52_I2C_MMA845X.pm added
- change: 49_SSCAM: change to new RemoveInternalTimer for functions - change: 49_SSCAM: change to new RemoveInternalTimer for functions

View File

@ -440,7 +440,7 @@ sub MilightDevice_Set(@)
$usage = "Usage: set $name rgb RRGGBB [seconds(0..x)] [flags(l=long path|q=don't clear queue)]"; $usage = "Usage: set $name rgb RRGGBB [seconds(0..x)] [flags(l=long path|q=don't clear queue)]";
return $usage if ($args[0] !~ /^([0-9A-Fa-f]{1,2})([0-9A-Fa-f]{1,2})([0-9A-Fa-f]{1,2})$/); return $usage if ($args[0] !~ /^([0-9A-Fa-f]{1,2})([0-9A-Fa-f]{1,2})([0-9A-Fa-f]{1,2})$/);
my( $r, $g, $b ) = (hex($1), hex($2), hex($3)); #change to color.pm? my( $r, $g, $b ) = (hex($1), hex($2), hex($3)); #change to color.pm?
my( $h, $s, $v ) = Color::rgb2hsv($r,$g,$b); my( $h, $s, $v ) = Color::rgb2hsv($r/255.0,$g/255.0,$b/255.0);
$h = MilightDevice_roundfunc($h * 360); $h = MilightDevice_roundfunc($h * 360);
$s = MilightDevice_roundfunc($s * 100); $s = MilightDevice_roundfunc($s * 100);
$v = MilightDevice_roundfunc($v * 100); $v = MilightDevice_roundfunc($v * 100);