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