diff --git a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-update.ts b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-update.ts
index d0ac0f298a..0f7b14e403 100644
--- a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-update.ts
+++ b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-update.ts
@@ -2,7 +2,7 @@ import { css, html, LitElement, nothing, PropertyValues } from "lit";
import { customElement, property } from "lit/decorators";
import { fireEvent } from "../../common/dom/fire_event";
import "../../components/ha-circular-progress";
-import { UNAVAILABLE } from "../../data/entity";
+import { OFF, ON, UNAVAILABLE } from "../../data/entity";
import { HomeAssistant } from "../../types";
import { AssistantSetupStyles } from "./styles";
@@ -14,6 +14,8 @@ export class HaVoiceAssistantSetupStepUpdate extends LitElement {
private _updated = false;
+ private _refreshTimeout?: number;
+
protected override willUpdate(changedProperties: PropertyValues): void {
super.willUpdate(changedProperties);
@@ -28,17 +30,18 @@ export class HaVoiceAssistantSetupStepUpdate extends LitElement {
const oldState = oldHass.states[this.updateEntityId];
const newState = this.hass.states[this.updateEntityId];
if (
- oldState?.state === UNAVAILABLE &&
- newState?.state !== UNAVAILABLE
+ (oldState?.state === UNAVAILABLE &&
+ newState?.state !== UNAVAILABLE) ||
+ (oldState?.state === OFF && newState?.state === ON)
) {
// Device is rebooted, let's move on
- this._tryUpdate();
+ this._tryUpdate(false);
}
}
}
if (changedProperties.has("updateEntityId")) {
- this._tryUpdate();
+ this._tryUpdate(true);
}
}
@@ -54,7 +57,11 @@ export class HaVoiceAssistantSetupStepUpdate extends LitElement {
return html`

-
Updating your voice assistant
+
+ ${stateObj.state === OFF
+ ? "Checking for updates"
+ : "Updating your voice assistant"}
+
We are making sure you have the latest and greatest version of your
voice assistant. This may take a few minutes.
@@ -75,7 +82,8 @@ export class HaVoiceAssistantSetupStepUpdate extends LitElement {
`;
}
- private async _tryUpdate() {
+ private async _tryUpdate(refreshUpdate: boolean) {
+ clearTimeout(this._refreshTimeout);
if (!this.updateEntityId) {
return;
}
@@ -91,6 +99,16 @@ export class HaVoiceAssistantSetupStepUpdate extends LitElement {
{},
{ entity_id: updateEntity.entity_id }
);
+ } else if (refreshUpdate) {
+ await this.hass.callService(
+ "homeassistant",
+ "update_entity",
+ {},
+ { entity_id: this.updateEntityId }
+ );
+ this._refreshTimeout = window.setTimeout(() => {
+ this._nextStep();
+ }, 5000);
} else {
this._nextStep();
}