diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 38a7e4ab84..ced7e56e0e 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -214,7 +214,7 @@ export class MoreInfoDialog extends LitElement { return null; } const entityId = this._entityId; - const stateObj = this.hass.states[entityId]; + const stateObj = this.hass.states[entityId] as HassEntity | undefined; const domain = computeDomain(entityId); const name = (stateObj && computeStateName(stateObj)) || entityId; @@ -226,6 +226,7 @@ export class MoreInfoDialog extends LitElement { const title = this._childView?.viewTitle ?? name; const isInfoView = this._currView === "info" && !this._childView; + const isNewMoreInfo = stateObj && computeShowNewMoreInfo(stateObj); return html` @@ -251,7 +252,7 @@ export class MoreInfoDialog extends LitElement { )} > `} - ${!isInfoView || !computeShowNewMoreInfo(stateObj) + ${!isInfoView || !isNewMoreInfo ? html`
@@ -46,7 +47,7 @@ export class MoreInfoInfo extends LitElement { ` : ""}
- ${DOMAINS_NO_INFO.includes(domain) || computeShowNewMoreInfo(stateObj) + ${DOMAINS_NO_INFO.includes(domain) || isNewMoreInfo ? "" : html` `}