@digital-alchemy/hass 24.6.3 → 24.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dynamic.d.ts +286 -371
- package/dist/dynamic.js +0 -405
- package/dist/dynamic.js.map +1 -1
- package/dist/extensions/area.extension.d.ts +3 -3
- package/dist/extensions/area.extension.js.map +1 -1
- package/dist/extensions/entity.extension.d.ts +36 -18
- package/dist/extensions/entity.extension.js +12 -12
- package/dist/extensions/entity.extension.js.map +1 -1
- package/dist/extensions/fetch-api.extension.d.ts +6 -6
- package/dist/extensions/fetch-api.extension.js +1 -1
- package/dist/extensions/fetch-api.extension.js.map +1 -1
- package/dist/extensions/id-by.extension.d.ts +7 -5
- package/dist/extensions/id-by.extension.js +45 -38
- package/dist/extensions/id-by.extension.js.map +1 -1
- package/dist/extensions/reference.extension.d.ts +9 -20
- package/dist/extensions/reference.extension.js +24 -4
- package/dist/extensions/reference.extension.js.map +1 -1
- package/dist/helpers/entity-state.helper.d.ts +12 -12
- package/dist/helpers/entity-state.helper.js.map +1 -1
- package/dist/helpers/fetch/calendar.d.ts +1 -1
- package/dist/helpers/registry.d.ts +5 -5
- package/dist/helpers/utility.helper.d.ts +15 -15
- package/dist/helpers/utility.helper.js +1 -1
- package/dist/helpers/utility.helper.js.map +1 -1
- package/dist/helpers/websocket.helper.d.ts +4 -4
- package/dist/mock_assistant/extensions/events.extension.d.ts +2 -2
- package/dist/mock_assistant/extensions/fixtures.extension.d.ts +4 -4
- package/dist/mock_assistant/extensions/fixtures.extension.js.map +1 -1
- package/dist/mock_assistant/helpers/fixtures.d.ts +3 -3
- package/dist/testing/entity.spec.js +36 -2
- package/dist/testing/entity.spec.js.map +1 -1
- package/dist/testing/fetch-api.spec.js +2 -2
- package/dist/testing/fetch-api.spec.js.map +1 -1
- package/dist/testing/ref-by.spec.js +97 -4
- package/dist/testing/ref-by.spec.js.map +1 -1
- package/package.json +3 -1
package/dist/dynamic.js
CHANGED
|
@@ -1,408 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ENTITY_SETUP = void 0;
|
|
4
|
-
// #MARK: ENTITY_SETUP
|
|
5
|
-
exports.ENTITY_SETUP = {
|
|
6
|
-
binary_sensor: {
|
|
7
|
-
hass_e2e_online: {
|
|
8
|
-
attributes: {
|
|
9
|
-
friendly_name: "hass_e2e online",
|
|
10
|
-
restored: true,
|
|
11
|
-
supported_features: 0,
|
|
12
|
-
},
|
|
13
|
-
context: {
|
|
14
|
-
id: "01HWXTSCSBGW129NV7WY8MMG1E",
|
|
15
|
-
parent_id: null,
|
|
16
|
-
user_id: null,
|
|
17
|
-
},
|
|
18
|
-
entity_id: "binary_sensor.hass_e2e_online",
|
|
19
|
-
last_changed: "2024-05-02T23:38:44.907649+00:00",
|
|
20
|
-
last_reported: "2024-05-02T23:38:44.907649+00:00",
|
|
21
|
-
last_updated: "2024-05-02T23:38:44.907649+00:00",
|
|
22
|
-
state: "unavailable",
|
|
23
|
-
},
|
|
24
|
-
toggles: {
|
|
25
|
-
attributes: {
|
|
26
|
-
friendly_name: "toggles",
|
|
27
|
-
icon: "mdi:toggle-switch-variant-off",
|
|
28
|
-
restored: true,
|
|
29
|
-
supported_features: 0,
|
|
30
|
-
},
|
|
31
|
-
context: {
|
|
32
|
-
id: "01HWXTSCSB43FF1R6FX0QEE4Z6",
|
|
33
|
-
parent_id: null,
|
|
34
|
-
user_id: null,
|
|
35
|
-
},
|
|
36
|
-
entity_id: "binary_sensor.toggles",
|
|
37
|
-
last_changed: "2024-05-02T23:38:44.907718+00:00",
|
|
38
|
-
last_reported: "2024-05-02T23:38:44.907718+00:00",
|
|
39
|
-
last_updated: "2024-05-02T23:38:44.907718+00:00",
|
|
40
|
-
state: "unavailable",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
calendar: {
|
|
44
|
-
united_states_tx: {
|
|
45
|
-
attributes: {
|
|
46
|
-
all_day: true,
|
|
47
|
-
description: "",
|
|
48
|
-
end_time: "2024-05-28 00:00:00",
|
|
49
|
-
friendly_name: "United States, TX",
|
|
50
|
-
location: "United States, TX",
|
|
51
|
-
message: "Memorial Day",
|
|
52
|
-
start_time: "2024-05-27 00:00:00",
|
|
53
|
-
},
|
|
54
|
-
context: {
|
|
55
|
-
id: "01HWXTYEEFBB7QQC1CSM6PAR36",
|
|
56
|
-
parent_id: null,
|
|
57
|
-
user_id: null,
|
|
58
|
-
},
|
|
59
|
-
entity_id: "calendar.united_states_tx",
|
|
60
|
-
last_changed: "2024-05-02T23:41:30.447850+00:00",
|
|
61
|
-
last_reported: "2024-05-02T23:41:30.449701+00:00",
|
|
62
|
-
last_updated: "2024-05-02T23:41:30.447850+00:00",
|
|
63
|
-
state: "off",
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
light: {
|
|
67
|
-
bedroom_ceiling_fan: {
|
|
68
|
-
attributes: {
|
|
69
|
-
brightness: null,
|
|
70
|
-
color_mode: null,
|
|
71
|
-
color_temp: null,
|
|
72
|
-
color_temp_kelvin: null,
|
|
73
|
-
friendly_name: "Bedroom Ceiling Fan",
|
|
74
|
-
hs_color: null,
|
|
75
|
-
icon: "mdi:lightbulb-group",
|
|
76
|
-
max_color_temp_kelvin: 6535,
|
|
77
|
-
max_mireds: 500,
|
|
78
|
-
min_color_temp_kelvin: 2000,
|
|
79
|
-
min_mireds: 153,
|
|
80
|
-
rgb_color: null,
|
|
81
|
-
supported_color_modes: ["color_temp", "xy"],
|
|
82
|
-
supported_features: 40,
|
|
83
|
-
xy_color: null,
|
|
84
|
-
},
|
|
85
|
-
context: {
|
|
86
|
-
id: "01HX722Y1JFS6KN2MDERK0VJ2D",
|
|
87
|
-
parent_id: null,
|
|
88
|
-
user_id: null,
|
|
89
|
-
},
|
|
90
|
-
entity_id: "light.bedroom_ceiling_fan",
|
|
91
|
-
last_changed: "2024-05-06T13:39:28.645503+00:00",
|
|
92
|
-
last_reported: "2024-05-06T13:39:28.645503+00:00",
|
|
93
|
-
last_updated: "2024-05-06T13:39:28.645503+00:00",
|
|
94
|
-
state: "off",
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
person: {
|
|
98
|
-
digital_alchemy: {
|
|
99
|
-
attributes: {
|
|
100
|
-
device_trackers: [],
|
|
101
|
-
editable: true,
|
|
102
|
-
friendly_name: "digital-alchemy",
|
|
103
|
-
id: "digital_alchemy",
|
|
104
|
-
user_id: "4dd1cf7e93e94f3fbaf419501f9a3d59",
|
|
105
|
-
},
|
|
106
|
-
context: {
|
|
107
|
-
id: "01HWXTSCSBRKJ9T2KV1JNER5KQ",
|
|
108
|
-
parent_id: null,
|
|
109
|
-
user_id: null,
|
|
110
|
-
},
|
|
111
|
-
entity_id: "person.digital_alchemy",
|
|
112
|
-
last_changed: "2024-05-02T23:38:39.485125+00:00",
|
|
113
|
-
last_reported: "2024-05-02T23:38:44.907957+00:00",
|
|
114
|
-
last_updated: "2024-05-02T23:38:44.907957+00:00",
|
|
115
|
-
state: "unknown",
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
scene: {
|
|
119
|
-
games_room_auto: {
|
|
120
|
-
attributes: {
|
|
121
|
-
"Managed By": "home_automation",
|
|
122
|
-
friendly_name: "bedroom off",
|
|
123
|
-
},
|
|
124
|
-
context: {
|
|
125
|
-
id: "01HWXW289S8HP5MSGNNTNB2CBG",
|
|
126
|
-
parent_id: null,
|
|
127
|
-
user_id: null,
|
|
128
|
-
},
|
|
129
|
-
entity_id: "scene.bedroom_off",
|
|
130
|
-
last_changed: "2024-05-03T00:01:03.801727+00:00",
|
|
131
|
-
last_reported: "2024-05-03T00:01:03.801727+00:00",
|
|
132
|
-
last_updated: "2024-05-03T00:01:03.801727+00:00",
|
|
133
|
-
state: "unknown",
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
sensor: {
|
|
137
|
-
magic: {
|
|
138
|
-
attributes: {
|
|
139
|
-
friendly_name: "magic",
|
|
140
|
-
icon: "mdi:satellite-uplink",
|
|
141
|
-
restored: true,
|
|
142
|
-
supported_features: 0,
|
|
143
|
-
},
|
|
144
|
-
context: {
|
|
145
|
-
id: "01HWXTSCSBW34BP3R20RJ09CVZ",
|
|
146
|
-
parent_id: null,
|
|
147
|
-
user_id: null,
|
|
148
|
-
},
|
|
149
|
-
entity_id: "sensor.magic",
|
|
150
|
-
last_changed: "2024-05-02T23:38:44.907694+00:00",
|
|
151
|
-
last_reported: "2024-05-02T23:38:44.907694+00:00",
|
|
152
|
-
last_updated: "2024-05-02T23:38:44.907694+00:00",
|
|
153
|
-
state: "unavailable",
|
|
154
|
-
},
|
|
155
|
-
sun_next_dawn: {
|
|
156
|
-
attributes: {
|
|
157
|
-
device_class: "timestamp",
|
|
158
|
-
friendly_name: "Sun Next dawn",
|
|
159
|
-
},
|
|
160
|
-
context: {
|
|
161
|
-
id: "01HWXTS8W1SRTPT5K1XM0G491X",
|
|
162
|
-
parent_id: null,
|
|
163
|
-
user_id: null,
|
|
164
|
-
},
|
|
165
|
-
entity_id: "sensor.sun_next_dawn",
|
|
166
|
-
last_changed: "2024-05-02T23:38:40.897643+00:00",
|
|
167
|
-
last_reported: "2024-05-02T23:38:40.897643+00:00",
|
|
168
|
-
last_updated: "2024-05-02T23:38:40.897643+00:00",
|
|
169
|
-
state: "2024-05-03T03:24:45+00:00",
|
|
170
|
-
},
|
|
171
|
-
sun_next_dusk: {
|
|
172
|
-
attributes: {
|
|
173
|
-
device_class: "timestamp",
|
|
174
|
-
friendly_name: "Sun Next dusk",
|
|
175
|
-
},
|
|
176
|
-
context: {
|
|
177
|
-
id: "01HWXTS8W1S95P1MVHDGHSQEB2",
|
|
178
|
-
parent_id: null,
|
|
179
|
-
user_id: null,
|
|
180
|
-
},
|
|
181
|
-
entity_id: "sensor.sun_next_dusk",
|
|
182
|
-
last_changed: "2024-05-02T23:38:40.897814+00:00",
|
|
183
|
-
last_reported: "2024-05-02T23:38:40.897814+00:00",
|
|
184
|
-
last_updated: "2024-05-02T23:38:40.897814+00:00",
|
|
185
|
-
state: "2024-05-03T19:51:10+00:00",
|
|
186
|
-
},
|
|
187
|
-
sun_next_midnight: {
|
|
188
|
-
attributes: {
|
|
189
|
-
device_class: "timestamp",
|
|
190
|
-
friendly_name: "Sun Next midnight",
|
|
191
|
-
},
|
|
192
|
-
context: {
|
|
193
|
-
id: "01HWXTS8W1YQCPA3WZ69Y9JSPD",
|
|
194
|
-
parent_id: null,
|
|
195
|
-
user_id: null,
|
|
196
|
-
},
|
|
197
|
-
entity_id: "sensor.sun_next_midnight",
|
|
198
|
-
last_changed: "2024-05-02T23:38:40.897950+00:00",
|
|
199
|
-
last_reported: "2024-05-02T23:38:40.897950+00:00",
|
|
200
|
-
last_updated: "2024-05-02T23:38:40.897950+00:00",
|
|
201
|
-
state: "2024-05-03T23:37:12+00:00",
|
|
202
|
-
},
|
|
203
|
-
sun_next_noon: {
|
|
204
|
-
attributes: {
|
|
205
|
-
device_class: "timestamp",
|
|
206
|
-
friendly_name: "Sun Next noon",
|
|
207
|
-
},
|
|
208
|
-
context: {
|
|
209
|
-
id: "01HWXTS8W28MVV48CQ31JB2WKC",
|
|
210
|
-
parent_id: null,
|
|
211
|
-
user_id: null,
|
|
212
|
-
},
|
|
213
|
-
entity_id: "sensor.sun_next_noon",
|
|
214
|
-
last_changed: "2024-05-02T23:38:40.898068+00:00",
|
|
215
|
-
last_reported: "2024-05-02T23:38:40.898068+00:00",
|
|
216
|
-
last_updated: "2024-05-02T23:38:40.898068+00:00",
|
|
217
|
-
state: "2024-05-03T11:37:19+00:00",
|
|
218
|
-
},
|
|
219
|
-
sun_next_rising: {
|
|
220
|
-
attributes: {
|
|
221
|
-
device_class: "timestamp",
|
|
222
|
-
friendly_name: "Sun Next rising",
|
|
223
|
-
},
|
|
224
|
-
context: {
|
|
225
|
-
id: "01HWXTS8W2MMADKGWE4A5BMH51",
|
|
226
|
-
parent_id: null,
|
|
227
|
-
user_id: null,
|
|
228
|
-
},
|
|
229
|
-
entity_id: "sensor.sun_next_rising",
|
|
230
|
-
last_changed: "2024-05-02T23:38:40.898182+00:00",
|
|
231
|
-
last_reported: "2024-05-02T23:38:40.898182+00:00",
|
|
232
|
-
last_updated: "2024-05-02T23:38:40.898182+00:00",
|
|
233
|
-
state: "2024-05-03T04:05:17+00:00",
|
|
234
|
-
},
|
|
235
|
-
sun_next_setting: {
|
|
236
|
-
attributes: {
|
|
237
|
-
device_class: "timestamp",
|
|
238
|
-
friendly_name: "Sun Next setting",
|
|
239
|
-
},
|
|
240
|
-
context: {
|
|
241
|
-
id: "01HWXTS8W24KWTHR2B6V32NCXG",
|
|
242
|
-
parent_id: null,
|
|
243
|
-
user_id: null,
|
|
244
|
-
},
|
|
245
|
-
entity_id: "sensor.sun_next_setting",
|
|
246
|
-
last_changed: "2024-05-02T23:38:40.898289+00:00",
|
|
247
|
-
last_reported: "2024-05-02T23:38:40.898289+00:00",
|
|
248
|
-
last_updated: "2024-05-02T23:38:40.898289+00:00",
|
|
249
|
-
state: "2024-05-03T19:10:21+00:00",
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
sun: {
|
|
253
|
-
sun: {
|
|
254
|
-
attributes: {
|
|
255
|
-
azimuth: 0.35,
|
|
256
|
-
elevation: -21.86,
|
|
257
|
-
friendly_name: "Sun",
|
|
258
|
-
next_dawn: "2024-05-03T03:24:45.747945+00:00",
|
|
259
|
-
next_dusk: "2024-05-03T19:51:10.358970+00:00",
|
|
260
|
-
next_midnight: "2024-05-03T23:37:12+00:00",
|
|
261
|
-
next_noon: "2024-05-03T11:37:19+00:00",
|
|
262
|
-
next_rising: "2024-05-03T04:05:17.926549+00:00",
|
|
263
|
-
next_setting: "2024-05-03T19:10:21.280558+00:00",
|
|
264
|
-
rising: true,
|
|
265
|
-
},
|
|
266
|
-
context: {
|
|
267
|
-
id: "01HWXTS8W1J2TDGMN7KKNWP8DV",
|
|
268
|
-
parent_id: null,
|
|
269
|
-
user_id: null,
|
|
270
|
-
},
|
|
271
|
-
entity_id: "sun.sun",
|
|
272
|
-
last_changed: "2024-05-02T23:38:40.897074+00:00",
|
|
273
|
-
last_reported: "2024-05-02T23:38:40.897074+00:00",
|
|
274
|
-
last_updated: "2024-05-02T23:38:40.897074+00:00",
|
|
275
|
-
state: "below_horizon",
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
switch: {
|
|
279
|
-
bedroom_lamp: {
|
|
280
|
-
attributes: {
|
|
281
|
-
friendly_name: "bedroom_lamp",
|
|
282
|
-
restored: true,
|
|
283
|
-
supported_features: 0,
|
|
284
|
-
},
|
|
285
|
-
context: {
|
|
286
|
-
id: "01HWXTSCSB7BK003CH3AYYVXCB",
|
|
287
|
-
parent_id: null,
|
|
288
|
-
user_id: null,
|
|
289
|
-
},
|
|
290
|
-
entity_id: "switch.bedroom_lamp",
|
|
291
|
-
last_changed: "2024-05-02T23:38:44.907730+00:00",
|
|
292
|
-
last_reported: "2024-05-02T23:38:44.907730+00:00",
|
|
293
|
-
last_updated: "2024-05-02T23:38:44.907730+00:00",
|
|
294
|
-
state: "unavailable",
|
|
295
|
-
},
|
|
296
|
-
kitchen_cabinets: {
|
|
297
|
-
attributes: {
|
|
298
|
-
friendly_name: "kitchen_cabinets",
|
|
299
|
-
restored: true,
|
|
300
|
-
supported_features: 0,
|
|
301
|
-
},
|
|
302
|
-
context: {
|
|
303
|
-
id: "01HWXTSCSBM9Y3SRQTFJ5CVK6H",
|
|
304
|
-
parent_id: null,
|
|
305
|
-
user_id: null,
|
|
306
|
-
},
|
|
307
|
-
entity_id: "switch.kitchen_cabinets",
|
|
308
|
-
last_changed: "2024-05-02T23:38:44.907743+00:00",
|
|
309
|
-
last_reported: "2024-05-02T23:38:44.907743+00:00",
|
|
310
|
-
last_updated: "2024-05-02T23:38:44.907743+00:00",
|
|
311
|
-
state: "unavailable",
|
|
312
|
-
},
|
|
313
|
-
living_room_mood_lights: {
|
|
314
|
-
attributes: {
|
|
315
|
-
friendly_name: "living_room_mood_lights",
|
|
316
|
-
restored: true,
|
|
317
|
-
supported_features: 0,
|
|
318
|
-
},
|
|
319
|
-
context: {
|
|
320
|
-
id: "01HWXTSCSBS5B586JJ7VFH10SX",
|
|
321
|
-
parent_id: null,
|
|
322
|
-
user_id: null,
|
|
323
|
-
},
|
|
324
|
-
entity_id: "switch.living_room_mood_lights",
|
|
325
|
-
last_changed: "2024-05-02T23:38:44.907753+00:00",
|
|
326
|
-
last_reported: "2024-05-02T23:38:44.907753+00:00",
|
|
327
|
-
last_updated: "2024-05-02T23:38:44.907753+00:00",
|
|
328
|
-
state: "unavailable",
|
|
329
|
-
},
|
|
330
|
-
porch_light: {
|
|
331
|
-
attributes: {
|
|
332
|
-
friendly_name: "porch_light",
|
|
333
|
-
restored: true,
|
|
334
|
-
supported_features: 0,
|
|
335
|
-
},
|
|
336
|
-
context: {
|
|
337
|
-
id: "01HWXTSCSBFTSZR1M5XAK7XSR8",
|
|
338
|
-
parent_id: null,
|
|
339
|
-
user_id: null,
|
|
340
|
-
},
|
|
341
|
-
entity_id: "switch.porch_light",
|
|
342
|
-
last_changed: "2024-05-02T23:38:44.907761+00:00",
|
|
343
|
-
last_reported: "2024-05-02T23:38:44.907761+00:00",
|
|
344
|
-
last_updated: "2024-05-02T23:38:44.907761+00:00",
|
|
345
|
-
state: "unavailable",
|
|
346
|
-
},
|
|
347
|
-
},
|
|
348
|
-
todo: {
|
|
349
|
-
shopping_list: {
|
|
350
|
-
attributes: {
|
|
351
|
-
friendly_name: "Shopping List",
|
|
352
|
-
supported_features: 15,
|
|
353
|
-
},
|
|
354
|
-
context: {
|
|
355
|
-
id: "01HWXTS8X3D417XC4YJTG8QJWB",
|
|
356
|
-
parent_id: null,
|
|
357
|
-
user_id: null,
|
|
358
|
-
},
|
|
359
|
-
entity_id: "todo.shopping_list",
|
|
360
|
-
last_changed: "2024-05-02T23:38:40.931953+00:00",
|
|
361
|
-
last_reported: "2024-05-02T23:38:40.931953+00:00",
|
|
362
|
-
last_updated: "2024-05-02T23:38:40.931953+00:00",
|
|
363
|
-
state: "0",
|
|
364
|
-
},
|
|
365
|
-
},
|
|
366
|
-
tts: {
|
|
367
|
-
google_en_com: {
|
|
368
|
-
attributes: {
|
|
369
|
-
friendly_name: "Google en com",
|
|
370
|
-
},
|
|
371
|
-
context: {
|
|
372
|
-
id: "01HWXTS8XMPQ236CDJ6X7C6E60",
|
|
373
|
-
parent_id: null,
|
|
374
|
-
user_id: null,
|
|
375
|
-
},
|
|
376
|
-
entity_id: "tts.google_en_com",
|
|
377
|
-
last_changed: "2024-05-02T23:38:40.948156+00:00",
|
|
378
|
-
last_reported: "2024-05-02T23:38:40.948156+00:00",
|
|
379
|
-
last_updated: "2024-05-02T23:38:40.948156+00:00",
|
|
380
|
-
state: "unknown",
|
|
381
|
-
},
|
|
382
|
-
},
|
|
383
|
-
zone: {
|
|
384
|
-
home: {
|
|
385
|
-
attributes: {
|
|
386
|
-
editable: true,
|
|
387
|
-
friendly_name: "Home",
|
|
388
|
-
icon: "mdi:home",
|
|
389
|
-
latitude: 52.373_133_9,
|
|
390
|
-
longitude: 4.890_314_7,
|
|
391
|
-
passive: false,
|
|
392
|
-
persons: [],
|
|
393
|
-
radius: 100,
|
|
394
|
-
},
|
|
395
|
-
context: {
|
|
396
|
-
id: "01HWXTS8GMB4ZW20P8MGMX0QSN",
|
|
397
|
-
parent_id: null,
|
|
398
|
-
user_id: null,
|
|
399
|
-
},
|
|
400
|
-
entity_id: "zone.home",
|
|
401
|
-
last_changed: "2024-05-02T23:38:40.532050+00:00",
|
|
402
|
-
last_reported: "2024-05-02T23:38:40.532050+00:00",
|
|
403
|
-
last_updated: "2024-05-02T23:38:40.532050+00:00",
|
|
404
|
-
state: "0",
|
|
405
|
-
},
|
|
406
|
-
},
|
|
407
|
-
};
|
|
408
3
|
//# sourceMappingURL=dynamic.js.map
|
package/dist/dynamic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic.js","sourceRoot":"","sources":["../src/dynamic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamic.js","sourceRoot":"","sources":["../src/dynamic.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TServiceParams } from "@digital-alchemy/core";
|
|
2
2
|
import { TAreaId } from "../dynamic";
|
|
3
|
-
import { AreaCreate, AreaDetails
|
|
3
|
+
import { ANY_ENTITY, AreaCreate, AreaDetails } from "../helpers";
|
|
4
4
|
export declare function Area({ hass, context, config, logger, event, lifecycle, }: TServiceParams): {
|
|
5
|
-
apply: (area: TAreaId, entities:
|
|
6
|
-
updated:
|
|
5
|
+
apply: (area: TAreaId, entities: ANY_ENTITY[]) => Promise<{
|
|
6
|
+
updated: import("../dynamic").TRawEntityIds[];
|
|
7
7
|
}>;
|
|
8
8
|
create: (details: AreaCreate) => Promise<void>;
|
|
9
9
|
current: AreaDetails[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"area.extension.js","sourceRoot":"","sources":["../../src/extensions/area.extension.ts"],"names":[],"mappings":";;;AAAA,gDAI+B;AAG/B,wCAOoB;AAEpB,SAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,SAAS,GACM;IACf,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YACrE,OAAO;QACT,CAAC;QACD,IAAI,OAAO,GAAG,IAAI,OAAO,CAAO,KAAK,EAAC,IAAI,EAAC,EAAE;YAC3C,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAC3C,OAAO,GAAG,SAAS,CAAC;YACpB,IAAI,EAAE,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TServiceParams } from "@digital-alchemy/core";
|
|
3
3
|
import EventEmitter from "events";
|
|
4
|
-
import { ByIdProxy, EditLabelOptions, ENTITY_STATE, EntityHistoryDTO, EntityHistoryResult, EntityRegistryItem, PICK_ENTITY, TAreaId, TDeviceId, TFloorId, TLabelId, TPlatformId, TRawDomains } from "..";
|
|
4
|
+
import { ALL_DOMAINS, ANY_ENTITY, ByIdProxy, EditLabelOptions, ENTITY_STATE, EntityHistoryDTO, EntityHistoryResult, EntityRegistryItem, PICK_ENTITY, TAreaId, TDeviceId, TFloorId, TLabelId, TPlatformId, TRawDomains } from "..";
|
|
5
5
|
export declare const ENTITY_UPDATE_RECEIVER: unique symbol;
|
|
6
|
+
type TMasterState = {
|
|
7
|
+
[DOMAIN in ALL_DOMAINS]: Record<string, ENTITY_STATE<PICK_ENTITY<DOMAIN>>>;
|
|
8
|
+
};
|
|
6
9
|
export declare function EntityManager({ logger, hass, config, lifecycle, event, context, internal, }: TServiceParams): {
|
|
7
10
|
_entityEvents: () => EventEmitter<[never]>;
|
|
11
|
+
_masterState: () => Partial<TMasterState>;
|
|
8
12
|
/**
|
|
9
13
|
* Retrieve a list of entities listed as being part of a certain area
|
|
10
14
|
* Tracks area updates at runtime
|
|
@@ -14,7 +18,7 @@ export declare function EntityManager({ logger, hass, config, lifecycle, event,
|
|
|
14
18
|
byArea: <AREA extends TAreaId, DOMAINS extends TRawDomains = TRawDomains>(area: AREA, ...domains: DOMAINS[]) => Extract<{
|
|
15
19
|
_living_room: "switch.living_room_mood_lights";
|
|
16
20
|
_kitchen: "switch.kitchen_cabinets";
|
|
17
|
-
_bedroom: "
|
|
21
|
+
_bedroom: "light.bedroom_ceiling_fan" | "switch.bedroom_lamp";
|
|
18
22
|
}[`_${AREA}`], PICK_ENTITY<DOMAINS>>[];
|
|
19
23
|
/**
|
|
20
24
|
* Retrieve a list of entities associated with a particular device id
|
|
@@ -37,8 +41,10 @@ export declare function EntityManager({ logger, hass, config, lifecycle, event,
|
|
|
37
41
|
/**
|
|
38
42
|
* Retrieves a proxy object for a specified entity. This proxy object
|
|
39
43
|
* provides current values and event hooks for the entity.
|
|
44
|
+
*
|
|
45
|
+
* @deprecated use `hass.refBy.id` - to be remove 2024-08
|
|
40
46
|
*/
|
|
41
|
-
byId: <ID extends
|
|
47
|
+
byId: <ID extends import("..").TRawEntityIds>(id: ID) => ByIdProxy<ID>;
|
|
42
48
|
/**
|
|
43
49
|
* Retrieve a list of entities that have a given label
|
|
44
50
|
*
|
|
@@ -53,45 +59,56 @@ export declare function EntityManager({ logger, hass, config, lifecycle, event,
|
|
|
53
59
|
*
|
|
54
60
|
* @deprecated use `hass.idBy.platform` - to be remove 2024-08
|
|
55
61
|
*/
|
|
56
|
-
byPlatform: <PLATFORM extends TPlatformId, DOMAINS_4 extends TRawDomains = TRawDomains>(platform: PLATFORM, ...domains: DOMAINS_4[]) =>
|
|
62
|
+
byPlatform: <PLATFORM extends TPlatformId, DOMAINS_4 extends TRawDomains = TRawDomains>(platform: PLATFORM, ...domains: DOMAINS_4[]) => Extract<{
|
|
63
|
+
_sun: "sensor.sun_next_dawn" | "sensor.sun_next_dusk" | "sensor.sun_next_midnight" | "sensor.sun_next_noon" | "sensor.sun_next_rising" | "sensor.sun_next_setting" | "sensor.sun_solar_elevation" | "sensor.sun_solar_azimuth" | "sensor.sun_solar_rising";
|
|
64
|
+
_person: "person.digital_alchemy";
|
|
65
|
+
_shopping_list: "todo.shopping_list";
|
|
66
|
+
_google_translate: "tts.google_en_com";
|
|
67
|
+
_synapse: "binary_sensor.hass_e2e_online" | "sensor.magic" | "binary_sensor.toggles" | "switch.bedroom_lamp" | "switch.kitchen_cabinets" | "switch.living_room_mood_lights" | "switch.porch_light";
|
|
68
|
+
_holiday: "calendar.united_states_tx";
|
|
69
|
+
}[`_${PLATFORM}`], PICK_ENTITY<DOMAINS_4>>[];
|
|
57
70
|
/**
|
|
58
71
|
* looks up entity_id reference by the unique id in the registry, and returns the entity reference
|
|
72
|
+
*
|
|
73
|
+
* @deprecated use `hass.idBy.unique_id` | `hass.refBy.unique_id`
|
|
59
74
|
*/
|
|
60
|
-
byUniqueId: <ID_1 extends
|
|
75
|
+
byUniqueId: <ID_1 extends import("..").TRawEntityIds>(unique_id: string) => ByIdProxy<ID_1>;
|
|
61
76
|
/**
|
|
62
77
|
* Internal library use only
|
|
63
78
|
*/
|
|
64
|
-
entityUpdateReceiver: <ENTITY extends
|
|
79
|
+
entityUpdateReceiver: <ENTITY extends import("..").TRawEntityIds = import("..").TRawEntityIds>(entity_id: ENTITY, new_state: ENTITY_STATE<ENTITY>, old_state: ENTITY_STATE<ENTITY>) => void;
|
|
65
80
|
/**
|
|
66
81
|
* Lists all entities within a specified domain. This is useful for
|
|
67
82
|
* domain-specific operations or queries.
|
|
83
|
+
*
|
|
84
|
+
* @deprecated use `hass.idBy.domain` | `hass.refBy.domain`
|
|
68
85
|
*/
|
|
69
|
-
findByDomain: <DOMAIN extends TRawDomains>(domain: DOMAIN) => ByIdProxy<PICK_ENTITY
|
|
86
|
+
findByDomain: <DOMAIN extends TRawDomains>(domain: DOMAIN) => ByIdProxy<PICK_ENTITY<DOMAIN>>[];
|
|
70
87
|
/**
|
|
71
88
|
* Retrieves the current state of a given entity. This method returns
|
|
72
89
|
* raw data, offering a direct view of the entity's state at a given moment.
|
|
73
90
|
*/
|
|
74
|
-
getCurrentState: <ENTITY_ID extends
|
|
91
|
+
getCurrentState: <ENTITY_ID extends import("..").TRawEntityIds>(entity_id: ENTITY_ID) => ENTITY_STATE<ENTITY_ID>;
|
|
75
92
|
/**
|
|
76
93
|
* Retrieves the historical state data of entities over a specified time
|
|
77
94
|
* period. Useful for analysis or tracking changes over time.
|
|
78
95
|
*/
|
|
79
|
-
history: <ENTITES extends
|
|
96
|
+
history: <ENTITES extends import("..").TRawEntityIds[]>(payload: Omit<EntityHistoryDTO<ENTITES>, "type">) => Promise<{
|
|
80
97
|
[k: string]: EntityHistoryResult[];
|
|
81
98
|
}>;
|
|
82
99
|
/**
|
|
83
100
|
* Provides a simple listing of all entity IDs. Useful for enumeration
|
|
84
101
|
* and quick reference to all available entities.
|
|
85
102
|
*/
|
|
86
|
-
listEntities: () => PICK_ENTITY[];
|
|
103
|
+
listEntities: <DOMAIN_1 extends TRawDomains = TRawDomains>(domain?: DOMAIN_1) => PICK_ENTITY<DOMAIN_1>[];
|
|
87
104
|
/**
|
|
88
105
|
* Returns the previous entity state (not a proxy)
|
|
89
106
|
*/
|
|
90
|
-
previousState: (entity_id:
|
|
107
|
+
previousState: (entity_id: ANY_ENTITY) => ENTITY_STATE<import("..").TRawEntityIds>;
|
|
91
108
|
/**
|
|
92
109
|
* Retrieve the raw entity data for this point in time
|
|
93
110
|
*/
|
|
94
|
-
raw: (entity_id:
|
|
111
|
+
raw: (entity_id: ANY_ENTITY) => ENTITY_STATE<"person.digital_alchemy"> | ENTITY_STATE<"zone.home"> | ENTITY_STATE<"sun.sun"> | ENTITY_STATE<PICK_ENTITY<"sensor">> | ENTITY_STATE<"light.bedroom_ceiling_fan"> | ENTITY_STATE<"scene.games_room_auto"> | ENTITY_STATE<"todo.shopping_list"> | ENTITY_STATE<"tts.google_en_com"> | ENTITY_STATE<PICK_ENTITY<"binary_sensor">> | ENTITY_STATE<PICK_ENTITY<"switch">> | ENTITY_STATE<"calendar.united_states_tx">;
|
|
95
112
|
/**
|
|
96
113
|
* Initiates a refresh of the current entity states. Useful for ensuring
|
|
97
114
|
* synchronization with the latest state data from Home Assistant.
|
|
@@ -102,15 +119,16 @@ export declare function EntityManager({ logger, hass, config, lifecycle, event,
|
|
|
102
119
|
*/
|
|
103
120
|
registry: {
|
|
104
121
|
addLabel: ({ entity, label }: EditLabelOptions) => Promise<void>;
|
|
105
|
-
current: EntityRegistryItem<
|
|
106
|
-
get: <ENTITY_1 extends
|
|
107
|
-
list: () => Promise<EntityRegistryItem<
|
|
108
|
-
registryList: () => Promise<EntityRegistryItem<
|
|
109
|
-
removeEntity: (entity_id:
|
|
122
|
+
current: EntityRegistryItem<import("..").TRawEntityIds>[];
|
|
123
|
+
get: <ENTITY_1 extends import("..").TRawEntityIds>(entity_id: ENTITY_1) => Promise<EntityRegistryItem<ENTITY_1>>;
|
|
124
|
+
list: () => Promise<EntityRegistryItem<import("..").TRawEntityIds>[]>;
|
|
125
|
+
registryList: () => Promise<EntityRegistryItem<import("..").TRawEntityIds>[]>;
|
|
126
|
+
removeEntity: (entity_id: ANY_ENTITY | ANY_ENTITY[]) => Promise<void>;
|
|
110
127
|
removeLabel: ({ entity, label }: EditLabelOptions) => Promise<void>;
|
|
111
|
-
source: () => Promise<Record<
|
|
128
|
+
source: () => Promise<Record<import("..").TRawEntityIds, {
|
|
112
129
|
domain: string;
|
|
113
130
|
}>>;
|
|
114
131
|
};
|
|
115
132
|
warnEarly: (method: string) => void;
|
|
116
133
|
};
|
|
134
|
+
export {};
|
|
@@ -62,7 +62,10 @@ function EntityManager({ logger, hass, config, lifecycle, event, context, intern
|
|
|
62
62
|
}));
|
|
63
63
|
}
|
|
64
64
|
// #MARK: listEntities
|
|
65
|
-
function listEntities() {
|
|
65
|
+
function listEntities(domain) {
|
|
66
|
+
if (domain) {
|
|
67
|
+
return Object.keys(MASTER_STATE[domain]).map(id => `${domain}.${id}`);
|
|
68
|
+
}
|
|
66
69
|
return Object.keys(MASTER_STATE).flatMap(domain => Object.keys(MASTER_STATE[domain]).map(id => `${domain}.${id}`));
|
|
67
70
|
}
|
|
68
71
|
// #MARK: findByDomain
|
|
@@ -210,16 +213,6 @@ function EntityManager({ logger, hass, config, lifecycle, event, context, intern
|
|
|
210
213
|
},
|
|
211
214
|
});
|
|
212
215
|
});
|
|
213
|
-
// #MARK: byUniqueId
|
|
214
|
-
function byUniqueId(unique_id) {
|
|
215
|
-
warnEarly("byUniqueId");
|
|
216
|
-
const entity = hass.entity.registry.current.find(i => i.unique_id === unique_id);
|
|
217
|
-
if (!entity) {
|
|
218
|
-
logger.error({ name: byUniqueId, unique_id }, `could not find an entity`);
|
|
219
|
-
return undefined;
|
|
220
|
-
}
|
|
221
|
-
return hass.entity.byId(entity.entity_id);
|
|
222
|
-
}
|
|
223
216
|
// #MARK: RemoveEntity
|
|
224
217
|
async function RemoveEntity(entity_id) {
|
|
225
218
|
warnEarly("RemoveEntity");
|
|
@@ -234,6 +227,7 @@ function EntityManager({ logger, hass, config, lifecycle, event, context, intern
|
|
|
234
227
|
// #MARK: return object
|
|
235
228
|
return {
|
|
236
229
|
_entityEvents: () => ENTITY_EVENTS,
|
|
230
|
+
_masterState: () => MASTER_STATE,
|
|
237
231
|
/**
|
|
238
232
|
* Retrieve a list of entities listed as being part of a certain area
|
|
239
233
|
* Tracks area updates at runtime
|
|
@@ -256,6 +250,8 @@ function EntityManager({ logger, hass, config, lifecycle, event, context, intern
|
|
|
256
250
|
/**
|
|
257
251
|
* Retrieves a proxy object for a specified entity. This proxy object
|
|
258
252
|
* provides current values and event hooks for the entity.
|
|
253
|
+
*
|
|
254
|
+
* @deprecated use `hass.refBy.id` - to be remove 2024-08
|
|
259
255
|
*/
|
|
260
256
|
byId: (id) => hass.refBy.id(id),
|
|
261
257
|
/**
|
|
@@ -272,8 +268,10 @@ function EntityManager({ logger, hass, config, lifecycle, event, context, intern
|
|
|
272
268
|
byPlatform: (platform, ...domains) => hass.idBy.platform(platform, ...domains),
|
|
273
269
|
/**
|
|
274
270
|
* looks up entity_id reference by the unique id in the registry, and returns the entity reference
|
|
271
|
+
*
|
|
272
|
+
* @deprecated use `hass.idBy.unique_id` | `hass.refBy.unique_id`
|
|
275
273
|
*/
|
|
276
|
-
byUniqueId,
|
|
274
|
+
byUniqueId: (unique_id) => hass.refBy.unique_id(unique_id),
|
|
277
275
|
/**
|
|
278
276
|
* Internal library use only
|
|
279
277
|
*/
|
|
@@ -281,6 +279,8 @@ function EntityManager({ logger, hass, config, lifecycle, event, context, intern
|
|
|
281
279
|
/**
|
|
282
280
|
* Lists all entities within a specified domain. This is useful for
|
|
283
281
|
* domain-specific operations or queries.
|
|
282
|
+
*
|
|
283
|
+
* @deprecated use `hass.idBy.domain` | `hass.refBy.domain`
|
|
284
284
|
*/
|
|
285
285
|
findByDomain,
|
|
286
286
|
/**
|