mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Fix Google Cloud TTS not respecting config values (#123275)
This commit is contained in:
parent
be7f3ca439
commit
27b9965b10
@ -59,7 +59,10 @@ def tts_options_schema(
|
|||||||
vol.Optional(
|
vol.Optional(
|
||||||
CONF_GENDER,
|
CONF_GENDER,
|
||||||
description={"suggested_value": config_options.get(CONF_GENDER)},
|
description={"suggested_value": config_options.get(CONF_GENDER)},
|
||||||
default=texttospeech.SsmlVoiceGender.NEUTRAL.name, # type: ignore[attr-defined]
|
default=config_options.get(
|
||||||
|
CONF_GENDER,
|
||||||
|
texttospeech.SsmlVoiceGender.NEUTRAL.name, # type: ignore[attr-defined]
|
||||||
|
),
|
||||||
): vol.All(
|
): vol.All(
|
||||||
vol.Upper,
|
vol.Upper,
|
||||||
SelectSelector(
|
SelectSelector(
|
||||||
@ -72,7 +75,7 @@ def tts_options_schema(
|
|||||||
vol.Optional(
|
vol.Optional(
|
||||||
CONF_VOICE,
|
CONF_VOICE,
|
||||||
description={"suggested_value": config_options.get(CONF_VOICE)},
|
description={"suggested_value": config_options.get(CONF_VOICE)},
|
||||||
default=DEFAULT_VOICE,
|
default=config_options.get(CONF_VOICE, DEFAULT_VOICE),
|
||||||
): SelectSelector(
|
): SelectSelector(
|
||||||
SelectSelectorConfig(
|
SelectSelectorConfig(
|
||||||
mode=SelectSelectorMode.DROPDOWN,
|
mode=SelectSelectorMode.DROPDOWN,
|
||||||
@ -82,7 +85,10 @@ def tts_options_schema(
|
|||||||
vol.Optional(
|
vol.Optional(
|
||||||
CONF_ENCODING,
|
CONF_ENCODING,
|
||||||
description={"suggested_value": config_options.get(CONF_ENCODING)},
|
description={"suggested_value": config_options.get(CONF_ENCODING)},
|
||||||
default=texttospeech.AudioEncoding.MP3.name, # type: ignore[attr-defined]
|
default=config_options.get(
|
||||||
|
CONF_ENCODING,
|
||||||
|
texttospeech.AudioEncoding.MP3.name, # type: ignore[attr-defined]
|
||||||
|
),
|
||||||
): vol.All(
|
): vol.All(
|
||||||
vol.Upper,
|
vol.Upper,
|
||||||
SelectSelector(
|
SelectSelector(
|
||||||
@ -95,22 +101,22 @@ def tts_options_schema(
|
|||||||
vol.Optional(
|
vol.Optional(
|
||||||
CONF_SPEED,
|
CONF_SPEED,
|
||||||
description={"suggested_value": config_options.get(CONF_SPEED)},
|
description={"suggested_value": config_options.get(CONF_SPEED)},
|
||||||
default=1.0,
|
default=config_options.get(CONF_SPEED, 1.0),
|
||||||
): NumberSelector(NumberSelectorConfig(min=0.25, max=4.0, step=0.01)),
|
): NumberSelector(NumberSelectorConfig(min=0.25, max=4.0, step=0.01)),
|
||||||
vol.Optional(
|
vol.Optional(
|
||||||
CONF_PITCH,
|
CONF_PITCH,
|
||||||
description={"suggested_value": config_options.get(CONF_PITCH)},
|
description={"suggested_value": config_options.get(CONF_PITCH)},
|
||||||
default=0,
|
default=config_options.get(CONF_PITCH, 0),
|
||||||
): NumberSelector(NumberSelectorConfig(min=-20.0, max=20.0, step=0.1)),
|
): NumberSelector(NumberSelectorConfig(min=-20.0, max=20.0, step=0.1)),
|
||||||
vol.Optional(
|
vol.Optional(
|
||||||
CONF_GAIN,
|
CONF_GAIN,
|
||||||
description={"suggested_value": config_options.get(CONF_GAIN)},
|
description={"suggested_value": config_options.get(CONF_GAIN)},
|
||||||
default=0,
|
default=config_options.get(CONF_GAIN, 0),
|
||||||
): NumberSelector(NumberSelectorConfig(min=-96.0, max=16.0, step=0.1)),
|
): NumberSelector(NumberSelectorConfig(min=-96.0, max=16.0, step=0.1)),
|
||||||
vol.Optional(
|
vol.Optional(
|
||||||
CONF_PROFILES,
|
CONF_PROFILES,
|
||||||
description={"suggested_value": config_options.get(CONF_PROFILES)},
|
description={"suggested_value": config_options.get(CONF_PROFILES)},
|
||||||
default=[],
|
default=config_options.get(CONF_PROFILES, []),
|
||||||
): SelectSelector(
|
): SelectSelector(
|
||||||
SelectSelectorConfig(
|
SelectSelectorConfig(
|
||||||
mode=SelectSelectorMode.DROPDOWN,
|
mode=SelectSelectorMode.DROPDOWN,
|
||||||
@ -132,7 +138,7 @@ def tts_options_schema(
|
|||||||
vol.Optional(
|
vol.Optional(
|
||||||
CONF_TEXT_TYPE,
|
CONF_TEXT_TYPE,
|
||||||
description={"suggested_value": config_options.get(CONF_TEXT_TYPE)},
|
description={"suggested_value": config_options.get(CONF_TEXT_TYPE)},
|
||||||
default="text",
|
default=config_options.get(CONF_TEXT_TYPE, "text"),
|
||||||
): vol.All(
|
): vol.All(
|
||||||
vol.Lower,
|
vol.Lower,
|
||||||
SelectSelector(
|
SelectSelector(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user