Allow managing Lovelace storage dashboards (#32241)
* Allow managing Lovelace storage dashboards * Make sure we do not allow duplicate url paths * Allow setting sidebar to None * Fix tests * Delete storage file on delete * List all dashboards
This commit is contained in:
1 parent
ede39454a2
commit
deda2f86e7
11 files changed
+447
-90
No files matched your search
@@ -992,6 +992,10 @@ def mock_storage(data=None):
|
||||
# To ensure that the data can be serialized
|
||||
data[store.key] = json.loads(json.dumps(data_to_write, cls=store._encoder))
|
||||
|
||||
async def mock_remove(store):
|
||||
"""Remove data."""
|
||||
data.pop(store.key, None)
|
||||
|
||||
with patch(
|
||||
"homeassistant.helpers.storage.Store._async_load",
|
||||
side_effect=mock_async_load,
|
||||
@@ -1000,6 +1004,10 @@ def mock_storage(data=None):
|
||||
"homeassistant.helpers.storage.Store._write_data",
|
||||
side_effect=mock_write_data,
|
||||
autospec=True,
|
||||
), patch(
|
||||
"homeassistant.helpers.storage.Store.async_remove",
|
||||
side_effect=mock_remove,
|
||||
autospec=True,
|
||||
):
|
||||
yield data
|
||||
|
||||
|
||||
Reference in new issue
Block a user