Use string instead of boolean for voice event (#147244)

Use string instead of bool
This commit is contained in:
Michael Hansen 2025-06-20 14:18:03 -05:00 committed by GitHub
parent 435c08685d
commit 65f897793d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -285,9 +285,9 @@ class EsphomeAssistSatellite(
data_to_send = {"text": event.data["stt_output"]["text"]}
elif event_type == VoiceAssistantEventType.VOICE_ASSISTANT_INTENT_PROGRESS:
data_to_send = {
"tts_start_streaming": bool(
event.data and event.data.get("tts_start_streaming")
),
"tts_start_streaming": "1"
if (event.data and event.data.get("tts_start_streaming"))
else "0",
}
elif event_type == VoiceAssistantEventType.VOICE_ASSISTANT_INTENT_END:
assert event.data is not None

View File

@ -243,12 +243,12 @@ async def test_pipeline_api_audio(
event_callback(
PipelineEvent(
type=PipelineEventType.INTENT_PROGRESS,
data={"tts_start_streaming": True},
data={"tts_start_streaming": "1"},
)
)
assert mock_client.send_voice_assistant_event.call_args_list[-1].args == (
VoiceAssistantEventType.VOICE_ASSISTANT_INTENT_PROGRESS,
{"tts_start_streaming": True},
{"tts_start_streaming": "1"},
)
event_callback(