-
-
Notifications
You must be signed in to change notification settings - Fork 29.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cloud tts entity #108293
Add cloud tts entity #108293
Changes from all commits
f90b88d
fca4ace
4cedcd5
e287a13
e4a9f61
a71aa37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,7 @@ | |
|
||
DEFAULT_MODE = MODE_PROD | ||
|
||
PLATFORMS = [Platform.BINARY_SENSOR, Platform.STT] | ||
PLATFORMS = [Platform.BINARY_SENSOR, Platform.STT, Platform.TTS] | ||
|
||
SERVICE_REMOTE_CONNECT = "remote_connect" | ||
SERVICE_REMOTE_DISCONNECT = "remote_disconnect" | ||
|
@@ -288,9 +288,11 @@ async def async_startup_repairs(_: datetime) -> None: | |
loaded = False | ||
stt_platform_loaded = asyncio.Event() | ||
tts_platform_loaded = asyncio.Event() | ||
stt_tts_entities_added = asyncio.Event() | ||
hass.data[DATA_PLATFORMS_SETUP] = { | ||
Platform.STT: stt_platform_loaded, | ||
Platform.TTS: tts_platform_loaded, | ||
"stt_tts_entities_added": stt_tts_entities_added, | ||
} | ||
|
||
async def _on_start() -> None: | ||
|
@@ -330,6 +332,7 @@ async def _on_initialized() -> None: | |
|
||
account_link.async_setup(hass) | ||
|
||
# Load legacy tts platform for backwards compatibility. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How long do we need to maintain this compatibility? If it can be removed 2025.2 it makes sense to mention that also in this comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We haven't decided if and when we want to deprecate it. |
||
hass.async_create_task( | ||
async_load_platform( | ||
hass, | ||
|
@@ -377,8 +380,10 @@ async def remote_prefs_updated(prefs: CloudPreferences) -> None: | |
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: | ||
"""Set up a config entry.""" | ||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) | ||
stt_platform_loaded: asyncio.Event = hass.data[DATA_PLATFORMS_SETUP][Platform.STT] | ||
stt_platform_loaded.set() | ||
stt_tts_entities_added: asyncio.Event = hass.data[DATA_PLATFORMS_SETUP][ | ||
"stt_tts_entities_added" | ||
] | ||
stt_tts_entities_added.set() | ||
MartinHjelmare marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
return True | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should really be a dataclass instance instead. OK to do in a follow-up if it adds too much noise to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'll clean it up in the next PR.