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,