|
From: <ni...@us...> - 2010-11-19 23:48:28
|
Revision: 143
http://openautomation.svn.sourceforge.net/openautomation/?rev=143&view=rev
Author: nilss1
Date: 2010-11-19 23:48:22 +0000 (Fri, 19 Nov 2010)
Log Message:
-----------
config option toggle for easy connections to KNX objects
Modified Paths:
--------------
PyWireGate/trunk/lirc_connector/LIRC_Connector.py
Modified: PyWireGate/trunk/lirc_connector/LIRC_Connector.py
===================================================================
--- PyWireGate/trunk/lirc_connector/LIRC_Connector.py 2010-11-19 23:47:12 UTC (rev 142)
+++ PyWireGate/trunk/lirc_connector/LIRC_Connector.py 2010-11-19 23:48:22 UTC (rev 143)
@@ -75,8 +75,24 @@
raw, counter, button, channel = rawmsg.split()
## default "LIRC:channel_button
id = u"%s:%s:%s" % (self.instanceName,channel,button)
- self.WG.DATASTORE.update(id,int(counter,16))
+ obj = self.WG.DATASTORE.get(id)
+ val = int(counter,16)
+ if 'toggle' in obj.config:
+ if counter <> "00":
+ continue
+ toggle = obj.config['toggle']
+ val = obj.getValue()
+ if type(val) == int:
+ val = int(val == 0)
+ else:
+ val = 0
+ #if type(obj.config['toggle']) == list:
+ # toglen = len(val)
+
+
+ self.WG.DATASTORE.update(id,val)
+
id = u"%s:%s" % (self.instanceName,button)
## dont't create it "LIRC:Button"
if id in self.WG.DATASTORE.dataobjects:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|