mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Small Assist Satellite fixes (#125384)
This commit is contained in:
parent
dfcfe78732
commit
ff3cabbf3a
@ -504,7 +504,7 @@ class AudioSettings:
|
|||||||
is_vad_enabled: bool = True
|
is_vad_enabled: bool = True
|
||||||
"""True if VAD is used to determine the end of the voice command."""
|
"""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."""
|
"""Seconds of silence after voice command has ended."""
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
def __post_init__(self) -> None:
|
||||||
@ -906,6 +906,8 @@ class PipelineRun:
|
|||||||
metadata,
|
metadata,
|
||||||
self._speech_to_text_stream(audio_stream=stream, stt_vad=stt_vad),
|
self._speech_to_text_stream(audio_stream=stream, stt_vad=stt_vad),
|
||||||
)
|
)
|
||||||
|
except (asyncio.CancelledError, TimeoutError):
|
||||||
|
raise # expected
|
||||||
except Exception as src_error:
|
except Exception as src_error:
|
||||||
_LOGGER.exception("Unexpected error during speech-to-text")
|
_LOGGER.exception("Unexpected error during speech-to-text")
|
||||||
raise SpeechToTextError(
|
raise SpeechToTextError(
|
||||||
|
@ -73,7 +73,7 @@ class AssistSatelliteEntity(entity.Entity):
|
|||||||
_is_announcing = False
|
_is_announcing = False
|
||||||
_wake_word_intercept_future: asyncio.Future[str | None] | None = None
|
_wake_word_intercept_future: asyncio.Future[str | None] | None = None
|
||||||
|
|
||||||
__assist_satellite_state: AssistSatelliteState | None = None
|
__assist_satellite_state = AssistSatelliteState.LISTENING_WAKE_WORD
|
||||||
|
|
||||||
@final
|
@final
|
||||||
@property
|
@property
|
||||||
|
@ -21,7 +21,6 @@ from homeassistant.components.assist_satellite import SatelliteBusyError
|
|||||||
from homeassistant.components.assist_satellite.entity import AssistSatelliteState
|
from homeassistant.components.assist_satellite.entity import AssistSatelliteState
|
||||||
from homeassistant.components.media_source import PlayMedia
|
from homeassistant.components.media_source import PlayMedia
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import STATE_UNKNOWN
|
|
||||||
from homeassistant.core import Context, HomeAssistant
|
from homeassistant.core import Context, HomeAssistant
|
||||||
|
|
||||||
from . import ENTITY_ID
|
from . import ENTITY_ID
|
||||||
@ -35,7 +34,7 @@ async def test_entity_state(
|
|||||||
|
|
||||||
state = hass.states.get(ENTITY_ID)
|
state = hass.states.get(ENTITY_ID)
|
||||||
assert state is not None
|
assert state is not None
|
||||||
assert state.state == STATE_UNKNOWN
|
assert state.state == AssistSatelliteState.LISTENING_WAKE_WORD
|
||||||
|
|
||||||
context = Context()
|
context = Context()
|
||||||
audio_stream = object()
|
audio_stream = object()
|
||||||
@ -71,7 +70,7 @@ async def test_entity_state(
|
|||||||
assert kwargs["end_stage"] == PipelineStage.TTS
|
assert kwargs["end_stage"] == PipelineStage.TTS
|
||||||
|
|
||||||
for event_type, expected_state in (
|
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.RUN_END, AssistSatelliteState.LISTENING_WAKE_WORD),
|
||||||
(PipelineEventType.WAKE_WORD_START, AssistSatelliteState.LISTENING_WAKE_WORD),
|
(PipelineEventType.WAKE_WORD_START, AssistSatelliteState.LISTENING_WAKE_WORD),
|
||||||
(PipelineEventType.WAKE_WORD_END, AssistSatelliteState.LISTENING_WAKE_WORD),
|
(PipelineEventType.WAKE_WORD_END, AssistSatelliteState.LISTENING_WAKE_WORD),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user