@digital-alchemy/hass 24.8.1 → 24.8.3
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 +5 -4
- package/dist/extensions/area.extension.js +1 -1
- package/dist/extensions/device.extension.js +1 -1
- package/dist/extensions/entity.extension.js +1 -1
- package/dist/extensions/floor.extension.js +1 -1
- package/dist/extensions/id-by.extension.js +14 -2
- package/dist/extensions/id-by.extension.js.map +1 -1
- package/dist/extensions/label.extension.js +1 -1
- package/dist/extensions/zone.extension.js +1 -1
- package/dist/hass.module.d.ts +1 -1
- package/dist/hass.module.js +2 -2
- package/dist/helpers/notify.helper.d.ts +76 -25
- package/dist/testing/area.spec.js +1 -1
- package/dist/testing/device.spec.js +1 -1
- package/dist/testing/entity.spec.js +2 -2
- package/dist/testing/floor.spec.js +1 -1
- package/dist/testing/id-by.spec.js +22 -3
- package/dist/testing/id-by.spec.js.map +1 -1
- package/dist/testing/label.spec.js +1 -1
- package/dist/testing/ref-by.spec.js +4 -4
- package/dist/testing/zone.spec.js +1 -1
- package/package.json +29 -5
package/dist/dynamic.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AndroidNotificationData, AppleNotificationData, NotificationData, PICK_ENTITY } from "./helpers";
|
|
2
2
|
type PICK_FROM_PLATFORM<ID extends TPlatformId, DOMAIN extends TRawDomains = TRawDomains> = Extract<REGISTRY_SETUP["platform"][`_${ID}`], PICK_ENTITY<DOMAIN>>;
|
|
3
3
|
export type ENTITY_SETUP = {
|
|
4
4
|
"button.example": {
|
|
@@ -2326,7 +2326,7 @@ export type iCallService = {
|
|
|
2326
2326
|
* > object: null
|
|
2327
2327
|
* > ```
|
|
2328
2328
|
*/
|
|
2329
|
-
data?:
|
|
2329
|
+
data?: NotificationData & (AndroidNotificationData | AppleNotificationData);
|
|
2330
2330
|
/**
|
|
2331
2331
|
* ## message
|
|
2332
2332
|
*
|
|
@@ -2395,7 +2395,7 @@ export type iCallService = {
|
|
|
2395
2395
|
* > object: null
|
|
2396
2396
|
* > ```
|
|
2397
2397
|
*/
|
|
2398
|
-
data?:
|
|
2398
|
+
data?: NotificationData & (AndroidNotificationData | AppleNotificationData);
|
|
2399
2399
|
/**
|
|
2400
2400
|
* ## Message
|
|
2401
2401
|
*
|
|
@@ -3700,6 +3700,7 @@ export type iCallService = {
|
|
|
3700
3700
|
};
|
|
3701
3701
|
export type REGISTRY_SETUP = {
|
|
3702
3702
|
area: {
|
|
3703
|
+
_test: "switch.living_room_mood_lights";
|
|
3703
3704
|
_living_room: "switch.living_room_mood_lights";
|
|
3704
3705
|
_kitchen: "switch.kitchen_cabinets";
|
|
3705
3706
|
_bedroom: "switch.bedroom_lamp" | "light.bedroom_ceiling_fan";
|
|
@@ -3725,7 +3726,7 @@ export type REGISTRY_SETUP = {
|
|
|
3725
3726
|
_e58841e47cf86097b310316e55d6bb12: "calendar.united_states_tx";
|
|
3726
3727
|
};
|
|
3727
3728
|
};
|
|
3728
|
-
export type TAreaId = "living_room" | "kitchen" | "bedroom";
|
|
3729
|
+
export type TAreaId = "living_room" | "kitchen" | "bedroom" | "test";
|
|
3729
3730
|
export type TDeviceId = "308e39cf50a9fc6c30b4110724ed1f2e" | "e58841e47cf86097b310316e55d6bb12";
|
|
3730
3731
|
export type TFloorId = "downstairs" | "upstairs";
|
|
3731
3732
|
export type TLabelId = "synapse" | "test";
|
|
@@ -19,7 +19,7 @@ function Area({ hass, context, config, logger, event, lifecycle, }) {
|
|
|
19
19
|
context,
|
|
20
20
|
event_type: "area_registry_updated",
|
|
21
21
|
async exec() {
|
|
22
|
-
await (0, core_1.
|
|
22
|
+
await (0, core_1.debounce)(helpers_1.AREA_REGISTRY_UPDATED, config.hass.EVENT_DEBOUNCE_MS);
|
|
23
23
|
hass.area.current = await hass.area.list();
|
|
24
24
|
logger.debug(`area registry updated`);
|
|
25
25
|
event.emit(helpers_1.AREA_REGISTRY_UPDATED);
|
|
@@ -20,7 +20,7 @@ function Device({ hass, config, context, logger, lifecycle, event, }) {
|
|
|
20
20
|
context,
|
|
21
21
|
event_type: "device_registry_updated",
|
|
22
22
|
async exec() {
|
|
23
|
-
await (0, core_1.
|
|
23
|
+
await (0, core_1.debounce)(helpers_1.DEVICE_REGISTRY_UPDATED, config.hass.EVENT_DEBOUNCE_MS);
|
|
24
24
|
hass.device.current = await hass.device.list();
|
|
25
25
|
logger.debug(`device registry updated`);
|
|
26
26
|
event.emit(helpers_1.DEVICE_REGISTRY_UPDATED);
|
|
@@ -200,7 +200,7 @@ function EntityManager({ logger, hass, config, lifecycle, event, context, intern
|
|
|
200
200
|
context,
|
|
201
201
|
event_type: "entity_registry_updated",
|
|
202
202
|
async exec() {
|
|
203
|
-
await (0, core_1.
|
|
203
|
+
await (0, core_1.debounce)(__1.ENTITY_REGISTRY_UPDATED, config.hass.EVENT_DEBOUNCE_MS);
|
|
204
204
|
logger.debug("entity registry updated");
|
|
205
205
|
hass.entity.registry.current = await hass.entity.registry.list();
|
|
206
206
|
event.emit(__1.ENTITY_REGISTRY_UPDATED);
|
|
@@ -19,7 +19,7 @@ function Floor({ hass, config, context, event, logger, lifecycle, }) {
|
|
|
19
19
|
context,
|
|
20
20
|
event_type: "floor_registry_updated",
|
|
21
21
|
async exec() {
|
|
22
|
-
await (0, core_1.
|
|
22
|
+
await (0, core_1.debounce)(helpers_1.FLOOR_REGISTRY_UPDATED, config.hass.EVENT_DEBOUNCE_MS);
|
|
23
23
|
hass.floor.current = await hass.floor.list();
|
|
24
24
|
logger.debug(`floor registry updated`);
|
|
25
25
|
event.emit(helpers_1.FLOOR_REGISTRY_UPDATED);
|
|
@@ -34,9 +34,21 @@ function IDByExtension({ hass, logger }) {
|
|
|
34
34
|
// * area
|
|
35
35
|
function area(area, ...domains) {
|
|
36
36
|
hass.entity.warnEarly("area");
|
|
37
|
-
|
|
37
|
+
// find entities are associated with the area directly
|
|
38
|
+
const fromEntity = hass.entity.registry.current
|
|
38
39
|
.filter(i => i.area_id === area)
|
|
39
|
-
.map(i => i.entity_id)
|
|
40
|
+
.map(i => i.entity_id);
|
|
41
|
+
// identify devices
|
|
42
|
+
const devices = new Set(hass.device.current
|
|
43
|
+
.filter(device => device.area_id === area)
|
|
44
|
+
.map(i => i.id));
|
|
45
|
+
// extract entities associated with device, that have not been assigned to a room
|
|
46
|
+
const fromDevice = hass.entity.registry.current
|
|
47
|
+
.filter(entity => devices.has(entity.device_id) && core_1.is.empty(entity.area_id))
|
|
48
|
+
.map(i => i.entity_id);
|
|
49
|
+
return process(
|
|
50
|
+
// merge lists
|
|
51
|
+
core_1.is.unique([...fromEntity, ...fromDevice]), domains);
|
|
40
52
|
}
|
|
41
53
|
// * device
|
|
42
54
|
function device(device, ...domains) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-by.extension.js","sourceRoot":"","sources":["../../src/extensions/id-by.extension.ts"],"names":[],"mappings":";;AAkCA,
|
|
1
|
+
{"version":3,"file":"id-by.extension.js","sourceRoot":"","sources":["../../src/extensions/id-by.extension.ts"],"names":[],"mappings":";;AAkCA,sCAiIC;AAnKD,gDAA2D;AAwB3D,MAAM,OAAO,GAAG,CACd,GAAU,EACV,OAAsB,EACtB,EAAE;IACF,IAAI,CAAC,SAAE,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACvB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,SAAE,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,SAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAkB;IAC5D,UAAU;IACV,SAAS,QAAQ,CAA6B,MAAc;QAC1D,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QAChD,OAAO,MAAM,CAAC,IAAI,CAA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EACZ,GAAG,OAAiB;QAEpB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC/B,MAAM,KAAK,GAAG,IAAI,GAAG,CACnB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CACxE,CAAC;QACF,OAAO,OAAO,CACZ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO;aACzB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;aACjC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAA2C,CAAC,EAC1D,OAAO,CACR,CAAC;IACJ,CAAC;IAED,aAAa;IACb,SAAS,QAAQ,CACf,QAAkB,EAClB,GAAG,OAAiB;QAEpB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAClC,OAAO,OAAO,CACZ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO;aACzB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;aACpC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAiD,CAAC,EAChE,OAAO,CACR,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI;QACJ,MAAM;QACN,MAAM,EAAE,QAAQ;QAChB,KAAK;QACL,KAAK;QACL,QAAQ;QACR,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -19,7 +19,7 @@ function Label({ hass, config, logger, lifecycle, event, context, }) {
|
|
|
19
19
|
context,
|
|
20
20
|
event_type: "label_registry_updated",
|
|
21
21
|
async exec() {
|
|
22
|
-
await (0, core_1.
|
|
22
|
+
await (0, core_1.debounce)(helpers_1.LABEL_REGISTRY_UPDATED, config.hass.EVENT_DEBOUNCE_MS);
|
|
23
23
|
hass.label.current = await hass.label.list();
|
|
24
24
|
logger.debug(`label registry updated`);
|
|
25
25
|
event.emit(helpers_1.LABEL_REGISTRY_UPDATED);
|
|
@@ -19,7 +19,7 @@ function Zone({ config, hass, event, logger, context, lifecycle, }) {
|
|
|
19
19
|
context,
|
|
20
20
|
event_type: "zone_registry_updated",
|
|
21
21
|
async exec() {
|
|
22
|
-
await (0, core_1.
|
|
22
|
+
await (0, core_1.debounce)(helpers_1.ZONE_REGISTRY_UPDATED, config.hass.EVENT_DEBOUNCE_MS);
|
|
23
23
|
hass.zone.current = await hass.zone.list();
|
|
24
24
|
logger.debug(`zone registry updated`);
|
|
25
25
|
event.emit(helpers_1.ZONE_REGISTRY_UPDATED);
|
package/dist/hass.module.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export declare const LIB_HASS: import("@digital-alchemy/core").LibraryDefinition
|
|
|
81
81
|
type: "string";
|
|
82
82
|
};
|
|
83
83
|
CALL_PROXY_ALLOW_REST: StringConfig<AllowRestOptions>;
|
|
84
|
-
|
|
84
|
+
EVENT_DEBOUNCE_MS: {
|
|
85
85
|
default: number;
|
|
86
86
|
description: string;
|
|
87
87
|
type: "number";
|
package/dist/hass.module.js
CHANGED
|
@@ -31,9 +31,9 @@ exports.LIB_HASS = (0, core_1.CreateLibrary)({
|
|
|
31
31
|
enum: ["prefer", "forbid", "allow"],
|
|
32
32
|
type: "string",
|
|
33
33
|
},
|
|
34
|
-
|
|
34
|
+
EVENT_DEBOUNCE_MS: {
|
|
35
35
|
default: 50,
|
|
36
|
-
description: "
|
|
36
|
+
description: "Debounce reactions to registry changes",
|
|
37
37
|
type: "number",
|
|
38
38
|
},
|
|
39
39
|
EXPECT_RESPONSE_AFTER: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type AppleNotificationPush = {
|
|
2
2
|
/**
|
|
3
3
|
* **iOS | MacOS**
|
|
4
4
|
*
|
|
@@ -28,7 +28,70 @@ export type AppleActionableNotificationPush = {
|
|
|
28
28
|
*/
|
|
29
29
|
presentation_options?: ["alert" | "badge" | "sound"];
|
|
30
30
|
};
|
|
31
|
-
export type
|
|
31
|
+
export type NotificationAction = {
|
|
32
|
+
/**
|
|
33
|
+
* Key passed back in events.
|
|
34
|
+
* When set to `REPLY`, you will be prompted for text to send with the event.
|
|
35
|
+
*/
|
|
36
|
+
action: "REPLY" | "URI" | string;
|
|
37
|
+
/**
|
|
38
|
+
* Shown on the action button to the user.
|
|
39
|
+
*/
|
|
40
|
+
title: string;
|
|
41
|
+
/**
|
|
42
|
+
* The URI to open when selected.
|
|
43
|
+
* Android requires setting the action string to `URI` to use this key. [More Info](https://companion.home-assistant.io/docs/notifications/actionable-notifications/#uri-values).
|
|
44
|
+
*/
|
|
45
|
+
uri?: string;
|
|
46
|
+
};
|
|
47
|
+
export type AndroidNotificationActionOptions = {};
|
|
48
|
+
export type AppleNotificationActionOptions = {
|
|
49
|
+
/**
|
|
50
|
+
* **iOS | MacOS**
|
|
51
|
+
*
|
|
52
|
+
* Set to `foreground` to launch the app when tapped. Defaults to background which just fires the event.
|
|
53
|
+
* This is automatically set to foreground when providing a uri.
|
|
54
|
+
*/
|
|
55
|
+
activationMode?: "foreground" | "background";
|
|
56
|
+
/**
|
|
57
|
+
* **iOS | MacOS**
|
|
58
|
+
*
|
|
59
|
+
* Set to `true` to require a password to fire the event.
|
|
60
|
+
*/
|
|
61
|
+
authenticationRequired?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* **iOS | MacOS**
|
|
64
|
+
*
|
|
65
|
+
* Set to `true` to color the actions title red.
|
|
66
|
+
*/
|
|
67
|
+
destructive?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* **iOS | MacOS**
|
|
70
|
+
*
|
|
71
|
+
* Set to `textInput` to prompt for text to return with the event. This also occurs when setting the action to `REPLY`.
|
|
72
|
+
*/
|
|
73
|
+
behavior?: "textInput";
|
|
74
|
+
/**
|
|
75
|
+
* **iOS | MacOS**
|
|
76
|
+
*
|
|
77
|
+
* Title to use for text input for actions that prompt.
|
|
78
|
+
*/
|
|
79
|
+
textInputButtonTitle?: string;
|
|
80
|
+
/**
|
|
81
|
+
* **iOS | MacOS**
|
|
82
|
+
*
|
|
83
|
+
* Placeholder to use for text input for actions that prompt.
|
|
84
|
+
*/
|
|
85
|
+
textInputPlaceholder?: string;
|
|
86
|
+
/**
|
|
87
|
+
* **iOS | MacOS**
|
|
88
|
+
*
|
|
89
|
+
* The icon to use for the notification.
|
|
90
|
+
* * [More info](https://companion.home-assistant.io/docs/notifications/actionable-notifications#icon-values)
|
|
91
|
+
*/
|
|
92
|
+
icon?: string;
|
|
93
|
+
};
|
|
94
|
+
export type AppleNotificationData = {
|
|
32
95
|
/**
|
|
33
96
|
* **iOS | MacOS**
|
|
34
97
|
*
|
|
@@ -43,9 +106,13 @@ export type AppleActionableNotification = {
|
|
|
43
106
|
* [More info](https://companion.home-assistant.io/docs/notifications/notifications-basic#subtitle--subject)
|
|
44
107
|
*/
|
|
45
108
|
subtitle?: string;
|
|
46
|
-
push?:
|
|
109
|
+
push?: AppleNotificationPush;
|
|
110
|
+
/**
|
|
111
|
+
* iOS Supports ~10 actions.
|
|
112
|
+
*/
|
|
113
|
+
actions: Array<NotificationAction & AppleNotificationActionOptions>;
|
|
47
114
|
};
|
|
48
|
-
export type
|
|
115
|
+
export type AndroidNotificationData = {
|
|
49
116
|
/**
|
|
50
117
|
* **Android**
|
|
51
118
|
*
|
|
@@ -179,28 +246,12 @@ export type AndroidActionableNotification = {
|
|
|
179
246
|
* [More info](https://companion.home-assistant.io/docs/notifications/notifications-basic#android-auto-visibility)
|
|
180
247
|
*/
|
|
181
248
|
car_ui?: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Android Supports 3 actions.
|
|
251
|
+
*/
|
|
252
|
+
actions: Array<NotificationAction & AndroidNotificationActionOptions>;
|
|
182
253
|
};
|
|
183
|
-
export type
|
|
184
|
-
/**
|
|
185
|
-
* Android allows 3 actions.
|
|
186
|
-
* iOS allows around 10 actions.
|
|
187
|
-
*/
|
|
188
|
-
actions?: {
|
|
189
|
-
/**
|
|
190
|
-
* Key passed back in events.
|
|
191
|
-
* When set to `REPLY`, you will be prompted for text to send with the event.
|
|
192
|
-
*/
|
|
193
|
-
action: "REPLY" | "URI" | string;
|
|
194
|
-
/**
|
|
195
|
-
* Shown on the action button to the user.
|
|
196
|
-
*/
|
|
197
|
-
title: string;
|
|
198
|
-
/**
|
|
199
|
-
* The URI to open when selected.
|
|
200
|
-
* Android requires setting the action string to `URI` to use this key. [More Info](https://companion.home-assistant.io/docs/notifications/actionable-notifications/#uri-values).
|
|
201
|
-
*/
|
|
202
|
-
uri?: string;
|
|
203
|
-
}[];
|
|
254
|
+
export type NotificationData = {
|
|
204
255
|
/**
|
|
205
256
|
* The group to which the notification belongs.
|
|
206
257
|
* [More info](https://companion.home-assistant.io/docs/notifications/notifications-basic#grouping)
|
|
@@ -88,7 +88,7 @@ describe("Area", () => {
|
|
|
88
88
|
},
|
|
89
89
|
}));
|
|
90
90
|
});
|
|
91
|
-
it("should
|
|
91
|
+
it("should debounce updates properly", async () => {
|
|
92
92
|
expect.assertions(1);
|
|
93
93
|
application = (0, mock_assistant_1.CreateTestingApplication)({
|
|
94
94
|
Test({ lifecycle, hass }) {
|
|
@@ -52,7 +52,7 @@ describe("Device", () => {
|
|
|
52
52
|
}));
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
|
-
it("should
|
|
55
|
+
it("should debounce updates properly", async () => {
|
|
56
56
|
expect.assertions(1);
|
|
57
57
|
application = (0, utils_1.CreateTestingApplication)({
|
|
58
58
|
Test({ lifecycle, hass }) {
|
|
@@ -13,7 +13,7 @@ describe("Entity", () => {
|
|
|
13
13
|
});
|
|
14
14
|
describe("API", () => {
|
|
15
15
|
describe("Updates", () => {
|
|
16
|
-
it("should
|
|
16
|
+
it("should debounce updates properly", async () => {
|
|
17
17
|
expect.assertions(1);
|
|
18
18
|
application = (0, mock_assistant_1.CreateTestingApplication)({
|
|
19
19
|
Test({ lifecycle, hass }) {
|
|
@@ -41,7 +41,7 @@ describe("Entity", () => {
|
|
|
41
41
|
hass: {
|
|
42
42
|
AUTO_CONNECT_SOCKET: false,
|
|
43
43
|
AUTO_SCAN_CALL_PROXY: false,
|
|
44
|
-
|
|
44
|
+
EVENT_DEBOUNCE_MS: 10,
|
|
45
45
|
},
|
|
46
46
|
}));
|
|
47
47
|
});
|
|
@@ -164,7 +164,7 @@ describe("Floor", () => {
|
|
|
164
164
|
},
|
|
165
165
|
}));
|
|
166
166
|
});
|
|
167
|
-
it("should
|
|
167
|
+
it("should debounce updates properly", async () => {
|
|
168
168
|
expect.assertions(1);
|
|
169
169
|
application = (0, utils_1.CreateTestingApplication)({
|
|
170
170
|
Test({ lifecycle, hass }) {
|
|
@@ -18,13 +18,32 @@ describe("ID By", () => {
|
|
|
18
18
|
lifecycle.onReady(() => {
|
|
19
19
|
const bedroom = hass.idBy.area("bedroom");
|
|
20
20
|
const kitchen = hass.idBy.area("kitchen");
|
|
21
|
-
expect(bedroom.length).toBe(
|
|
21
|
+
expect(bedroom.length).toBe(2);
|
|
22
22
|
expect(kitchen.length).toBe(1);
|
|
23
23
|
});
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
26
|
await application.bootstrap((0, mock_assistant_1.SILENT_BOOT)({ hass: { MOCK_SOCKET: true } }, true));
|
|
27
27
|
});
|
|
28
|
+
it("finds entities only related by device", async () => {
|
|
29
|
+
expect.assertions(1);
|
|
30
|
+
application = (0, mock_assistant_1.CreateTestingApplication)({
|
|
31
|
+
Test({ lifecycle, hass }) {
|
|
32
|
+
lifecycle.onReady(() => {
|
|
33
|
+
// merges 1 from direct area, 2 via device
|
|
34
|
+
// ignores 2 from the device assigned to another area
|
|
35
|
+
const list = hass.idBy.area("test");
|
|
36
|
+
const expected = [
|
|
37
|
+
"sensor.sun_next_dusk",
|
|
38
|
+
"climate.hallway_thermostat",
|
|
39
|
+
"binary_sensor.garage_door",
|
|
40
|
+
];
|
|
41
|
+
expect(expected.every(expected => list.includes(expected))).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
await application.bootstrap((0, mock_assistant_1.SILENT_BOOT)({ hass: { MOCK_SOCKET: true } }, true));
|
|
46
|
+
});
|
|
28
47
|
it("find entities by area limiting by domain", async () => {
|
|
29
48
|
expect.assertions(2);
|
|
30
49
|
application = (0, mock_assistant_1.CreateTestingApplication)({
|
|
@@ -32,7 +51,7 @@ describe("ID By", () => {
|
|
|
32
51
|
lifecycle.onReady(() => {
|
|
33
52
|
const bedroom = hass.idBy.area("bedroom", "light");
|
|
34
53
|
const kitchen = hass.idBy.area("kitchen", "light");
|
|
35
|
-
expect(bedroom.length).toBe(
|
|
54
|
+
expect(bedroom.length).toBe(1);
|
|
36
55
|
expect(kitchen.length).toBe(0);
|
|
37
56
|
});
|
|
38
57
|
},
|
|
@@ -125,7 +144,7 @@ describe("ID By", () => {
|
|
|
125
144
|
Test({ lifecycle, hass }) {
|
|
126
145
|
lifecycle.onReady(() => {
|
|
127
146
|
const synapse = hass.idBy.floor("downstairs");
|
|
128
|
-
expect(synapse.length).toBe(
|
|
147
|
+
expect(synapse.length).toBe(3);
|
|
129
148
|
});
|
|
130
149
|
},
|
|
131
150
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id-by.spec.js","sourceRoot":"","sources":["../../src/testing/id-by.spec.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"id-by.spec.js","sourceRoot":"","sources":["../../src/testing/id-by.spec.ts"],"names":[],"mappings":";;AAQA,sDAA0E;AAE1E,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,IAAI,WAGH,CAAC;IAEF,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,WAAW,EAAE,C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AC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;wBACvD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;oBACjC,CAAC,CAAC,CAAC;gBACL,CAAC;aACF,CAAC,CAAC;YACH,MAAM,WAAW,CAAC,SAAS,CACzB,IAAA,4BAAW,EAAC,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CACnD,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -164,7 +164,7 @@ describe("Label", () => {
|
|
|
164
164
|
},
|
|
165
165
|
}));
|
|
166
166
|
});
|
|
167
|
-
it("should
|
|
167
|
+
it("should debounce updates properly", async () => {
|
|
168
168
|
expect.assertions(1);
|
|
169
169
|
application = (0, utils_1.CreateTestingApplication)({
|
|
170
170
|
Test({ lifecycle, hass }) {
|
|
@@ -94,7 +94,7 @@ describe("ID By", () => {
|
|
|
94
94
|
Test({ lifecycle, hass }) {
|
|
95
95
|
lifecycle.onReady(() => {
|
|
96
96
|
const sensor = hass.refBy.domain("sensor");
|
|
97
|
-
expect(sensor.length).toBe(
|
|
97
|
+
expect(sensor.length).toBe(8);
|
|
98
98
|
});
|
|
99
99
|
},
|
|
100
100
|
});
|
|
@@ -149,7 +149,7 @@ describe("ID By", () => {
|
|
|
149
149
|
lifecycle.onReady(() => {
|
|
150
150
|
const bedroom = hass.refBy.area("bedroom");
|
|
151
151
|
const kitchen = hass.refBy.area("kitchen");
|
|
152
|
-
expect(bedroom.length).toBe(
|
|
152
|
+
expect(bedroom.length).toBe(2);
|
|
153
153
|
expect(kitchen.length).toBe(1);
|
|
154
154
|
});
|
|
155
155
|
},
|
|
@@ -163,7 +163,7 @@ describe("ID By", () => {
|
|
|
163
163
|
lifecycle.onReady(() => {
|
|
164
164
|
const bedroom = hass.refBy.area("bedroom", "light");
|
|
165
165
|
const kitchen = hass.refBy.area("kitchen", "light");
|
|
166
|
-
expect(bedroom.length).toBe(
|
|
166
|
+
expect(bedroom.length).toBe(1);
|
|
167
167
|
expect(kitchen.length).toBe(0);
|
|
168
168
|
});
|
|
169
169
|
},
|
|
@@ -230,7 +230,7 @@ describe("ID By", () => {
|
|
|
230
230
|
Test({ lifecycle, hass }) {
|
|
231
231
|
lifecycle.onReady(() => {
|
|
232
232
|
const synapse = hass.refBy.floor("downstairs");
|
|
233
|
-
expect(synapse.length).toBe(
|
|
233
|
+
expect(synapse.length).toBe(3);
|
|
234
234
|
});
|
|
235
235
|
},
|
|
236
236
|
});
|
|
@@ -89,7 +89,7 @@ describe("Zone", () => {
|
|
|
89
89
|
});
|
|
90
90
|
});
|
|
91
91
|
describe("Order of operations", () => {
|
|
92
|
-
it("should
|
|
92
|
+
it("should debounce updates properly", async () => {
|
|
93
93
|
expect.assertions(1);
|
|
94
94
|
application = (0, mock_assistant_1.CreateTestingApplication)({
|
|
95
95
|
Test({ lifecycle, hass }) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"name": "@digital-alchemy/hass",
|
|
3
3
|
"repository": "https://github.com/Digital-Alchemy-TS/hass",
|
|
4
4
|
"homepage": "https://docs.digital-alchemy.app",
|
|
5
|
-
"version": "24.8.
|
|
5
|
+
"version": "24.8.3",
|
|
6
|
+
"description": "Typescript APIs for Home Assistant. Includes rest & websocket bindings",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"build": "rm -rf dist/; tsc",
|
|
8
9
|
"lint": "eslint src",
|
|
@@ -10,9 +11,32 @@
|
|
|
10
11
|
"prepublishOnly": "yarn build",
|
|
11
12
|
"upgrade": "ncu -f '@digital-alchemy/*' -u; yarn"
|
|
12
13
|
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"email": "bugs@digital-alchemy.app",
|
|
16
|
+
"url": "https://github.com/Digital-Alchemy-TS/hass/issues/new/choose"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"nodejs",
|
|
20
|
+
"home-automation",
|
|
21
|
+
"automation",
|
|
22
|
+
"typescript",
|
|
23
|
+
"websocket",
|
|
24
|
+
"home-assistant",
|
|
25
|
+
"digital-alchemy"
|
|
26
|
+
],
|
|
13
27
|
"bin": {
|
|
14
28
|
"mock-assistant": "./dist/mock_assistant/main.js"
|
|
15
29
|
},
|
|
30
|
+
"funding": [
|
|
31
|
+
{
|
|
32
|
+
"url": "https://github.com/sponsors/zoe-codez",
|
|
33
|
+
"type": "GitHub"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"url": "https://ko-fi.com/zoe_codez",
|
|
37
|
+
"type": "ko-fi"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
16
40
|
"author": {
|
|
17
41
|
"url": "https://github.com/zoe-codez",
|
|
18
42
|
"name": "Zoe Codez"
|
|
@@ -37,9 +61,9 @@
|
|
|
37
61
|
"license": "MIT",
|
|
38
62
|
"devDependencies": {
|
|
39
63
|
"@cspell/eslint-plugin": "^8.8.4",
|
|
40
|
-
"@digital-alchemy/core": "^24.
|
|
41
|
-
"@digital-alchemy/synapse": "^24.
|
|
42
|
-
"@digital-alchemy/type-writer": "^24.
|
|
64
|
+
"@digital-alchemy/core": "^24.8.4",
|
|
65
|
+
"@digital-alchemy/synapse": "^24.8.2",
|
|
66
|
+
"@digital-alchemy/type-writer": "^24.8.1",
|
|
43
67
|
"@types/figlet": "^1.5.8",
|
|
44
68
|
"@types/jest": "^29.5.12",
|
|
45
69
|
"@types/js-yaml": "^4.0.9",
|
|
@@ -101,5 +125,5 @@
|
|
|
101
125
|
]
|
|
102
126
|
}
|
|
103
127
|
},
|
|
104
|
-
"packageManager": "yarn@4.
|
|
128
|
+
"packageManager": "yarn@4.4.0"
|
|
105
129
|
}
|