From a6ef330b63eaa1b683c4940b8df66183ac46eb66 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 29 Jun 2022 12:36:57 +0200 Subject: [PATCH] Add ButtonEntity to pylint checks (#74171) --- pylint/plugins/hass_enforce_type_hints.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index f08e6d932e7..c6e2fd1a553 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -697,6 +697,26 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { ], ), ], + "button": [ + ClassTypeHintMatch( + base_class="Entity", + matches=_ENTITY_MATCH, + ), + ClassTypeHintMatch( + base_class="ButtonEntity", + matches=[ + TypeHintMatch( + function_name="device_class", + return_type=["ButtonDeviceClass", "str", None], + ), + TypeHintMatch( + function_name="press", + return_type=None, + has_async_counterpart=True, + ), + ], + ), + ], "cover": [ ClassTypeHintMatch( base_class="Entity",