Keep cloud tokens always valid (#20762)

* Keep auth token always valid

* Remove unused refresh_auth message

* Capture EndpointConnectionError

* Lint
This commit is contained in:
Paulus Schoutsen authored and Paulus Schoutsen committed 2019-02-05 08:04:41 -08:00
1 parent 7f76210549
commit 3d75e1c299
5 files changed
+122 -36

No files matched your search

+2 -1
View File
@@ -106,6 +106,7 @@ async def async_setup(hass, config):
)
cloud = hass.data[DOMAIN] = Cloud(hass, **kwargs)
await auth_api.async_setup(hass, cloud)
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, cloud.async_start)
await http_api.async_setup(hass)
return True
@@ -263,7 +264,7 @@ class Cloud:
self.access_token = info['access_token']
self.refresh_token = info['refresh_token']
self.hass.add_job(self.iot.connect())
self.hass.async_create_task(self.iot.connect())
def _decode_claims(self, token): # pylint: disable=no-self-use
"""Decode the claims in a token."""