Skip to content

Instantly share code, notes, and snippets.

@matbor
Last active December 28, 2015 22:59
Show Gist options
  • Save matbor/7575954 to your computer and use it in GitHub Desktop.
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
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()
@matbor
Copy link
Author

matbor commented Nov 24, 2013

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