Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.cloud.tts Namespace Reference

Classes

class  CloudProvider
 
class  CloudTTSEntity
 

Functions

str _deprecated_platform (str value)
 
CloudProvider async_get_engine (HomeAssistant hass, ConfigType config, DiscoveryInfoType|None discovery_info=None)
 
None async_setup_entry (HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 
Gender|None handle_deprecated_gender (HomeAssistant hass, Gender|str|None gender)
 
str|None handle_deprecated_voice (HomeAssistant hass, str|None original_voice)
 
dict[str, Any] validate_lang (dict[str, Any] value)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTR_GENDER = "gender"
 
dictionary DEPRECATED_VOICES = {"XiaoxuanNeural": "XiaozhenNeural"}
 
 PLATFORM_SCHEMA
 
 SUPPORT_LANGUAGES = list(TTS_VOICES)
 

Detailed Description

Support for the cloud for text-to-speech service.

Function Documentation

◆ _deprecated_platform()

str homeassistant.components.cloud.tts._deprecated_platform ( str  value)
private
Validate if platform is deprecated.

Definition at line 44 of file tts.py.

◆ async_get_engine()

CloudProvider homeassistant.components.cloud.tts.async_get_engine ( HomeAssistant  hass,
ConfigType  config,
DiscoveryInfoType | None   discovery_info = None 
)
Set up Cloud speech component.

Definition at line 93 of file tts.py.

◆ async_setup_entry()

None homeassistant.components.cloud.tts.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Set up Home Assistant Cloud text-to-speech platform.

Definition at line 106 of file tts.py.

◆ handle_deprecated_gender()

Gender | None homeassistant.components.cloud.tts.handle_deprecated_gender ( HomeAssistant  hass,
Gender | str | None  gender 
)
Handle deprecated gender.

Definition at line 299 of file tts.py.

◆ handle_deprecated_voice()

str | None homeassistant.components.cloud.tts.handle_deprecated_voice ( HomeAssistant  hass,
str | None  original_voice 
)
Handle deprecated voice.

Definition at line 325 of file tts.py.

◆ validate_lang()

dict[str, Any] homeassistant.components.cloud.tts.validate_lang ( dict[str, Any]  value)
Validate chosen gender or language.

Definition at line 65 of file tts.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.cloud.tts._LOGGER = logging.getLogger(__name__)
private

Definition at line 41 of file tts.py.

◆ ATTR_GENDER

string homeassistant.components.cloud.tts.ATTR_GENDER = "gender"

Definition at line 36 of file tts.py.

◆ DEPRECATED_VOICES

dictionary homeassistant.components.cloud.tts.DEPRECATED_VOICES = {"XiaoxuanNeural": "XiaozhenNeural"}

Definition at line 38 of file tts.py.

◆ PLATFORM_SCHEMA

homeassistant.components.cloud.tts.PLATFORM_SCHEMA
Initial value:
1 = vol.All(
2  TTS_PLATFORM_SCHEMA.extend(
3  {
4  vol.Required(CONF_PLATFORM): vol.All(cv.string, _deprecated_platform),
5  vol.Optional(CONF_LANG): str,
6  vol.Optional(ATTR_GENDER): str,
7  }
8  ),
9  validate_lang,
10 )

Definition at line 81 of file tts.py.

◆ SUPPORT_LANGUAGES

homeassistant.components.cloud.tts.SUPPORT_LANGUAGES = list(TTS_VOICES)

Definition at line 39 of file tts.py.