voice: hold the wake word until the scheduler reaches a result
Gate the wake word on the scheduler's single slot being free: a wake that fires while the current request is still running is ignored (traced voice_wake_blocked), so a second command cannot start mid-run. The gate is GatewayService.input_ready (False while a run executes, True when idle or paused for the user's answer), handed to adapters via set_input_ready; the voice adapter passes it to VoiceDaemon.input_ready.
This commit is contained in:
1 parent
ff94ea938c
commit
88700898be
8 files changed
+130
-7
No files matched your search
@@ -53,6 +53,16 @@ class VoiceAdapter(GatewayAdapter):
|
||||
def check_requirements(self) -> tuple[bool, str | None]:
|
||||
return self.daemon.check_requirements()
|
||||
|
||||
def set_input_ready(self, ready) -> None:
|
||||
"""Gate the wake word on the scheduler being able to accept a command.
|
||||
|
||||
`ready` is a callable returning whether a new command may start now
|
||||
(`GatewayService.input_ready`). While it returns False the wake word is
|
||||
ignored, so a second command cannot be started before the current
|
||||
request has reached a result.
|
||||
"""
|
||||
self.daemon.input_ready = ready
|
||||
|
||||
# ---- transport ----
|
||||
|
||||
def run(
|
||||
|
||||
Reference in new issue
Block a user