mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix more info for disabled entity (#15641)
This commit is contained in:
parent
a5541996d7
commit
e3b797e85c
@ -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`
|
||||
<ha-dialog open @closed=${this.closeDialog} .heading=${title} hideActions>
|
||||
@ -251,7 +252,7 @@ export class MoreInfoDialog extends LitElement {
|
||||
)}
|
||||
></ha-icon-button-prev>
|
||||
`}
|
||||
${!isInfoView || !computeShowNewMoreInfo(stateObj)
|
||||
${!isInfoView || !isNewMoreInfo
|
||||
? html`<div
|
||||
slot="title"
|
||||
class="main-title"
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { HassEntity } from "home-assistant-js-websocket";
|
||||
import { css, html, LitElement } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
import { computeDomain } from "../../common/entity/compute_domain";
|
||||
@ -21,10 +22,10 @@ export class MoreInfoInfo extends LitElement {
|
||||
|
||||
protected render() {
|
||||
const entityId = this.entityId;
|
||||
const stateObj = this.hass.states[entityId];
|
||||
const stateObj = this.hass.states[entityId] as HassEntity | undefined;
|
||||
const entityRegObj = this.hass.entities[entityId];
|
||||
const domain = computeDomain(entityId);
|
||||
const newMoreInfo = computeShowNewMoreInfo(stateObj);
|
||||
const isNewMoreInfo = stateObj && computeShowNewMoreInfo(stateObj);
|
||||
|
||||
return html`
|
||||
<div class="container" data-domain=${domain}>
|
||||
@ -46,7 +47,7 @@ export class MoreInfoInfo extends LitElement {
|
||||
</ha-alert>`
|
||||
: ""}
|
||||
<div class="content">
|
||||
${DOMAINS_NO_INFO.includes(domain) || computeShowNewMoreInfo(stateObj)
|
||||
${DOMAINS_NO_INFO.includes(domain) || isNewMoreInfo
|
||||
? ""
|
||||
: html`
|
||||
<state-card-content
|
||||
@ -70,7 +71,7 @@ export class MoreInfoInfo extends LitElement {
|
||||
.entityId=${this.entityId}
|
||||
></ha-more-info-logbook>`}
|
||||
<more-info-content
|
||||
?full-height=${newMoreInfo}
|
||||
?full-height=${isNewMoreInfo}
|
||||
.stateObj=${stateObj}
|
||||
.hass=${this.hass}
|
||||
></more-info-content>
|
||||
|
Loading…
x
Reference in New Issue
Block a user