Skip to content
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

register static files with async_register_static_paths instead #1554

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions custom_components/ui_lovelace_minimalist/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
GitHubRatelimitException,
)
from homeassistant.components.frontend import add_extra_js_url, async_remove_panel
from homeassistant.components.http import StaticPathConfig
from homeassistant.components.lovelace import _register_panel
from homeassistant.components.lovelace.dashboard import LovelaceYAML
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
Expand Down Expand Up @@ -363,10 +364,14 @@ async def configure_plugins(self) -> bool:
)

# Register
self.hass.http.register_static_path(
"/ui_lovelace_minimalist/cards",
self.hass.config.path(f"{self.integration_dir}/cards"),
True,
await self.hass.http.async_register_static_paths(
[
StaticPathConfig(
"/ui_lovelace_minimalist/cards",
self.hass.config.path(f"{self.integration_dir}/cards"),
True,
)
]
)

except Exception as exception:
Expand Down
Loading