mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix developer tools set state for unexisting entity (#18827)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
79f5ec0cd5
commit
f1692038f8
@ -360,17 +360,16 @@ class HaPanelDevState extends LitElement {
|
||||
}
|
||||
|
||||
private _updateEntity() {
|
||||
if (!this._entityId) {
|
||||
const entityState = this._entityId
|
||||
? this.hass.states[this._entityId]
|
||||
: undefined;
|
||||
if (!entityState) {
|
||||
this._entity = undefined;
|
||||
this._state = "";
|
||||
this._stateAttributes = {};
|
||||
this._updateEditor();
|
||||
return;
|
||||
}
|
||||
const entityState = this.hass.states[this._entityId];
|
||||
if (!entityState) {
|
||||
return;
|
||||
}
|
||||
this._entity = entityState;
|
||||
this._state = entityState.state;
|
||||
this._stateAttributes = entityState.attributes;
|
||||
|
Loading…
x
Reference in New Issue
Block a user