mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Fill state details when entity selected (#3615)
This commit is contained in:
parent
164e433592
commit
0008a100f4
@ -74,6 +74,7 @@ class HaPanelDevState extends EventsMixin(PolymerElement) {
|
|||||||
autofocus
|
autofocus
|
||||||
hass="[[hass]]"
|
hass="[[hass]]"
|
||||||
value="{{_entityId}}"
|
value="{{_entityId}}"
|
||||||
|
on-change="entityIdChanged"
|
||||||
allow-custom-entity
|
allow-custom-entity
|
||||||
></ha-entity-picker>
|
></ha-entity-picker>
|
||||||
<paper-input
|
<paper-input
|
||||||
@ -214,6 +215,12 @@ class HaPanelDevState extends EventsMixin(PolymerElement) {
|
|||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entityIdChanged() {
|
||||||
|
var state = this.hass.states[this._entityId];
|
||||||
|
this._state = state.state;
|
||||||
|
this._stateAttributes = JSON.stringify(state.attributes, null, " ");
|
||||||
|
}
|
||||||
|
|
||||||
entityMoreInfo(ev) {
|
entityMoreInfo(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
this.fire("hass-more-info", { entityId: ev.model.entity.entity_id });
|
this.fire("hass-more-info", { entityId: ev.model.entity.entity_id });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user