Mark button methods and properties as mandatory in pylint plugin (#145269)

This commit is contained in:
epenet 2025-05-20 11:48:33 +02:00 committed by GitHub
parent 642dc5b49c
commit a8264ae8ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -68,6 +68,6 @@ class StarlineButton(StarlineEntity, ButtonEntity):
"""Return True if entity is available.""" """Return True if entity is available."""
return super().available and self._device.online return super().available and self._device.online
def press(self): def press(self) -> None:
"""Press the button.""" """Press the button."""
self._account.api.set_car_state(self._device.device_id, self._key, True) self._account.api.set_car_state(self._device.device_id, self._key, True)

View File

@ -941,12 +941,13 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
matches=[ matches=[
TypeHintMatch( TypeHintMatch(
function_name="device_class", function_name="device_class",
return_type=["ButtonDeviceClass", "str", None], return_type=["ButtonDeviceClass", None],
), ),
TypeHintMatch( TypeHintMatch(
function_name="press", function_name="press",
return_type=None, return_type=None,
has_async_counterpart=True, has_async_counterpart=True,
mandatory=True,
), ),
], ],
), ),