diff --git a/homeassistant/components/google_cloud/tts.py b/homeassistant/components/google_cloud/tts.py index e7bb899361a9fc6a6b17a61d9be00d3348ae83d9..c3a8254ad90b5a8703b9fd6b52df94c4e12a8c39 100644 --- a/homeassistant/components/google_cloud/tts.py +++ b/homeassistant/components/google_cloud/tts.py @@ -172,10 +172,12 @@ class BaseGoogleCloudProvider: _LOGGER.error("Error: %s when validating options: %s", err, options) return None, None - encoding = texttospeech.AudioEncoding(options[CONF_ENCODING]) - gender: texttospeech.SsmlVoiceGender | None = texttospeech.SsmlVoiceGender( + encoding: texttospeech.AudioEncoding = texttospeech.AudioEncoding[ + options[CONF_ENCODING] + ] # type: ignore[misc] + gender: texttospeech.SsmlVoiceGender | None = texttospeech.SsmlVoiceGender[ options[CONF_GENDER] - ) + ] # type: ignore[misc] voice = options[CONF_VOICE] if voice: gender = None