Created
January 1, 2019 12:44
-
-
Save kylecorry31/3468fda110e212106834ac9f453a6e18 to your computer and use it in GitHub Desktop.
A script for interacting with wemo devices.
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
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