Skip to content

Commit

Permalink
Small Assist Satellite fixes (home-assistant#125384)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Sep 6, 2024
1 parent dfcfe78 commit ff3cabb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion homeassistant/components/assist_pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class AudioSettings:
is_vad_enabled: bool = True
"""True if VAD is used to determine the end of the voice command."""

silence_seconds: float = 0.5
silence_seconds: float = 0.7
"""Seconds of silence after voice command has ended."""

def __post_init__(self) -> None:
Expand Down Expand Up @@ -906,6 +906,8 @@ async def speech_to_text(
metadata,
self._speech_to_text_stream(audio_stream=stream, stt_vad=stt_vad),
)
except (asyncio.CancelledError, TimeoutError):
raise # expected
except Exception as src_error:
_LOGGER.exception("Unexpected error during speech-to-text")
raise SpeechToTextError(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/assist_satellite/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class AssistSatelliteEntity(entity.Entity):
_is_announcing = False
_wake_word_intercept_future: asyncio.Future[str | None] | None = None

__assist_satellite_state: AssistSatelliteState | None = None
__assist_satellite_state = AssistSatelliteState.LISTENING_WAKE_WORD

@final
@property
Expand Down
5 changes: 2 additions & 3 deletions tests/components/assist_satellite/test_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from homeassistant.components.assist_satellite.entity import AssistSatelliteState
from homeassistant.components.media_source import PlayMedia
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_UNKNOWN
from homeassistant.core import Context, HomeAssistant

from . import ENTITY_ID
Expand All @@ -35,7 +34,7 @@ async def test_entity_state(

state = hass.states.get(ENTITY_ID)
assert state is not None
assert state.state == STATE_UNKNOWN
assert state.state == AssistSatelliteState.LISTENING_WAKE_WORD

context = Context()
audio_stream = object()
Expand Down Expand Up @@ -71,7 +70,7 @@ async def test_entity_state(
assert kwargs["end_stage"] == PipelineStage.TTS

for event_type, expected_state in (
(PipelineEventType.RUN_START, STATE_UNKNOWN),
(PipelineEventType.RUN_START, AssistSatelliteState.LISTENING_WAKE_WORD),
(PipelineEventType.RUN_END, AssistSatelliteState.LISTENING_WAKE_WORD),
(PipelineEventType.WAKE_WORD_START, AssistSatelliteState.LISTENING_WAKE_WORD),
(PipelineEventType.WAKE_WORD_END, AssistSatelliteState.LISTENING_WAKE_WORD),
Expand Down

0 comments on commit ff3cabb

Please sign in to comment.