Skip to content

Commit 77134dd

Browse files
authored
Merge pull request #799 from TheTakylo/patch-1
Fix warning (utils.py)
2 parents de1ccf0 + aa5e92a commit 77134dd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

custom_components/webrtc/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ async def init_resource(hass: HomeAssistant, url: str, ver: str) -> bool:
126126
random url to avoid problems with the cache. But chromecast don't support
127127
extra JS urls and can't load custom card.
128128
"""
129-
resources: ResourceStorageCollection = hass.data["lovelace"]["resources"]
129+
resources: ResourceStorageCollection = (
130+
hass.data["lovelace"].resources
131+
if hasattr(hass.data["lovelace"], "resources")
132+
else hass.data["lovelace"]["resources"]
133+
)
134+
130135
# force load storage
131136
await resources.async_get_info()
132137

0 commit comments

Comments
 (0)