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
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)])
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 "-------------------------------"
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)])
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())