From 6b74bf18988e8bf0438b80fb8c0352fe4501cc06 Mon Sep 17 00:00:00 2001 From: wherzig <> Date: Sat, 12 May 2012 21:16:56 +0000 Subject: [PATCH] error for AC set fixed git-svn-id: https://svn.fhem.de/fhem/trunk@1560 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/46_TRX_LIGHT.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/46_TRX_LIGHT.pm b/fhem/FHEM/46_TRX_LIGHT.pm index 08c3aafca..b2003410d 100755 --- a/fhem/FHEM/46_TRX_LIGHT.pm +++ b/fhem/FHEM/46_TRX_LIGHT.pm @@ -119,13 +119,19 @@ TRX_LIGHT_Set($@) my $ret = undef; 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 my $name = $a[0]; 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 $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"; 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; if ($command eq "level") { $command .= sprintf " %d", $level;