def setup_platform(opp, config, add_entities, discovery_info=None): """Set up the Wink cover platform.""" for shade in pywink.get_shades(): _id = shade.object_id() + shade.name() if _id not in opp.data[DOMAIN]["unique_ids"]: add_entities([WinkCoverEntity(shade, opp)]) for shade in pywink.get_shade_groups(): _id = shade.object_id() + shade.name() if _id not in opp.data[DOMAIN]["unique_ids"]: add_entities([WinkCoverEntity(shade, opp)]) for door in pywink.get_garage_doors(): _id = door.object_id() + door.name() if _id not in opp.data[DOMAIN]["unique_ids"]: add_entities([WinkCoverEntity(door, opp)])
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Wink cover platform.""" import pywink for shade in pywink.get_shades(): _id = shade.object_id() + shade.name() if _id not in hass.data[DOMAIN]['unique_ids']: add_entities([WinkCoverDevice(shade, hass)]) for shade in pywink.get_shade_groups(): _id = shade.object_id() + shade.name() if _id not in hass.data[DOMAIN]['unique_ids']: add_entities([WinkCoverDevice(shade, hass)]) for door in pywink.get_garage_doors(): _id = door.object_id() + door.name() if _id not in hass.data[DOMAIN]['unique_ids']: add_entities([WinkCoverDevice(door, hass)])
def listGroups(self): r = "" groups = pywink.get_light_groups() for g in groups: r += '{color}{name} ({type}) - {state}\n```'.format( color=("```css\n" if g.state() else "```brainfuck\n"), name=g.name(), type='lights', state=("ON" if g.state() else "OFF")) groups = pywink.get_binary_switch_groups() for g in groups: r += '{color}{name} ({type}) - {state}\n```'.format( color=("```css\n" if g.state() else "```brainfuck\n"), name=g.name(), type='switches', state=("ON" if g.state() else "OFF")) groups = pywink.get_shade_groups() for g in groups: r += '{color}{name} ({type}) - {state}\n```'.format( color=("```css\n" if g.state() else "```brainfuck\n"), name=g.name(), type='shades', state=("ON" if g.state() else "OFF")) return r