From 3992387e9c5e359091a7c3990867169a787c80b1 Mon Sep 17 00:00:00 2001 From: Patrick Masters Date: Wed, 4 Dec 2024 21:27:59 -0500 Subject: [PATCH 1/2] register static files with async_register_static_paths instead --- custom_components/ui_lovelace_minimalist/base.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/base.py b/custom_components/ui_lovelace_minimalist/base.py index 4c45acec8..0bdf2a7e1 100644 --- a/custom_components/ui_lovelace_minimalist/base.py +++ b/custom_components/ui_lovelace_minimalist/base.py @@ -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 @@ -363,10 +364,11 @@ 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: From 2725320902536d4515f9fbf56005efaaab79e877 Mon Sep 17 00:00:00 2001 From: Patrick Masters Date: Wed, 4 Dec 2024 22:07:41 -0500 Subject: [PATCH 2/2] code quality fix --- custom_components/ui_lovelace_minimalist/base.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/base.py b/custom_components/ui_lovelace_minimalist/base.py index 0bdf2a7e1..dc2e0dcae 100644 --- a/custom_components/ui_lovelace_minimalist/base.py +++ b/custom_components/ui_lovelace_minimalist/base.py @@ -365,10 +365,13 @@ async def configure_plugins(self) -> bool: # Register await self.hass.http.async_register_static_paths( - [StaticPathConfig( - "/ui_lovelace_minimalist/cards", - self.hass.config.path(f"{self.integration_dir}/cards"), - True)] + [ + StaticPathConfig( + "/ui_lovelace_minimalist/cards", + self.hass.config.path(f"{self.integration_dir}/cards"), + True, + ) + ] ) except Exception as exception: