Add speech-to-text cooldown for local wake word#108806
Merged
Merged
Conversation
Contributor
|
Hey there @balloob, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
balloob
reviewed
Jan 24, 2024
balloob
reviewed
Jan 24, 2024
balloob
reviewed
Jan 26, 2024
balloob
reviewed
Jan 30, 2024
50a6a30 to
872229a
Compare
balloob
reviewed
Feb 26, 2024
balloob
reviewed
Feb 26, 2024
balloob
reviewed
Feb 26, 2024
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
balloob
approved these changes
Feb 26, 2024
| 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.""" |
Member
There was a problem hiding this comment.
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", |
Member
There was a problem hiding this comment.
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.
20 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_detectederror.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 nabuphrase and a different satellite uses local wake word detection with anok nabuphrase, 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
infomessage.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: