Fix unreleased breaking change in Google Cloud (#121523)

This commit is contained in:
tronikos 2024-07-08 05:34:18 -07:00 committed by GitHub
parent 98651cbd2e
commit 5f909d0c52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,11 +58,14 @@ def tts_options_schema(
CONF_GENDER,
description={"suggested_value": config_options.get(CONF_GENDER)},
default=texttospeech.SsmlVoiceGender.NEUTRAL.name, # type: ignore[attr-defined]
): SelectSelector(
SelectSelectorConfig(
mode=SelectSelectorMode.DROPDOWN,
options=list(texttospeech.SsmlVoiceGender.__members__),
)
): vol.All(
vol.Upper,
SelectSelector(
SelectSelectorConfig(
mode=SelectSelectorMode.DROPDOWN,
options=list(texttospeech.SsmlVoiceGender.__members__),
)
),
),
vol.Optional(
CONF_VOICE,
@ -78,11 +81,14 @@ def tts_options_schema(
CONF_ENCODING,
description={"suggested_value": config_options.get(CONF_ENCODING)},
default=texttospeech.AudioEncoding.MP3.name, # type: ignore[attr-defined]
): SelectSelector(
SelectSelectorConfig(
mode=SelectSelectorMode.DROPDOWN,
options=list(texttospeech.AudioEncoding.__members__),
)
): vol.All(
vol.Upper,
SelectSelector(
SelectSelectorConfig(
mode=SelectSelectorMode.DROPDOWN,
options=list(texttospeech.AudioEncoding.__members__),
)
),
),
vol.Optional(
CONF_SPEED,
@ -125,11 +131,14 @@ def tts_options_schema(
CONF_TEXT_TYPE,
description={"suggested_value": config_options.get(CONF_TEXT_TYPE)},
default="text",
): SelectSelector(
SelectSelectorConfig(
mode=SelectSelectorMode.DROPDOWN,
options=["text", "ssml"],
)
): vol.All(
vol.Lower,
SelectSelector(
SelectSelectorConfig(
mode=SelectSelectorMode.DROPDOWN,
options=["text", "ssml"],
)
),
),
}
)