2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-17 05:16:02 +00:00

Fix of the Fix of the Fix. Hopefully the last timed dimmer command fix

git-svn-id: https://svn.fhem.de/fhem/trunk@784 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2010-12-27 19:19:07 +00:00
parent 7ef5651508
commit b632ca2b65

View File

@ -189,21 +189,21 @@ FS20_Set($@)
my $val; my $val;
if($na == 3) { # Timed command. if($na == 3) { # Timed command.
$c = sprintf("%02X", $c & 0x20); # Set the extension bit $c = sprintf("%02X", (hex($c) | 0x20)); # Set the extension bit
######################## ########################
# Calculating the time. # Calculating the time.
LOOP: for(my $i = 0; $i <= 12; $i++) { LOOP: for(my $i = 0; $i <= 12; $i++) {
for(my $j = 0; $j <= 15; $j++) { for(my $j = 0; $j <= 15; $j++) {
$val = (2**$i)*$j*0.25; $val = (2**$i)*$j*0.25;
if($val >= $a[2]) { if($val >= $a[2]) {
if($val != $a[2]) { if($val != $a[2]) {
$ret = "FS20 Setting timeout to $val from $a[2]"; $ret = "FS20 Setting timeout to $val from $a[2]";
Log GetLogLevel($a[0],2), $ret; Log GetLogLevel($a[0],2), $ret;
} }
$c .= sprintf("%x%x", $i, $j); $c .= sprintf("%x%x", $i, $j);
last LOOP; last LOOP;
} }
} }
} }
return "Specified timeout too large, max is 15360" if(length($c) == 2); return "Specified timeout too large, max is 15360" if(length($c) == 2);