Last active
December 28, 2015 22:59
-
-
Save matbor/7575954 to your computer and use it in GitHub Desktop.
testing wemo ouimeaux script to get the state of my belkin wemo device
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ouimeaux.environment import Environment | |
def on_switch(switch): | |
print ('******** Switch found:', switch.name) | |
def on_change(value): | |
print('******** light has changed state and has been switched!') | |
env = Environment(switch_callback=on_switch, with_cache=False) | |
env.start() | |
env.discover(3) | |
lounge = env.get_switch('Lounge room lamp') | |
lounge.register_listener(on_change) | |
env.wait() |
Above was fixed in new release of library,
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
update.... just upgraded to 0.5.1 and it seems to of fixed my problem and is detecting the switch changes now ;)
but now it is coming up with this error....