mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Update ha-entity-picker.ts
This commit is contained in:
parent
264759ddf0
commit
29759de021
@ -38,15 +38,14 @@ const rowRenderer = (
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<paper-icon-item>
|
<paper-icon-item>
|
||||||
<state-badge state-obj="[[item]]" slot="item-icon"></state-badge>
|
<state-badge slot="item-icon"></state-badge>
|
||||||
<paper-item-body two-line="">
|
<paper-item-body two-line="">
|
||||||
<div class='name'>[[_computeStateName(item)]]</div>
|
<div class='name'></div>
|
||||||
<div secondary>[[item.entity_id]]</div>
|
<div secondary></div>
|
||||||
</paper-item-body>
|
</paper-item-body>
|
||||||
</paper-icon-item>
|
</paper-icon-item>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
root.querySelector("state-badge")!.stateObj = model.item;
|
root.querySelector("state-badge")!.stateObj = model.item;
|
||||||
root.querySelector(".name")!.textContent = computeStateName(model.item);
|
root.querySelector(".name")!.textContent = computeStateName(model.item);
|
||||||
root.querySelector("[secondary]")!.textContent = model.item.entity_id;
|
root.querySelector("[secondary]")!.textContent = model.item.entity_id;
|
||||||
@ -148,6 +147,10 @@ class HaEntityPicker extends LitElement {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
protected shouldUpdate(changedProps: PropertyValues) {
|
||||||
|
return !(!changedProps.has("_opened") && this._opened);
|
||||||
|
}
|
||||||
|
|
||||||
protected updated(changedProps: PropertyValues) {
|
protected updated(changedProps: PropertyValues) {
|
||||||
if (changedProps.has("_opened") && this._opened) {
|
if (changedProps.has("_opened") && this._opened) {
|
||||||
const states = this._getStates(
|
const states = this._getStates(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user