mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
commit
28de2d6f75
@ -175,10 +175,13 @@ def async_setup(hass, config):
|
|||||||
if data is None:
|
if data is None:
|
||||||
data = {}
|
data = {}
|
||||||
|
|
||||||
|
refresh_token = None
|
||||||
if 'hassio_user' in data:
|
if 'hassio_user' in data:
|
||||||
user = yield from hass.auth.async_get_user(data['hassio_user'])
|
user = yield from hass.auth.async_get_user(data['hassio_user'])
|
||||||
refresh_token = list(user.refresh_tokens.values())[0]
|
if user:
|
||||||
else:
|
refresh_token = list(user.refresh_tokens.values())[0]
|
||||||
|
|
||||||
|
if refresh_token is None:
|
||||||
user = yield from hass.auth.async_create_system_user('Hass.io')
|
user = yield from hass.auth.async_create_system_user('Hass.io')
|
||||||
refresh_token = yield from hass.auth.async_create_refresh_token(user)
|
refresh_token = yield from hass.auth.async_create_refresh_token(user)
|
||||||
data['hassio_user'] = user.id
|
data['hassio_user'] = user.id
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"""Constants used by Home Assistant components."""
|
"""Constants used by Home Assistant components."""
|
||||||
MAJOR_VERSION = 0
|
MAJOR_VERSION = 0
|
||||||
MINOR_VERSION = 75
|
MINOR_VERSION = 75
|
||||||
PATCH_VERSION = '2'
|
PATCH_VERSION = '3'
|
||||||
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
|
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
|
||||||
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION)
|
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION)
|
||||||
REQUIRED_PYTHON_VER = (3, 5, 3)
|
REQUIRED_PYTHON_VER = (3, 5, 3)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user