diff --git a/homeassistant/components/lovelace/dashboard.py b/homeassistant/components/lovelace/dashboard.py index 38740672914..cdb104a150b 100644 --- a/homeassistant/components/lovelace/dashboard.py +++ b/homeassistant/components/lovelace/dashboard.py @@ -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) diff --git a/tests/components/lovelace/test_dashboard.py b/tests/components/lovelace/test_dashboard.py index 1effb10be27..775b2760c96 100644 --- a/tests/components/lovelace/test_dashboard.py +++ b/tests/components/lovelace/test_dashboard.py @@ -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"