def keep_alive_call(event_time): """Call the Wink API endpoints to keep PubNub working.""" _LOGGER.info("Polling the Wink API to keep PubNub updates flowing.") pywink.set_user_agent(str(int(time.time()))) _temp_response = pywink.get_user() _LOGGER.debug(str(json.dumps(_temp_response))) time.sleep(1) pywink.set_user_agent(USER_AGENT) _temp_response = pywink.wink_api_fetch() _LOGGER.debug(str(json.dumps(_temp_response)))
def keep_alive_call(event_time): """Call the Wink API endpoints to keep PubNub working.""" _LOGGER.info("Polling the Wink API to keep PubNub updates flowing") pywink.set_user_agent(str(int(time.time()))) _temp_response = pywink.get_user() _LOGGER.debug(str(json.dumps(_temp_response))) time.sleep(1) pywink.set_user_agent(USER_AGENT) _temp_response = pywink.wink_api_fetch() _LOGGER.debug(str(json.dumps(_temp_response)))
def keep_alive_call(event_time): """Call the Wink API endpoints to keep PubNub working.""" _LOGGER.info("Getting a new Wink token.") if hass.data[DOMAIN]["oath"].get("client_id") is not None: _email = hass.data[DOMAIN]["oath"]["email"] _password = hass.data[DOMAIN]["oath"]["password"] _client_id = hass.data[DOMAIN]["oath"]["client_id"] _client_secret = hass.data[DOMAIN]["oath"]["client_secret"] pywink.set_wink_credentials(_email, _password, _client_id, _client_secret) else: _LOGGER.info("Getting a new Wink token.") _get_wink_token_from_web() time.sleep(1) _LOGGER.info("Polling the Wink API to keep PubNub updates flowing.") _LOGGER.debug(str(json.dumps(pywink.wink_api_fetch()))) time.sleep(1) _LOGGER.debug(str(json.dumps(pywink.get_user())))