Add name to tts voices (#91814)
* Add name to tts voices * Add new file
This commit is contained in:
parent
c6d846453d
commit
9a0de43f98
7 changed files with 35 additions and 8 deletions
|
@ -9,6 +9,7 @@ from homeassistant.components.tts import (
|
|||
CONF_LANG,
|
||||
PLATFORM_SCHEMA,
|
||||
Provider,
|
||||
Voice,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
|
||||
|
@ -97,9 +98,11 @@ class CloudProvider(Provider):
|
|||
return [ATTR_GENDER, ATTR_VOICE, ATTR_AUDIO_OUTPUT]
|
||||
|
||||
@callback
|
||||
def async_get_supported_voices(self, language: str) -> list[str] | None:
|
||||
def async_get_supported_voices(self, language: str) -> list[Voice] | None:
|
||||
"""Return a list of supported voices for a language."""
|
||||
return TTS_VOICES.get(language)
|
||||
if not (voices := TTS_VOICES.get(language)):
|
||||
return None
|
||||
return [Voice(voice, voice) for voice in voices]
|
||||
|
||||
@property
|
||||
def default_options(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue