From 9c78ce4e99b005c5c201e9e2a4113ec1dc8c5684 Mon Sep 17 00:00:00 2001 From: wherzig Date: Wed, 26 Sep 2012 19:35:49 +0000 Subject: [PATCH] removed set for devicelogs window, door, motion, lightsensor and photosensor git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1891 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/46_TRX_LIGHT.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/FHEM/46_TRX_LIGHT.pm b/FHEM/46_TRX_LIGHT.pm index e2feba067..81672c214 100755 --- a/FHEM/46_TRX_LIGHT.pm +++ b/FHEM/46_TRX_LIGHT.pm @@ -144,6 +144,14 @@ TRX_LIGHT_Set($@) return "No set implemented for $device_type"; } + if ( lc($hash->{TRX_LIGHT_devicelog}) eq "window" || lc($hash->{TRX_LIGHT_devicelog}) eq "door" || + lc($hash->{TRX_LIGHT_devicelog}) eq "motion" || + lc($hash->{TRX_LIGHT_devicelog}) eq "lightsensor" || lc($hash->{TRX_LIGHT_devicelog}) eq "photosensor" + ) { + return "No set implemented for $device_type"; + } + + my $device_type_num = $light_device_c2b{$device_type}; if(!defined($device_type_num)) { return "Unknown device_type, choose one of " . @@ -431,6 +439,14 @@ sub TRX_LIGHT_parse_X10 { } } + if (lc($def->{TRX_LIGHT_devicelog}) eq "window" || lc($def->{TRX_LIGHT_devicelog}) eq "door") { + $command = ($command eq "on") ? "Open" : "Closed" ; + } elsif (lc($def->{TRX_LIGHT_devicelog}) eq "motion") { + $command = ($command eq "on") ? "alert" : "normal" ; + } elsif (lc($def->{TRX_LIGHT_devicelog}) eq "lightsensor" || lc($def->{TRX_LIGHT_devicelog}) eq "photosensor") { + $command = ($command eq "on") ? "dark" : "bright" ; + } + if ($type == 0x10 || $type == 0x11) { # try to use it for all types: $current = $command;