From d6e083bf076a85b8ad101ad67922682ccd5b6f84 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 22 Aug 2026 09:26:21 +0200 Subject: [PATCH] Skip hassfest MDI icon generation on an outdated frontend (#179781) Co-authored-by: Claude --- script/hassfest/mdi_icons.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/script/hassfest/mdi_icons.py b/script/hassfest/mdi_icons.py index 3f8b2882942c..d24f20532c00 100644 --- a/script/hassfest/mdi_icons.py +++ b/script/hassfest/mdi_icons.py @@ -8,6 +8,7 @@ from .model import Config, Integration from .serializer import format_python_namespace _TARGET = "pylint/plugins/pylint_home_assistant/generated/mdi_icons.py" +_REQUIREMENT_PREFIX = "home-assistant-frontend==" def _get_frontend_version() -> str | None: @@ -18,6 +19,14 @@ def _get_frontend_version() -> str | None: return None +def _get_pinned_frontend_version(integrations: dict[str, Integration]) -> str | None: + """Get the home-assistant-frontend version pinned in the frontend manifest.""" + for requirement in integrations["frontend"].requirements: + if requirement.startswith(_REQUIREMENT_PREFIX): + return requirement.removeprefix(_REQUIREMENT_PREFIX) + return None + + def _load_mdi_icons() -> set[str]: """Load the MDI icon names from the frontend package.""" try: @@ -35,6 +44,10 @@ def validate(integrations: dict[str, Integration], config: Config) -> None: if frontend_version is None: return + pinned_version = _get_pinned_frontend_version(integrations) + if pinned_version is not None and pinned_version != frontend_version: + return + icons = _load_mdi_icons() if not icons: config.add_error(