mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 12:16:39 +00:00
🚫 render error-entity-row
when state not available (#2352)
This commit is contained in:
parent
b78c48ecec
commit
849ed80e78
@ -31,12 +31,22 @@ class HuiClimateEntityRow extends LitElement implements EntityRow {
|
|||||||
return html``;
|
return html``;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const stateObj = this.hass.states[this._config.entity];
|
||||||
|
|
||||||
|
if (!stateObj) {
|
||||||
|
return html`
|
||||||
|
<hui-error-entity-row
|
||||||
|
.entity="${this._config.entity}"
|
||||||
|
></hui-error-entity-row>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
${this.renderStyle()}
|
${this.renderStyle()}
|
||||||
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}">
|
<hui-generic-entity-row .hass="${this.hass}" .config="${this._config}">
|
||||||
<ha-climate-state
|
<ha-climate-state
|
||||||
.hass="${this.hass}"
|
.hass="${this.hass}"
|
||||||
.stateObj="${this.hass.states[this._config.entity]}"
|
.stateObj="${stateObj}"
|
||||||
></ha-climate-state>
|
></ha-climate-state>
|
||||||
</hui-generic-entity-row>
|
</hui-generic-entity-row>
|
||||||
`;
|
`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user