[climate-1.0] Bugfix evohome showstopper (#25139)

* initial commit

* small tweak
This commit is contained in:
David Bonnes 2019-07-14 17:40:06 +01:00 committed by Paulus Schoutsen
parent e6a2dde19a
commit 3480e6229a

View file

@ -129,7 +129,7 @@ class EvoBroker:
self.config = self.status = self.timers = {}
self.client = self.tcs = None
self._app_storage = None
self._app_storage = {}
hass.data[DOMAIN] = {}
hass.data[DOMAIN]['broker'] = self
@ -195,6 +195,9 @@ class EvoBroker:
store = self.hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY)
app_storage = self._app_storage = await store.async_load()
if app_storage is None:
app_storage = self._app_storage = {}
if app_storage.get(CONF_USERNAME) == self.params[CONF_USERNAME]:
refresh_token = app_storage.get(CONF_REFRESH_TOKEN)
access_token = app_storage.get(CONF_ACCESS_TOKEN)