1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Fix cloud defaults (#19172)

This commit is contained in:
Paulus Schoutsen
2018-12-11 06:50:54 +01:00
committed by GitHub
parent 92e19f6001
commit 557720b094
4 changed files with 6 additions and 9 deletions

View File

@@ -16,19 +16,17 @@ class CloudPreferences:
self._store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY)
self._prefs = None
async def async_initialize(self, logged_in):
async def async_initialize(self):
"""Finish initializing the preferences."""
prefs = await self._store.async_load()
if prefs is None:
# Backwards compat: we enable alexa/google if already logged in
prefs = {
PREF_ENABLE_ALEXA: logged_in,
PREF_ENABLE_GOOGLE: logged_in,
PREF_ENABLE_ALEXA: True,
PREF_ENABLE_GOOGLE: True,
PREF_GOOGLE_ALLOW_UNLOCK: False,
PREF_CLOUDHOOKS: {}
}
await self._store.async_save(prefs)
self._prefs = prefs