Skip to content

Fix warning (utils.py) #799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

TheTakylo
Copy link
Contributor

This should fix #797

@Pieter-HA
Copy link

Implemented this proposed change, but got freezing streams as a result. After revert to the originals, things were working as expected.

@@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resources: ResourceStorageCollection = hass.data["lovelace"].resources
resources: ResourceStorageCollection = (
hass.data["lovelace"].resources
if hasattr(hass.data["lovelace"], "resources")
else hass.data["lovelace"]["resources"]
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be backwards compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Depreciation: lovelace_data['resources'] instead of lovelace_data.resources
3 participants