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 speech-to-text cooldown for local wake word #108806
Conversation
Hey there @balloob, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
50a6a30
to
872229a
Compare
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
hass_ws_client: WebSocketGenerator, | ||
snapshot: SnapshotAssertion, | ||
) -> None: | ||
"""Test that two speech-to-text pipelines can run within the cooldown period if they have the different wake words.""" |
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.
Please limit docstrings to max 72 characters per line in accordance with PEP8.
SatelliteAsyncTcpClient(events), | ||
) as mock_client, | ||
patch( | ||
"homeassistant.components.wyoming.satellite.assist_pipeline.async_pipeline_from_audio_stream", |
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.
Consider breaking out the patch to a pytest fixture that yields the mock. Then set a side effect on the mock in the test as needed instead. We can avoid repeating all these patches in the tests then.
Breaking change
Proposed change
With streaming wake word detection, HA stops multiple satellites waking up at the same time by enforcing a "cooldown" period (default: 5 seconds). During this period, any pipeline with the same wake word (and wake word system) cannot run.
When satellites use local wake word detection, they begin their pipeline runs at the speech-to-text (STT) stage instead. This PR adds a "cooldown" to STT, and includes a new parameter for identifying the wake word phrase that was detected by the satellite (e.g., "ok nabu"). Now, if two satellites report the same wake word and attempt to begin their STT stages within the cooldown period (5 seconds), one will succeed and the other will receive a
duplicate_wake_up_detected
error.Additionally, both local and streaming wake word detection now share cooldown periods for the same "wake word phrase". For example, if one satellite uses streaming wake word detection with an
ok nabu
phrase and a different satellite uses local wake word detection with anok nabu
phrase, they cannot both be woken up at the same time.The wake word phrase must be supplied by the wake word provider or satellite. For Wyoming-based services, this is now included in the
info
message.Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: