From da338f2c1ac644734833763cd1cac9920fd14e87 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 10 Dec 2018 12:25:08 +0100 Subject: [PATCH] Fix lovelace save (#19162) --- homeassistant/components/lovelace/__init__.py | 4 ++-- tests/components/lovelace/test_init.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/lovelace/__init__.py b/homeassistant/components/lovelace/__init__.py index 68c322b39565e6..e6f122bce19542 100644 --- a/homeassistant/components/lovelace/__init__.py +++ b/homeassistant/components/lovelace/__init__.py @@ -101,8 +101,8 @@ async def async_load(self, force): async def async_save(self, config): """Save config.""" - self._data = {'config': config} - await self._store.async_save(config) + self._data['config'] = config + await self._store.async_save(self._data) class LovelaceYAML: diff --git a/tests/components/lovelace/test_init.py b/tests/components/lovelace/test_init.py index ea856b464c318a..15548b28cfb3a8 100644 --- a/tests/components/lovelace/test_init.py +++ b/tests/components/lovelace/test_init.py @@ -34,7 +34,7 @@ async def test_lovelace_from_storage(hass, hass_ws_client, hass_storage): response = await client.receive_json() assert response['success'] assert hass_storage[lovelace.STORAGE_KEY]['data'] == { - 'yo': 'hello' + 'config': {'yo': 'hello'} } # Load new config