MCPcopy
hub / github.com/home-assistant/frontend / HaAreaControlsPicker

Class HaAreaControlsPicker

src/components/ha-area-controls-picker.ts:49–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48@customElement("ha-area-controls-picker")
49export class HaAreaControlsPicker extends LitElement {
50 @property({ attribute: false }) public hass!: HomeAssistant;
51
52 @property({ attribute: "area-id" }) public areaId!: string;
53
54 @property({ type: Array, attribute: "exclude-entities" })
55 public excludeEntities?: string[];
56
57 @property() public value?: string;
58
59 @property({ type: Array, attribute: "exclude-values" })
60 public excludeValues?: string[];
61
62 @property() public label?: string;
63
64 @property() public placeholder?: string;
65
66 @property() public helper?: string;
67
68 @property({ type: Boolean }) public disabled = false;
69
70 @property({ type: Boolean }) public required = false;
71
72 @property({ attribute: "add-button-label" }) public addButtonLabel?: string;
73
74 private _domainSearchKeys: FuseWeightedKey[] = [
75 {
76 name: "primary",
77 weight: 10,
78 },
79 ];
80
81 private _entitySearchKeys: FuseWeightedKey[] = [
82 {
83 name: "primary",
84 weight: 10,
85 },
86 {
87 name: "secondary",
88 weight: 5,
89 },
90 {
91 name: "id",
92 weight: 3,
93 },
94 ];
95
96 private _createFuseIndex = (
97 items: AreaControlPickerItem[],
98 keys: FuseWeightedKey[]
99 ) => Fuse.createIndex(keys, items);
100
101 private _domainFuseIndex = memoizeOne((items: AreaControlPickerItem[]) =>
102 this._createFuseIndex(items, this._domainSearchKeys)
103 );
104
105 private _entityFuseIndex = memoizeOne((items: AreaControlPickerItem[]) =>
106 this._createFuseIndex(items, this._entitySearchKeys)

Callers

nothing calls this directly

Calls 7

getAreaControlEntitiesFunction · 0.90
multiTermSortedSearchFunction · 0.90
computeRTLFunction · 0.90
computeEntityNameListFunction · 0.90
keysMethod · 0.80
valuesMethod · 0.80
localizeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…