Lovelace: storage key based on id instead of url_path (#32873)
* Fix storage key based on url_path * Fix test
This commit is contained in:
parent
03b1c6ddee
commit
a7aca10668
2 changed files with 4 additions and 5 deletions
|
@ -88,7 +88,7 @@ class LovelaceStorage(LovelaceConfig):
|
|||
storage_key = CONFIG_STORAGE_KEY_DEFAULT
|
||||
else:
|
||||
url_path = config[CONF_URL_PATH]
|
||||
storage_key = CONFIG_STORAGE_KEY.format(url_path)
|
||||
storage_key = CONFIG_STORAGE_KEY.format(config["id"])
|
||||
|
||||
super().__init__(hass, url_path, config)
|
||||
|
||||
|
|
|
@ -373,7 +373,6 @@ async def test_storage_dashboards(hass, hass_ws_client, hass_storage):
|
|||
assert response["result"]["icon"] == "mdi:map"
|
||||
|
||||
dashboard_id = response["result"]["id"]
|
||||
dashboard_path = response["result"]["url_path"]
|
||||
|
||||
assert "created-url-path" in hass.data[frontend.DATA_PANELS]
|
||||
|
||||
|
@ -408,9 +407,9 @@ async def test_storage_dashboards(hass, hass_ws_client, hass_storage):
|
|||
)
|
||||
response = await client.receive_json()
|
||||
assert response["success"]
|
||||
assert hass_storage[dashboard.CONFIG_STORAGE_KEY.format(dashboard_path)][
|
||||
"data"
|
||||
] == {"config": {"yo": "hello"}}
|
||||
assert hass_storage[dashboard.CONFIG_STORAGE_KEY.format(dashboard_id)]["data"] == {
|
||||
"config": {"yo": "hello"}
|
||||
}
|
||||
assert len(events) == 1
|
||||
assert events[0].data["url_path"] == "created-url-path"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue