From edc6da04f794ad380a94ca158e19faa0169ec376 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 1 May 2023 14:46:44 +0200 Subject: [PATCH] Make sure stt_binary_handler_id is reset (#16360) --- src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts index ae97087550..87ea70b4e5 100644 --- a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts +++ b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts @@ -401,6 +401,7 @@ export class HaVoiceCommandDialog extends LitElement { } }); } + this._stt_binary_handler_id = undefined; this._audioBuffer = []; const userMessage: Message = { who: "user", @@ -463,6 +464,7 @@ export class HaVoiceCommandDialog extends LitElement { } if (event.type === "run-end") { + this._stt_binary_handler_id = undefined; unsub(); } @@ -509,6 +511,7 @@ export class HaVoiceCommandDialog extends LitElement { } // Send empty message to indicate we're done streaming. this._sendAudioChunk(new Int16Array()); + this._stt_binary_handler_id = undefined; } this._audioBuffer = undefined; }