Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions custom_components/vaca/assist_satellite.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ def __init__(
# Make info accessible from entities
self.device.info = service.info

# Init custom settings
self.device.custom_settings = {}
# Init custom settings. Select/number entities restore their state
# into this dict concurrently; do not wipe what they already wrote.
if self.device.custom_settings is None:
self.device.custom_settings = {}

# stream tts var to allow interupt and cancel remaining response
self.stream_tts = False
Expand Down
4 changes: 3 additions & 1 deletion custom_components/vaca/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ async def async_added_to_hass(self) -> None:
await super().async_added_to_hass()

state = await self.async_get_last_state()
if state is not None and state.state in self.options:
# Options depend on the wake word engine, which may not be restored
# yet; restore the saved word anyway instead of falling back to None.
if state is not None and state.state not in ("unknown", "unavailable"):
await self.async_select_option(state.state)
# Default to the first available option if no state is found
elif self.options:
Expand Down