From 21978917b9b20d96eb701abb0aed2ba78385bfd2 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 18 Feb 2026 17:10:11 +0100 Subject: [PATCH] Mark siren/stt/todo method type hints as mandatory (#163265) --- pylint/plugins/hass_enforce_type_hints.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index da31c415828..08ae1ac3767 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -2591,10 +2591,12 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { TypeHintMatch( function_name="available_tones", return_type=["dict[int, str]", "list[int | str]", None], + mandatory=True, ), TypeHintMatch( function_name="supported_features", return_type="SirenEntityFeature", + mandatory=True, ), ], ), @@ -2606,31 +2608,38 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { TypeHintMatch( function_name="supported_languages", return_type="list[str]", + mandatory=True, ), TypeHintMatch( function_name="supported_formats", return_type="list[AudioFormats]", + mandatory=True, ), TypeHintMatch( function_name="supported_codecs", return_type="list[AudioCodecs]", + mandatory=True, ), TypeHintMatch( function_name="supported_bit_rates", return_type="list[AudioBitRates]", + mandatory=True, ), TypeHintMatch( function_name="supported_sample_rates", return_type="list[AudioSampleRates]", + mandatory=True, ), TypeHintMatch( function_name="supported_channels", return_type="list[AudioChannels]", + mandatory=True, ), TypeHintMatch( function_name="async_process_audio_stream", arg_types={1: "SpeechMetadata", 2: "AsyncIterable[bytes]"}, return_type="SpeechResult", + mandatory=True, ), ], ), @@ -2674,6 +2683,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { TypeHintMatch( function_name="todo_items", return_type=["list[TodoItem]", None], + mandatory=True, ), TypeHintMatch( function_name="async_create_todo_item", @@ -2681,6 +2691,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { 1: "TodoItem", }, return_type="None", + mandatory=True, ), TypeHintMatch( function_name="async_update_todo_item", @@ -2688,6 +2699,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { 1: "TodoItem", }, return_type="None", + mandatory=True, ), TypeHintMatch( function_name="async_delete_todo_items", @@ -2695,6 +2707,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { 1: "list[str]", }, return_type="None", + mandatory=True, ), TypeHintMatch( function_name="async_move_todo_item", @@ -2703,6 +2716,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { 2: "str | None", }, return_type="None", + mandatory=True, ), ], ),