Fix enum lookup (#125220)

This commit is contained in:
Marc Mueller 2024-09-04 15:05:28 +02:00 committed by GitHub
parent 5c35ccb9ca
commit 1bc63a61be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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