From 8b7e56b6a735000ab45695dca7a9ce2a0b455d14 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 19 Sep 2024 08:49:15 +0000 Subject: [PATCH] Add tag to _ENTITY_COMPONENTS --- pylint/plugins/hass_enforce_class_module.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pylint/plugins/hass_enforce_class_module.py b/pylint/plugins/hass_enforce_class_module.py index 0fce0e13f63..c0b363bbddf 100644 --- a/pylint/plugins/hass_enforce_class_module.py +++ b/pylint/plugins/hass_enforce_class_module.py @@ -65,7 +65,8 @@ _MODULES: dict[str, set[str]] = { "WeatherEntityDescription", }, } -_PLATFORMS: set[str] = {platform.value for platform in Platform} +_ENTITY_COMPONENTS: set[str] = {platform.value for platform in Platform} +_ENTITY_COMPONENTS.add("tag") class HassEnforceClassModule(BaseChecker): @@ -92,7 +93,7 @@ class HassEnforceClassModule(BaseChecker): current_integration = parts[2] current_module = parts[3] if len(parts) > 3 else "" - if current_module != "entity" and current_integration not in _PLATFORMS: + if current_module != "entity" and current_integration not in _ENTITY_COMPONENTS: top_level_ancestors = list(node.ancestors(recurs=False)) for ancestor in top_level_ancestors: