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

* initial commit

* small tweak
pull/25205/head
David Bonnes 2019-07-14 17:40:06 +01:00 committed by Paulus Schoutsen
parent 2643bbc228
commit 02e8ee137f
1 changed files with 4 additions and 1 deletions

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)