From 46397e17f777e0123825b0a323dbd8d858503966 Mon Sep 17 00:00:00 2001 From: markus-m Date: Sun, 3 Apr 2016 11:40:34 +0000 Subject: [PATCH] 31_MilightDevice: Fixed incompatibility with Color::rgb2hsv git-svn-id: https://svn.fhem.de/fhem/trunk@11177 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/31_MilightDevice.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index f682e6e6e..d1febf54c 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # 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. + - bugfix: 31_MilightDevice: Fixed incompatibility with Color::rgb2hsv - feature: new module 37_fakeRoku.pm to control fhem from a harmony hub - feature: new module 52_I2C_MMA845X.pm added - change: 49_SSCAM: change to new RemoveInternalTimer for functions diff --git a/fhem/FHEM/31_MilightDevice.pm b/fhem/FHEM/31_MilightDevice.pm index 8266a7749..111db295c 100644 --- a/fhem/FHEM/31_MilightDevice.pm +++ b/fhem/FHEM/31_MilightDevice.pm @@ -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)]"; 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( $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); $s = MilightDevice_roundfunc($s * 100); $v = MilightDevice_roundfunc($v * 100);