From 5116f02290cc23332ca9d4c2bbf909115956a496 Mon Sep 17 00:00:00 2001 From: Jason Hu Date: Thu, 9 Aug 2018 04:31:48 -0700 Subject: [PATCH 1/2] Fix downgrade hassio cannot get refresh_token issue (#15874) * Fix downgrade hassio issue * Update __init__.py --- homeassistant/components/hassio/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/hassio/__init__.py b/homeassistant/components/hassio/__init__.py index 3a3e19fb484..13c486533d9 100644 --- a/homeassistant/components/hassio/__init__.py +++ b/homeassistant/components/hassio/__init__.py @@ -175,10 +175,13 @@ def async_setup(hass, config): if data is None: data = {} + refresh_token = None if 'hassio_user' in data: user = yield from hass.auth.async_get_user(data['hassio_user']) - refresh_token = list(user.refresh_tokens.values())[0] - else: + if user: + refresh_token = list(user.refresh_tokens.values())[0] + + if refresh_token is None: user = yield from hass.auth.async_create_system_user('Hass.io') refresh_token = yield from hass.auth.async_create_refresh_token(user) data['hassio_user'] = user.id From 37d98474d545ded44dfda738f1efe7d9c9a17509 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 9 Aug 2018 13:41:24 +0200 Subject: [PATCH 2/2] Bumped version to 0.75.3 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 6f0c5d50481..edc4d87421e 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 75 -PATCH_VERSION = '2' +PATCH_VERSION = '3' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3)