Beispiel #1
0
 def listLights(self):
     r = ""
     lights = pywink.get_light_bulbs()
     for l in lights:
         r += ("```css\n" if l.state() else "```brainfuck\n") + l.name(
         ) + " - " + ("ON" if l.state() else "OFF") + ("\n```")
     return r
Beispiel #2
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the Wink lights."""
    import pywink

    for light in pywink.get_light_bulbs():
        _id = light.object_id() + light.name()
        if _id not in hass.data[DOMAIN]['unique_ids']:
            add_devices([WinkLight(light, hass)])
Beispiel #3
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the Wink lights."""
    import pywink

    for light in pywink.get_light_bulbs():
        _id = light.object_id() + light.name()
        if _id not in hass.data[DOMAIN]['unique_ids']:
            add_devices([WinkLight(light, hass)])
Beispiel #4
0
def DimLights():
    for bulb in pywink.get_light_bulbs():
        print "-------------------------------"
        print(bulb.name(), bulb.state())
        currentBrightness = bulb.brightness()
        print currentBrightness
        bulb.set_state(True, brightness=.6)
        print "-------------------------------"
Beispiel #5
0
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the Wink lights."""

    for light in pywink.get_light_bulbs():
        _id = light.object_id() + light.name()
        if _id not in hass.data[DOMAIN]["unique_ids"]:
            add_entities([WinkLight(light, hass)])
    for light in pywink.get_light_groups():
        _id = light.object_id() + light.name()
        if _id not in hass.data[DOMAIN]["unique_ids"]:
            add_entities([WinkLight(light, hass)])
Beispiel #6
0
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Wink lights."""
    import pywink

    add_devices(WinkLight(light, hass) for light in pywink.get_light_bulbs())