From a8264ae8ae0c997bd9f91b06d23eb667400a55da Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 20 May 2025 11:48:33 +0200 Subject: [PATCH] Mark button methods and properties as mandatory in pylint plugin (#145269) --- homeassistant/components/starline/button.py | 2 +- pylint/plugins/hass_enforce_type_hints.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/starline/button.py b/homeassistant/components/starline/button.py index 1d238e232b9..fd449607f52 100644 --- a/homeassistant/components/starline/button.py +++ b/homeassistant/components/starline/button.py @@ -68,6 +68,6 @@ class StarlineButton(StarlineEntity, ButtonEntity): """Return True if entity is available.""" return super().available and self._device.online - def press(self): + def press(self) -> None: """Press the button.""" self._account.api.set_car_state(self._device.device_id, self._key, True) diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index ea4bd75d667..fe0e664d546 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -941,12 +941,13 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { matches=[ TypeHintMatch( function_name="device_class", - return_type=["ButtonDeviceClass", "str", None], + return_type=["ButtonDeviceClass", None], ), TypeHintMatch( function_name="press", return_type=None, has_async_counterpart=True, + mandatory=True, ), ], ),