mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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() {
|
private _updateEntity() {
|
||||||
if (!this._entityId) {
|
const entityState = this._entityId
|
||||||
|
? this.hass.states[this._entityId]
|
||||||
|
: undefined;
|
||||||
|
if (!entityState) {
|
||||||
this._entity = undefined;
|
this._entity = undefined;
|
||||||
this._state = "";
|
this._state = "";
|
||||||
this._stateAttributes = {};
|
this._stateAttributes = {};
|
||||||
this._updateEditor();
|
this._updateEditor();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const entityState = this.hass.states[this._entityId];
|
|
||||||
if (!entityState) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._entity = entityState;
|
this._entity = entityState;
|
||||||
this._state = entityState.state;
|
this._state = entityState.state;
|
||||||
this._stateAttributes = entityState.attributes;
|
this._stateAttributes = entityState.attributes;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user