Use entity id as label in entity picker dev tools (#16484)

This commit is contained in:
Bram Kragten 2023-05-10 10:23:33 +02:00 committed by GitHub
parent 24fc2a0ccc
commit 3325cbfa28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -102,6 +102,9 @@ export class HaEntityPicker extends LitElement {
@property({ type: Boolean }) public hideClearIcon = false;
@property({ attribute: "item-label-path" }) public itemLabelPath =
"friendly_name";
@state() private _opened = false;
@query("ha-combo-box", true) public comboBox!: HaComboBox;
@ -300,7 +303,7 @@ export class HaEntityPicker extends LitElement {
return html`
<ha-combo-box
item-value-path="entity_id"
item-label-path="friendly_name"
.itemLabelPath=${this.itemLabelPath}
.hass=${this.hass}
.value=${this._value}
.label=${this.label === undefined

View File

@ -193,6 +193,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
value="{{_entityId}}"
on-change="entityIdChanged"
allow-custom-entity
item-label-path="entity_id"
></ha-entity-picker>
<ha-tip hass="[[hass]]">[[localize('ui.tips.key_e_hint')]]</ha-tip>
<ha-textfield