Advertisement
KrystianD

Toggle light on electric switch toggle event

Jan 13th, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. # Automation script for KDhome (Home automation system) - http://krystiand.net/projekt/12/kdhome
  2.  
  3. import kdhome
  4.  
  5. class Light(kdhome.KDHome):
  6.  
  7.     def __init__(self):
  8.         super().__init__()
  9.  
  10.     def onInputChangedEvent(self, id, name, value):
  11.         if name == "LIGHT_SWITCH":
  12.             self.toggleOutput("LIGHT")
  13.  
  14. home = Light()
  15. home.connect("localhost", 9999)
  16. home.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement