Skip to content

Commit

Permalink
Update voice-assistant-setup-step-update.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Sep 26, 2024
1 parent 5551e98 commit d334b1c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css, html, LitElement, PropertyValues } from "lit";
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";
Expand Down Expand Up @@ -45,7 +45,11 @@ export class HaVoiceAssistantSetupStepUpdate extends LitElement {
}

protected override render() {
const stateObj = this.hass.states[this.updateEntityId!];
if (!this.updateEntityId || !(this.updateEntityId in this.hass.states)) {
return nothing;
}

const stateObj = this.hass.states[this.updateEntityId];

const progressIsNumeric =
typeof stateObj?.attributes.in_progress === "number";
Expand Down

0 comments on commit d334b1c

Please sign in to comment.