Skip to content

Commit

Permalink
Fix timeout error handling local voice (#23023)
Browse files Browse the repository at this point in the history
fix timeout error handling local voice
  • Loading branch information
bramkragten authored Nov 27, 2024
1 parent 0a954cf commit 7121435
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class HaVoiceAssistantSetupStepLocal extends LitElement {
await this._setupConfigEntry("whisper");
}
this._detailState = "Creating assistant";
this._findEntitiesAndCreatePipeline();
await this._findEntitiesAndCreatePipeline();
} catch (e) {
this._state = "ERROR";
}
Expand Down Expand Up @@ -314,8 +314,10 @@ export class HaVoiceAssistantSetupStepLocal extends LitElement {
if (tryNo > 3) {
throw new Error("Timeout searching for local TTS and STT entities");
}
setTimeout(() => this._findEntitiesAndCreatePipeline(tryNo + 1), 2000);
return;
await new Promise<void>((resolve) => {
setTimeout(resolve, 2000);
});
return this._findEntitiesAndCreatePipeline(tryNo + 1);
}

const localPipeline = await this._createPipeline(
Expand All @@ -330,6 +332,7 @@ export class HaVoiceAssistantSetupStepLocal extends LitElement {
{ entity_id: this.assistConfiguration?.pipeline_entity_id }
);
this._nextStep();
return undefined;
}

static styles = [
Expand Down

0 comments on commit 7121435

Please sign in to comment.