Add tag to base platforms
parent
907086edbc
commit
381bcf12f0
|
@ -71,6 +71,7 @@ class Platform(StrEnum):
|
|||
SIREN = "siren"
|
||||
STT = "stt"
|
||||
SWITCH = "switch"
|
||||
TAG = "tag"
|
||||
TEXT = "text"
|
||||
TIME = "time"
|
||||
TODO = "todo"
|
||||
|
|
|
@ -8,7 +8,7 @@ from astroid import nodes
|
|||
from pylint.checkers import BaseChecker
|
||||
from pylint.lint import PyLinter
|
||||
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.const import BASE_PLATFORMS
|
||||
|
||||
_MODULES: dict[str, set[str]] = {
|
||||
"air_quality": {"AirQualityEntity"},
|
||||
|
@ -65,8 +65,6 @@ _MODULES: dict[str, set[str]] = {
|
|||
"WeatherEntityDescription",
|
||||
},
|
||||
}
|
||||
_ENTITY_COMPONENTS: set[str] = {platform.value for platform in Platform}
|
||||
_ENTITY_COMPONENTS.add("tag")
|
||||
|
||||
|
||||
class HassEnforceClassModule(BaseChecker):
|
||||
|
@ -93,7 +91,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 _ENTITY_COMPONENTS:
|
||||
if current_module != "entity" and current_integration not in BASE_PLATFORMS:
|
||||
top_level_ancestors = list(node.ancestors(recurs=False))
|
||||
|
||||
for ancestor in top_level_ancestors:
|
||||
|
|
Loading…
Reference in New Issue