mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Set assist pipeline binary sensor to true only when stt-start is received (#98844)
This commit is contained in:
parent
35a8385d9d
commit
57bc8ae68e
@ -343,7 +343,6 @@ class ESPHomeManager:
|
|||||||
),
|
),
|
||||||
"esphome.voice_assistant_udp_server.run_pipeline",
|
"esphome.voice_assistant_udp_server.run_pipeline",
|
||||||
)
|
)
|
||||||
self.entry_data.async_set_assist_pipeline_state(True)
|
|
||||||
|
|
||||||
return port
|
return port
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ class VoiceAssistantUDPServer(asyncio.DatagramProtocol):
|
|||||||
self.hass = hass
|
self.hass = hass
|
||||||
|
|
||||||
assert entry_data.device_info is not None
|
assert entry_data.device_info is not None
|
||||||
|
self.entry_data = entry_data
|
||||||
self.device_info = entry_data.device_info
|
self.device_info = entry_data.device_info
|
||||||
|
|
||||||
self.queue: asyncio.Queue[bytes] = asyncio.Queue()
|
self.queue: asyncio.Queue[bytes] = asyncio.Queue()
|
||||||
@ -158,7 +159,9 @@ class VoiceAssistantUDPServer(asyncio.DatagramProtocol):
|
|||||||
|
|
||||||
data_to_send = None
|
data_to_send = None
|
||||||
error = False
|
error = False
|
||||||
if event_type == VoiceAssistantEventType.VOICE_ASSISTANT_STT_END:
|
if event_type == VoiceAssistantEventType.VOICE_ASSISTANT_STT_START:
|
||||||
|
self.entry_data.async_set_assist_pipeline_state(True)
|
||||||
|
elif event_type == VoiceAssistantEventType.VOICE_ASSISTANT_STT_END:
|
||||||
assert event.data is not None
|
assert event.data is not None
|
||||||
data_to_send = {"text": event.data["stt_output"]["text"]}
|
data_to_send = {"text": event.data["stt_output"]["text"]}
|
||||||
elif event_type == VoiceAssistantEventType.VOICE_ASSISTANT_INTENT_END:
|
elif event_type == VoiceAssistantEventType.VOICE_ASSISTANT_INTENT_END:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user