hass-core/homeassistant/components/tts/const.py
epenet d40464e5d3
Use HassKey in tts (#126327)
* Use HassKey in tts

* Also migrate DATA_TTS_MANAGER
2024-09-21 13:14:27 +02:00

33 lines
787 B
Python

"""Text-to-speech constants."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.util.hass_dict import HassKey
if TYPE_CHECKING:
from homeassistant.helpers.entity_component import EntityComponent
from . import SpeechManager, TextToSpeechEntity
ATTR_CACHE = "cache"
ATTR_LANGUAGE = "language"
ATTR_MESSAGE = "message"
ATTR_OPTIONS = "options"
CONF_CACHE = "cache"
CONF_CACHE_DIR = "cache_dir"
CONF_FIELDS = "fields"
CONF_TIME_MEMORY = "time_memory"
DEFAULT_CACHE = True
DEFAULT_CACHE_DIR = "tts"
DEFAULT_TIME_MEMORY = 300
DOMAIN = "tts"
DOMAIN_DATA: HassKey[EntityComponent[TextToSpeechEntity]] = HassKey(DOMAIN)
DATA_TTS_MANAGER: HassKey[SpeechManager] = HassKey("tts_manager")
type TtsAudioType = tuple[str | None, bytes | None]