Voice wizard: prevent flash of hardware screen when cloud is active (#22933)

This commit is contained in:
Bram Kragten 2024-11-21 09:59:43 +01:00 committed by GitHub
parent 0e0be279ea
commit 64374a4fcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,6 +29,8 @@ export class HaVoiceAssistantSetupStepPipeline extends LitElement {
@property() public assistEntityId?: string;
@state() private _cloudChecked = false;
@state() private _showFirst = false;
@state() private _showSecond = false;
@ -62,6 +64,10 @@ export class HaVoiceAssistantSetupStepPipeline extends LitElement {
}
protected override render() {
if (!this._cloudChecked) {
return nothing;
}
return html`<div class="content">
<h1>What hardware do you want to use?</h1>
<p class="secondary">
@ -130,10 +136,12 @@ export class HaVoiceAssistantSetupStepPipeline extends LitElement {
private async _checkCloud() {
if (!isComponentLoaded(this.hass, "cloud")) {
this._cloudChecked = true;
return;
}
const cloudStatus = await fetchCloudStatus(this.hass);
if (!cloudStatus.logged_in || !cloudStatus.active_subscription) {
this._cloudChecked = true;
return;
}
let cloudTtsEntityId;