@camstack/types 1.2.295 → 1.2.297
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/addon.js +2 -1
- package/dist/addon.mjs +2 -1
- package/dist/capabilities/calendar-source.cap.d.ts +75 -0
- package/dist/capabilities/calendars.cap.d.ts +68 -0
- package/dist/capabilities/index.d.ts +8 -2
- package/dist/capabilities/notification-rules.cap.d.ts +241 -1
- package/dist/generated/addon-api.d.ts +52 -0
- package/dist/generated/capability-router-map.d.ts +10 -4
- package/dist/generated/collection-array-methods.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +2 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +321 -14
- package/dist/index.mjs +300 -15
- package/dist/notification/alarm-controllable.d.ts +33 -0
- package/dist/notification/alarm-membership.d.ts +8 -1
- package/dist/notification/alarm-settings.d.ts +27 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21312,19 +21312,52 @@ var NcAlarmNonBlockingEditSchema = zod.z.object({
|
|
|
21312
21312
|
nonBlocking: zod.z.boolean()
|
|
21313
21313
|
});
|
|
21314
21314
|
/**
|
|
21315
|
-
*
|
|
21316
|
-
*
|
|
21315
|
+
* Controllable openings: opt IN to blocking (default is do not block). Contacts
|
|
21316
|
+
* keep using {@link NcAlarmNonBlockingEditSchema}.
|
|
21317
|
+
*/
|
|
21318
|
+
var NcAlarmBlockingEditSchema = zod.z.object({
|
|
21319
|
+
mode: AlarmArmModeSchema,
|
|
21320
|
+
deviceId: zod.z.number().int().positive(),
|
|
21321
|
+
/** true = on the list (blocks when open); false = off the list (default). */
|
|
21322
|
+
blocking: zod.z.boolean()
|
|
21323
|
+
});
|
|
21324
|
+
/**
|
|
21325
|
+
* Controllable openings: opt OUT of secure-on-arm (default is secure ON —
|
|
21326
|
+
* close / lock / turn off when this mode arms).
|
|
21317
21327
|
*/
|
|
21318
|
-
var
|
|
21328
|
+
var NcAlarmSecureOnArmEditSchema = zod.z.object({
|
|
21329
|
+
mode: AlarmArmModeSchema,
|
|
21330
|
+
deviceId: zod.z.number().int().positive(),
|
|
21331
|
+
/** true = secure on arm (default); false = do not actuate on arm. */
|
|
21332
|
+
secureOnArm: zod.z.boolean()
|
|
21333
|
+
});
|
|
21334
|
+
/**
|
|
21335
|
+
* One arm mode's device-id list (non-blocking, blocking, or secure-on-arm-off).
|
|
21336
|
+
*/
|
|
21337
|
+
var NcAlarmModeDeviceListSchema = zod.z.object({
|
|
21319
21338
|
mode: AlarmArmModeSchema,
|
|
21320
21339
|
deviceIds: zod.z.array(zod.z.number().int()).max(200)
|
|
21321
21340
|
});
|
|
21322
21341
|
/**
|
|
21342
|
+
* One arm mode's non-blocking list: devices that may be open when that mode
|
|
21343
|
+
* arms, without the arm being refused.
|
|
21344
|
+
*/
|
|
21345
|
+
var NcAlarmNonBlockingSchema = NcAlarmModeDeviceListSchema;
|
|
21346
|
+
/** Controllable devices that DO block when open (opt-in; default empty). */
|
|
21347
|
+
var NcAlarmBlockingSchema = NcAlarmModeDeviceListSchema;
|
|
21348
|
+
/**
|
|
21349
|
+
* Controllable devices that do NOT secure on arm (opt-out; default empty =
|
|
21350
|
+
* every controllable secures).
|
|
21351
|
+
*/
|
|
21352
|
+
var NcAlarmSecureOnArmOffSchema = NcAlarmModeDeviceListSchema;
|
|
21353
|
+
/**
|
|
21323
21354
|
* The per-mode lists, at most one per mode. Two lists for one mode have no
|
|
21324
21355
|
* meaning a reader could agree on (union? the last one?), so they are refused
|
|
21325
21356
|
* at the boundary rather than interpreted.
|
|
21326
21357
|
*/
|
|
21327
21358
|
var NcAlarmNonBlockingListSchema = zod.z.array(NcAlarmNonBlockingSchema).max(8).refine(uniqueModes, { message: "nonBlocking: at most one list per arm mode" });
|
|
21359
|
+
var NcAlarmBlockingListSchema = zod.z.array(NcAlarmBlockingSchema).max(8).refine(uniqueModes, { message: "blocking: at most one list per arm mode" });
|
|
21360
|
+
var NcAlarmSecureOnArmOffListSchema = zod.z.array(NcAlarmSecureOnArmOffSchema).max(8).refine(uniqueModes, { message: "secureOnArmOff: at most one list per arm mode" });
|
|
21328
21361
|
/**
|
|
21329
21362
|
* The three durations — global, and per mode since D697 — the panel's state
|
|
21330
21363
|
* machine runs on, who hears about its transitions, and which openings each mode tolerates.
|
|
@@ -21367,9 +21400,23 @@ var NcAlarmSettingsSchema = zod.z.object({
|
|
|
21367
21400
|
* arm (a window left ajar for the cat under `home`, say). At most one entry
|
|
21368
21401
|
* per mode is meaningful. Defaulted to `[]` so a blob stored before D630
|
|
21369
21402
|
* parses as "every opening blocks" — the behaviour it was written under.
|
|
21403
|
+
* Contacts use this list; controllable openings use {@link blocking} instead
|
|
21404
|
+
* (default: do not block).
|
|
21370
21405
|
*/
|
|
21371
21406
|
nonBlocking: NcAlarmNonBlockingListSchema.default([]),
|
|
21372
21407
|
/**
|
|
21408
|
+
* Per arm mode, controllable openings that DO refuse the arm when open.
|
|
21409
|
+
* Default `[]` = none block (secure-on-arm closes them instead). Absent on a
|
|
21410
|
+
* blob older than this field — read as empty.
|
|
21411
|
+
*/
|
|
21412
|
+
blocking: NcAlarmBlockingListSchema.default([]),
|
|
21413
|
+
/**
|
|
21414
|
+
* Per arm mode, controllable openings that must NOT be actuated on arm.
|
|
21415
|
+
* Default `[]` = every controllable secures (close / lock / off). Absent on
|
|
21416
|
+
* an older blob — read as empty (secure ON).
|
|
21417
|
+
*/
|
|
21418
|
+
secureOnArmOff: NcAlarmSecureOnArmOffListSchema.default([]),
|
|
21419
|
+
/**
|
|
21373
21420
|
* Per arm mode, the delays that mode OVERRIDES (D697). A mode with no entry, or an entry
|
|
21374
21421
|
* without a field, uses the global value above — so `[]`, the default, is exactly the
|
|
21375
21422
|
* behaviour of a blob stored before this field existed. Read through `resolveModeDelays`.
|
|
@@ -21379,7 +21426,7 @@ var NcAlarmSettingsSchema = zod.z.object({
|
|
|
21379
21426
|
/**
|
|
21380
21427
|
* Every field optional — a tab edits one control at a time.
|
|
21381
21428
|
*
|
|
21382
|
-
*
|
|
21429
|
+
* List fields and `modeDelays` are re-declared WITHOUT their defaults:
|
|
21383
21430
|
* `.partial()` does not remove an inner `.default()`, so a patch that never
|
|
21384
21431
|
* named the field would parse to `[]` and wipe every mode's list on an
|
|
21385
21432
|
* unrelated edit (the same trap {@link NcRulePatchSchema} documents). Here
|
|
@@ -21387,11 +21434,15 @@ var NcAlarmSettingsSchema = zod.z.object({
|
|
|
21387
21434
|
*/
|
|
21388
21435
|
var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.extend({
|
|
21389
21436
|
nonBlocking: NcAlarmNonBlockingListSchema,
|
|
21437
|
+
blocking: NcAlarmBlockingListSchema,
|
|
21438
|
+
secureOnArmOff: NcAlarmSecureOnArmOffListSchema,
|
|
21390
21439
|
/** Per-mode, per-field edits — NOT the whole list (see NcAlarmModeDelaysEditSchema). */
|
|
21391
21440
|
modeDelays: NcAlarmModeDelaysEditListSchema,
|
|
21392
21441
|
/** ONE membership change; the panel applies it to the list it holds at its turn. */
|
|
21393
|
-
nonBlockingEdit: NcAlarmNonBlockingEditSchema
|
|
21394
|
-
|
|
21442
|
+
nonBlockingEdit: NcAlarmNonBlockingEditSchema,
|
|
21443
|
+
blockingEdit: NcAlarmBlockingEditSchema,
|
|
21444
|
+
secureOnArmEdit: NcAlarmSecureOnArmEditSchema
|
|
21445
|
+
}).partial().refine((p) => p.nonBlocking === void 0 || p.nonBlockingEdit === void 0, { message: "nonBlocking and nonBlockingEdit are exclusive — send the whole lists or one edit" }).refine((p) => p.blocking === void 0 || p.blockingEdit === void 0, { message: "blocking and blockingEdit are exclusive — send the whole lists or one edit" }).refine((p) => p.secureOnArmOff === void 0 || p.secureOnArmEdit === void 0, { message: "secureOnArmOff and secureOnArmEdit are exclusive — send the whole lists or one edit" });
|
|
21395
21446
|
/**
|
|
21396
21447
|
* What one arm mode actually arms, DERIVED from the enabled rules gated on it.
|
|
21397
21448
|
* Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
|
|
@@ -21508,7 +21559,13 @@ var NcAlarmSensorStateSchema = zod.z.object({
|
|
|
21508
21559
|
/** Why `unknown`: the read failed, or the slice holds no word its cap defines (a placeholder included). */
|
|
21509
21560
|
unknownWhy: zod.z.enum(["read-failed", "unknown-word"]).nullable(),
|
|
21510
21561
|
/** The device manager's liveness as the centre mirrors it; null = not known. */
|
|
21511
|
-
online: zod.z.boolean().nullable()
|
|
21562
|
+
online: zod.z.boolean().nullable(),
|
|
21563
|
+
/**
|
|
21564
|
+
* True when the opening is a cover / lock / switch — the table shows the
|
|
21565
|
+
* Secure-on-arm switch and uses the controllable defaults. False for contacts
|
|
21566
|
+
* and for non-openings. Defaulted so an older hub answer still parses.
|
|
21567
|
+
*/
|
|
21568
|
+
controllable: zod.z.boolean().default(false)
|
|
21512
21569
|
});
|
|
21513
21570
|
var NcAlarmSensorsInputSchema = zod.z.object({ deviceIds: zod.z.array(zod.z.number().int().positive()).max(500) });
|
|
21514
21571
|
var NcAlarmSensorsSchema = zod.z.object({
|
|
@@ -33600,6 +33657,87 @@ var buttonCapability = {
|
|
|
33600
33657
|
}) }
|
|
33601
33658
|
};
|
|
33602
33659
|
//#endregion
|
|
33660
|
+
//#region src/capabilities/calendar-source.cap.ts
|
|
33661
|
+
/**
|
|
33662
|
+
* `calendar-source` — collection cap exposing per-provider calendars and
|
|
33663
|
+
* their events. Every addon that contributes calendars (Home Assistant,
|
|
33664
|
+
* a future Google Calendar addon, …) registers a provider here. The hub
|
|
33665
|
+
* singleton `calendars` walks the collection and merges the answers.
|
|
33666
|
+
*
|
|
33667
|
+
* Mirrors `addon-pages-source`: the public listing is a different shape
|
|
33668
|
+
* (source-stamped ids) and lives on the aggregator.
|
|
33669
|
+
*/
|
|
33670
|
+
var CalendarSourceKindSchema = zod.z.enum(["ha", "addon"]);
|
|
33671
|
+
var CalendarInfoSchema = zod.z.object({
|
|
33672
|
+
/** Provider-local id (e.g. HA `calendar.family`). The aggregator prefixes. */
|
|
33673
|
+
id: zod.z.string().min(1),
|
|
33674
|
+
name: zod.z.string().min(1),
|
|
33675
|
+
source: CalendarSourceKindSchema,
|
|
33676
|
+
enabled: zod.z.boolean()
|
|
33677
|
+
});
|
|
33678
|
+
var CalendarEventSchema = zod.z.object({
|
|
33679
|
+
id: zod.z.string().min(1),
|
|
33680
|
+
calendarId: zod.z.string().min(1),
|
|
33681
|
+
title: zod.z.string(),
|
|
33682
|
+
startMs: zod.z.number().int(),
|
|
33683
|
+
endMs: zod.z.number().int(),
|
|
33684
|
+
allDay: zod.z.boolean().optional(),
|
|
33685
|
+
description: zod.z.string().optional(),
|
|
33686
|
+
location: zod.z.string().optional()
|
|
33687
|
+
});
|
|
33688
|
+
var CalendarListEventsInputSchema = zod.z.object({
|
|
33689
|
+
calendarIds: zod.z.array(zod.z.string().min(1)).max(64).optional(),
|
|
33690
|
+
startMs: zod.z.number().int(),
|
|
33691
|
+
endMs: zod.z.number().int()
|
|
33692
|
+
});
|
|
33693
|
+
var calendarSourceCapability = {
|
|
33694
|
+
name: "calendar-source",
|
|
33695
|
+
scope: "system",
|
|
33696
|
+
mode: "collection",
|
|
33697
|
+
internal: true,
|
|
33698
|
+
methods: {
|
|
33699
|
+
listCalendars: require_sleep.method(zod.z.void(), zod.z.array(CalendarInfoSchema).readonly(), { auth: "admin" }),
|
|
33700
|
+
listEvents: require_sleep.method(CalendarListEventsInputSchema, zod.z.array(CalendarEventSchema).readonly(), { auth: "admin" })
|
|
33701
|
+
}
|
|
33702
|
+
};
|
|
33703
|
+
//#endregion
|
|
33704
|
+
//#region src/capabilities/calendars.cap.ts
|
|
33705
|
+
/**
|
|
33706
|
+
* `calendars` — system-scoped singleton. Public surface admin-ui and the
|
|
33707
|
+
* notification-center calendar-events producer consume.
|
|
33708
|
+
*
|
|
33709
|
+
* Walks every `calendar-source` provider, stamps each calendar with a
|
|
33710
|
+
* cluster-stable id (`<sourceAddonId>:<localId>`) and the providing
|
|
33711
|
+
* addon's id, and fans `listEvents` out the same way. Home Assistant
|
|
33712
|
+
* import is a built-in refresh of the HA source rather than a second
|
|
33713
|
+
* registry — `importFromHomeAssistant` asks that source to re-discover.
|
|
33714
|
+
*/
|
|
33715
|
+
var CalendarEntrySchema = CalendarInfoSchema.extend({
|
|
33716
|
+
/** Cluster-stable id: `<providerAddonId>:<localId>`. */
|
|
33717
|
+
id: zod.z.string().min(1),
|
|
33718
|
+
/** The addon that registered the calendar-source provider. */
|
|
33719
|
+
providerAddonId: zod.z.string().min(1).optional()
|
|
33720
|
+
});
|
|
33721
|
+
var CalendarImportResultSchema = zod.z.object({
|
|
33722
|
+
imported: zod.z.number().int().nonnegative(),
|
|
33723
|
+
/** Absent when no HA calendar-source provider was reachable. */
|
|
33724
|
+
providerAddonId: zod.z.string().min(1).optional(),
|
|
33725
|
+
error: zod.z.string().optional()
|
|
33726
|
+
});
|
|
33727
|
+
var calendarsCapability = {
|
|
33728
|
+
name: "calendars",
|
|
33729
|
+
scope: "system",
|
|
33730
|
+
mode: "singleton",
|
|
33731
|
+
methods: {
|
|
33732
|
+
listCalendars: require_sleep.method(zod.z.void(), zod.z.array(CalendarEntrySchema).readonly(), { auth: "admin" }),
|
|
33733
|
+
listEvents: require_sleep.method(CalendarListEventsInputSchema, zod.z.array(CalendarEventSchema).readonly(), { auth: "admin" }),
|
|
33734
|
+
importFromHomeAssistant: require_sleep.method(zod.z.void(), CalendarImportResultSchema, {
|
|
33735
|
+
auth: "admin",
|
|
33736
|
+
kind: "mutation"
|
|
33737
|
+
})
|
|
33738
|
+
}
|
|
33739
|
+
};
|
|
33740
|
+
//#endregion
|
|
33603
33741
|
//#region src/capabilities/camera-credentials.cap.ts
|
|
33604
33742
|
/**
|
|
33605
33743
|
* camera-credentials — device-scoped cap exposing the camera's network
|
|
@@ -52030,6 +52168,8 @@ var CAPABILITY_NAMES = {
|
|
|
52030
52168
|
brightness: "brightness",
|
|
52031
52169
|
broker: "broker",
|
|
52032
52170
|
button: "button",
|
|
52171
|
+
calendarSource: "calendar-source",
|
|
52172
|
+
calendars: "calendars",
|
|
52033
52173
|
cameraCredentials: "camera-credentials",
|
|
52034
52174
|
cameraGridLayout: "camera-grid-layout",
|
|
52035
52175
|
cameraPipelineConfig: "camera-pipeline-config",
|
|
@@ -52271,6 +52411,14 @@ var CAPABILITY_ROUTER_KEYS = [
|
|
|
52271
52411
|
key: "button",
|
|
52272
52412
|
name: "button"
|
|
52273
52413
|
},
|
|
52414
|
+
{
|
|
52415
|
+
key: "calendarSource",
|
|
52416
|
+
name: "calendar-source"
|
|
52417
|
+
},
|
|
52418
|
+
{
|
|
52419
|
+
key: "calendars",
|
|
52420
|
+
name: "calendars"
|
|
52421
|
+
},
|
|
52274
52422
|
{
|
|
52275
52423
|
key: "cameraCredentials",
|
|
52276
52424
|
name: "camera-credentials"
|
|
@@ -52859,6 +53007,8 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
52859
53007
|
brightnessCapability,
|
|
52860
53008
|
brokerCapability,
|
|
52861
53009
|
buttonCapability,
|
|
53010
|
+
calendarSourceCapability,
|
|
53011
|
+
calendarsCapability,
|
|
52862
53012
|
cameraCredentialsCapability,
|
|
52863
53013
|
cameraGridLayoutCapability,
|
|
52864
53014
|
cameraPipelineConfigCapability,
|
|
@@ -53781,6 +53931,36 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
53781
53931
|
addonId: null,
|
|
53782
53932
|
access: "create"
|
|
53783
53933
|
},
|
|
53934
|
+
"calendars.importFromHomeAssistant": {
|
|
53935
|
+
capName: "calendars",
|
|
53936
|
+
capScope: "system",
|
|
53937
|
+
addonId: null,
|
|
53938
|
+
access: "create"
|
|
53939
|
+
},
|
|
53940
|
+
"calendars.listCalendars": {
|
|
53941
|
+
capName: "calendars",
|
|
53942
|
+
capScope: "system",
|
|
53943
|
+
addonId: null,
|
|
53944
|
+
access: "view"
|
|
53945
|
+
},
|
|
53946
|
+
"calendars.listEvents": {
|
|
53947
|
+
capName: "calendars",
|
|
53948
|
+
capScope: "system",
|
|
53949
|
+
addonId: null,
|
|
53950
|
+
access: "view"
|
|
53951
|
+
},
|
|
53952
|
+
"calendarSource.listCalendars": {
|
|
53953
|
+
capName: "calendar-source",
|
|
53954
|
+
capScope: "system",
|
|
53955
|
+
addonId: null,
|
|
53956
|
+
access: "view"
|
|
53957
|
+
},
|
|
53958
|
+
"calendarSource.listEvents": {
|
|
53959
|
+
capName: "calendar-source",
|
|
53960
|
+
capScope: "system",
|
|
53961
|
+
addonId: null,
|
|
53962
|
+
access: "view"
|
|
53963
|
+
},
|
|
53784
53964
|
"cameraCredentials.getCredentials": {
|
|
53785
53965
|
capName: "camera-credentials",
|
|
53786
53966
|
capScope: "device",
|
|
@@ -60241,6 +60421,8 @@ var KNOWN_CAP_NAMES = [
|
|
|
60241
60421
|
"brightness",
|
|
60242
60422
|
"broker",
|
|
60243
60423
|
"button",
|
|
60424
|
+
"calendar-source",
|
|
60425
|
+
"calendars",
|
|
60244
60426
|
"camera-credentials",
|
|
60245
60427
|
"camera-grid-layout",
|
|
60246
60428
|
"camera-pipeline-config",
|
|
@@ -60487,6 +60669,8 @@ var SYSTEM_CAP_NAMES = [
|
|
|
60487
60669
|
"auth-provider",
|
|
60488
60670
|
"backup",
|
|
60489
60671
|
"broker",
|
|
60672
|
+
"calendar-source",
|
|
60673
|
+
"calendars",
|
|
60490
60674
|
"composer",
|
|
60491
60675
|
"connection-test",
|
|
60492
60676
|
"core-blocks",
|
|
@@ -63873,6 +64057,11 @@ function createSystemProxy(api) {
|
|
|
63873
64057
|
getState: (input) => dispatch("broker", "getState", "query", input),
|
|
63874
64058
|
getStatus: (input) => dispatch("broker", "getStatus", "query", input)
|
|
63875
64059
|
},
|
|
64060
|
+
calendars: {
|
|
64061
|
+
listCalendars: (input) => dispatch("calendars", "listCalendars", "query", input),
|
|
64062
|
+
listEvents: (input) => dispatch("calendars", "listEvents", "query", input),
|
|
64063
|
+
importFromHomeAssistant: (input) => dispatch("calendars", "importFromHomeAssistant", "mutation", input)
|
|
64064
|
+
},
|
|
63876
64065
|
connectionTest: {
|
|
63877
64066
|
testSettings: (input) => dispatch("connectionTest", "testSettings", "mutation", input),
|
|
63878
64067
|
describeTest: (input) => dispatch("connectionTest", "describeTest", "query", input)
|
|
@@ -66174,8 +66363,21 @@ var ALARM_PANEL_TRIGGER_METHOD = "trigger";
|
|
|
66174
66363
|
var NC_ALARM_OPENING_EVENT_KINDS = [
|
|
66175
66364
|
"contact",
|
|
66176
66365
|
"cover",
|
|
66177
|
-
"lock"
|
|
66366
|
+
"lock",
|
|
66367
|
+
"switch"
|
|
66368
|
+
];
|
|
66369
|
+
/**
|
|
66370
|
+
* Opening caps that can be ACTUATED to a secure state on arm (close / lock /
|
|
66371
|
+
* off). Contacts are openings but not controllable — they only block.
|
|
66372
|
+
*/
|
|
66373
|
+
var NC_ALARM_CONTROLLABLE_CAPS = [
|
|
66374
|
+
"cover",
|
|
66375
|
+
"lock-control",
|
|
66376
|
+
"switch"
|
|
66178
66377
|
];
|
|
66378
|
+
function isAlarmControllableCap(cap) {
|
|
66379
|
+
return NC_ALARM_CONTROLLABLE_CAPS.includes(cap);
|
|
66380
|
+
}
|
|
66179
66381
|
/**
|
|
66180
66382
|
* A rule belongs to the alarm when its `deviceState` gate names ANY device's
|
|
66181
66383
|
* `armed_*` word, or an ENABLED `onTrigger` sequence pulls the alarm panel's
|
|
@@ -66204,6 +66406,46 @@ function sensorTransitionNeverFires(rule) {
|
|
|
66204
66406
|
/** The warning an editor shows for {@link sensorTransitionNeverFires}. */
|
|
66205
66407
|
var NC_SENSOR_TRANSITION_NEVER_FIRES_WARNING = "This rule belongs to the alarm, and an alarm rule fires only when an opening OPENS. Set to “only when it clears”, it can never fire.";
|
|
66206
66408
|
//#endregion
|
|
66409
|
+
//#region src/notification/alarm-controllable.ts
|
|
66410
|
+
/**
|
|
66411
|
+
* Controllable openings on the alarm: defaults for the two switches, and the
|
|
66412
|
+
* actuation each cap gets when "secure on arm" fires.
|
|
66413
|
+
*
|
|
66414
|
+
* Controllable = cover / lock-control / switch. Contacts stay passive: they
|
|
66415
|
+
* block by default and have no secure switch.
|
|
66416
|
+
*/
|
|
66417
|
+
/** Whether this device refuses the arm when open. */
|
|
66418
|
+
function alarmDeviceBlocksArming(input) {
|
|
66419
|
+
if (input.controllable) return input.blocking.includes(input.deviceId);
|
|
66420
|
+
return !input.nonBlocking.includes(input.deviceId);
|
|
66421
|
+
}
|
|
66422
|
+
/** Whether this controllable should be closed/locked/turned off on arm. */
|
|
66423
|
+
function alarmDeviceSecureOnArm(input) {
|
|
66424
|
+
if (!input.controllable) return false;
|
|
66425
|
+
return !input.secureOnArmOff.includes(input.deviceId);
|
|
66426
|
+
}
|
|
66427
|
+
/** The one secure command for a controllable opening cap, or null for contacts. */
|
|
66428
|
+
function secureActuationFor(cap) {
|
|
66429
|
+
if (!isAlarmControllableCap(cap)) return null;
|
|
66430
|
+
switch (cap) {
|
|
66431
|
+
case "cover": return {
|
|
66432
|
+
cap,
|
|
66433
|
+
method: "close",
|
|
66434
|
+
args: {}
|
|
66435
|
+
};
|
|
66436
|
+
case "lock-control": return {
|
|
66437
|
+
cap,
|
|
66438
|
+
method: "lock",
|
|
66439
|
+
args: {}
|
|
66440
|
+
};
|
|
66441
|
+
case "switch": return {
|
|
66442
|
+
cap,
|
|
66443
|
+
method: "setState",
|
|
66444
|
+
args: { on: false }
|
|
66445
|
+
};
|
|
66446
|
+
}
|
|
66447
|
+
}
|
|
66448
|
+
//#endregion
|
|
66207
66449
|
//#region src/notification/alarm-settings.ts
|
|
66208
66450
|
var NC_ALARM_DELAY_FIELDS = [
|
|
66209
66451
|
"exitDelaySec",
|
|
@@ -66264,10 +66506,11 @@ function applyModeDelaysEdits(current, edits) {
|
|
|
66264
66506
|
return out.filter((e) => e.exitDelaySec !== void 0 || e.entryDelaySec !== void 0 || e.triggeredDurationSec !== void 0);
|
|
66265
66507
|
}
|
|
66266
66508
|
/**
|
|
66267
|
-
* Put ONE device on, or take it off, ONE mode's list. A no-op answers
|
|
66268
|
-
* to a full list is REFUSED by reason (never silently
|
|
66509
|
+
* Put ONE device on, or take it off, ONE mode's device-id list. A no-op answers
|
|
66510
|
+
* `changed: false`; an add to a full list is REFUSED by reason (never silently
|
|
66511
|
+
* dropped); an emptied list drops its entry.
|
|
66269
66512
|
*/
|
|
66270
|
-
function
|
|
66513
|
+
function applyModeDeviceListEdit(lists, edit) {
|
|
66271
66514
|
const copy = lists.map((l) => ({
|
|
66272
66515
|
mode: l.mode,
|
|
66273
66516
|
deviceIds: [...l.deviceIds]
|
|
@@ -66275,12 +66518,12 @@ function applyNonBlockingEdit(lists, edit) {
|
|
|
66275
66518
|
const at = copy.findIndex((l) => l.mode === edit.mode);
|
|
66276
66519
|
const held = at >= 0 ? copy[at]?.deviceIds ?? [] : [];
|
|
66277
66520
|
const present = held.includes(edit.deviceId);
|
|
66278
|
-
if (edit.
|
|
66521
|
+
if (edit.present === present) return {
|
|
66279
66522
|
kind: "applied",
|
|
66280
66523
|
lists: copy,
|
|
66281
66524
|
changed: false
|
|
66282
66525
|
};
|
|
66283
|
-
if (edit.
|
|
66526
|
+
if (edit.present) {
|
|
66284
66527
|
if (held.length >= 200) return {
|
|
66285
66528
|
kind: "refused",
|
|
66286
66529
|
reason: "list-full",
|
|
@@ -66306,6 +66549,35 @@ function applyNonBlockingEdit(lists, edit) {
|
|
|
66306
66549
|
changed: true
|
|
66307
66550
|
};
|
|
66308
66551
|
}
|
|
66552
|
+
/**
|
|
66553
|
+
* Put ONE device on, or take it off, ONE mode's non-blocking list.
|
|
66554
|
+
*/
|
|
66555
|
+
function applyNonBlockingEdit(lists, edit) {
|
|
66556
|
+
return applyModeDeviceListEdit(lists, {
|
|
66557
|
+
mode: edit.mode,
|
|
66558
|
+
deviceId: edit.deviceId,
|
|
66559
|
+
present: edit.nonBlocking
|
|
66560
|
+
});
|
|
66561
|
+
}
|
|
66562
|
+
/** Controllable opt-in to blocking. */
|
|
66563
|
+
function applyBlockingEdit(lists, edit) {
|
|
66564
|
+
return applyModeDeviceListEdit(lists, {
|
|
66565
|
+
mode: edit.mode,
|
|
66566
|
+
deviceId: edit.deviceId,
|
|
66567
|
+
present: edit.blocking
|
|
66568
|
+
});
|
|
66569
|
+
}
|
|
66570
|
+
/**
|
|
66571
|
+
* Controllable secure-on-arm: `secureOnArm: true` removes from the opt-out list;
|
|
66572
|
+
* `false` adds to it.
|
|
66573
|
+
*/
|
|
66574
|
+
function applySecureOnArmEdit(lists, edit) {
|
|
66575
|
+
return applyModeDeviceListEdit(lists, {
|
|
66576
|
+
mode: edit.mode,
|
|
66577
|
+
deviceId: edit.deviceId,
|
|
66578
|
+
present: !edit.secureOnArm
|
|
66579
|
+
});
|
|
66580
|
+
}
|
|
66309
66581
|
function sameSet(a, b) {
|
|
66310
66582
|
const sa = new Set(a);
|
|
66311
66583
|
const sb = new Set(b);
|
|
@@ -66344,6 +66616,9 @@ function editFieldOf(edit, field) {
|
|
|
66344
66616
|
case "triggeredDurationSec": return edit.triggeredDurationSec;
|
|
66345
66617
|
}
|
|
66346
66618
|
}
|
|
66619
|
+
function listHolds(lists, mode, deviceId) {
|
|
66620
|
+
return lists?.find((l) => l.mode === mode)?.deviceIds.includes(deviceId) ?? false;
|
|
66621
|
+
}
|
|
66347
66622
|
/**
|
|
66348
66623
|
* True iff every key the patch sent is reflected in what the host returned. A host older than
|
|
66349
66624
|
* this build strips the keys it does not know; this is how a client tells "saved" from "parsed
|
|
@@ -66358,6 +66633,8 @@ function alarmPatchLanded(patch, returned) {
|
|
|
66358
66633
|
if (patch.triggeredDurationSec !== void 0 && patch.triggeredDurationSec !== returned.triggeredDurationSec) return false;
|
|
66359
66634
|
if (patch.announceTargets !== void 0 && !sameSet(patch.announceTargets, returned.announceTargets)) return false;
|
|
66360
66635
|
if (patch.nonBlocking !== void 0 && !sameLists(patch.nonBlocking, returned.nonBlocking ?? [])) return false;
|
|
66636
|
+
if (patch.blocking !== void 0 && !sameLists(patch.blocking, returned.blocking ?? [])) return false;
|
|
66637
|
+
if (patch.secureOnArmOff !== void 0 && !sameLists(patch.secureOnArmOff, returned.secureOnArmOff ?? [])) return false;
|
|
66361
66638
|
for (const edit of patch.modeDelays ?? []) {
|
|
66362
66639
|
const entry = (returned.modeDelays ?? []).find((e) => e.mode === edit.mode);
|
|
66363
66640
|
for (const field of NC_ALARM_DELAY_FIELDS) {
|
|
@@ -66369,7 +66646,15 @@ function alarmPatchLanded(patch, returned) {
|
|
|
66369
66646
|
}
|
|
66370
66647
|
if (patch.nonBlockingEdit !== void 0) {
|
|
66371
66648
|
const e = patch.nonBlockingEdit;
|
|
66372
|
-
if ((
|
|
66649
|
+
if (listHolds(returned.nonBlocking, e.mode, e.deviceId) !== e.nonBlocking) return false;
|
|
66650
|
+
}
|
|
66651
|
+
if (patch.blockingEdit !== void 0) {
|
|
66652
|
+
const e = patch.blockingEdit;
|
|
66653
|
+
if (listHolds(returned.blocking, e.mode, e.deviceId) !== e.blocking) return false;
|
|
66654
|
+
}
|
|
66655
|
+
if (patch.secureOnArmEdit !== void 0) {
|
|
66656
|
+
const e = patch.secureOnArmEdit;
|
|
66657
|
+
if (listHolds(returned.secureOnArmOff, e.mode, e.deviceId) === e.secureOnArm) return false;
|
|
66373
66658
|
}
|
|
66374
66659
|
return true;
|
|
66375
66660
|
}
|
|
@@ -70407,6 +70692,12 @@ exports.CONTAINER_CHILD_PRIORITY = CONTAINER_CHILD_PRIORITY;
|
|
|
70407
70692
|
exports.CORE_BLOCKS_ADDON_ID = CORE_BLOCKS_ADDON_ID;
|
|
70408
70693
|
exports.CORE_BLOCK_ADDON_PREFIX = CORE_BLOCK_ADDON_PREFIX;
|
|
70409
70694
|
exports.CUSTOMIZATION_BLOCK_NAME_PREFIX = require_composition.CUSTOMIZATION_BLOCK_NAME_PREFIX;
|
|
70695
|
+
exports.CalendarEntrySchema = CalendarEntrySchema;
|
|
70696
|
+
exports.CalendarEventSchema = CalendarEventSchema;
|
|
70697
|
+
exports.CalendarImportResultSchema = CalendarImportResultSchema;
|
|
70698
|
+
exports.CalendarInfoSchema = CalendarInfoSchema;
|
|
70699
|
+
exports.CalendarListEventsInputSchema = CalendarListEventsInputSchema;
|
|
70700
|
+
exports.CalendarSourceKindSchema = CalendarSourceKindSchema;
|
|
70410
70701
|
exports.CamProfileSchema = require_sleep.CamProfileSchema;
|
|
70411
70702
|
exports.CamStreamDescriptorSchema = CamStreamDescriptorSchema;
|
|
70412
70703
|
exports.CamStreamKindSchema = require_sleep.CamStreamKindSchema;
|
|
@@ -71003,6 +71294,7 @@ exports.NATIVE_LEASE_TILE_BUDGET_KEY = NATIVE_LEASE_TILE_BUDGET_KEY;
|
|
|
71003
71294
|
exports.NAVIGATION_ACTION_CATALOG = NAVIGATION_ACTION_CATALOG;
|
|
71004
71295
|
exports.NAVIGATION_LIGHT_LEVEL_MAX = NAVIGATION_LIGHT_LEVEL_MAX;
|
|
71005
71296
|
exports.NAVIGATION_LIGHT_LEVEL_MIN = NAVIGATION_LIGHT_LEVEL_MIN;
|
|
71297
|
+
exports.NC_ALARM_CONTROLLABLE_CAPS = NC_ALARM_CONTROLLABLE_CAPS;
|
|
71006
71298
|
exports.NC_ALARM_DELAY_FIELDS = NC_ALARM_DELAY_FIELDS;
|
|
71007
71299
|
exports.NC_ALARM_DELAY_MAX_SEC = NC_ALARM_DELAY_MAX_SEC;
|
|
71008
71300
|
exports.NC_ALARM_NONBLOCKING_MAX = NC_ALARM_NONBLOCKING_MAX;
|
|
@@ -71099,11 +71391,17 @@ exports.NavigationMoveCommandSchema = NavigationMoveCommandSchema;
|
|
|
71099
71391
|
exports.NavigationPointSchema = NavigationPointSchema;
|
|
71100
71392
|
exports.NavigationRuntimeStateSchema = NavigationRuntimeStateSchema;
|
|
71101
71393
|
exports.NavigationStatusSchema = NavigationStatusSchema;
|
|
71394
|
+
exports.NcAlarmBlockingEditSchema = NcAlarmBlockingEditSchema;
|
|
71395
|
+
exports.NcAlarmBlockingSchema = NcAlarmBlockingSchema;
|
|
71102
71396
|
exports.NcAlarmConfigSchema = NcAlarmConfigSchema;
|
|
71103
71397
|
exports.NcAlarmModeCoverageSchema = NcAlarmModeCoverageSchema;
|
|
71104
71398
|
exports.NcAlarmModeDelaysEditSchema = NcAlarmModeDelaysEditSchema;
|
|
71105
71399
|
exports.NcAlarmModeDelaysSchema = NcAlarmModeDelaysSchema;
|
|
71400
|
+
exports.NcAlarmModeDeviceListSchema = NcAlarmModeDeviceListSchema;
|
|
71106
71401
|
exports.NcAlarmNonBlockingEditSchema = NcAlarmNonBlockingEditSchema;
|
|
71402
|
+
exports.NcAlarmNonBlockingSchema = NcAlarmNonBlockingSchema;
|
|
71403
|
+
exports.NcAlarmSecureOnArmEditSchema = NcAlarmSecureOnArmEditSchema;
|
|
71404
|
+
exports.NcAlarmSecureOnArmOffSchema = NcAlarmSecureOnArmOffSchema;
|
|
71107
71405
|
exports.NcAlarmSensorReadingSchema = NcAlarmSensorReadingSchema;
|
|
71108
71406
|
exports.NcAlarmSensorStateSchema = NcAlarmSensorStateSchema;
|
|
71109
71407
|
exports.NcAlarmSensorsInputSchema = NcAlarmSensorsInputSchema;
|
|
@@ -71685,12 +71983,17 @@ exports.addonWidgetsSourceCapability = addonWidgetsSourceCapability;
|
|
|
71685
71983
|
exports.addonsCapability = addonsCapability;
|
|
71686
71984
|
exports.adminUiCapability = require_sleep.adminUiCapability;
|
|
71687
71985
|
exports.airQualitySensorCapability = airQualitySensorCapability;
|
|
71986
|
+
exports.alarmDeviceBlocksArming = alarmDeviceBlocksArming;
|
|
71987
|
+
exports.alarmDeviceSecureOnArm = alarmDeviceSecureOnArm;
|
|
71688
71988
|
exports.alarmPanelCapability = alarmPanelCapability;
|
|
71689
71989
|
exports.alarmPatchLanded = alarmPatchLanded;
|
|
71690
71990
|
exports.alertsCapability = alertsCapability;
|
|
71691
71991
|
exports.ambientLightSensorCapability = ambientLightSensorCapability;
|
|
71992
|
+
exports.applyBlockingEdit = applyBlockingEdit;
|
|
71692
71993
|
exports.applyModeDelaysEdits = applyModeDelaysEdits;
|
|
71994
|
+
exports.applyModeDeviceListEdit = applyModeDeviceListEdit;
|
|
71693
71995
|
exports.applyNonBlockingEdit = applyNonBlockingEdit;
|
|
71996
|
+
exports.applySecureOnArmEdit = applySecureOnArmEdit;
|
|
71694
71997
|
exports.asBoolean = require_sleep.asBoolean;
|
|
71695
71998
|
exports.asJsonArray = require_sleep.asJsonArray;
|
|
71696
71999
|
exports.asJsonObject = require_sleep.asJsonObject;
|
|
@@ -71735,6 +72038,8 @@ exports.buildStreamParamsConfigSchema = buildStreamParamsConfigSchema;
|
|
|
71735
72038
|
exports.buildVideoArgs = require_composition.buildVideoArgs;
|
|
71736
72039
|
exports.builtCapabilityBlockers = builtCapabilityBlockers;
|
|
71737
72040
|
exports.buttonCapability = buttonCapability;
|
|
72041
|
+
exports.calendarSourceCapability = calendarSourceCapability;
|
|
72042
|
+
exports.calendarsCapability = calendarsCapability;
|
|
71738
72043
|
exports.cameraCredentialsCapability = cameraCredentialsCapability;
|
|
71739
72044
|
exports.cameraGridLayoutCapability = cameraGridLayoutCapability;
|
|
71740
72045
|
exports.cameraOwnsMotionViaSensor = cameraOwnsMotionViaSensor;
|
|
@@ -71950,6 +72255,7 @@ exports.invalidClusterStepModelEntries = invalidClusterStepModelEntries;
|
|
|
71950
72255
|
exports.invertPresetFeature = invertPresetFeature;
|
|
71951
72256
|
exports.invocationFromEncodeProfile = require_composition.invocationFromEncodeProfile;
|
|
71952
72257
|
exports.isAgentOnlyPlacement = isAgentOnlyPlacement;
|
|
72258
|
+
exports.isAlarmControllableCap = isAlarmControllableCap;
|
|
71953
72259
|
exports.isArrayOutputSchema = isArrayOutputSchema;
|
|
71954
72260
|
exports.isAudioChunkFormat = require_sleep.isAudioChunkFormat;
|
|
71955
72261
|
exports.isAudioClassName = isAudioClassName;
|
|
@@ -72197,6 +72503,7 @@ exports.scopesAllowDeviceCap = scopesAllowDeviceCap;
|
|
|
72197
72503
|
exports.scoreRuntimes = scoreRuntimes;
|
|
72198
72504
|
exports.scriptRunnerCapability = scriptRunnerCapability;
|
|
72199
72505
|
exports.searchDisplayIcons = searchDisplayIcons;
|
|
72506
|
+
exports.secureActuationFor = secureActuationFor;
|
|
72200
72507
|
exports.selectAssignedProfileSlots = require_sleep.selectAssignedProfileSlots;
|
|
72201
72508
|
exports.sendTimesOfSchedule = sendTimesOfSchedule;
|
|
72202
72509
|
exports.sensorRaisedOf = sensorRaisedOf;
|