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