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 VAD sensitivity option to VoIP devices #94688
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
|
from homeassistant.config_entries import ConfigEntry | ||
from homeassistant.core import Event, HomeAssistant, callback | ||
from homeassistant.helpers import device_registry as dr, entity_registry as er | ||
|
||
from .const import DOMAIN | ||
|
||
|
||
class VadSensitivity(StrEnum): |
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.
This should live in assist_pipeline.vad
and we should make sure it's consistent across any integration that uses VAD (so also ESPHome).
@@ -21,6 +30,7 @@ class VoIPDevice: | |||
device_id: str | |||
is_active: bool = False | |||
update_listeners: list[Callable[[VoIPDevice], None]] = field(default_factory=list) | |||
vad_sensitivity: VadSensitivity = VadSensitivity.DEFAULT |
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.
Instead of storing it on VoIPDevice
, I suggest that we make it a select entity provided by assist_pipeline/select.py
, just like we do for the selected pipeline. That way there is a single consistent place that we control this for all integrations that use VAD.
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.
See comments.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Please follow-up this PR with one for ESPHome. |
Breaking change
Proposed change
Adds a VAD sensitivity option to VoIP devices with 3 settings: default, relaxed, and aggressive. This setting translates into the number of seconds of silence after a voice command before Assist begins processing.
The previous default of 0.5 seconds is now the "aggressive" setting. The "default" and "relaxed" settings are 1 and 3 seconds, respectively.
Type of change
Additional information
Checklist
black --fast 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: