mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
36_Shelly.pm: bugfix
git-svn-id: https://svn.fhem.de/fhem/trunk@21943 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
79e24d56d4
commit
8a073c033c
@ -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($){
|
||||
<br />switches device on or off for <time> seconds. </li>
|
||||
<li>
|
||||
<code>set <name> hsv <hue value 0..360>,<saturation value 0..1>,<brightness value 0..1> </code>
|
||||
<br />comma separated list of hue, saturation and value to set the color</li>
|
||||
<br />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°.</li>
|
||||
<li>
|
||||
<code>set <name> rgb <rrggbb> </code>
|
||||
<br />6-digit hex string to set the color</li>
|
||||
|
Loading…
Reference in New Issue
Block a user