From 5e9c0399eb7d4d0b2de50793b830c3c0cc7c1b74 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 12 Sep 2022 18:58:06 +0200 Subject: [PATCH] Add STT checks to pylint plugin (#78284) --- pylint/plugins/hass_enforce_type_hints.py | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/pylint/plugins/hass_enforce_type_hints.py b/pylint/plugins/hass_enforce_type_hints.py index 80ec054159c..2b99dde8c0d 100644 --- a/pylint/plugins/hass_enforce_type_hints.py +++ b/pylint/plugins/hass_enforce_type_hints.py @@ -2072,6 +2072,42 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = { ], ), ], + "stt": [ + ClassTypeHintMatch( + base_class="Provider", + matches=[ + TypeHintMatch( + function_name="supported_languages", + return_type="list[str]", + ), + TypeHintMatch( + function_name="supported_formats", + return_type="list[AudioFormats]", + ), + TypeHintMatch( + function_name="supported_codecs", + return_type="list[AudioCodecs]", + ), + TypeHintMatch( + function_name="supported_bit_rates", + return_type="list[AudioBitRates]", + ), + TypeHintMatch( + function_name="supported_sample_rates", + return_type="list[AudioSampleRates]", + ), + TypeHintMatch( + function_name="supported_channels", + return_type="list[AudioChannels]", + ), + TypeHintMatch( + function_name="async_process_audio_stream", + arg_types={1: "SpeechMetadata", 2: "StreamReader"}, + return_type="SpeechResult", + ), + ], + ), + ], "switch": [ ClassTypeHintMatch( base_class="Entity",