Skip to content

Commit

Permalink
Fix lovelace warning #626
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Feb 21, 2025
1 parent 2e22d97 commit 547619a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions custom_components/yandex_station/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,17 @@ def clean_v1(hass_dir):


async def has_custom_icons(hass: HomeAssistant):
lovelace = hass.data.get("lovelace")

# GUI off mode
if "lovelace" not in hass.data:
if not lovelace:
return False

resources = hass.data["lovelace"]["resources"]
resources = (
lovelace.resources if hasattr(lovelace, "resources") else lovelace["resources"]
)
await resources.async_get_info()

return any(
"/yandex-icons.js" in resource["url"] for resource in resources.async_items()
)
Expand Down

0 comments on commit 547619a

Please sign in to comment.