def setup_platform(hass, config, add_devices_callback, discovery_info=None): """ Find and return Wink lights. """ import pywink token = config.get(CONF_ACCESS_TOKEN) if not pywink.is_token_set() and token is None: logging.getLogger(__name__).error( "Missing wink access_token - " "get one at https://winkbearertoken.appspot.com/") return elif token is not None: pywink.set_bearer_token(token) add_devices_callback(WinkLight(light) for light in pywink.get_bulbs())
def setup_platform(hass, config, add_devices_callback, discovery_info=None): """ Find and return Wink lights. """ import pywink token = config.get(CONF_ACCESS_TOKEN) if not pywink.is_token_set() and token is None: logging.getLogger(__name__).error( "Missing wink access_token - " "get one at https://winkbearertoken.appspot.com/") return elif token is not None: pywink.set_bearer_token(token) add_devices_callback( WinkLight(light) for light in pywink.get_bulbs())