Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Automation script for KDhome (Home automation system) - http://krystiand.net/projekt/12/kdhome
- import kdhome
- import ircodes
- def run(cmd):
- subprocess.Popen(cmd, shell=True)
- class Light(kdhome.KDHome):
- def __init__(self):
- super().__init__()
- def onIRPressedEvent(self, code):
- if code == ircodes.mediatech.MUTE:
- run("~/apps/sound_mute_toggle.sh")
- def onIRNewCodeEvent(self, code):
- if code == ircodes.mediatech.UP:
- run("amixer -c 0 set Master 2%+")
- if code == ircodes.mediatech.DOWN:
- run("amixer -c 0 set Master 2%-")
- home = Light()
- home.connect("localhost", 9999)
- home.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement