def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the Wink platform.""" import pywink add_devices(WinkToggleDevice(switch) for switch in pywink.get_switches()) add_devices(WinkToggleDevice(switch) for switch in pywink.get_powerstrip_outlets()) add_devices(WinkToggleDevice(switch) for switch in pywink.get_sirens())
def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the Wink platform.""" import pywink add_devices(WinkToggleDevice(switch) for switch in pywink.get_switches()) add_devices( WinkToggleDevice(switch) for switch in pywink.get_powerstrip_outlets()) add_devices(WinkToggleDevice(switch) for switch in pywink.get_sirens())
def ToggleSwitches(): for switch in pywink.get_switches(): print "-------------------------------" name = switch.name() state = switch.state() print name, state print "-------------------------------" switch.set_state(not state)
def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the Wink platform.""" import pywink for switch in pywink.get_switches(): add_devices([WinkToggleDevice(switch, hass)]) for switch in pywink.get_powerstrips(): add_devices([WinkToggleDevice(switch, hass)]) for switch in pywink.get_sirens(): add_devices([WinkToggleDevice(switch, hass)]) for sprinkler in pywink.get_sprinklers(): add_devices([WinkToggleDevice(sprinkler, hass)])
def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the Wink platform.""" import pywink for switch in pywink.get_switches(): add_devices([WinkToggleDevice(switch, hass)]) for switch in pywink.get_powerstrips(): add_devices([WinkToggleDevice(switch, hass)]) for switch in pywink.get_sirens(): add_devices([WinkToggleDevice(switch, hass)]) for sprinkler in pywink.get_sprinklers(): add_devices([WinkToggleDevice(sprinkler, hass)])
def setup_platform(hass, config, add_devices, discovery_info=None): """ Sets up the Wink platform. """ import pywink if discovery_info is None: token = config.get(CONF_ACCESS_TOKEN) if token is None: logging.getLogger(__name__).error( "Missing wink access_token. " "Get one at https://winkbearertoken.appspot.com/") return pywink.set_bearer_token(token) add_devices(WinkToggleDevice(switch) for switch in pywink.get_switches())
def setup_platform(hass, config, add_devices, discovery_info=None): """ Sets up the Wink platform. """ import pywink if discovery_info is None: token = config.get(CONF_ACCESS_TOKEN) if token is None: logging.getLogger(__name__).error( "Missing wink access_token - " "get one at https://winkbearertoken.appspot.com/") return pywink.set_bearer_token(token) add_devices(WinkToggleDevice(switch) for switch in pywink.get_switches())
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Wink platform.""" for switch in pywink.get_switches(): _id = switch.object_id() + switch.name() if _id not in hass.data[DOMAIN]["unique_ids"]: add_entities([WinkToggleDevice(switch, hass)]) for switch in pywink.get_powerstrips(): _id = switch.object_id() + switch.name() if _id not in hass.data[DOMAIN]["unique_ids"]: add_entities([WinkToggleDevice(switch, hass)]) for sprinkler in pywink.get_sprinklers(): _id = sprinkler.object_id() + sprinkler.name() if _id not in hass.data[DOMAIN]["unique_ids"]: add_entities([WinkToggleDevice(sprinkler, hass)]) for switch in pywink.get_binary_switch_groups(): _id = switch.object_id() + switch.name() if _id not in hass.data[DOMAIN]["unique_ids"]: add_entities([WinkToggleDevice(switch, hass)])
def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the Wink platform.""" import pywink for switch in pywink.get_switches(): _id = switch.object_id() + switch.name() if _id not in hass.data[DOMAIN]['unique_ids']: add_devices([WinkToggleDevice(switch, hass)]) for switch in pywink.get_powerstrips(): _id = switch.object_id() + switch.name() if _id not in hass.data[DOMAIN]['unique_ids']: add_devices([WinkToggleDevice(switch, hass)]) for switch in pywink.get_sirens(): _id = switch.object_id() + switch.name() if _id not in hass.data[DOMAIN]['unique_ids']: add_devices([WinkToggleDevice(switch, hass)]) for sprinkler in pywink.get_sprinklers(): _id = sprinkler.object_id() + sprinkler.name() if _id not in hass.data[DOMAIN]['unique_ids']: add_devices([WinkToggleDevice(sprinkler, hass)])
def setup_platform(hass, config, add_devices, discovery_info=None): """Set up the Wink platform.""" import pywink for switch in pywink.get_switches(): _id = switch.object_id() + switch.name() if _id not in hass.data[DOMAIN]['unique_ids']: add_devices([WinkToggleDevice(switch, hass)]) for switch in pywink.get_powerstrips(): _id = switch.object_id() + switch.name() if _id not in hass.data[DOMAIN]['unique_ids']: add_devices([WinkToggleDevice(switch, hass)]) for switch in pywink.get_sirens(): _id = switch.object_id() + switch.name() if _id not in hass.data[DOMAIN]['unique_ids']: add_devices([WinkToggleDevice(switch, hass)]) for sprinkler in pywink.get_sprinklers(): _id = sprinkler.object_id() + sprinkler.name() if _id not in hass.data[DOMAIN]['unique_ids']: add_devices([WinkToggleDevice(sprinkler, hass)])