From 037d16f3c8eb4ecd0ae8ec19984540b25515a4a0 Mon Sep 17 00:00:00 2001 From: martinp876 <> Date: Sun, 27 Nov 2016 15:46:42 +0000 Subject: [PATCH] CUL_HM: update rgbw git-svn-id: https://svn.fhem.de/fhem/trunk@12675 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 11 +++++++---- fhem/FHEM/HMConfig.pm | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index e78ba82dd..47b3c1915 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -4539,7 +4539,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++ $lvl = $lvlMin + $lvl*($lvlMax-$lvlMin)/100; # relativ to range $lvl = ($lvl > $lvlMax)?$lvlMax:(($lvl <= $lvlMin)?0:$lvl); } - if ($st eq "dimmer"){# at least blind cannot stand ramp time... + if ($st =~ m /(dimmer|rgb)/){# at least blind cannot stand ramp time... if (!$a[3]){ $tval = "FFFF"; $duration = 0; @@ -4563,7 +4563,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++ # store desiredLevel in and its Cmd in case we have to repeat my $plvl = ($lvl eq "old")?"C9" :sprintf("%02X",(($lvlInv)?100-$lvl :$lvl)*2); - if (($tval && $tval ne "FFFF") || $lvl eq "old"){ + if (($tval ne "FFFF") || $lvl eq "old"){ delete $hash->{helper}{dlvl};#stop desiredLevel supervision } else{ @@ -4758,8 +4758,11 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++ } elsif($cmd eq "brightCol") { ################################################ my (undef,undef,$bright,$colVal,$duration,$ramp) = @a; #date prepared extention to entdate - return "please enter the duration in seconds" - if (!defined $duration || $duration !~ m/^[+-]?\d+(\.\d+)?$/); + return "cmd requires brightness[0..100] step 0.5, color[0..100] step 0.5, duration, ramptime" if (!defined $ramp); + return "please enter the duration in seconds" if (!defined $duration || $duration !~ m/^[+-]?\d+(\.\d+)?$/); + ($bright,$colVal) = (int($bright*2),int($colVal*2));# convert percent to [0..200] + return "obey range for brightness[0..100] color[0..100]" if ( $bright < 0 or $bright > 200 + or $colVal < 0 or $colVal > 200); my $tval = CUL_HM_encodeTime16($duration);# onTime 0.0..85825945.6, 0=forever $ramp = CUL_HM_encodeTime16($ramp); diff --git a/fhem/FHEM/HMConfig.pm b/fhem/FHEM/HMConfig.pm index 3b54c8b5a..724576aac 100644 --- a/fhem/FHEM/HMConfig.pm +++ b/fhem/FHEM/HMConfig.pm @@ -1796,7 +1796,7 @@ $culHmModelSets{"HM-Sen-Wa-Od"} = $culHmModelSets{"HM-SEC-SD"}; ,statusRequest =>"" ,peerIODev =>"[IO] -btn- [set|unset]... not for future use" } - ,"HM-LC-RGBW-WM02" =>{ brightCol =>"-bright- -colVal- -duration- -ramp- ..."} + ,"HM-LC-RGBW-WM02" =>{ brightCol =>"-bright[0-100]- -colVal[0-100]- -duration- -ramp- ..."} ,"HM-LC-RGBW-WM03" =>{ brightAuto =>"-bright- -colProg- -min- -max- -duration- -ramp- ..."} ,"HM-Sec-Sir-WM01" =>{ on =>"" ,off =>""