From 1bc63a61be8057850f68e0ff4e0c94563d5a41c9 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:05:28 +0200 Subject: [PATCH] Fix enum lookup (#125220) --- homeassistant/components/google_cloud/tts.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/google_cloud/tts.py b/homeassistant/components/google_cloud/tts.py index d65a743c015..60cdfbee3ab 100644 --- a/homeassistant/components/google_cloud/tts.py +++ b/homeassistant/components/google_cloud/tts.py @@ -172,12 +172,10 @@ class BaseGoogleCloudProvider: _LOGGER.error("Error: %s when validating options: %s", err, options) return None, None - encoding: texttospeech.AudioEncoding = texttospeech.AudioEncoding[ - options[CONF_ENCODING] - ] # type: ignore[misc] - gender: texttospeech.SsmlVoiceGender | None = texttospeech.SsmlVoiceGender[ + encoding = texttospeech.AudioEncoding(options[CONF_ENCODING]) + gender: texttospeech.SsmlVoiceGender | None = texttospeech.SsmlVoiceGender( options[CONF_GENDER] - ] # type: ignore[misc] + ) voice = options[CONF_VOICE] if voice: gender = None