Skip to content

Instantly share code, notes, and snippets.

@kylecorry31
Created January 1, 2019 12:44
Show Gist options
  • Save kylecorry31/3468fda110e212106834ac9f453a6e18 to your computer and use it in GitHub Desktop.
Save kylecorry31/3468fda110e212106834ac9f453a6e18 to your computer and use it in GitHub Desktop.
A script for interacting with wemo devices.
import gi
import time
gi.require_version('Notify', '0.7')
from gi.repository import Notify
from ouimeaux.environment import Environment
def print_name(light):
print light.name
env = Environment()
env.start()
env.discover(seconds=2)
bridges = env.list_bridges()
if len(bridges) == 0:
exit()
bridge = env.get_bridge(bridges[0])
lights = bridge.bridge_get_lights()
print time.time()
bridge.light_set_state(lights['Left Lamp'], 1, 255)
print time.time()
# Notify.init("App Name")
# Notify.Notification.new("Hi", "This is a test").show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment