Use stt-vad-end event in assist debug panel (#18671)

* Use stt-vad-end event in assist debug panel

* Remove end_suffix
This commit is contained in:
Michael Hansen 2023-11-15 15:36:49 -06:00 committed by GitHub
parent 08a7a10e1c
commit f2efff9d71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,10 +71,11 @@ const maybeRenderError = (
const renderProgress = ( const renderProgress = (
hass: HomeAssistant, hass: HomeAssistant,
pipelineRun: PipelineRun, pipelineRun: PipelineRun,
stage: PipelineRun["stage"] stage: PipelineRun["stage"],
start_suffix: string = "-start"
) => { ) => {
const startEvent = pipelineRun.events.find( const startEvent = pipelineRun.events.find(
(ev) => ev.type === `${stage}-start` (ev) => ev.type === `${stage}` + start_suffix
); );
const finishEvent = pipelineRun.events.find( const finishEvent = pipelineRun.events.find(
(ev) => ev.type === `${stage}-end` (ev) => ev.type === `${stage}-end`
@ -244,7 +245,12 @@ export class AssistPipelineDebug extends LitElement {
<div class="card-content"> <div class="card-content">
<div class="row heading"> <div class="row heading">
<span>Speech-to-text</span> <span>Speech-to-text</span>
${renderProgress(this.hass, this.pipelineRun, "stt")} ${renderProgress(
this.hass,
this.pipelineRun,
"stt",
"-vad-end"
)}
</div> </div>
${this.pipelineRun.stt ${this.pipelineRun.stt
? html` ? html`