diff --git a/homeassistant/components/lg_thinq/vacuum.py b/homeassistant/components/lg_thinq/vacuum.py index 6cf2a9086b1..6b98b6d8f11 100644 --- a/homeassistant/components/lg_thinq/vacuum.py +++ b/homeassistant/components/lg_thinq/vacuum.py @@ -4,6 +4,7 @@ from __future__ import annotations from enum import StrEnum import logging +from typing import Any from thinqconnect import DeviceType from thinqconnect.integration import ExtendedProperty @@ -154,7 +155,7 @@ class ThinQStateVacuumEntity(ThinQEntity, StateVacuumEntity): ) ) - async def async_return_to_base(self, **kwargs) -> None: + async def async_return_to_base(self, **kwargs: Any) -> None: """Return device to dock.""" _LOGGER.debug( "[%s:%s] async_return_to_base", diff --git a/pylint/plugins/hass_enforce_class_module.py b/pylint/plugins/hass_enforce_class_module.py index cc7b33d9946..41c07819fe8 100644 --- a/pylint/plugins/hass_enforce_class_module.py +++ b/pylint/plugins/hass_enforce_class_module.py @@ -70,7 +70,7 @@ _MODULES: dict[str, set[str]] = { "todo": {"TodoListEntity"}, "tts": {"TextToSpeechEntity"}, "update": {"UpdateEntity", "UpdateEntityDescription"}, - "vacuum": {"StateVacuumEntity", "VacuumEntity", "VacuumEntityDescription"}, + "vacuum": {"StateVacuumEntity", "VacuumEntityDescription"}, "wake_word": {"WakeWordDetectionEntity"}, "water_heater": {"WaterHeaterEntity"}, "weather": { diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index 45a3e41f91a..0760cd33821 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -2789,12 +2789,12 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { matches=_RESTORE_ENTITY_MATCH, ), ClassTypeHintMatch( - base_class="ToggleEntity", - matches=_TOGGLE_ENTITY_MATCH, - ), - ClassTypeHintMatch( - base_class="_BaseVacuum", + base_class="StateVacuumEntity", matches=[ + TypeHintMatch( + function_name="state", + return_type=["str", None], + ), TypeHintMatch( function_name="battery_level", return_type=["int", None], @@ -2821,6 +2821,16 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { return_type=None, has_async_counterpart=True, ), + TypeHintMatch( + function_name="start", + return_type=None, + has_async_counterpart=True, + ), + TypeHintMatch( + function_name="pause", + return_type=None, + has_async_counterpart=True, + ), TypeHintMatch( function_name="return_to_base", kwargs_type="Any", @@ -2860,63 +2870,6 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { ), ], ), - ClassTypeHintMatch( - base_class="VacuumEntity", - matches=[ - TypeHintMatch( - function_name="status", - return_type=["str", None], - ), - TypeHintMatch( - function_name="start_pause", - kwargs_type="Any", - return_type=None, - has_async_counterpart=True, - ), - TypeHintMatch( - function_name="async_pause", - return_type=None, - ), - TypeHintMatch( - function_name="async_start", - return_type=None, - ), - ], - ), - ClassTypeHintMatch( - base_class="StateVacuumEntity", - matches=[ - TypeHintMatch( - function_name="state", - return_type=["str", None], - ), - TypeHintMatch( - function_name="start", - return_type=None, - has_async_counterpart=True, - ), - TypeHintMatch( - function_name="pause", - return_type=None, - has_async_counterpart=True, - ), - TypeHintMatch( - function_name="async_turn_on", - kwargs_type="Any", - return_type=None, - ), - TypeHintMatch( - function_name="async_turn_off", - kwargs_type="Any", - return_type=None, - ), - TypeHintMatch( - function_name="async_toggle", - kwargs_type="Any", - return_type=None, - ), - ], - ), ], "water_heater": [ ClassTypeHintMatch( diff --git a/tests/pylint/test_enforce_type_hints.py b/tests/pylint/test_enforce_type_hints.py index 9179a545256..ae426b13fcb 100644 --- a/tests/pylint/test_enforce_type_hints.py +++ b/tests/pylint/test_enforce_type_hints.py @@ -1161,17 +1161,11 @@ def test_vacuum_entity(linter: UnittestLinter, type_hint_checker: BaseChecker) - class Entity(): pass - class ToggleEntity(Entity): - pass - - class _BaseVacuum(Entity): - pass - - class VacuumEntity(_BaseVacuum, ToggleEntity): + class StateVacuumEntity(Entity): pass class MyVacuum( #@ - VacuumEntity + StateVacuumEntity ): def send_command( self,