diff --git a/custom_components/webrtc/utils.py b/custom_components/webrtc/utils.py index f667eeb..74a82c5 100644 --- a/custom_components/webrtc/utils.py +++ b/custom_components/webrtc/utils.py @@ -126,7 +126,12 @@ async def init_resource(hass: HomeAssistant, url: str, ver: str) -> bool: random url to avoid problems with the cache. But chromecast don't support extra JS urls and can't load custom card. """ - resources: ResourceStorageCollection = hass.data["lovelace"]["resources"] + resources: ResourceStorageCollection = ( + hass.data["lovelace"].resources + if hasattr(hass.data["lovelace"], "resources") + else hass.data["lovelace"]["resources"] + ) + # force load storage await resources.async_get_info()