From 8a073c033c4749702cad81e270eaa6d0ecef9d60 Mon Sep 17 00:00:00 2001 From: phenning <> Date: Fri, 15 May 2020 02:50:13 +0000 Subject: [PATCH] 36_Shelly.pm: bugfix git-svn-id: https://svn.fhem.de/fhem/trunk@21943 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/36_Shelly.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/36_Shelly.pm b/fhem/FHEM/36_Shelly.pm index 5285dc993..2637ad97d 100644 --- a/fhem/FHEM/36_Shelly.pm +++ b/fhem/FHEM/36_Shelly.pm @@ -39,7 +39,7 @@ use vars qw{%attr %defs}; sub Log($$); #-- globals on start -my $version = "2.11"; +my $version = "2.12"; #-- these we may get on request my %gets = ( @@ -709,6 +709,10 @@ sub Shelly_Set ($@) { if( $cmd eq "hsv" ){ my($hue,$saturation,$value)=split(',',$value); + #-- rescale + if( $hue>1 ){ + $hue = $hue/360; + } my ($red,$green,$blue)=Color::hsv2rgb($hue,$saturation,$value); $cmd=sprintf("red=%d&green=%d&blue=%d",int($red*255+0.5),int($green*255+0.5),int($blue*255+0.5)); Shelly_dim($hash,"color/0","?".$cmd); @@ -1478,7 +1482,8 @@ sub Shelly_updown2($){
switches device on or off for <time> seconds.
  • set <name> hsv <hue value 0..360>,<saturation value 0..1>,<brightness value 0..1> -
    comma separated list of hue, saturation and value to set the color
  • +
    comma separated list of hue, saturation and value to set the color. Note, that 360° is the same hue as 0° = red. + Hue values smaller than 1 will be treated as fraction of the full circle, e.g. 0.5 will give the same hue as 180°.
  • set <name> rgb <rrggbb>
    6-digit hex string to set the color