From a7de947f00e87cb68b97d2bc79e08beb23abab3e Mon Sep 17 00:00:00 2001 From: G Johansson Date: Mon, 23 Jun 2025 19:12:18 +0200 Subject: [PATCH] Add vacuum activity to pylint type hints check (#147162) --- pylint/plugins/hass_enforce_type_hints.py | 4 ++++ tests/pylint/test_enforce_type_hints.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index 0760cd33821..32a053527f6 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -2795,6 +2795,10 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { function_name="state", return_type=["str", None], ), + TypeHintMatch( + function_name="activity", + return_type=["VacuumActivity", None], + ), TypeHintMatch( function_name="battery_level", return_type=["int", None], diff --git a/tests/pylint/test_enforce_type_hints.py b/tests/pylint/test_enforce_type_hints.py index ae426b13fcb..41605bf2f2b 100644 --- a/tests/pylint/test_enforce_type_hints.py +++ b/tests/pylint/test_enforce_type_hints.py @@ -1167,6 +1167,10 @@ def test_vacuum_entity(linter: UnittestLinter, type_hint_checker: BaseChecker) - class MyVacuum( #@ StateVacuumEntity ): + @property + def activity(self) -> VacuumActivity | None: + pass + def send_command( self, command: str,