From 7d8296520e6eeec3fc1a1e81f17f72f57075e06f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20T=2E?= <10907922+TheTakylo@users.noreply.github.com> Date: Tue, 4 Feb 2025 08:51:33 +0100 Subject: [PATCH 1/2] Update utils.py --- custom_components/webrtc/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/webrtc/utils.py b/custom_components/webrtc/utils.py index f667eeb..125ca03 100644 --- a/custom_components/webrtc/utils.py +++ b/custom_components/webrtc/utils.py @@ -126,7 +126,7 @@ 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 # force load storage await resources.async_get_info() From aa5e92a608d36c9e14eebfb8e9832f2546121263 Mon Sep 17 00:00:00 2001 From: Alex X <511909+AlexxIT@users.noreply.github.com> Date: Wed, 13 Aug 2025 20:16:46 +0300 Subject: [PATCH 2/2] Update custom_components/webrtc/utils.py Co-authored-by: Robbin Janssen --- custom_components/webrtc/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/custom_components/webrtc/utils.py b/custom_components/webrtc/utils.py index 125ca03..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()