From 8751fea77705442dcef36a5216e09d10e5707e17 Mon Sep 17 00:00:00 2001 From: Will <65567450+wjnelson78@users.noreply.github.com> Date: Tue, 11 Mar 2025 05:38:41 -0700 Subject: [PATCH] fix: use hass.data["lovelace"].resources instead of hass.data["lovelace"]["resources"] This commit addresses the deprecation warning related to accessing Lovelace resources by dictionary key. As of Home Assistant 2026.2, direct dictionary access to lovelace_data['resources'] will no longer be supported, and the recommended approach is to use the property-based access lovelace_data.resources instead. Updated utils.py to replace resources: ResourceStorageCollection = hass.data["lovelace"]["resources"] with resources: ResourceStorageCollection = hass.data["lovelace"].resources Ensured that references to resources in subsequent code remain compatible with the new property-based API. --- 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()