@camstack/addon-export-hap 1.2.183 → 1.2.184

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.
@@ -5492,7 +5492,7 @@ var ZodIssueCode = {
5492
5492
  var ZodFirstPartyTypeKind;
5493
5493
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5494
5494
  //#endregion
5495
- //#region ../types/dist/sleep-bykKrTgu.mjs
5495
+ //#region ../types/dist/sleep--jXS9hWo.mjs
5496
5496
  /**
5497
5497
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5498
5498
  * window to float samples (D455).
@@ -8673,6 +8673,7 @@ var CAP_NAMES = Object.freeze([
8673
8673
  "filesystem-browse",
8674
8674
  "flood",
8675
8675
  "gas",
8676
+ "group-active",
8676
8677
  "group-commands",
8677
8678
  "group-status",
8678
8679
  "heating-valve",
@@ -8695,6 +8696,7 @@ var CAP_NAMES = Object.freeze([
8695
8696
  "login-method",
8696
8697
  "media-player",
8697
8698
  "mesh-network",
8699
+ "meter",
8698
8700
  "metrics-provider",
8699
8701
  "model-convert",
8700
8702
  "model-distributor",
@@ -9493,6 +9495,10 @@ Object.freeze({
9493
9495
  "path": "detected",
9494
9496
  "valueType": "boolean"
9495
9497
  }],
9498
+ "group-active": [{
9499
+ "path": "active",
9500
+ "valueType": "boolean"
9501
+ }],
9496
9502
  "group-status": [
9497
9503
  {
9498
9504
  "path": "included",
@@ -9752,6 +9758,10 @@ Object.freeze({
9752
9758
  ]
9753
9759
  }
9754
9760
  ],
9761
+ "meter": [{
9762
+ "path": "value",
9763
+ "valueType": "number"
9764
+ }],
9755
9765
  "motion": [
9756
9766
  {
9757
9767
  "path": "detected",
@@ -10854,7 +10864,7 @@ function errMsg$16(err) {
10854
10864
  return String(err);
10855
10865
  }
10856
10866
  //#endregion
10857
- //#region ../types/dist/composition-B2rw5L29.mjs
10867
+ //#region ../types/dist/composition-Bb8iwHEJ.mjs
10858
10868
  var AUDIO_ENCODER_BY_CODEC = {
10859
10869
  opus: "libopus",
10860
10870
  aac: "aac",
@@ -11764,6 +11774,13 @@ var table = {
11764
11774
  apply: () => {
11765
11775
  throw new ExpressionEvalError("latchedAt: stateful evaluation context is required");
11766
11776
  }
11777
+ },
11778
+ schmitt: {
11779
+ minArgs: 3,
11780
+ maxArgs: 5,
11781
+ apply: () => {
11782
+ throw new ExpressionEvalError("schmitt: stateful evaluation context is required");
11783
+ }
11767
11784
  }
11768
11785
  };
11769
11786
  Object.freeze(Object.assign(Object.create(null), table));
@@ -12225,6 +12242,79 @@ var APPLIANCE_KINDS = [
12225
12242
  ];
12226
12243
  DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
12227
12244
  /**
12245
+ * Statistics and integrals over a history read (D944).
12246
+ *
12247
+ * Pure: the same points always give the same answer, so a restart recomputes
12248
+ * rather than trusting a buffer. A gauge mean is time-weighted (value × ms),
12249
+ * never the mean of the samples. A hole with no held value is not integrated
12250
+ * as zero. A truncated read is not published.
12251
+ */
12252
+ var STATISTIC_STATS = [
12253
+ "min",
12254
+ "max",
12255
+ "mean",
12256
+ "sum",
12257
+ "count",
12258
+ "change"
12259
+ ];
12260
+ /**
12261
+ * The range a statistics or integral helper asks history for (D944).
12262
+ *
12263
+ * Calendar edges are the hub's timezone, never UTC midnight: a day is 23, 24
12264
+ * or 25 hours across a DST change. A tier is eligible only when its retention
12265
+ * is strictly longer than the longest that range can be. Forever qualifies.
12266
+ * Equal to a tier's retention is a refusal, not a short answer.
12267
+ */
12268
+ var MINUTE_MS = 6e4;
12269
+ var HOUR_MS = 60 * MINUTE_MS;
12270
+ var DAY_MS = 24 * HOUR_MS;
12271
+ var ROLLING_SPANS = [
12272
+ "1h",
12273
+ "24h",
12274
+ "2d",
12275
+ "7d",
12276
+ "30d",
12277
+ "custom"
12278
+ ];
12279
+ var CALENDAR_PERIODS = [
12280
+ "today",
12281
+ "yesterday",
12282
+ "this-week",
12283
+ "this-month"
12284
+ ];
12285
+ var RESET_PERIODS = [
12286
+ "never",
12287
+ "daily",
12288
+ "weekly",
12289
+ "monthly"
12290
+ ];
12291
+ 5 * MINUTE_MS;
12292
+ 24 * HOUR_MS, 2 * DAY_MS, 7 * DAY_MS, 30 * DAY_MS;
12293
+ 7 * DAY_MS, 30 * DAY_MS, 365 * DAY_MS;
12294
+ var rollingWindowObject = object({
12295
+ kind: literal("rolling"),
12296
+ span: _enum(ROLLING_SPANS),
12297
+ customMinutes: number().int().min(5).optional()
12298
+ }).check((payload) => {
12299
+ if (payload.value.span === "custom" && payload.value.customMinutes === void 0) payload.issues.push({
12300
+ code: "custom",
12301
+ message: "a custom range needs a duration in minutes",
12302
+ path: ["customMinutes"],
12303
+ input: payload.value
12304
+ });
12305
+ if (payload.value.span !== "custom" && payload.value.customMinutes !== void 0) payload.issues.push({
12306
+ code: "custom",
12307
+ message: "only a custom range carries a duration",
12308
+ path: ["customMinutes"],
12309
+ input: payload.value
12310
+ });
12311
+ });
12312
+ var RollingWindowSchema = rollingWindowObject;
12313
+ var StatisticWindowSchema = discriminatedUnion("kind", [rollingWindowObject, object({
12314
+ kind: literal("calendar"),
12315
+ period: _enum(CALENDAR_PERIODS)
12316
+ })]);
12317
+ /**
12228
12318
  * A composition source identity: `(addonId, stableId)`, never a numeric device
12229
12319
  * id. Split out so helper schemas can name it without a cycle through
12230
12320
  * `composition.ts` (D659).
@@ -12250,7 +12340,13 @@ var GROUP_TEMPLATE_IDS = [
12250
12340
  "occupancy",
12251
12341
  "binary",
12252
12342
  "switch",
12253
- "light"
12343
+ "light",
12344
+ "fan",
12345
+ "cover",
12346
+ "valve",
12347
+ "lock",
12348
+ "media-player",
12349
+ "climate"
12254
12350
  ];
12255
12351
  var NUMERIC_AGGREGATES = [
12256
12352
  "mean",
@@ -12280,22 +12376,73 @@ var HelperMemberSchema = object({
12280
12376
  cap: string().min(1),
12281
12377
  fieldPath: string().min(1)
12282
12378
  });
12283
- var HelperSpecSchema = discriminatedUnion("kind", [object({
12284
- kind: literal("group"),
12285
- templateId: GroupTemplateIdSchema,
12286
- aggregate: AggregateReducerSchema,
12287
- members: array(HelperMemberSchema).min(1).max(64),
12288
- /** Actuator groups only. Readings leave this unset. */
12289
- active: ActiveCriterionSchema.optional()
12290
- }), object({
12291
- kind: literal("appliance"),
12292
- templateId: literal(APPLIANCE_TEMPLATE_ID),
12293
- appliance: _enum(APPLIANCE_KINDS),
12294
- thresholdWatts: number().positive(),
12295
- startDwellMs: number().int().nonnegative(),
12296
- stopDwellMs: number().int().nonnegative(),
12297
- member: HelperMemberSchema
12298
- })]);
12379
+ var HelperSpecSchema = discriminatedUnion("kind", [
12380
+ object({
12381
+ kind: literal("group"),
12382
+ templateId: GroupTemplateIdSchema,
12383
+ aggregate: AggregateReducerSchema,
12384
+ members: array(HelperMemberSchema).min(1).max(64),
12385
+ /** Actuator groups only. Readings leave this unset. */
12386
+ active: ActiveCriterionSchema.optional()
12387
+ }),
12388
+ object({
12389
+ kind: literal("appliance"),
12390
+ templateId: literal(APPLIANCE_TEMPLATE_ID),
12391
+ appliance: _enum(APPLIANCE_KINDS),
12392
+ thresholdWatts: number().positive(),
12393
+ startDwellMs: number().int().nonnegative(),
12394
+ stopDwellMs: number().int().nonnegative(),
12395
+ member: HelperMemberSchema
12396
+ }),
12397
+ object({
12398
+ kind: literal("statistic"),
12399
+ stat: _enum(STATISTIC_STATS),
12400
+ window: StatisticWindowSchema,
12401
+ source: HelperMemberSchema
12402
+ }),
12403
+ object({
12404
+ kind: literal("integral"),
12405
+ reset: _enum(RESET_PERIODS),
12406
+ output: _enum(["energy", "meter"]),
12407
+ source: HelperMemberSchema
12408
+ }),
12409
+ object({
12410
+ kind: literal("threshold"),
12411
+ source: HelperMemberSchema,
12412
+ high: number(),
12413
+ low: number(),
12414
+ onForMs: number().int().nonnegative(),
12415
+ offForMs: number().int().nonnegative()
12416
+ }),
12417
+ object({
12418
+ kind: literal("arithmetic"),
12419
+ op: _enum([
12420
+ "sum",
12421
+ "difference",
12422
+ "ratio"
12423
+ ]),
12424
+ inputs: array(HelperMemberSchema).min(2).max(64)
12425
+ }),
12426
+ object({
12427
+ kind: literal("expression"),
12428
+ expr: string().min(1),
12429
+ inputs: array(object({
12430
+ name: string().min(1),
12431
+ member: HelperMemberSchema
12432
+ })).min(1).max(64),
12433
+ output: _enum(["number", "boolean"])
12434
+ }),
12435
+ object({
12436
+ kind: literal("derivative"),
12437
+ window: RollingWindowSchema,
12438
+ per: _enum([
12439
+ "second",
12440
+ "minute",
12441
+ "hour"
12442
+ ]),
12443
+ source: HelperMemberSchema
12444
+ })
12445
+ ]);
12299
12446
  /** A composed device's stableId is this prefix plus the block id. */
12300
12447
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
12301
12448
  /** Longest snippet a `code` source may carry (slice 4). */
@@ -12356,6 +12503,12 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
12356
12503
  "all"
12357
12504
  ]),
12358
12505
  reads: array(CompositionFieldReadSchema).min(1).max(64),
12506
+ /**
12507
+ * Set when the reads are an enum state, not a yes/no: the listed states
12508
+ * count as active (a cover is `open`). A state outside the list is inactive;
12509
+ * a read that is not a state at all is left out. Only `any` / `all` use it.
12510
+ */
12511
+ activeWhen: array(string().min(1)).min(1).optional(),
12359
12512
  /** `value` is the reading; the others are the member counts. */
12360
12513
  publish: _enum([
12361
12514
  "value",
@@ -12369,6 +12522,26 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
12369
12522
  "omit",
12370
12523
  "offline"
12371
12524
  ])
12525
+ }),
12526
+ object({
12527
+ kind: literal("series"),
12528
+ read: CompositionFieldReadSchema,
12529
+ /** `value` is the statistic or the integral. The others are the gap counts. */
12530
+ publish: _enum([
12531
+ "value",
12532
+ "included",
12533
+ "excluded",
12534
+ "total"
12535
+ ]),
12536
+ /**
12537
+ * What an unanswered `value` does. Counts ignore this. `offline` leaves the
12538
+ * device unseeded until history answers, so a restart cannot publish 0.
12539
+ */
12540
+ empty: _enum([
12541
+ "null",
12542
+ "omit",
12543
+ "offline"
12544
+ ])
12372
12545
  })
12373
12546
  ]);
12374
12547
  var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
@@ -17752,7 +17925,22 @@ var BrokerProviderInfoSchema = object({
17752
17925
  */
17753
17926
  interactiveConnectPath: string().min(1).optional(),
17754
17927
  /** Relative hub path to disconnect the linked account (same popup pattern). */
17755
- interactiveDisconnectPath: string().min(1).optional()
17928
+ interactiveDisconnectPath: string().min(1).optional(),
17929
+ /**
17930
+ * The kind signs in through a server-held interactive session instead of
17931
+ * (or before) typed credentials. `basePath` is a hub-relative route set
17932
+ * served by the owning addon (`/addon/<id>/...`) speaking the sign-in
17933
+ * contract: `POST {basePath}/start` (body: the form's settings) answers
17934
+ * `{ sessionId, loginUrl }`; `GET {basePath}/status?sessionId=` answers
17935
+ * `{ phase: 'starting' | 'awaiting-login' | 'captured' | 'error' |
17936
+ * 'cancelled', loginUrl, error }`; `POST {basePath}/commit`
17937
+ * (`{ sessionId, name, brokerId? }`) stores the credentials on a new or
17938
+ * existing broker and answers `{ brokerId }`; `POST {basePath}/cancel`
17939
+ * (`{ sessionId }`) drops the session. The dialog that edits a broker
17940
+ * offers it as the default path; the fields the session fills are
17941
+ * marked `filledBySignIn` in the kind's settings schema.
17942
+ */
17943
+ signIn: object({ basePath: string().min(1) }).optional()
17756
17944
  }))
17757
17945
  });
17758
17946
  var ListInputSchema = object({
@@ -18751,7 +18939,8 @@ var CompositionProblemSchema = object({
18751
18939
  "native-capability-replace",
18752
18940
  "mixed-quantity",
18753
18941
  "helper-mismatch",
18754
- "member-constraint"
18942
+ "member-constraint",
18943
+ "retention"
18755
18944
  ]),
18756
18945
  path: string(),
18757
18946
  message: string()
@@ -18985,13 +19174,17 @@ Object.freeze({
18985
19174
  latchedAt: {
18986
19175
  kind: "fixed",
18987
19176
  result: ["number", "null"]
19177
+ },
19178
+ schmitt: {
19179
+ kind: "fixed",
19180
+ result: ["boolean", "null"]
18988
19181
  }
18989
19182
  });
18990
19183
  /**
18991
19184
  * One catalog row per base reading a group helper can build (D944 §3).
18992
19185
  * Data, not a form default written into the block.
18993
19186
  */
18994
- var NOW = {
19187
+ var NOW$2 = {
18995
19188
  fieldPath: "lastFetchedAt",
18996
19189
  expr: "now"
18997
19190
  };
@@ -19005,6 +19198,8 @@ function numeric(input) {
19005
19198
  family: "numeric",
19006
19199
  deviceType: DeviceType.Sensor,
19007
19200
  memberDeviceType: DeviceType.Sensor,
19201
+ memberDeviceTypes: [DeviceType.Sensor],
19202
+ activeWhen: void 0,
19008
19203
  commandCaps: [],
19009
19204
  baseUnit: baseUnitOf(input.quantity),
19010
19205
  aggregates: NUMERIC_AGGREGATES,
@@ -19020,6 +19215,8 @@ function binary(input) {
19020
19215
  family: "binary",
19021
19216
  deviceType: DeviceType.Sensor,
19022
19217
  memberDeviceType: DeviceType.Sensor,
19218
+ memberDeviceTypes: [DeviceType.Sensor],
19219
+ activeWhen: void 0,
19023
19220
  commandCaps: [],
19024
19221
  quantity: "none",
19025
19222
  baseUnit: void 0,
@@ -19037,7 +19234,7 @@ var GROUP_TEMPLATES = [
19037
19234
  quantity: "temperature",
19038
19235
  defaultAggregate: "mean",
19039
19236
  empty: "null",
19040
- companions: [NOW]
19237
+ companions: [NOW$2]
19041
19238
  }),
19042
19239
  numeric({
19043
19240
  id: "humidity",
@@ -19048,7 +19245,7 @@ var GROUP_TEMPLATES = [
19048
19245
  quantity: "humidity",
19049
19246
  defaultAggregate: "mean",
19050
19247
  empty: "null",
19051
- companions: [NOW]
19248
+ companions: [NOW$2]
19052
19249
  }),
19053
19250
  numeric({
19054
19251
  id: "pressure",
@@ -19059,7 +19256,7 @@ var GROUP_TEMPLATES = [
19059
19256
  quantity: "pressure",
19060
19257
  defaultAggregate: "mean",
19061
19258
  empty: "null",
19062
- companions: [NOW]
19259
+ companions: [NOW$2]
19063
19260
  }),
19064
19261
  numeric({
19065
19262
  id: "illuminance",
@@ -19070,7 +19267,7 @@ var GROUP_TEMPLATES = [
19070
19267
  quantity: "illuminance",
19071
19268
  defaultAggregate: "mean",
19072
19269
  empty: "null",
19073
- companions: [NOW]
19270
+ companions: [NOW$2]
19074
19271
  }),
19075
19272
  numeric({
19076
19273
  id: "power",
@@ -19081,7 +19278,7 @@ var GROUP_TEMPLATES = [
19081
19278
  quantity: "power",
19082
19279
  defaultAggregate: "sum",
19083
19280
  empty: "omit",
19084
- companions: [NOW]
19281
+ companions: [NOW$2]
19085
19282
  }),
19086
19283
  numeric({
19087
19284
  id: "energy",
@@ -19092,7 +19289,7 @@ var GROUP_TEMPLATES = [
19092
19289
  quantity: "energy",
19093
19290
  defaultAggregate: "sum",
19094
19291
  empty: "omit",
19095
- companions: [NOW]
19292
+ companions: [NOW$2]
19096
19293
  }),
19097
19294
  numeric({
19098
19295
  id: "battery",
@@ -19127,7 +19324,7 @@ var GROUP_TEMPLATES = [
19127
19324
  quantity: "device",
19128
19325
  defaultAggregate: "mean",
19129
19326
  empty: "null",
19130
- companions: [NOW]
19327
+ companions: [NOW$2]
19131
19328
  }),
19132
19329
  binary({
19133
19330
  id: "motion",
@@ -19221,6 +19418,11 @@ var GROUP_TEMPLATES = [
19221
19418
  summary: "On when at least one switch is on, or when all of them are. Offline and unknown members are left out of that decision, never read as off, and still receive the command.",
19222
19419
  deviceType: DeviceType.Switch,
19223
19420
  outputCap: "switch",
19421
+ outputField: "on",
19422
+ member: {
19423
+ cap: "switch",
19424
+ fieldPath: "on"
19425
+ },
19224
19426
  commandCaps: ["switch"]
19225
19427
  }),
19226
19428
  actuator({
@@ -19228,34 +19430,136 @@ var GROUP_TEMPLATES = [
19228
19430
  summary: "On when at least one light is on, or when all of them are. Brightness and colour are offered only when every member has them. A command is not sent to a member that lacks it.",
19229
19431
  deviceType: DeviceType.Light,
19230
19432
  outputCap: "switch",
19433
+ outputField: "on",
19434
+ member: {
19435
+ cap: "switch",
19436
+ fieldPath: "on"
19437
+ },
19231
19438
  commandCaps: [
19232
19439
  "switch",
19233
19440
  "brightness",
19234
19441
  "color"
19235
19442
  ]
19443
+ }),
19444
+ actuator({
19445
+ id: "fan",
19446
+ summary: "On when at least one fan is on, or when all of them are. Speed, preset, direction and oscillation are offered only when every fan has them. A command is not sent to a fan that lacks it.",
19447
+ deviceType: DeviceType.Fan,
19448
+ outputCap: "switch",
19449
+ outputField: "on",
19450
+ member: {
19451
+ cap: "switch",
19452
+ fieldPath: "on"
19453
+ },
19454
+ commandCaps: ["switch", "fan-control"]
19455
+ }),
19456
+ actuator({
19457
+ id: "cover",
19458
+ summary: "Open when at least one cover is open or part-open, or only when all of them are. Position and tilt are offered only when every cover has them. A cover that reports nothing is left out, never read as closed.",
19459
+ deviceType: DeviceType.Cover,
19460
+ outputCap: "group-active",
19461
+ outputField: "active",
19462
+ member: {
19463
+ cap: "cover",
19464
+ fieldPath: "state"
19465
+ },
19466
+ activeWhen: [
19467
+ "open",
19468
+ "opening",
19469
+ "stopped"
19470
+ ],
19471
+ commandCaps: ["cover"]
19472
+ }),
19473
+ actuator({
19474
+ id: "valve",
19475
+ summary: "Open when at least one valve is open or part-open, or only when all of them are. Position is offered only when every valve has it. A valve that reports nothing is left out, never read as closed.",
19476
+ deviceType: DeviceType.Valve,
19477
+ outputCap: "group-active",
19478
+ outputField: "active",
19479
+ member: {
19480
+ cap: "valve",
19481
+ fieldPath: "state"
19482
+ },
19483
+ activeWhen: [
19484
+ "open",
19485
+ "opening",
19486
+ "stopped"
19487
+ ],
19488
+ commandCaps: ["valve"]
19489
+ }),
19490
+ actuator({
19491
+ id: "lock",
19492
+ summary: "Locked when at least one lock is locked, or only when all of them are. A jammed or moving lock is not locked. Locking is one tap; unlocking the group needs a confirmation every time, and nothing is sent without it.",
19493
+ deviceType: DeviceType.Lock,
19494
+ outputCap: "group-active",
19495
+ outputField: "active",
19496
+ member: {
19497
+ cap: "lock-control",
19498
+ fieldPath: "state"
19499
+ },
19500
+ activeWhen: ["locked"],
19501
+ commandCaps: ["lock-control"]
19502
+ }),
19503
+ actuator({
19504
+ id: "media-player",
19505
+ summary: "Playing when at least one player is playing, or only when all of them are. Volume is offered only when every player has it. A player that reports nothing is left out, never read as stopped.",
19506
+ deviceType: DeviceType.MediaPlayer,
19507
+ outputCap: "group-active",
19508
+ outputField: "active",
19509
+ member: {
19510
+ cap: "media-player",
19511
+ fieldPath: "state"
19512
+ },
19513
+ activeWhen: ["playing", "buffering"],
19514
+ commandCaps: ["media-player"]
19515
+ }),
19516
+ actuator({
19517
+ id: "climate",
19518
+ summary: "Running when at least one thermostat or air conditioner is not off, or only when all of them are. Target temperature and fan are offered only when every device has them. A device that reports nothing is left out, never read as off.",
19519
+ deviceType: DeviceType.Thermostat,
19520
+ memberDeviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
19521
+ outputCap: "group-active",
19522
+ outputField: "active",
19523
+ member: {
19524
+ cap: "climate-control",
19525
+ fieldPath: "mode"
19526
+ },
19527
+ activeWhen: [
19528
+ "heat",
19529
+ "cool",
19530
+ "auto",
19531
+ "heat_cool",
19532
+ "fan_only",
19533
+ "dry"
19534
+ ],
19535
+ commandCaps: ["climate-control"]
19236
19536
  })
19237
19537
  ];
19238
19538
  function actuator(input) {
19239
19539
  return {
19240
- ...input,
19540
+ id: input.id,
19541
+ summary: input.summary,
19542
+ deviceType: input.deviceType,
19543
+ outputCap: input.outputCap,
19544
+ outputField: input.outputField,
19545
+ commandCaps: input.commandCaps,
19241
19546
  family: "actuator",
19242
19547
  role: void 0,
19243
19548
  memberDeviceType: input.deviceType,
19244
- outputField: "on",
19549
+ memberDeviceTypes: input.memberDeviceTypes ?? [input.deviceType],
19550
+ activeWhen: input.activeWhen,
19245
19551
  quantity: "none",
19246
19552
  baseUnit: void 0,
19247
19553
  aggregates: BINARY_AGGREGATES,
19248
19554
  defaultAggregate: "any",
19249
19555
  empty: "offline",
19250
- accept: [{
19251
- cap: "switch",
19252
- fieldPath: "on"
19253
- }],
19556
+ accept: [input.member],
19254
19557
  companions: [CHANGED]
19255
19558
  };
19256
19559
  }
19257
19560
  new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
19258
19561
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
19562
+ DeviceType.Camera;
19259
19563
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
19260
19564
  /**
19261
19565
  * What a composition may BUILD on a device type (G2, D676): the caps a new
@@ -44351,7 +44655,7 @@ var NetworkAccessStatusSchema = object({
44351
44655
  });
44352
44656
  /**
44353
44657
  * Optional, richer endpoint shape returned by providers that expose
44354
- * MORE than one ingress concurrently (Tailscale Ingress with mixed
44658
+ * MORE than one ingress concurrently (Tailscale Funnel with mixed
44355
44659
  * serve+funnel rules, future ngrok multi-tunnel, …). Each entry carries
44356
44660
  * the originating provider config (mode + sourcePort) so the
44357
44661
  * orchestrator UI can label rows distinctly. Providers that expose only
@@ -46994,7 +47298,20 @@ var NcRuleInputSchema = object({
46994
47298
  * save by the hub's grouping guard). `.optional()`, never `.default()`: the addon cap
46995
47299
  * path does not run Zod defaults.
46996
47300
  */
46997
- groupingSec: number().int().min(5).max(60).optional()
47301
+ groupingSec: number().int().min(5).max(60).optional(),
47302
+ /**
47303
+ * ASK ME TO CONFIRM DETECTIONS (#243): a DETECTION notification of this rule
47304
+ * carries "Correct" / "Wrong" buttons (and, where the channel has room, a
47305
+ * "Wrong, it is a <class>" choice). A tap marks the track for retraining, the
47306
+ * same mark the Library writes, and records whose notification it was and
47307
+ * when. A channel with no buttons gets the same two choices as links.
47308
+ *
47309
+ * `.optional()`, never `.default()` (a Zod default does not run on the addon
47310
+ * cap path): absent and `false` both mean off, which is what every rule
47311
+ * authored before this field meant. An editor turns it off by writing
47312
+ * `false`, so it needs no `clear` key.
47313
+ */
47314
+ askVerdict: boolean().optional()
46998
47315
  });
46999
47316
  /**
47000
47317
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -57648,7 +57965,7 @@ var BatteryStatusSchema = object({
57648
57965
  */
57649
57966
  binary: boolean().optional().meta({ label: "Binary indicator" })
57650
57967
  });
57651
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat;
57968
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter;
57652
57969
  method(object({
57653
57970
  deviceId: number(),
57654
57971
  /** Bound on the wait. Sensible range 3000–10000ms. */
@@ -59416,7 +59733,13 @@ results: array(object({
59416
59733
  /** Ms epoch of the attempt. */
59417
59734
  at: number()
59418
59735
  })) });
59419
- DeviceType.Switch, DeviceType.Light;
59736
+ DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Cover, DeviceType.Valve, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.Thermostat, DeviceType.Climate;
59737
+ object({
59738
+ active: boolean().meta({ label: "Active" }),
59739
+ /** Ms epoch when the slice was last updated. */
59740
+ lastChangedAt: number()
59741
+ });
59742
+ DeviceType.Cover, DeviceType.Valve, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.Climate, DeviceType.Thermostat;
59420
59743
  object({
59421
59744
  /** Members whose current value entered the aggregate. */
59422
59745
  included: number().int().nonnegative().meta(readingMeta("count", {
@@ -59434,7 +59757,7 @@ object({
59434
59757
  label: "Members"
59435
59758
  }))
59436
59759
  });
59437
- DeviceType.Sensor, DeviceType.Switch, DeviceType.Light;
59760
+ DeviceType.Sensor, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Cover, DeviceType.Valve, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.Thermostat, DeviceType.Climate;
59438
59761
  object({
59439
59762
  /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
59440
59763
  position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
@@ -60349,7 +60672,14 @@ DeviceType.Lock, method(object({
60349
60672
  auth: "protected"
60350
60673
  }), method(object({
60351
60674
  deviceId: number().int().nonnegative(),
60352
- code: string().min(1).optional()
60675
+ code: string().min(1).optional(),
60676
+ /**
60677
+ * Honoured by a helper lock GROUP only (D944): unlocking several doors
60678
+ * with one call is refused unless the caller says it was confirmed. A
60679
+ * single lock ignores it. The refusal lives in the callee, so no
60680
+ * automation or API caller reaches the doors by skipping a dialog.
60681
+ */
60682
+ confirm: boolean().optional()
60353
60683
  }), _void(), {
60354
60684
  kind: "mutation",
60355
60685
  auth: "protected"
@@ -60357,6 +60687,11 @@ DeviceType.Lock, method(object({
60357
60687
  kind: "mutation",
60358
60688
  auth: "protected"
60359
60689
  });
60690
+ object({
60691
+ value: number().nullable().meta(readingMeta("device", { label: "Total" })),
60692
+ lastFetchedAt: number()
60693
+ });
60694
+ DeviceType.Sensor;
60360
60695
  /**
60361
60696
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
60362
60697
  * Apple TV, Spotify, Roku, generic OTT receivers, …) on
@@ -62264,9 +62599,9 @@ object({
62264
62599
  /** Cumulative energy in kilowatt-hours since the meter was reset. */
62265
62600
  kwhTotal: number().optional().meta(readingMeta("energy", { label: "Energy" })),
62266
62601
  /** Voltage in volts. */
62267
- volts: number().optional().meta(readingMeta("voltage")),
62602
+ volts: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
62268
62603
  /** Current in amperes. */
62269
- amps: number().optional().meta(readingMeta("current")),
62604
+ amps: number().optional().meta(readingMeta("current", { label: "Current" })),
62270
62605
  /** Apparent power in volt-amperes. */
62271
62606
  va: number().optional().meta(readingMeta("apparent-power")),
62272
62607
  /** Power factor (0..1) if reported. */
@@ -62274,7 +62609,23 @@ object({
62274
62609
  /** Ms epoch when the slice was last updated. */
62275
62610
  lastFetchedAt: number()
62276
62611
  });
62277
- DeviceType.Sensor, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
62612
+ [
62613
+ DeviceType.Sensor,
62614
+ DeviceType.Switch,
62615
+ DeviceType.Light,
62616
+ DeviceType.Fan,
62617
+ DeviceType.Climate,
62618
+ DeviceType.Thermostat,
62619
+ DeviceType.Humidifier,
62620
+ DeviceType.WaterHeater,
62621
+ DeviceType.MediaPlayer,
62622
+ DeviceType.Washer,
62623
+ DeviceType.Dryer,
62624
+ DeviceType.Dishwasher,
62625
+ DeviceType.Vacuum,
62626
+ DeviceType.LawnMower,
62627
+ DeviceType.PetFeeder
62628
+ ].filter((type) => type !== DeviceType.Sensor);
62278
62629
  /**
62279
62630
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
62280
62631
  * on `DeviceType.Presence`. Read-only — no setters: presence is
@@ -64769,7 +65120,7 @@ object({
64769
65120
  /** Ms epoch of the last state change. Useful for UI "X minutes ago". */
64770
65121
  lastChangedAt: number()
64771
65122
  });
64772
- DeviceType.Switch, DeviceType.Siren, DeviceType.Light, method(object({
65123
+ DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, method(object({
64773
65124
  deviceId: number(),
64774
65125
  on: boolean()
64775
65126
  }), _void(), {
@@ -66473,8 +66824,9 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
66473
66824
  kind: "mutation",
66474
66825
  auth: "admin"
66475
66826
  });
66827
+ DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
66476
66828
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
66477
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
66829
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
66478
66830
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
66479
66831
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
66480
66832
  new Set(CAP_NAMES);
@@ -69750,6 +70102,13 @@ Object.freeze({
69750
70102
  access: "view",
69751
70103
  role: "viewer"
69752
70104
  },
70105
+ "groupActive.getStatus": {
70106
+ capName: "group-active",
70107
+ capScope: "device",
70108
+ addonId: null,
70109
+ access: "view",
70110
+ role: "viewer"
70111
+ },
69753
70112
  "groupCommands.getStatus": {
69754
70113
  capName: "group-commands",
69755
70114
  capScope: "device",
@@ -70716,6 +71075,13 @@ Object.freeze({
70716
71075
  access: "create",
70717
71076
  role: "admin"
70718
71077
  },
71078
+ "meter.getStatus": {
71079
+ capName: "meter",
71080
+ capScope: "device",
71081
+ addonId: null,
71082
+ access: "view",
71083
+ role: "viewer"
71084
+ },
70719
71085
  "metricsProvider.collectSnapshot": {
70720
71086
  capName: "metrics-provider",
70721
71087
  capScope: "system",
@@ -79618,6 +79984,10 @@ var SENSOR_CAP_VOCABULARY = {
79618
79984
  icon: "flame"
79619
79985
  }]
79620
79986
  },
79987
+ "group-active": {
79988
+ scope: "device",
79989
+ noun: t("Group state", "Stato del gruppo")
79990
+ },
79621
79991
  "group-commands": {
79622
79992
  scope: "device",
79623
79993
  noun: t("Group command", "Comando di gruppo")
@@ -79674,6 +80044,17 @@ var SENSOR_CAP_VOCABULARY = {
79674
80044
  }],
79675
80045
  events: { onMotionChanged: { notOperatorFacing: "the `detected` state trigger phrases both edges, from the mirror that survives a dropped event (D49)" } }
79676
80046
  },
80047
+ meter: {
80048
+ scope: "device",
80049
+ noun: t("Meter", "Contatore"),
80050
+ state: [{
80051
+ kind: "numeric",
80052
+ field: "value",
80053
+ quantity: t("the total", "il totale"),
80054
+ label: t("Total", "Totale"),
80055
+ icon: "gauge"
80056
+ }]
80057
+ },
79677
80058
  "numeric-sensor": {
79678
80059
  scope: "device",
79679
80060
  noun: t("Sensor", "Sensore"),
@@ -81178,6 +81559,11 @@ Object.freeze({
81178
81559
  form: "single",
81179
81560
  optional: false
81180
81561
  }],
81562
+ "groupActive.getStatus": [{
81563
+ name: "deviceId",
81564
+ form: "single",
81565
+ optional: false
81566
+ }],
81181
81567
  "groupCommands.getStatus": [{
81182
81568
  name: "deviceId",
81183
81569
  form: "single",
@@ -81388,6 +81774,11 @@ Object.freeze({
81388
81774
  form: "single",
81389
81775
  optional: false
81390
81776
  }],
81777
+ "meter.getStatus": [{
81778
+ name: "deviceId",
81779
+ form: "single",
81780
+ optional: false
81781
+ }],
81391
81782
  "motion.getStatus": [{
81392
81783
  name: "deviceId",
81393
81784
  form: "single",
@@ -82995,7 +83386,6 @@ Object.freeze({
82995
83386
  "network-access": "ingress",
82996
83387
  "smtp-provider": "email"
82997
83388
  });
82998
- DeviceType.Camera;
82999
83389
  /**
83000
83390
  * A saved Customize assignment (D936). The schema is the type: callers use
83001
83391
  * `z.infer`, they do not restate the shape.