2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

error for AC set fixed

git-svn-id: https://svn.fhem.de/fhem/trunk@1560 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
wherzig 2012-05-12 21:16:56 +00:00
parent 24e7e45be6
commit 6b74bf1898

View File

@ -119,13 +119,19 @@ TRX_LIGHT_Set($@)
my $ret = undef; my $ret = undef;
my $na = int(@a); my $na = int(@a);
return "no set value specified" if($na < 2 || $na > 4); return "no set value specified" if($na < 2 || $na > 3);
# look for device_type # look for device_type
my $name = $a[0]; my $name = $a[0];
my $command = $a[1]; my $command = $a[1];
my $level = $a[2]; my $level;
if ($na == 3) {
$level = $a[2];
} else {
$level = 0;
}
my $device_type = $hash->{TRX_LIGHT_type}; my $device_type = $hash->{TRX_LIGHT_type};
my $deviceid = $hash->{TRX_LIGHT_deviceid}; my $deviceid = $hash->{TRX_LIGHT_deviceid};
@ -185,7 +191,7 @@ TRX_LIGHT_Set($@)
Log 4,"TRX_LIGHT_Set lightning2 wrong deviceid: name=$name device_type=$device_type, deviceid=$deviceid"; Log 4,"TRX_LIGHT_Set lightning2 wrong deviceid: name=$name device_type=$device_type, deviceid=$deviceid";
return "error set name=$name deviveid=$deviceid"; return "error set name=$name deviveid=$deviceid";
} }
$hex_prefix = sprintf "0711"; $hex_prefix = sprintf "0B11";
$hex_command = sprintf "%02x%02x%s%02x%02x00", $device_type_num & 0xff, $seqnr, $deviceid, $cmnd, $level; $hex_command = sprintf "%02x%02x%s%02x%02x00", $device_type_num & 0xff, $seqnr, $deviceid, $cmnd, $level;
if ($command eq "level") { if ($command eq "level") {
$command .= sprintf " %d", $level; $command .= sprintf " %d", $level;