mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 10:59:50 +00:00
Only pick entities with location in map card editor (#15839)
This commit is contained in:
@@ -5,7 +5,10 @@ import { repeat } from "lit/directives/repeat";
|
||||
import type { SortableEvent } from "sortablejs";
|
||||
import { fireEvent } from "../../../common/dom/fire_event";
|
||||
import "../../../components/entity/ha-entity-picker";
|
||||
import type { HaEntityPicker } from "../../../components/entity/ha-entity-picker";
|
||||
import type {
|
||||
HaEntityPicker,
|
||||
HaEntityPickerEntityFilterFunc,
|
||||
} from "../../../components/entity/ha-entity-picker";
|
||||
import "../../../components/ha-icon-button";
|
||||
import { sortableStyles } from "../../../resources/ha-sortable-style";
|
||||
import {
|
||||
@@ -21,6 +24,8 @@ export class HuiEntityEditor extends LitElement {
|
||||
|
||||
@property({ attribute: false }) protected entities?: EntityConfig[];
|
||||
|
||||
@property() protected entityFilter?: HaEntityPickerEntityFilterFunc;
|
||||
|
||||
@property() protected label?: string;
|
||||
|
||||
private _entityKeys = new WeakMap<EntityConfig, string>();
|
||||
@@ -65,6 +70,7 @@ export class HuiEntityEditor extends LitElement {
|
||||
.hass=${this.hass}
|
||||
.value=${entityConf.entity}
|
||||
.index=${index}
|
||||
.entityFilter=${this.entityFilter}
|
||||
@value-changed=${this._valueChanged}
|
||||
allow-custom-entity
|
||||
></ha-entity-picker>
|
||||
@@ -75,6 +81,7 @@ export class HuiEntityEditor extends LitElement {
|
||||
<ha-entity-picker
|
||||
class="add-entity"
|
||||
.hass=${this.hass}
|
||||
.entityFilter=${this.entityFilter}
|
||||
@value-changed=${this._addEntity}
|
||||
></ha-entity-picker>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user