Fill state details when entity selected (#3615)

This commit is contained in:
Bram Kragten 2019-09-04 19:05:49 +02:00 committed by Paulus Schoutsen
parent 164e433592
commit 0008a100f4

View File

@ -74,6 +74,7 @@ class HaPanelDevState extends EventsMixin(PolymerElement) {
autofocus
hass="[[hass]]"
value="{{_entityId}}"
on-change="entityIdChanged"
allow-custom-entity
></ha-entity-picker>
<paper-input
@ -214,6 +215,12 @@ class HaPanelDevState extends EventsMixin(PolymerElement) {
ev.preventDefault();
}
entityIdChanged() {
var state = this.hass.states[this._entityId];
this._state = state.state;
this._stateAttributes = JSON.stringify(state.attributes, null, " ");
}
entityMoreInfo(ev) {
ev.preventDefault();
this.fire("hass-more-info", { entityId: ev.model.entity.entity_id });