@camstack/addon-provider-homematic 1.2.188 → 1.2.190

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 CHANGED
@@ -811,7 +811,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
811
811
  return EventCategory;
812
812
  }({});
813
813
  //#endregion
814
- //#region ../types/dist/composed-stable-id-jnvhwGoH.mjs
814
+ //#region ../types/dist/composed-stable-id-CPp3votu.mjs
815
815
  /**
816
816
  import { errMsg } from '@camstack/types'
817
817
  * Extract a human-readable message from an unknown error value.
@@ -824,17 +824,18 @@ function errMsg(err) {
824
824
  }
825
825
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
826
826
  DeviceType["Camera"] = "camera";
827
+ /** Legacy stored value, read only by the hub-to-integration migrations; no live device carries it. */
827
828
  DeviceType["Hub"] = "hub";
828
829
  DeviceType["Light"] = "light";
829
830
  DeviceType["Siren"] = "siren";
830
831
  DeviceType["Switch"] = "switch";
831
832
  DeviceType["Sensor"] = "sensor";
832
- DeviceType["Thermostat"] = "thermostat";
833
- /** Air-conditioner / heat-pump climate device (HVAC) — shares the
834
- * `climate-control` cap surface with `Thermostat` but renders a
835
- * dedicated AC-appropriate control UI (mode chips, fan speed,
836
- * independent vertical/horizontal swing). Sources: native Gree, and
837
- * reusable by other AC integrations. */
833
+ /** Every climate device: an air conditioner, a room thermostat, a radiator
834
+ * valve, a floor-heating zone, a heat-pump circuit. They share one set of
835
+ * controls (`climate-control`), so they are one type; WHICH kind of climate
836
+ * device it is is its {@link DeviceRole} (`climate-*`), which the UI and the
837
+ * exports branch on. The retired `thermostat` type is read as this one
838
+ * (`canonicalStoredDeviceType`). */
838
839
  DeviceType["Climate"] = "climate";
839
840
  DeviceType["Button"] = "button";
840
841
  /** Generic stateless event emitter — carries a device's EXACT declared
@@ -925,10 +926,6 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
925
926
  /** Washing machine. A plug-built one is running while its power stays
926
927
  * above a threshold. No program cap — that surface is the dishwasher's. */
927
928
  DeviceType["Washer"] = "washer";
928
- /** A dumb plug-in stove or heater: a switch (and, with a meter, a power
929
- * reading) that only runs while the plug is on. Built from a smart plug;
930
- * the `timed-run` cap switches it off again after a chosen time. */
931
- DeviceType["Heater"] = "heater";
932
929
  /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
933
930
  DeviceType["Dryer"] = "dryer";
934
931
  /** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
@@ -1148,6 +1145,27 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1148
1145
  /** A smart plug: a `switch` whose source says it is an outlet (HA
1149
1146
  * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
1150
1147
  DeviceRole["Outlet"] = "outlet";
1148
+ /** A dumb plug-in stove or heater behind a switch: it runs only while the
1149
+ * switch is on. Offered `timed-run`, which switches it off again after a
1150
+ * chosen time. */
1151
+ DeviceRole["SwitchHeater"] = "switch-heater";
1152
+ /** A plain fan behind a switch (a smart plug powering it): drawn as a fan,
1153
+ * with the switch's on/off only. Speed or oscillation appear only when the
1154
+ * device also has a fan cap (D1033). */
1155
+ DeviceRole["SwitchFan"] = "switch-fan";
1156
+ /** Air conditioner / split unit: cooling, fan speed, louvres. */
1157
+ DeviceRole["ClimateAc"] = "climate-ac";
1158
+ /** Room thermostat: a setpoint and a room temperature. The default. */
1159
+ DeviceRole["ClimateThermostat"] = "climate-thermostat";
1160
+ /** Floor-heating zone actuator. */
1161
+ DeviceRole["ClimateFloor"] = "climate-floor";
1162
+ /** Radiator valve (thermostatic radiator head). */
1163
+ DeviceRole["ClimateRadiator"] = "climate-radiator";
1164
+ /** A heater with its own thermostat (stove, convector). */
1165
+ DeviceRole["ClimateHeater"] = "climate-heater";
1166
+ /** One heating/cooling circuit of a heat pump: a water loop with comfort /
1167
+ * eco setpoints and a heat/cool mode, no room sensor. */
1168
+ DeviceRole["ClimateHeatPumpCircuit"] = "climate-heat-pump-circuit";
1151
1169
  /** Generic motion / occupancy / moving event source. Distinct from
1152
1170
  * the camera accessory PirSensor role: that one is a camera child;
1153
1171
  * this is a standalone HA / 3rd-party motion sensor. */
@@ -6035,7 +6053,7 @@ var ZodIssueCode = {
6035
6053
  var ZodFirstPartyTypeKind;
6036
6054
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6037
6055
  //#endregion
6038
- //#region ../types/dist/sleep-Dz1P6--1.mjs
6056
+ //#region ../types/dist/sleep-Bn346wCJ.mjs
6039
6057
  /**
6040
6058
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6041
6059
  * window to float samples (D455).
@@ -11752,6 +11770,50 @@ var ACTUATOR_CAP_VOCABULARY = {
11752
11770
  value: false
11753
11771
  },
11754
11772
  args: { oscillating: false }
11773
+ },
11774
+ {
11775
+ id: "fan.horizontalOscillateOn",
11776
+ method: "setOscillationAxis",
11777
+ label: t("Horizontal oscillation on", "Oscillazione orizzontale attiva"),
11778
+ phrase: t("Start the horizontal oscillation of {device}", "Attiva l’oscillazione orizzontale di {device}"),
11779
+ icon: "move-horizontal",
11780
+ args: {
11781
+ axis: "horizontal",
11782
+ oscillating: true
11783
+ }
11784
+ },
11785
+ {
11786
+ id: "fan.horizontalOscillateOff",
11787
+ method: "setOscillationAxis",
11788
+ label: t("Horizontal oscillation off", "Oscillazione orizzontale spenta"),
11789
+ phrase: t("Stop the horizontal oscillation of {device}", "Ferma l’oscillazione orizzontale di {device}"),
11790
+ icon: "move-horizontal",
11791
+ args: {
11792
+ axis: "horizontal",
11793
+ oscillating: false
11794
+ }
11795
+ },
11796
+ {
11797
+ id: "fan.verticalOscillateOn",
11798
+ method: "setOscillationAxis",
11799
+ label: t("Vertical oscillation on", "Oscillazione verticale attiva"),
11800
+ phrase: t("Start the vertical oscillation of {device}", "Attiva l’oscillazione verticale di {device}"),
11801
+ icon: "move-vertical",
11802
+ args: {
11803
+ axis: "vertical",
11804
+ oscillating: true
11805
+ }
11806
+ },
11807
+ {
11808
+ id: "fan.verticalOscillateOff",
11809
+ method: "setOscillationAxis",
11810
+ label: t("Vertical oscillation off", "Oscillazione verticale spenta"),
11811
+ phrase: t("Stop the vertical oscillation of {device}", "Ferma l’oscillazione verticale di {device}"),
11812
+ icon: "move-vertical",
11813
+ args: {
11814
+ axis: "vertical",
11815
+ oscillating: false
11816
+ }
11755
11817
  }
11756
11818
  ],
11757
11819
  state: [{
@@ -13841,10 +13903,6 @@ var CAMERA_CAP_VOCABULARY = {
13841
13903
  scope: "device",
13842
13904
  noun: t("Admin link", "Link di amministrazione")
13843
13905
  },
13844
- "device-discovery": {
13845
- scope: "device",
13846
- noun: t("Discovery", "Rilevamento dispositivi")
13847
- },
13848
13906
  "device-extension": {
13849
13907
  scope: "device",
13850
13908
  noun: t("Device extension", "Estensione del dispositivo")
@@ -15016,6 +15074,7 @@ var SYSTEM_CAP_VOCABULARY = {
15016
15074
  backup: system("system backups — run and restored from the Backups page"),
15017
15075
  broker: system("message-broker connections — configured, not actuated"),
15018
15076
  "calendar-source": system(INTERNAL),
15077
+ "cluster-update": system(CLUSTER),
15019
15078
  calendars: system("calendars feed schedules and conditions, not device actions"),
15020
15079
  composer: system("device composition — an authoring tool, not an action"),
15021
15080
  "core-blocks": system(INTERNAL),
@@ -15322,6 +15381,7 @@ var CAP_NAMES = Object.freeze([
15322
15381
  "camera-streams",
15323
15382
  "carbon-monoxide",
15324
15383
  "climate-control",
15384
+ "cluster-update",
15325
15385
  "color",
15326
15386
  "composer",
15327
15387
  "connectivity",
@@ -15339,7 +15399,6 @@ var CAP_NAMES = Object.freeze([
15339
15399
  "device-admin-link",
15340
15400
  "device-adoption",
15341
15401
  "device-credentials",
15342
- "device-discovery",
15343
15402
  "device-export",
15344
15403
  "device-extension",
15345
15404
  "device-history",
@@ -15961,13 +16020,6 @@ Object.freeze({
15961
16020
  "valueType": "string"
15962
16021
  }
15963
16022
  ],
15964
- "device-discovery": [{
15965
- "path": "lastDiscoveryAt",
15966
- "valueType": "number"
15967
- }, {
15968
- "path": "lastError",
15969
- "valueType": "string"
15970
- }],
15971
16023
  "device-export": [
15972
16024
  {
15973
16025
  "path": "linkState",
@@ -17419,7 +17471,7 @@ Object.freeze({
17419
17471
  }
17420
17472
  });
17421
17473
  //#endregion
17422
- //#region ../types/dist/implemented-methods-OitwyO1Y.mjs
17474
+ //#region ../types/dist/implemented-methods-5YMDeE3f.mjs
17423
17475
  /**
17424
17476
  * The ffmpeg build every CamStack node downloads, per platform and arch.
17425
17477
  *
@@ -44078,6 +44130,62 @@ var WeekdayKeySchema = _enum([
44078
44130
  "sat",
44079
44131
  "sun"
44080
44132
  ]);
44133
+ /**
44134
+ * Hold semantics — "for N seconds" on a leaf of the `when` tree (#498).
44135
+ *
44136
+ * ONE primitive, `for: { ms, mode, tolerance? }`, shared by `device-becomes`,
44137
+ * `device-is` and `expression`:
44138
+ *
44139
+ * - `held`: the condition stays true for `ms`;
44140
+ * - `stable`: the value does not move by more than `tolerance` (absolute, in
44141
+ * the field's base unit) for `ms` while the condition holds.
44142
+ *
44143
+ * {@link HoldCore} is the pure state machine (an input observation → a reading).
44144
+ * {@link HoldTracker} keys cores by a leaf path for the STATE leaves the tree
44145
+ * evaluator judges. {@link BecomesWatch} wraps a core with a timer for the
44146
+ * `device-becomes` EVENT leaf: the deadline is armed when the hold starts and
44147
+ * cancelled when it breaks, and the leaf fires ONCE per episode.
44148
+ *
44149
+ * Hold state is memory only. A hold that is already running when the watcher
44150
+ * first looks (a restart) is INHERITED: nobody knows when it began, so it never
44151
+ * fires for that episode and a state leaf reads it as unknown until the window
44152
+ * has elapsed from the moment the watcher started (D49: not-known is not false).
44153
+ */
44154
+ var HOLD_MAX_MS = 864e5;
44155
+ var HoldModeSchema = _enum(["held", "stable"]);
44156
+ var HoldSpecSchema = object({
44157
+ /** How long the condition (or the value) must hold. */
44158
+ ms: number$1().int().min(1).max(HOLD_MAX_MS),
44159
+ mode: HoldModeSchema,
44160
+ /** `stable` only: the largest move of the value that still counts as unchanged (absolute, base unit). */
44161
+ tolerance: number$1().min(0).optional()
44162
+ });
44163
+ /** What a trace says about a hold. */
44164
+ var HoldTraceSchema = object({
44165
+ phase: _enum([
44166
+ "pending",
44167
+ "cancelled",
44168
+ "fired",
44169
+ "reseeded"
44170
+ ]),
44171
+ ms: number$1().int(),
44172
+ mode: HoldModeSchema,
44173
+ /** When the hold started (ms epoch). */
44174
+ since: number$1().optional(),
44175
+ /** When it completes (ms epoch), for a pending hold. */
44176
+ deadline: number$1().optional()
44177
+ });
44178
+ /** The operators a `device-becomes` leaf may carry: a threshold or a range. */
44179
+ var BecomesOperatorSchema = _enum([
44180
+ "eq",
44181
+ "ne",
44182
+ "gt",
44183
+ "gte",
44184
+ "lt",
44185
+ "lte",
44186
+ "between",
44187
+ "outside"
44188
+ ]);
44081
44189
  /** How a state leaf compares a device field to a value. Derived from the
44082
44190
  * field's `kind` in `deviceManager.getWireableFields`, never hand-maintained. */
44083
44191
  var AutomationConditionOperatorSchema = _enum([
@@ -44091,6 +44199,13 @@ var AutomationConditionOperatorSchema = _enum([
44091
44199
  "in"
44092
44200
  ]);
44093
44201
  /**
44202
+ * The stable name of an event leaf. A path (`when.0.1`) moves when a row is
44203
+ * reordered; the id does not, so a `triggered-by` leaf keeps pointing at the
44204
+ * same row. Optional: a leaf nothing refers to needs none.
44205
+ */
44206
+ var EVENT_LEAF_ID_RE = /^[A-Za-z0-9_-]{1,40}$/;
44207
+ var eventLeafId = { id: string().regex(EVENT_LEAF_ID_RE).optional() };
44208
+ /**
44094
44209
  * D8 compliance, and it is the reason a "becomes" leaf is not merely an event
44095
44210
  * subscription: it evaluates against the **state mirror**, which is reconciled,
44096
44211
  * and an event only WAKES the evaluation. A dropped event therefore DELAYS a
@@ -44098,24 +44213,60 @@ var AutomationConditionOperatorSchema = _enum([
44098
44213
  */
44099
44214
  var DeviceBecomesLeafSchema = object({
44100
44215
  kind: literal("device-becomes"),
44216
+ ...eventLeafId,
44101
44217
  deviceId: number$1().int().nonnegative(),
44102
44218
  cap: string().min(1),
44103
44219
  fieldPath: string().min(1),
44104
- /** Fire when the field takes this value. Omit to fire on any change. */
44220
+ /** Fire when the field takes this value. Omit (with no `operator`) to fire on any change. */
44105
44221
  becomes: union([
44106
44222
  string(),
44107
44223
  number$1(),
44108
44224
  boolean()
44109
44225
  ]).optional(),
44110
- /** Only on a CHANGE of value, not on every re-report. */
44226
+ /**
44227
+ * A threshold or a range instead of an equality: "crosses above 3000", "enters
44228
+ * 18..24". The leaf fires on the TRANSITION into the predicate, never on a re-report.
44229
+ * `value` is in the field's base unit; `between` / `outside` take `[low, high]`.
44230
+ */
44231
+ operator: BecomesOperatorSchema.optional(),
44232
+ value: union([
44233
+ number$1(),
44234
+ string(),
44235
+ boolean(),
44236
+ array(number$1()).length(2)
44237
+ ]).optional(),
44238
+ /**
44239
+ * Hold: the transition (or, with no predicate, the new value) must stay for
44240
+ * `for.ms` before the leaf fires, ONCE per episode. See `hold.ts`.
44241
+ */
44242
+ for: HoldSpecSchema.optional(),
44243
+ /** @deprecated every leaf fires on a transition now; read as always on. */
44111
44244
  edge: boolean().optional(),
44112
- /** The new value must hold this long before it counts. */
44113
- forMs: number$1().int().min(0).max(864e5).optional(),
44245
+ /** @deprecated legacy `held` window — read through `holdOf` as `for: { ms, mode: 'held' }`. */
44246
+ forMs: number$1().int().min(0).max(HOLD_MAX_MS).optional(),
44114
44247
  /** Collapse a burst into one occurrence. */
44115
44248
  debounceMs: number$1().int().min(0).max(6e5).optional()
44249
+ }).superRefine((leaf, ctx) => {
44250
+ if (leaf.becomes !== void 0 && leaf.operator !== void 0) ctx.addIssue({
44251
+ code: "custom",
44252
+ message: "a leaf names `becomes` or `operator`, not both",
44253
+ path: ["operator"]
44254
+ });
44255
+ if (leaf.operator !== void 0 && leaf.value === void 0) ctx.addIssue({
44256
+ code: "custom",
44257
+ message: "an operator needs the value to compare to",
44258
+ path: ["value"]
44259
+ });
44260
+ const range = leaf.operator === "between" || leaf.operator === "outside";
44261
+ if (leaf.operator !== void 0 && range !== Array.isArray(leaf.value)) ctx.addIssue({
44262
+ code: "custom",
44263
+ message: range ? "a range takes [low, high]" : "only a range takes [low, high]",
44264
+ path: ["value"]
44265
+ });
44116
44266
  });
44117
44267
  var DeviceEventLeafSchema = object({
44118
44268
  kind: literal("device-event"),
44269
+ ...eventLeafId,
44119
44270
  /** An `EventCategory` value. */
44120
44271
  category: string().min(1),
44121
44272
  deviceId: number$1().int().nonnegative().optional()
@@ -44128,18 +44279,24 @@ var DeviceEventLeafSchema = object({
44128
44279
  */
44129
44280
  var ScheduleLeafSchema = object({
44130
44281
  kind: literal("schedule"),
44282
+ ...eventLeafId,
44131
44283
  at: TimeSpecSchema.optional(),
44132
44284
  days: array(WeekdayKeySchema).min(1).max(7).optional(),
44133
44285
  /** @deprecated legacy cron — new schedules use `at`. */
44134
44286
  cron: string().min(1).max(120).optional()
44135
44287
  }).refine((leaf) => leaf.at === void 0 !== (leaf.cron === void 0), { message: "a schedule names exactly one of `at` (a time spec) and `cron` (legacy)" }).refine((leaf) => leaf.days === void 0 || leaf.at !== void 0, { message: "`days` goes with `at`; a cron expression carries its own days" });
44136
- var ManualLeafSchema = object({ kind: literal("manual") });
44288
+ var ManualLeafSchema = object({
44289
+ kind: literal("manual"),
44290
+ ...eventLeafId
44291
+ });
44137
44292
  var IntervalLeafSchema = object({
44138
44293
  kind: literal("interval"),
44294
+ ...eventLeafId,
44139
44295
  minutes: number$1().int().min(1).max(1440)
44140
44296
  });
44141
44297
  var DetectionLeafSchema = object({
44142
44298
  kind: literal("detection"),
44299
+ ...eventLeafId,
44143
44300
  /** One macro class each, optionally narrowed by a label; a track of any listed subject fires. */
44144
44301
  subjects: array(DetectionSubjectSchema).min(1),
44145
44302
  deviceIds: array(number$1().int().nonnegative()).min(1),
@@ -44150,6 +44307,7 @@ var DetectionLeafSchema = object({
44150
44307
  });
44151
44308
  var StationaryLeafSchema = object({
44152
44309
  kind: literal("stationary"),
44310
+ ...eventLeafId,
44153
44311
  deviceIds: array(number$1().int().nonnegative()).min(1),
44154
44312
  subjects: array(StationarySubjectSchema).min(1).optional(),
44155
44313
  zones: array(string().min(1)).min(1).optional(),
@@ -44177,7 +44335,9 @@ var DeviceIsLeafSchema = object({
44177
44335
  QuantityValueSchema
44178
44336
  ]),
44179
44337
  /** The unit the person picked for `value` (display only; `value` is in the base unit). */
44180
- unit: string().min(1).optional()
44338
+ unit: string().min(1).optional(),
44339
+ /** The comparison must hold (`held`) or the value stay put (`stable`) this long. */
44340
+ for: HoldSpecSchema.optional()
44181
44341
  });
44182
44342
  /**
44183
44343
  * True when the camera currently has a PARKED object matching `subjects` in at
@@ -44193,6 +44353,41 @@ var StationaryPresentLeafSchema = object({
44193
44353
  minCount: number$1().int().positive().optional()
44194
44354
  });
44195
44355
  /**
44356
+ * True while the site-local clock is inside a daily window and/or on one of
44357
+ * the named days. `days` names the local day a window STARTS on, so
44358
+ * 22:00-06:00 on weekdays is still inside at 01:00 Saturday. A one-date spec
44359
+ * (`kind: 'date'`) is refused: only a clock time or a sun event makes a window
44360
+ * that repeats every day.
44361
+ */
44362
+ var TimeIsLeafSchema = object({
44363
+ kind: literal("time-is"),
44364
+ between: object({
44365
+ from: TimeSpecSchema,
44366
+ to: TimeSpecSchema
44367
+ }).optional(),
44368
+ days: array(WeekdayKeySchema).min(1).max(7).optional()
44369
+ }).superRefine((leaf, ctx) => {
44370
+ if (leaf.between === void 0 && leaf.days === void 0) ctx.addIssue({
44371
+ code: "custom",
44372
+ message: "a time-is leaf needs a between window, days, or both"
44373
+ });
44374
+ for (const end of ["from", "to"]) if (leaf.between?.[end].kind === "date") ctx.addIssue({
44375
+ code: "custom",
44376
+ message: "a one-date time cannot bound a daily window: use a clock time or a sun event",
44377
+ path: ["between", end]
44378
+ });
44379
+ });
44380
+ /**
44381
+ * True for the run that one of the named event leaves started. It reads the
44382
+ * run, not a device: in the tree it is judged against the leaf that fired, in
44383
+ * a step guard against the trigger the run carries. A run no event leaf
44384
+ * started (a state-only tree becoming true) is false.
44385
+ */
44386
+ var TriggeredByLeafSchema = object({
44387
+ kind: literal("triggered-by"),
44388
+ leafIds: array(string().regex(EVENT_LEAF_ID_RE)).min(1).max(20)
44389
+ });
44390
+ /**
44196
44391
  * The escape hatch: the bounded expression engine over named device bindings.
44197
44392
  * Declared as a plain object so a discriminated union can read `kind`; the
44198
44393
  * author-time validation is the SAME function `ExpressionSourceSchema` runs.
@@ -44200,7 +44395,9 @@ var StationaryPresentLeafSchema = object({
44200
44395
  var ExpressionLeafSchema = object({
44201
44396
  kind: literal("expression"),
44202
44397
  expr: string().min(1).max(MAX_EXPRESSION_SOURCE_LENGTH),
44203
- bindings: record(string().regex(EXPRESSION_IDENTIFIER_RE), ExpressionBindingSourceSchema)
44398
+ bindings: record(string().regex(EXPRESSION_IDENTIFIER_RE), ExpressionBindingSourceSchema),
44399
+ /** The expression must stay true this long. An expression has no single value, so only `held`. */
44400
+ for: HoldSpecSchema.optional()
44204
44401
  }).superRefine((src, ctx) => {
44205
44402
  const err = validateExpressionSource(src);
44206
44403
  if (err !== null) ctx.addIssue({
@@ -44208,6 +44405,11 @@ var ExpressionLeafSchema = object({
44208
44405
  message: err,
44209
44406
  path: ["expr"]
44210
44407
  });
44408
+ if (src.for?.mode === "stable") ctx.addIssue({
44409
+ code: "custom",
44410
+ message: "an expression is held, not stable: it has no single value to keep still",
44411
+ path: ["for", "mode"]
44412
+ });
44211
44413
  });
44212
44414
  var AutomationWhenSchema = lazy(() => discriminatedUnion("kind", [
44213
44415
  object({
@@ -44231,7 +44433,9 @@ var AutomationWhenSchema = lazy(() => discriminatedUnion("kind", [
44231
44433
  StationaryLeafSchema,
44232
44434
  DeviceIsLeafSchema,
44233
44435
  StationaryPresentLeafSchema,
44234
- ExpressionLeafSchema
44436
+ ExpressionLeafSchema,
44437
+ TimeIsLeafSchema,
44438
+ TriggeredByLeafSchema
44235
44439
  ]));
44236
44440
  var EVENT_KINDS = new Set([
44237
44441
  "device-becomes",
@@ -44285,6 +44489,28 @@ function hasEventLeaves(node) {
44285
44489
  });
44286
44490
  return found;
44287
44491
  }
44492
+ /** The event leaves of the tree that carry an id, in tree order. */
44493
+ function identifiedEventLeaves(when) {
44494
+ const found = [];
44495
+ forEachLeaf(when, (leaf, path) => {
44496
+ if (isEventLeaf(leaf) && leaf.id !== void 0) found.push({
44497
+ id: leaf.id,
44498
+ path,
44499
+ leaf
44500
+ });
44501
+ });
44502
+ return found;
44503
+ }
44504
+ /** Does the tree hold a `triggered-by` leaf? */
44505
+ function hasTriggeredByLeaves(when) {
44506
+ let found = false;
44507
+ forEachLeaf(when, (leaf) => {
44508
+ if (leaf.kind === "triggered-by") found = true;
44509
+ });
44510
+ return found;
44511
+ }
44512
+ /** Why a `triggered-by` leaf is refused outside an automation: there is no trigger row to name. */
44513
+ var TRIGGERED_BY_NEEDS_AUTOMATION = "\"triggered by\" reads which trigger started an automation — an action or a scheduler has no trigger rows, so it could never be true here";
44288
44514
  function hasEmptyContainer(node) {
44289
44515
  if (isLeaf(node)) return false;
44290
44516
  if (node.kind === "not") return hasEmptyContainer(node.child);
@@ -44343,6 +44569,11 @@ function validateWhenTree(when) {
44343
44569
  if (depth > 4) return `the rules nest ${depth} levels deep — the limit is 4. "not (any of …)" is the same as "all of (not …)", which is one level shallower`;
44344
44570
  const leaves = countWhenLeaves(when);
44345
44571
  if (leaves > 32) return `the rules use ${leaves} rows — the limit is 32`;
44572
+ const seen = /* @__PURE__ */ new Set();
44573
+ for (const entry of identifiedEventLeaves(when)) {
44574
+ if (seen.has(entry.id)) return `two trigger rows share the id "${entry.id}" — an id names one row`;
44575
+ seen.add(entry.id);
44576
+ }
44346
44577
  const need = eventNeed(when, "when", false);
44347
44578
  if ("error" in need) return need.error;
44348
44579
  const [first, second] = need.paths;
@@ -44633,7 +44864,18 @@ var GuardedCapStepSchema = AutomationCapStepBaseSchema.extend(stepGuardShape).re
44633
44864
  message: "a domain target needs the vocabulary action it applies to (actionId)",
44634
44865
  path: ["actionId"]
44635
44866
  }).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
44636
- var ActionStepSchema = discriminatedUnion("kind", [GuardedWaitStepSchema, GuardedCapStepSchema]);
44867
+ /**
44868
+ * A step of a STANDALONE list (an action, a scheduler point, a preset): the
44869
+ * same two step kinds an automation runs, minus a guard that reads the
44870
+ * automation's trigger, which such a list does not have.
44871
+ */
44872
+ var ActionStepSchema = discriminatedUnion("kind", [GuardedWaitStepSchema, GuardedCapStepSchema]).superRefine((step, ctx) => {
44873
+ if (step.if !== void 0 && hasTriggeredByLeaves(step.if)) ctx.addIssue({
44874
+ code: "custom",
44875
+ message: TRIGGERED_BY_NEEDS_AUTOMATION,
44876
+ path: ["if"]
44877
+ });
44878
+ });
44637
44879
  var AutomationActionSchema = discriminatedUnion("kind", [
44638
44880
  GuardedWaitStepSchema,
44639
44881
  GuardedCapStepSchema,
@@ -44730,6 +44972,11 @@ var STATIONARY_DESCRIPTIONS = {
44730
44972
  phase: "appeared or departed",
44731
44973
  entryId: "the stopped object"
44732
44974
  };
44975
+ var BECOMES_DESCRIPTIONS = {
44976
+ deviceId: "the device that changed",
44977
+ from: "the value before the change, empty when it is not known",
44978
+ to: "the value it changed to"
44979
+ };
44733
44980
  function describe$1(descriptions) {
44734
44981
  return Object.entries(descriptions).map(([name, description]) => ({
44735
44982
  name,
@@ -44738,6 +44985,10 @@ function describe$1(descriptions) {
44738
44985
  }
44739
44986
  describe$1(DETECTION_DESCRIPTIONS);
44740
44987
  describe$1(STATIONARY_DESCRIPTIONS);
44988
+ describe$1(BECOMES_DESCRIPTIONS).map((v) => v.name === "deviceId" ? {
44989
+ ...v,
44990
+ hintKey: "becomesDeviceId"
44991
+ } : v);
44741
44992
  new Set(Object.values(COCO_TO_MACRO.mapping));
44742
44993
  /**
44743
44994
  * Schedulers (D983) — an entity that performs actions over the day.
@@ -44762,6 +45013,13 @@ var SchedulerStateTreeSchema = AutomationWhenSchema.superRefine((when, ctx) => {
44762
45013
  });
44763
45014
  return;
44764
45015
  }
45016
+ if (hasTriggeredByLeaves(when)) {
45017
+ ctx.addIssue({
45018
+ code: "custom",
45019
+ message: TRIGGERED_BY_NEEDS_AUTOMATION
45020
+ });
45021
+ return;
45022
+ }
44765
45023
  const problem = validateWhenTree(when);
44766
45024
  if (problem !== null) ctx.addIssue({
44767
45025
  code: "custom",
@@ -44967,7 +45225,9 @@ var AutomationTriggerTraceSchema = object({
44967
45225
  /** Why an event was rejected ("class person not in [dog]") or what fired. */
44968
45226
  reason: string(),
44969
45227
  /** deviceId, className, trackId, score … — only what the trigger exposes. */
44970
- vars: record(string(), TraceValueSchema)
45228
+ vars: record(string(), TraceValueSchema),
45229
+ /** A hold (`for`) this occurrence went through: pending, cancelled, fired or re-seeded. */
45230
+ hold: HoldTraceSchema.optional()
44971
45231
  });
44972
45232
  var AutomationConditionTraceNodeSchema = object({
44973
45233
  /** `when` for the root, `when.<i>` for its i-th child, … (`conditions…` on an old trace). */
@@ -44980,6 +45240,8 @@ var AutomationConditionTraceNodeSchema = object({
44980
45240
  "device-is",
44981
45241
  "expression",
44982
45242
  "stationary-present",
45243
+ "time-is",
45244
+ "triggered-by",
44983
45245
  "device-becomes",
44984
45246
  "device-event",
44985
45247
  "schedule",
@@ -45313,7 +45575,7 @@ object({
45313
45575
  * is irrelevant; the array is treated as a set by consumers. */
45314
45576
  hiddenChildIds: array(number$1()).readonly()
45315
45577
  });
45316
- DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Light, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Cover, DeviceType.Lock, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Generic, method(object({
45578
+ DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Sensor, DeviceType.Climate, DeviceType.Cover, DeviceType.Lock, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Generic, method(object({
45317
45579
  deviceId: number$1().int().nonnegative(),
45318
45580
  childDeviceId: number$1().int().nonnegative(),
45319
45581
  hidden: boolean()
@@ -47611,7 +47873,7 @@ var BATTERY_DEVICE_TYPES = [
47611
47873
  DeviceType.Switch,
47612
47874
  DeviceType.PetFeeder,
47613
47875
  DeviceType.Container,
47614
- DeviceType.Thermostat,
47876
+ DeviceType.Climate,
47615
47877
  DeviceType.EventEmitter
47616
47878
  ];
47617
47879
  /** Generic Customize target for the percentage reading (D936). */
@@ -49374,7 +49636,14 @@ var climateControlCapability = {
49374
49636
  scope: "device",
49375
49637
  deviceNative: true,
49376
49638
  mode: "singleton",
49377
- deviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
49639
+ deviceTypes: [DeviceType.Climate],
49640
+ power: {
49641
+ kind: "mode",
49642
+ field: "mode",
49643
+ offValue: "off",
49644
+ set: "setMode",
49645
+ lastField: "lastActiveMode"
49646
+ },
49378
49647
  methods: {
49379
49648
  setMode: method(object({
49380
49649
  deviceId: number$1().int().nonnegative(),
@@ -49484,6 +49753,140 @@ var climateControlCapability = {
49484
49753
  } }
49485
49754
  };
49486
49755
  /**
49756
+ * cluster-update — the ONE flow that brings the whole cluster to a release
49757
+ * (planning#493). Hub-provided (`server-provided`), hub-only: the hub runs
49758
+ * the sequence itself, so the admin UI, the MCP and the CLI all start the same
49759
+ * job and read the same report instead of each driving their own loop.
49760
+ *
49761
+ * 1. backup (`backup.trigger`) — skipped only when the caller says so
49762
+ * 2. the hub's server closure (`applyServerUpdate`); the hub restarts and the
49763
+ * job RESUMES on the new boot, verified against the hub's running version
49764
+ * 3. every online agent behind the target, one at a time, verified: runs the
49765
+ * target, settled, online, and its capabilities registered (D848) — an
49766
+ * agent that comes back capless is a FAILED step, never a done one
49767
+ * 4. every stale addon on the hub (`addons.updatePackage`); agents follow by
49768
+ * reconciliation, which is verified, never pushed
49769
+ *
49770
+ * The job stops on the first failed step with a typed reason (D877). Its state
49771
+ * is durable on the hub and read by RPC (`getClusterUpdateJob`) — events are
49772
+ * telemetry and never carry it (D8, D11).
49773
+ */
49774
+ /** The steps, in the order they run. */
49775
+ var ClusterUpdateStepKindSchema = _enum([
49776
+ "backup",
49777
+ "hub-server",
49778
+ "agent-server",
49779
+ "addons"
49780
+ ]);
49781
+ /**
49782
+ * - `pending` — not reached yet.
49783
+ * - `running` — in progress (for `hub-server`: possibly across the restart).
49784
+ * - `ok` — done AND verified.
49785
+ * - `failed` — did not land; `reason` + `detail` say why. Stops the job.
49786
+ * - `skipped` — not run: nothing to do, opted out, the node is offline, or a
49787
+ * step before it failed. `detail` says which.
49788
+ */
49789
+ var ClusterUpdateStepStatusSchema = _enum([
49790
+ "pending",
49791
+ "running",
49792
+ "ok",
49793
+ "failed",
49794
+ "skipped"
49795
+ ]);
49796
+ /**
49797
+ * Why a step (and with it the job) failed. Stable, greppable; `detail` carries
49798
+ * the prose.
49799
+ */
49800
+ var ClusterUpdateFailureReasonSchema = _enum([
49801
+ "backup-unavailable",
49802
+ "backup-failed",
49803
+ "server-refused",
49804
+ "server-not-on-target",
49805
+ "node-capless",
49806
+ "status-unreadable",
49807
+ "addon-update-failed",
49808
+ "addons-not-converged",
49809
+ "interrupted"
49810
+ ]);
49811
+ var ClusterUpdateStepSchema = object({
49812
+ kind: ClusterUpdateStepKindSchema,
49813
+ /** The node the step acts on; absent for `backup` and `addons`. */
49814
+ nodeId: string().optional(),
49815
+ status: ClusterUpdateStepStatusSchema,
49816
+ /** One line for the operator: what happened, or why not. */
49817
+ detail: string(),
49818
+ reason: ClusterUpdateFailureReasonSchema.optional(),
49819
+ /** `hub-server` / `agent-server`: the version the node ran before. */
49820
+ fromVersion: string().nullable().optional(),
49821
+ /** `addons`: the packages this step updates, `name from -> to`. */
49822
+ packages: array(string()).readonly().optional(),
49823
+ startedAt: number$1().optional(),
49824
+ finishedAt: number$1().optional()
49825
+ });
49826
+ var ClusterUpdateJobStateSchema = _enum([
49827
+ "running",
49828
+ "succeeded",
49829
+ "failed"
49830
+ ]);
49831
+ var ClusterUpdateJobSchema = object({
49832
+ id: string(),
49833
+ state: ClusterUpdateJobStateSchema,
49834
+ /** The server version every node is brought to. */
49835
+ targetVersion: string(),
49836
+ /** Who started it (the user name, or `system`). */
49837
+ requestedBy: string(),
49838
+ startedAt: number$1(),
49839
+ finishedAt: number$1().optional(),
49840
+ /** Every step, in run order; later steps stay `pending` while it runs. */
49841
+ steps: array(ClusterUpdateStepSchema).readonly(),
49842
+ /** On `failed`: the step that stopped it (`nodeId` or the step kind). */
49843
+ stoppedAt: string().optional(),
49844
+ reason: ClusterUpdateFailureReasonSchema.optional(),
49845
+ /** Agents offline when the plan was read: never touched. */
49846
+ skippedOffline: array(string()).readonly()
49847
+ });
49848
+ var ClusterUpdateOptionsSchema = object({
49849
+ /** Explicit server target; omitted = the hub's latest registry check. */
49850
+ version: string().optional(),
49851
+ /** Update the addons too (default true). */
49852
+ addons: boolean().optional(),
49853
+ /**
49854
+ * Back up before touching anything (default true). `false` is an explicit
49855
+ * operator opt-out; a missing backup provider is otherwise a failure.
49856
+ */
49857
+ backup: boolean().optional()
49858
+ });
49859
+ /** Why a plan cannot start. */
49860
+ var ClusterUpdateBlockerSchema = _enum([
49861
+ "no-target",
49862
+ "node-busy",
49863
+ "job-running",
49864
+ "nothing-to-do",
49865
+ "status-unreadable"
49866
+ ]);
49867
+ var ClusterUpdatePlanSchema = object({
49868
+ /** `null` when no target could be resolved (`blocker: 'no-target'`). */
49869
+ targetVersion: string().nullable(),
49870
+ /** The steps the job WOULD run, all `pending` (or `skipped` with a reason). */
49871
+ steps: array(ClusterUpdateStepSchema).readonly(),
49872
+ skippedOffline: array(string()).readonly(),
49873
+ /** `null` = the plan can start. */
49874
+ blocker: ClusterUpdateBlockerSchema.nullable(),
49875
+ /** Prose for `blocker`. */
49876
+ blockerDetail: string().nullable()
49877
+ });
49878
+ var StartClusterUpdateResultSchema = object({
49879
+ accepted: boolean(),
49880
+ /** The job to follow with `getClusterUpdateJob`; `null` when refused. */
49881
+ jobId: string().nullable(),
49882
+ blocker: ClusterUpdateBlockerSchema.nullable(),
49883
+ message: string()
49884
+ });
49885
+ method(ClusterUpdateOptionsSchema, ClusterUpdatePlanSchema, { auth: "admin" }), method(ClusterUpdateOptionsSchema, StartClusterUpdateResultSchema, {
49886
+ kind: "mutation",
49887
+ auth: "admin"
49888
+ }), method(object({ jobId: string().optional() }), ClusterUpdateJobSchema.nullable(), { auth: "admin" });
49889
+ /**
49487
49890
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
49488
49891
  * (level) on the same device — `switch` toggles the bulb, `brightness`
49489
49892
  * sets the dim level, this cap sets the chromaticity.
@@ -49625,6 +50028,7 @@ var CompositionProblemSchema = object({
49625
50028
  "nested-field",
49626
50029
  "missing-field",
49627
50030
  "kind-mismatch",
50031
+ "source-kind-mismatch",
49628
50032
  "may-be-null",
49629
50033
  "source-missing",
49630
50034
  "source-unreadable",
@@ -49646,7 +50050,8 @@ var CompositionProblemSchema = object({
49646
50050
  "command-method-unknown",
49647
50051
  "command-source-unknown",
49648
50052
  "command-input-unknown",
49649
- "command-input-missing"
50053
+ "command-input-missing",
50054
+ "power-source-is-actuator"
49650
50055
  ]),
49651
50056
  path: string(),
49652
50057
  message: string()
@@ -50684,6 +51089,13 @@ var mediaPlayerCapability = {
50684
51089
  deviceNative: true,
50685
51090
  mode: "singleton",
50686
51091
  deviceTypes: [DeviceType.MediaPlayer],
51092
+ power: {
51093
+ kind: "methods",
51094
+ field: "state",
51095
+ offValues: ["off", "standby"],
51096
+ on: "turnOn",
51097
+ off: "turnOff"
51098
+ },
50687
51099
  methods: {
50688
51100
  turnOn: optionalMethod(deviceOnly, _void(), {
50689
51101
  kind: "mutation",
@@ -50814,7 +51226,7 @@ var mediaPlayerCapability = {
50814
51226
  isMuted: { kind: "boolean" }
50815
51227
  } }
50816
51228
  };
50817
- 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.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, 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.Heater, 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.Heater, 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.Heater, 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.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.MediaPlayer;
51229
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, 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.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.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.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer;
50818
51230
  var NUMBER = {
50819
51231
  kind: "fixed",
50820
51232
  result: ["number"]
@@ -50897,7 +51309,7 @@ function numeric(input) {
50897
51309
  }, ...alsoFrom === void 0 ? [] : [alsoFrom.accept]]
50898
51310
  };
50899
51311
  }
50900
- var CLIMATE_DEVICES = [DeviceType.Thermostat, DeviceType.Climate];
51312
+ var CLIMATE_DEVICES = [DeviceType.Climate];
50901
51313
  function binary(input) {
50902
51314
  return {
50903
51315
  ...input,
@@ -51219,8 +51631,8 @@ var GROUP_TEMPLATES = [
51219
51631
  actuator({
51220
51632
  id: "climate",
51221
51633
  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.",
51222
- deviceType: DeviceType.Thermostat,
51223
- memberDeviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
51634
+ deviceType: DeviceType.Climate,
51635
+ memberDeviceTypes: [DeviceType.Climate],
51224
51636
  outputCap: "group-active",
51225
51637
  outputField: "active",
51226
51638
  member: {
@@ -51263,6 +51675,118 @@ function actuator(input) {
51263
51675
  new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
51264
51676
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
51265
51677
  DeviceType.Camera;
51678
+ var PowerSourceRefusalReasonSchema = _enum([
51679
+ "no-power-source",
51680
+ "switch-missing",
51681
+ "switch-offline",
51682
+ "switch-unknown",
51683
+ "restart-in-progress",
51684
+ "switch-call-failed",
51685
+ "switch-is-actuator"
51686
+ ]);
51687
+ var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
51688
+ accepted: literal(false),
51689
+ reason: PowerSourceRefusalReasonSchema,
51690
+ /** One line for the operator, naming the switch. */
51691
+ message: string()
51692
+ })]);
51693
+ var PowerSourceInfoSchema = object({
51694
+ /** False when the device has no power source linked; the rest is then empty. */
51695
+ linked: boolean(),
51696
+ switchDeviceId: number$1().nullable(),
51697
+ switchName: string().nullable(),
51698
+ /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
51699
+ switchOn: boolean().nullable(),
51700
+ switchOnline: boolean().nullable(),
51701
+ restartInProgress: boolean(),
51702
+ offSeconds: number$1().int()
51703
+ });
51704
+ /** The composed slice: the switch state the link mirrors, plus the stored off time. */
51705
+ var PowerSourceStateSchema = object({
51706
+ /** Null while the switch has not reported: unknown is never `false` (D393). */
51707
+ switchOn: boolean().nullable(),
51708
+ offSeconds: number$1().int(),
51709
+ lastFetchedAt: number$1()
51710
+ });
51711
+ var POWER_SOURCE_DEVICE_TYPES = [
51712
+ DeviceType.Gateway,
51713
+ DeviceType.Camera,
51714
+ DeviceType.Sensor,
51715
+ DeviceType.MediaPlayer,
51716
+ DeviceType.Vacuum,
51717
+ DeviceType.Generic,
51718
+ DeviceType.Washer,
51719
+ DeviceType.Dryer,
51720
+ DeviceType.Dishwasher,
51721
+ DeviceType.PetFountain,
51722
+ DeviceType.Fan,
51723
+ DeviceType.Humidifier,
51724
+ DeviceType.Climate,
51725
+ DeviceType.WaterHeater
51726
+ ];
51727
+ var powerSourceCustomize = {
51728
+ version: 1,
51729
+ targets: [{
51730
+ id: "switch",
51731
+ cardinality: "scalar",
51732
+ vocabulary: {
51733
+ cap: "power-source",
51734
+ stateField: "switchOn"
51735
+ },
51736
+ deviceTypes: POWER_SOURCE_DEVICE_TYPES,
51737
+ apply: "add",
51738
+ path: "switchOn",
51739
+ sources: [{
51740
+ kind: "switch",
51741
+ transforms: [{ kind: "identity" }]
51742
+ }],
51743
+ companions: [{
51744
+ kind: "constant",
51745
+ path: "offSeconds",
51746
+ value: 10,
51747
+ when: "add",
51748
+ formerValues: [0]
51749
+ }, {
51750
+ kind: "clock",
51751
+ path: "lastFetchedAt",
51752
+ when: "always"
51753
+ }],
51754
+ sourceReport: { status: "assignment-status" }
51755
+ }]
51756
+ };
51757
+ var deviceInput$2 = object({ deviceId: number$1().int().nonnegative() });
51758
+ var powerSourceCapability = {
51759
+ name: "power-source",
51760
+ scope: "device",
51761
+ mode: "singleton",
51762
+ deviceTypes: POWER_SOURCE_DEVICE_TYPES,
51763
+ methods: {
51764
+ getStatus: systemMethod(deviceInput$2, PowerSourceInfoSchema, { auth: "protected" }),
51765
+ powerOn: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
51766
+ kind: "mutation",
51767
+ auth: "protected"
51768
+ }),
51769
+ powerOff: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
51770
+ kind: "mutation",
51771
+ auth: "protected"
51772
+ }),
51773
+ forceRestart: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
51774
+ kind: "mutation",
51775
+ auth: "protected"
51776
+ })
51777
+ },
51778
+ runtimeState: PowerSourceStateSchema,
51779
+ customize: powerSourceCustomize,
51780
+ /**
51781
+ * Runtime-state durability: **session** — mirrored from the linked switch on
51782
+ * its next report; a restored value would outlive the reading it names.
51783
+ *
51784
+ * See `RuntimeStateDurability`. Enforced by
51785
+ * `scripts/check-runtime-state-durability.ts`.
51786
+ */
51787
+ durability: "session",
51788
+ history: "none"
51789
+ };
51266
51790
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
51267
51791
  /**
51268
51792
  * What a composition may BUILD on a device type (G2, D676): the caps a new
@@ -52307,27 +52831,35 @@ var deviceAdminLinkCapability = {
52307
52831
  getAdminLink: method(object({ deviceId: number$1().int().nonnegative() }), DeviceAdminLinkSchema.nullable(), { auth: "admin" }) }
52308
52832
  };
52309
52833
  /**
52310
- * device-discovery — device-scoped capability for parents that host /
52311
- * enumerate child devices (Reolink Hub / NVR, ONVIF gateway, future
52312
- * integrations). The parent advertises a list of discoverable children,
52313
- * and the operator promotes a subset to real devices via `adoptDevice`.
52314
- * Child lifecycle (kernel device create/remove, parent reference) is
52315
- * owned by the framework so a single shared `<DiscoveryPanel />` can
52316
- * drive any integration.
52317
- *
52318
- * Boundaries:
52319
- * - The cap exposes ENUMERATION + ADOPT/RELEASE only. The protocol
52320
- * used to discover children (CGI poll, mDNS, push from hub, ...)
52321
- * is the integration's business; results land in `runtimeState`
52322
- * so the panel can render without a fresh round-trip.
52323
- * - `childNativeId` is integration-defined and must be stable across
52324
- * reboots so re-discovery doesn't duplicate adopted children.
52325
- * - `adoptDevice` returns the new `deviceId` so the UI can navigate
52326
- * directly to the freshly-created child's settings page.
52327
- */
52328
- /**
52329
- * Status enum for a discovered device. Mirrors the Reolink simpleEvent
52330
- * lifecycle (`online` / `sleeping` / `offline`) — generic enough for
52834
+ * `device-adoption` — generic discovery + adoption surface,
52835
+ * system-scoped collection (one provider per integration addon), routed
52836
+ * by explicit `{ addonId }` on direct `deviceAdoption.*` calls — the same
52837
+ * pin model as `connection-test`. The admin UI keeps using
52838
+ * `deviceManager.adoption*` (which already threads `addonId`). The de-HA-ified
52839
+ * successor to `ha-discovery`:
52840
+ * keyed by `integrationId` (the addon resolves integrationId → broker
52841
+ * internally) rather than a connection-specific `brokerId`, and it
52842
+ * OWNS the shared `DiscoveredChildDevice` candidate type
52843
+ * (declared below) so a single shared adoption modal renders any integration's
52844
+ * candidate tree.
52845
+ *
52846
+ * UI flow (Integrations page → integration detail):
52847
+ * 1. `listCandidates({integrationId, page, pageSize, filter})` →
52848
+ * paginated candidate list, each row collapsed.
52849
+ * 2. User expands a row → `getCandidate({integrationId,
52850
+ * childNativeId})` returns the single candidate (with its nested
52851
+ * `children`) for the accordion render.
52852
+ * 3. User clicks "Adopt" on one or more candidates →
52853
+ * `adopt({integrationId, childNativeIds, perCandidate?})`
52854
+ * materialises one parent CamStack device per candidate plus its
52855
+ * accessory children. `perCandidate[childNativeId]` carries an
52856
+ * optional display-name override + a `hiddenChildIds` pre-hide set
52857
+ * (the parent's `accessories.hiddenChildIds` gates UI visibility).
52858
+ * 4. User clicks "Release" → `release({integrationId, camDeviceId})`
52859
+ * removes the parent + every child from the kernel registry.
52860
+ */
52861
+ /**
52862
+ * Status enum for a discovered device. Generic enough for
52331
52863
  * battery cams, awake cams, and unreachable cams alike.
52332
52864
  */
52333
52865
  var DiscoveredChildStatusSchema = _enum([
@@ -52344,12 +52876,12 @@ var DiscoveredChildDeviceSchema = lazy(() => object({
52344
52876
  /** DeviceType the child should be created with on adopt. */
52345
52877
  type: _enum(DeviceType),
52346
52878
  status: DiscoveredChildStatusSchema,
52347
- /** Free-form integration-specific metadata surfaced in the panel. */
52879
+ /** Free-form integration-specific metadata surfaced in the adoption modal. */
52348
52880
  metadata: object({
52349
52881
  model: string().optional(),
52350
52882
  serialNumber: string().optional(),
52351
52883
  uid: string().optional(),
52352
- /** Reolink: 0-based channel index inside the parent NVR/Hub. */
52884
+ /** Reolink: 0-based channel index inside the parent NVR. */
52353
52885
  rtspChannel: number$1().int().nonnegative().optional(),
52354
52886
  isBattery: boolean().optional(),
52355
52887
  isDoorbell: boolean().optional(),
@@ -52365,137 +52897,24 @@ var DiscoveredChildDeviceSchema = lazy(() => object({
52365
52897
  }).default({}),
52366
52898
  /**
52367
52899
  * `true` when the framework already created a child device for this
52368
- * `childNativeId` under the current parent. The panel uses it to
52900
+ * `childNativeId` under the current parent. The adoption modal uses it to
52369
52901
  * gate the Add/Remove button and surface the existing `deviceId`.
52370
52902
  */
52371
52903
  alreadyAdopted: boolean(),
52372
52904
  /** When `alreadyAdopted=true`, the framework-assigned child device id. */
52373
52905
  adoptedDeviceId: number$1().int().nonnegative().nullable(),
52374
- /** Capability names the candidate advertises — integrations populate, Hubs omit. */
52906
+ /** Capability names the candidate advertises — integrations populate, flat enumerations omit. */
52375
52907
  capabilities: array(string()).readonly().optional(),
52376
- /** Feature flags the candidate advertises — integrations populate, Hubs omit. */
52908
+ /** Feature flags the candidate advertises — integrations populate, flat enumerations omit. */
52377
52909
  features: array(string()).readonly().optional(),
52378
52910
  /** Upstream-system identity + rendering hints for the candidate. */
52379
52911
  sourceInfo: SourceInfoSchema.optional(),
52380
- /** Nested entity-children for accordion preview — integrations populate, Hubs omit. */
52912
+ /** Nested entity-children for accordion preview — integrations populate, flat enumerations omit. */
52381
52913
  children: array(DiscoveredChildDeviceSchema).readonly().optional(),
52382
52914
  /** `childNativeId` of the gateway candidate in the same list this device sits behind. */
52383
52915
  parentStableId: string().optional()
52384
52916
  }));
52385
52917
  /**
52386
- * Status block — populated by the integration after each
52387
- * `refreshDiscovery` (or push-driven update). The runtime-state slice
52388
- * is what the panel reads via the per-device proxy; `getStatus`
52389
- * returns the same payload via the codegen'd auto-injection.
52390
- */
52391
- var DeviceDiscoveryStatusSchema = object({
52392
- discovered: array(DiscoveredChildDeviceSchema),
52393
- /** Wall-clock ms of the last successful enumeration. */
52394
- lastDiscoveryAt: number$1().int().nonnegative().nullable(),
52395
- /** Last error surfaced from the source (rendered as a banner). */
52396
- lastError: string().nullable()
52397
- });
52398
- var deviceDiscoveryCapability = {
52399
- name: "device-discovery",
52400
- scope: "device",
52401
- deviceNative: true,
52402
- mode: "singleton",
52403
- deviceTypes: [DeviceType.Hub],
52404
- status: {
52405
- schema: DeviceDiscoveryStatusSchema,
52406
- kind: "poll"
52407
- },
52408
- runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number$1().int().nonnegative() }),
52409
- /**
52410
- * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
52411
- *
52412
- * See `RuntimeStateDurability`. Enforced by
52413
- * `scripts/check-runtime-state-durability.ts`.
52414
- */
52415
- durability: "session",
52416
- /**
52417
- * History (D850): none — inventory.
52418
- */
52419
- history: "none",
52420
- methods: {
52421
- /**
52422
- * Snapshot of the current `discovered` list. Returns the
52423
- * runtime-state cache — call `refreshDiscovery` first if a
52424
- * fresh round-trip to the source is required.
52425
- */
52426
- listDiscovered: method(object({ deviceId: number$1().int().nonnegative() }), array(DiscoveredChildDeviceSchema).readonly()),
52427
- /**
52428
- * Force the integration to re-enumerate and update the
52429
- * runtime-state slice. Returns the freshly-enumerated list (also
52430
- * available via `listDiscovered` post-call).
52431
- */
52432
- refreshDiscovery: method(object({ deviceId: number$1().int().nonnegative() }), array(DiscoveredChildDeviceSchema).readonly(), {
52433
- kind: "mutation",
52434
- auth: "admin"
52435
- }),
52436
- /**
52437
- * Promote a discovered entry to a real child device. The framework
52438
- * creates the child via `kernel.devices.create()` with
52439
- * `parentDeviceId = parent.id` and seeds the child's config from
52440
- * `childInitialConfig` (driver-defined; usually carries channel +
52441
- * uid + parent reference). Returns the kernel-assigned numeric id.
52442
- */
52443
- adoptDevice: method(object({
52444
- deviceId: number$1().int().nonnegative(),
52445
- childNativeId: string(),
52446
- /** Optional override for the child's display name. */
52447
- name: string().optional()
52448
- }), object({
52449
- deviceId: number$1().int().nonnegative(),
52450
- stableId: string()
52451
- }), {
52452
- kind: "mutation",
52453
- auth: "admin"
52454
- }),
52455
- /**
52456
- * Inverse of `adoptDevice`: removes the child device from the
52457
- * kernel registry. The discovered entry remains in the
52458
- * enumeration (status updates resume) so the operator can re-adopt
52459
- * it later without a fresh refresh.
52460
- */
52461
- releaseDevice: method(object({
52462
- deviceId: number$1().int().nonnegative(),
52463
- childDeviceId: number$1().int().nonnegative()
52464
- }), _void(), {
52465
- kind: "mutation",
52466
- auth: "admin"
52467
- })
52468
- }
52469
- };
52470
- /**
52471
- * `device-adoption` — generic discovery + adoption surface,
52472
- * system-scoped collection (one provider per integration addon), routed
52473
- * by explicit `{ addonId }` on direct `deviceAdoption.*` calls — the same
52474
- * pin model as `connection-test`. The admin UI keeps using
52475
- * `deviceManager.adoption*` (which already threads `addonId`). The de-HA-ified
52476
- * successor to `ha-discovery`:
52477
- * keyed by `integrationId` (the addon resolves integrationId → broker
52478
- * internally) rather than a connection-specific `brokerId`, and it
52479
- * REUSES the shared `DiscoveredChildDevice` candidate type from
52480
- * `device-discovery.cap.ts` so a single shared adoption panel renders
52481
- * any integration's candidate tree.
52482
- *
52483
- * UI flow (Integrations page → integration detail):
52484
- * 1. `listCandidates({integrationId, page, pageSize, filter})` →
52485
- * paginated candidate list, each row collapsed.
52486
- * 2. User expands a row → `getCandidate({integrationId,
52487
- * childNativeId})` returns the single candidate (with its nested
52488
- * `children`) for the accordion render.
52489
- * 3. User clicks "Adopt" on one or more candidates →
52490
- * `adopt({integrationId, childNativeIds, perCandidate?})`
52491
- * materialises one parent CamStack device per candidate plus its
52492
- * accessory children. `perCandidate[childNativeId]` carries an
52493
- * optional display-name override + a `hiddenChildIds` pre-hide set
52494
- * (the parent's `accessories.hiddenChildIds` gates UI visibility).
52495
- * 4. User clicks "Release" → `release({integrationId, camDeviceId})`
52496
- * removes the parent + every child from the kernel registry.
52497
- */
52498
- /**
52499
52918
  * Provider-declared discovery *granularity* filter (the keystone of the
52500
52919
  * single-entity-import design). A provider advertises which discovery
52501
52920
  * granularities it supports via `listCandidateFilters`; the operator picks
@@ -52956,6 +53375,90 @@ var SiteZoneSchema = object({
52956
53375
  * the ones that most want grouping. */
52957
53376
  locationKeys: array(string())
52958
53377
  });
53378
+ var DeviceSearchRequiresSchema = object({
53379
+ /** Capability names the field wants a value of. */
53380
+ caps: array(string()).readonly(),
53381
+ /** `any` (default): a device with one of them is compatible. `all`: it must hold every one. */
53382
+ mode: _enum(["any", "all"]).optional()
53383
+ });
53384
+ var DeviceSearchFiltersSchema = object({
53385
+ locations: array(string()).readonly().optional(),
53386
+ integrationIds: array(string()).readonly().optional(),
53387
+ types: array(string()).readonly().optional()
53388
+ });
53389
+ var DeviceSearchInputSchema = object({
53390
+ /** Matches name, location, type, integration (id and label) and id. Case-insensitive. */
53391
+ text: string().optional(),
53392
+ requires: DeviceSearchRequiresSchema.optional(),
53393
+ filters: DeviceSearchFiltersSchema.optional(),
53394
+ /** List the devices that do not provide the required cap too (greyed, not pickable). */
53395
+ includeIncompatible: boolean().optional(),
53396
+ /** The device the field belongs to: its location drives `suggested`. */
53397
+ contextDeviceId: number$1().optional(),
53398
+ /**
53399
+ * Resolve exactly these devices, regardless of every filter, so a picked
53400
+ * value can be rendered. When given, `items` is these devices in the order
53401
+ * asked (no paging, `nextCursor` null) and the ones that do not exist are
53402
+ * listed in `missingIds`.
53403
+ */
53404
+ ids: array(number$1()).readonly().optional(),
53405
+ cursor: string().nullable().optional(),
53406
+ limit: number$1().int().min(1).max(200).optional()
53407
+ });
53408
+ var DeviceValueOptionSchema = object({
53409
+ cap: string(),
53410
+ /** Status-schema field path inside the cap (same paths as `getWireableFields`). */
53411
+ path: string(),
53412
+ label: string(),
53413
+ /** The current value as text; `null` when it is unknown or the read FAILED — never `0`. */
53414
+ reading: string().nullable(),
53415
+ unit: string().nullable().optional(),
53416
+ /** The field's measured quantity, when the cap declares one, so a client can format the reading. */
53417
+ quantity: ReadingQuantitySchema.optional()
53418
+ });
53419
+ var DeviceSearchItemSchema = object({
53420
+ id: number$1(),
53421
+ name: string(),
53422
+ type: _enum(DeviceType),
53423
+ location: string().nullable(),
53424
+ integrationId: string().nullable(),
53425
+ integrationLabel: string().nullable(),
53426
+ online: boolean().nullable(),
53427
+ disabled: boolean(),
53428
+ compatible: boolean(),
53429
+ /** Only the required caps' fields; empty when nothing was required or the device is incompatible. */
53430
+ values: array(DeviceValueOptionSchema).readonly()
53431
+ });
53432
+ var DeviceSearchFacetValueSchema = object({
53433
+ value: string(),
53434
+ count: number$1()
53435
+ });
53436
+ var DeviceSearchFacetIntegrationSchema = object({
53437
+ id: string(),
53438
+ label: string(),
53439
+ count: number$1()
53440
+ });
53441
+ var DeviceSearchFacetsSchema = object({
53442
+ locations: array(DeviceSearchFacetValueSchema).readonly(),
53443
+ integrations: array(DeviceSearchFacetIntegrationSchema).readonly(),
53444
+ types: array(DeviceSearchFacetValueSchema).readonly()
53445
+ });
53446
+ var DeviceSearchResultSchema = object({
53447
+ items: array(DeviceSearchItemSchema).readonly(),
53448
+ nextCursor: string().nullable(),
53449
+ /** Devices listed by this query across all pages (filters + text applied; incompatible counted only when `includeIncompatible`). */
53450
+ total: number$1(),
53451
+ /** Compatible devices after filters + text. */
53452
+ compatibleTotal: number$1(),
53453
+ /** Every device the caller's fleet holds, before anything is applied. */
53454
+ fleetTotal: number$1(),
53455
+ /** Incompatible devices after filters + text — the K of "show the K that don't". */
53456
+ hiddenIncompatible: number$1(),
53457
+ facets: DeviceSearchFacetsSchema,
53458
+ /** Same location as `contextDeviceId`; first page only. */
53459
+ suggested: array(DeviceSearchItemSchema).readonly(),
53460
+ missingIds: array(number$1()).readonly()
53461
+ });
52959
53462
  var ProviderStatusSchema = object({
52960
53463
  connected: boolean(),
52961
53464
  deviceCount: number$1(),
@@ -53441,6 +53944,9 @@ var DeviceInfoSchema = object({
53441
53944
  * named accordion sections (with optional intra-section order). See
53442
53945
  * `DeviceMeta.childLayout`. Absent ⇒ no layout declared. */
53443
53946
  childLayout: array(ChildLayoutEntrySchema).readonly().optional(),
53947
+ /** The children a container stands for, most preferred first, by accessory
53948
+ * `childKey`. Provider-declared. See `DeviceMeta.primaryChildPreference`. */
53949
+ primaryChildPreference: array(string()).readonly().optional(),
53444
53950
  /** Operator-authored per-device display override. See `DeviceMeta.display`. */
53445
53951
  display: DeviceDisplayOverrideSchema.optional()
53446
53952
  });
@@ -53589,6 +54095,9 @@ var DeviceMetaSchema = object({
53589
54095
  * accordion sections (with optional intra-section order). See
53590
54096
  * `DeviceMeta.childLayout`. Absent ⇒ no layout declared. */
53591
54097
  childLayout: array(ChildLayoutEntrySchema).readonly().optional(),
54098
+ /** The children a container stands for, most preferred first, by accessory
54099
+ * `childKey`. Provider-declared. See `DeviceMeta.primaryChildPreference`. */
54100
+ primaryChildPreference: array(string()).readonly().optional(),
53592
54101
  /** Semantic role string (`DeviceRole`) — propagated from the spawn pre-seed.
53593
54102
  * Optional: only present for accessory children that carry a known role. */
53594
54103
  role: string().nullable().optional(),
@@ -53804,6 +54313,12 @@ method(object({
53804
54313
  }), _void(), {
53805
54314
  kind: "mutation",
53806
54315
  auth: "admin"
54316
+ }), method(object({
54317
+ deviceId: number$1(),
54318
+ primaryChildPreference: array(string()).readonly()
54319
+ }), _void(), {
54320
+ kind: "mutation",
54321
+ auth: "admin"
53807
54322
  }), method(object({
53808
54323
  deviceId: number$1(),
53809
54324
  display: DeviceDisplayOverrideSchema.nullable()
@@ -53827,8 +54342,14 @@ method(object({
53827
54342
  "string",
53828
54343
  "number",
53829
54344
  "boolean",
53830
- "enum"
54345
+ "enum",
54346
+ "union"
53831
54347
  ]),
54348
+ unionMembers: array(_enum([
54349
+ "string",
54350
+ "number",
54351
+ "boolean"
54352
+ ])).optional(),
53832
54353
  enumValues: array(string()).optional(),
53833
54354
  item: boolean().optional(),
53834
54355
  quantity: ReadingQuantitySchema.optional()
@@ -53941,7 +54462,7 @@ method(object({
53941
54462
  * it answers today and the caller filters as it already does.
53942
54463
  */
53943
54464
  deviceIds: array(number$1()).optional()
53944
- }), array(DeviceInfoSchema), { role: "viewer" }), method(object({ deviceId: number$1() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number$1() }), array(DeviceInfoSchema), { role: "viewer" }), method(object({ parentDeviceIds: array(number$1()).max(256) }), record(string(), array(DeviceInfoSchema))), method(object({ deviceId: number$1() }), object({
54465
+ }), array(DeviceInfoSchema), { role: "viewer" }), method(DeviceSearchInputSchema, DeviceSearchResultSchema, { role: "viewer" }), method(object({ deviceId: number$1() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number$1() }), array(DeviceInfoSchema), { role: "viewer" }), method(object({ parentDeviceIds: array(number$1()).max(256) }), record(string(), array(DeviceInfoSchema))), method(object({ deviceId: number$1() }), object({
53945
54466
  mode: LinkedDevicesModeSchema,
53946
54467
  devices: array(LinkedDeviceSchema)
53947
54468
  }), { role: "viewer" }), method(object({ deviceIds: array(number$1()) }), array(LinkedDevicesForDeviceSchema), { role: "viewer" }), method(object({ deviceId: number$1() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number$1() }), array(ConfigEntrySchema)), method(object({ deviceId: number$1() }), ConfigUISchemaOutput), method(object({
@@ -56456,8 +56977,85 @@ method(_void(), array(FailureContributionSchema).readonly());
56456
56977
  * - `FanPreset` — preset selector
56457
56978
  * - `FanDirection` — direction toggle (ceiling fans)
56458
56979
  * - `FanOscillating` — oscillation toggle
56980
+ *
56981
+ * Per-axis oscillation (`oscillationAxes`, `setOscillationAxis`, D1034): an air
56982
+ * circulator sweeps horizontally and vertically, each axis with its own
56983
+ * switch, fixed angle, sweep bounds and limits. A provider may report them
56984
+ * natively; otherwise the OPERATOR links sibling devices to each field in
56985
+ * Customize (a `replace` over the fields listed in `overridable` — nothing is
56986
+ * linked or inferred by itself), and a write to a linked field is forwarded to
56987
+ * its source. `oscillating` stays the single summary flag: when axes exist it
56988
+ * means "any axis oscillates" (`anyAxisOscillating`).
56459
56989
  */
56460
56990
  var FanDirectionSchema = _enum(["forward", "reverse"]);
56991
+ var FAN_OSCILLATION_AXES = ["horizontal", "vertical"];
56992
+ var FanOscillationAxisNameSchema = _enum(FAN_OSCILLATION_AXES);
56993
+ var FanOscillationAxisFieldSchema = _enum([
56994
+ "oscillating",
56995
+ "angle",
56996
+ "sweepFrom",
56997
+ "sweepTo"
56998
+ ]);
56999
+ /** The limits of one axis, read from the source that serves its angle. */
57000
+ var FAN_OSCILLATION_AXIS_LIMITS = [
57001
+ "min",
57002
+ "max",
57003
+ "step"
57004
+ ];
57005
+ /**
57006
+ * One oscillation axis. Every reading the device has not reported is `null`,
57007
+ * never `0` (D393): `0°` is a real position. Each leaf defaults to `null`, so
57008
+ * a slice that names only the leaves it knows (a Customize link of one field)
57009
+ * is still a whole axis.
57010
+ */
57011
+ var FanOscillationAxisSchema = object({
57012
+ /** Whether the axis sweeps. */
57013
+ oscillating: boolean().nullable().default(null),
57014
+ /** The fixed position (degrees) the axis holds when it does not sweep. */
57015
+ angle: number$1().nullable().default(null),
57016
+ /** The sweep bounds (degrees): left → right, bottom → top. */
57017
+ sweepFrom: number$1().nullable().default(null),
57018
+ sweepTo: number$1().nullable().default(null),
57019
+ /** The angles the axis accepts. Null when the device states none. */
57020
+ min: number$1().nullable().default(null),
57021
+ max: number$1().nullable().default(null),
57022
+ step: number$1().nullable().default(null)
57023
+ });
57024
+ /** Both axes; an axis the device does not have is `null`. */
57025
+ var FanOscillationAxesSchema = object({
57026
+ horizontal: FanOscillationAxisSchema.nullable().default(null),
57027
+ vertical: FanOscillationAxisSchema.nullable().default(null)
57028
+ });
57029
+ var FanOscillationAxisRefusalSchema = _enum([
57030
+ "nothing-to-set",
57031
+ "axis-not-linked",
57032
+ "out-of-range",
57033
+ "source-gone",
57034
+ "source-unknown",
57035
+ "source-call-failed"
57036
+ ]);
57037
+ var FanOscillationAxisResultSchema = discriminatedUnion("status", [object({ status: literal("applied") }), object({
57038
+ status: literal("refused"),
57039
+ reason: FanOscillationAxisRefusalSchema,
57040
+ /** The field at fault, when one is. */
57041
+ field: FanOscillationAxisFieldSchema.optional(),
57042
+ /** One line for the operator, naming the axis, the field and the source. */
57043
+ detail: string(),
57044
+ /** Fields that DID land before the refusal (writes run in order, stop at the first failure). */
57045
+ applied: array(FanOscillationAxisFieldSchema)
57046
+ })]);
57047
+ var SetOscillationAxisInputSchema = object({
57048
+ deviceId: number$1().int().nonnegative(),
57049
+ axis: FanOscillationAxisNameSchema,
57050
+ oscillating: boolean().optional(),
57051
+ angle: number$1().optional(),
57052
+ sweepFrom: number$1().optional(),
57053
+ sweepTo: number$1().optional()
57054
+ });
57055
+ /** The state path of one axis field: `oscillationAxes.<axis>.<field>`. */
57056
+ function fanAxisPath(axis, field) {
57057
+ return `oscillationAxes.${axis}.${field}`;
57058
+ }
56461
57059
  var FanControlStatusSchema = object({
56462
57060
  /** Active speed as 0..100 inclusive. Null when the device has no
56463
57061
  * speed surface (single-speed fan). */
@@ -56476,9 +57074,102 @@ var FanControlStatusSchema = object({
56476
57074
  /** Oscillation toggle. Null when the device has no oscillation
56477
57075
  * surface. */
56478
57076
  oscillating: boolean().nullable(),
57077
+ /**
57078
+ * Per-axis oscillation (air circulators). Absent when the device has no
57079
+ * per-axis surface and nothing is linked in Customize.
57080
+ */
57081
+ oscillationAxes: FanOscillationAxesSchema.optional(),
56479
57082
  /** Ms epoch when the slice was last updated. */
56480
57083
  lastChangedAt: number$1()
56481
57084
  });
57085
+ var FAN_CUSTOMIZE_DEVICE_TYPES = [DeviceType.Fan];
57086
+ /** The Customize section the axis targets are listed under. */
57087
+ var AXES_SECTION = "oscillation-axes";
57088
+ function axisOscillatingTarget(axis) {
57089
+ return {
57090
+ id: `${axis}-oscillating`,
57091
+ cardinality: "scalar",
57092
+ vocabulary: {
57093
+ cap: "fan-control",
57094
+ stateField: "oscillating"
57095
+ },
57096
+ deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
57097
+ apply: "replace",
57098
+ section: AXES_SECTION,
57099
+ path: fanAxisPath(axis, "oscillating"),
57100
+ sources: [{
57101
+ kind: "switch",
57102
+ transforms: [{ kind: "identity" }]
57103
+ }],
57104
+ sourceReport: { status: "assignment-status" }
57105
+ };
57106
+ }
57107
+ /**
57108
+ * A numeric axis field. The `angle` link also carries the axis limits, read
57109
+ * from the SAME linked control's own range (`min`/`max`/`step`), so the limits
57110
+ * are the source's, never guessed.
57111
+ */
57112
+ function axisNumericTarget(axis, field) {
57113
+ const base = {
57114
+ id: `${axis}-${field}`,
57115
+ cardinality: "scalar",
57116
+ vocabulary: { cap: "fan-control" },
57117
+ deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
57118
+ apply: "replace",
57119
+ section: AXES_SECTION,
57120
+ path: fanAxisPath(axis, field),
57121
+ sources: [{
57122
+ kind: "numeric",
57123
+ transforms: [{ kind: "identity" }]
57124
+ }],
57125
+ sourceReport: { status: "assignment-status" }
57126
+ };
57127
+ if (field !== "angle") return base;
57128
+ return {
57129
+ ...base,
57130
+ companions: FAN_OSCILLATION_AXIS_LIMITS.map((limit) => ({
57131
+ kind: "source-field",
57132
+ path: fanAxisPath(axis, limit),
57133
+ field: limit
57134
+ }))
57135
+ };
57136
+ }
57137
+ var AXIS_TARGETS = FAN_OSCILLATION_AXES.flatMap((axis) => [
57138
+ axisOscillatingTarget(axis),
57139
+ axisNumericTarget(axis, "angle"),
57140
+ axisNumericTarget(axis, "sweepFrom"),
57141
+ axisNumericTarget(axis, "sweepTo")
57142
+ ]);
57143
+ /** A select (an enum control) the operator links to the fan's `preset`. */
57144
+ var PRESET_TARGET = {
57145
+ id: "preset",
57146
+ cardinality: "scalar",
57147
+ vocabulary: { cap: "fan-control" },
57148
+ deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
57149
+ apply: "replace",
57150
+ path: "preset",
57151
+ sources: [{
57152
+ kind: "field",
57153
+ valueKinds: ["string"],
57154
+ transforms: [{ kind: "identity" }]
57155
+ }],
57156
+ sourceReport: { status: "assignment-status" }
57157
+ };
57158
+ var FAN_CONTROL_TARGETS = [...AXIS_TARGETS, PRESET_TARGET];
57159
+ /**
57160
+ * Customize (D1034): the fan already serves `fan-control` natively, so every
57161
+ * target is a `replace` over a field listed in `overridable` — the axis leaves
57162
+ * and `preset`, nothing else. Nothing is pre-linked: the operator picks each
57163
+ * source (D356).
57164
+ */
57165
+ var fanControlCustomize = {
57166
+ version: 1,
57167
+ overridable: FAN_CONTROL_TARGETS.map((target) => ({
57168
+ path: target.path,
57169
+ by: target.id
57170
+ })),
57171
+ targets: FAN_CONTROL_TARGETS
57172
+ };
56482
57173
  var fanControlCapability = {
56483
57174
  name: "fan-control",
56484
57175
  scope: "device",
@@ -56513,6 +57204,18 @@ var fanControlCapability = {
56513
57204
  }), _void(), {
56514
57205
  kind: "mutation",
56515
57206
  auth: "protected"
57207
+ }),
57208
+ /**
57209
+ * Sets one oscillation axis: its switch, fixed angle and/or sweep bounds.
57210
+ * Fields left out are untouched. A field linked in Customize is forwarded
57211
+ * to its linked source (D1034); otherwise the native provider serves it;
57212
+ * neither → `axis-not-linked`. Ranges are checked against the axis limits
57213
+ * before anything is written; writes run in order and stop at the first
57214
+ * failure, which the result names.
57215
+ */
57216
+ setOscillationAxis: optionalMethod(SetOscillationAxisInputSchema, FanOscillationAxisResultSchema, {
57217
+ kind: "mutation",
57218
+ auth: "protected"
56516
57219
  })
56517
57220
  },
56518
57221
  status: {
@@ -56524,6 +57227,7 @@ var fanControlCapability = {
56524
57227
  * sliders read `speed` for live updates.
56525
57228
  */
56526
57229
  runtimeState: FanControlStatusSchema,
57230
+ customize: fanControlCustomize,
56527
57231
  /**
56528
57232
  * Runtime-state durability: **session** — as `brightness`.
56529
57233
  *
@@ -56543,16 +57247,33 @@ var fanControlCapability = {
56543
57247
  oscillating: { kind: "boolean" }
56544
57248
  } }
56545
57249
  };
57250
+ /** One axis as a preset wants it; an absent field is left as it is. */
57251
+ var FanPresetAxisSchema = object({
57252
+ oscillating: boolean().optional(),
57253
+ angle: number$1().optional(),
57254
+ sweepFrom: number$1().optional(),
57255
+ sweepTo: number$1().optional()
57256
+ });
57257
+ /** The fan-control state a preset sets; an absent field is left as it is. */
57258
+ var FanPresetStateSchema = object({
57259
+ speed: number$1().min(0).max(100).optional(),
57260
+ /** The fan's own preset mode (or the linked select's option). */
57261
+ preset: string().min(1).optional(),
57262
+ direction: FanDirectionSchema.optional(),
57263
+ oscillationAxes: object({
57264
+ horizontal: FanPresetAxisSchema.optional(),
57265
+ vertical: FanPresetAxisSchema.optional()
57266
+ }).optional()
57267
+ });
56546
57268
  var FanPresetSchema = object({
56547
57269
  /** Stable key; never reused after a delete within one device's list. */
56548
57270
  id: string().min(1).max(64),
56549
57271
  /** What the operator and a voice assistant call it. */
56550
57272
  name: string().trim().min(1).max(40),
56551
- steps: array(ActionStepSchema).min(1).max(20)
57273
+ state: FanPresetStateSchema
56552
57274
  });
56553
57275
  var FanPresetsRefusalSchema = _enum([
56554
- "not-sibling",
56555
- "bad-target",
57276
+ "empty-state",
56556
57277
  "duplicate-name",
56557
57278
  "duplicate-id",
56558
57279
  "too-many",
@@ -56564,72 +57285,55 @@ var FanPresetsSetResultSchema = discriminatedUnion("status", [object({
56564
57285
  }), object({
56565
57286
  status: literal("refused"),
56566
57287
  reason: FanPresetsRefusalSchema,
56567
- /** Names the preset and step at fault. */
57288
+ /** Names the preset at fault. */
56568
57289
  detail: string()
56569
57290
  })]);
56570
- var FanPresetStepResultSchema = object({
56571
- index: number$1().int().nonnegative(),
57291
+ var FanPresetFieldResultSchema = object({
57292
+ /** The state path: `speed`, `preset`, `direction`, `oscillationAxes.horizontal.angle`. */
57293
+ field: string(),
56572
57294
  outcome: _enum([
56573
57295
  "applied",
56574
57296
  "failed",
56575
57297
  "not-run",
56576
57298
  "refused"
56577
57299
  ]),
56578
- deviceId: number$1().int().nonnegative().optional(),
56579
- cap: string().optional(),
56580
- method: string().optional(),
56581
57300
  /** The cause, for every outcome but `applied`. */
56582
57301
  message: string().optional()
56583
57302
  });
56584
57303
  var FanPresetApplyResultSchema = object({
56585
- /** `applied`: every step ran. `partial`: some ran, one failed. `refused`: nothing ran. */
57304
+ /** `applied`: every field landed. `partial`: some did, one did not. `refused`: nothing ran. */
56586
57305
  status: _enum([
56587
57306
  "applied",
56588
57307
  "partial",
56589
57308
  "refused"
56590
57309
  ]),
56591
- steps: array(FanPresetStepResultSchema)
57310
+ fields: array(FanPresetFieldResultSchema)
56592
57311
  });
56593
57312
  var FanCaptureFieldSchema = _enum([
56594
57313
  "speed",
56595
- "oscillating",
56596
57314
  "direction",
56597
- "preset"
57315
+ "preset",
57316
+ "oscillationAxes"
56598
57317
  ]);
56599
- var FanCaptureOmissionSchema = object({
56600
- /** A fan field (`speed`) or `step <n>` for a sibling step. */
56601
- what: string(),
56602
- /** Why no value was taken: unknown reading (never stored as 0, D393), or a step that cannot be read. */
56603
- reason: string()
56604
- });
56605
- var FanCaptureItemSchema = object({
56606
- group: _enum([
56607
- "fan",
56608
- "oscillation",
56609
- "angles"
56610
- ]),
56611
- /** What the step sets, in the operator's words (a device name, a fan field). */
56612
- label: string()
56613
- });
56614
57318
  var FanPresetCaptureResultSchema = object({
56615
- /** The steps filled from the device's current values; NOT saved. */
56616
- steps: array(ActionStepSchema),
56617
- /** One entry per step, same order: its review group and label. */
56618
- items: array(FanCaptureItemSchema),
56619
- omitted: array(FanCaptureOmissionSchema)
57319
+ /** The fan's CURRENT fan-control state, as a preset; NOT saved. */
57320
+ state: FanPresetStateSchema,
57321
+ omitted: array(object({
57322
+ /** A state path (`speed`, `oscillationAxes.vertical.angle`). */
57323
+ what: string(),
57324
+ /** Why no value was taken: an unknown reading is never stored as 0 (D393). */
57325
+ reason: string()
57326
+ }))
56620
57327
  });
56621
- var deviceInput$2 = object({ deviceId: number$1().int().nonnegative() });
57328
+ var deviceInput$1 = object({ deviceId: number$1().int().nonnegative() });
56622
57329
  DeviceType.Fan;
56623
- method(deviceInput$2, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$2.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
57330
+ method(deviceInput$1, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$1.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
56624
57331
  kind: "mutation",
56625
57332
  auth: "admin"
56626
- }), method(deviceInput$2.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
57333
+ }), method(deviceInput$1.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
56627
57334
  kind: "mutation",
56628
57335
  auth: "protected"
56629
- }), method(deviceInput$2.extend({
56630
- fields: array(FanCaptureFieldSchema).optional(),
56631
- steps: array(ActionStepSchema).max(20).default([])
56632
- }), FanPresetCaptureResultSchema, { auth: "protected" });
57336
+ }), method(deviceInput$1.extend({ fields: array(FanCaptureFieldSchema).optional() }), FanPresetCaptureResultSchema, { auth: "protected" });
56633
57337
  /**
56634
57338
  * Per-device feature/identity probe slice. Holds the runtime-resolved
56635
57339
  * truth about what a device CAN do — which the kernel uses to:
@@ -56841,8 +57545,7 @@ var groupActiveCapability = {
56841
57545
  DeviceType.Valve,
56842
57546
  DeviceType.Lock,
56843
57547
  DeviceType.MediaPlayer,
56844
- DeviceType.Climate,
56845
- DeviceType.Thermostat
57548
+ DeviceType.Climate
56846
57549
  ],
56847
57550
  methods: {},
56848
57551
  status: {
@@ -56884,7 +57587,6 @@ var groupCommandsCapability = {
56884
57587
  DeviceType.Valve,
56885
57588
  DeviceType.Lock,
56886
57589
  DeviceType.MediaPlayer,
56887
- DeviceType.Thermostat,
56888
57590
  DeviceType.Climate
56889
57591
  ],
56890
57592
  methods: {},
@@ -56940,7 +57642,6 @@ var groupStatusCapability = {
56940
57642
  DeviceType.Valve,
56941
57643
  DeviceType.Lock,
56942
57644
  DeviceType.MediaPlayer,
56943
- DeviceType.Thermostat,
56944
57645
  DeviceType.Climate
56945
57646
  ],
56946
57647
  methods: {},
@@ -57269,7 +57970,7 @@ var heatingValveCapability = {
57269
57970
  scope: "device",
57270
57971
  deviceNative: true,
57271
57972
  mode: "singleton",
57272
- deviceTypes: [DeviceType.Thermostat],
57973
+ deviceTypes: [DeviceType.Climate],
57273
57974
  methods: {},
57274
57975
  status: {
57275
57976
  schema: HeatingValveStatusSchema,
@@ -57299,13 +58000,18 @@ var heatingValveCapability = {
57299
58000
  * retried in a loop - D49); a future one is re-armed.
57300
58001
  *
57301
58002
  * What a device may be run for, and for how long at most, is per device type
57302
- * ({@link TIMED_RUN_LIMITS}): the maximum is a safety bound, not a preference,
58003
+ * and role ({@link timedRunLimitOf}): the maximum is a safety bound, not a preference,
57303
58004
  * so a request above it is REFUSED with a typed reason, never clamped.
57304
58005
  */
57305
58006
  var TimedRunUnitSchema = _enum(["s", "min"]);
57306
58007
  _enum(["switch", "pet-fountain"]);
57307
- DeviceType.Heater, DeviceType.PetFountain;
57308
- var TIMED_RUN_DEVICE_TYPES = [DeviceType.Heater, DeviceType.PetFountain];
58008
+ /**
58009
+ * The device types `timed-run` may be offered on. A `switch` is narrowed by
58010
+ * role ({@link TIMED_RUN_DEVICE_ROLES}): only a plug-in heater runs on a timer.
58011
+ */
58012
+ var TIMED_RUN_DEVICE_TYPES = [DeviceType.Switch, DeviceType.PetFountain];
58013
+ /** The roles that make a device of these types timed-run-able (D1033). */
58014
+ var TIMED_RUN_DEVICE_ROLES = { [DeviceType.Switch]: [DeviceRole.SwitchHeater] };
57309
58015
  /** One duration, as the one-tap run asks for it. */
57310
58016
  var TimedRunQuickRunSchema = object({
57311
58017
  duration: number$1().positive().finite(),
@@ -57355,6 +58061,7 @@ var timedRunCapability = {
57355
58061
  kind: "wrapper",
57356
58062
  defaultActive: true,
57357
58063
  deviceTypes: TIMED_RUN_DEVICE_TYPES,
58064
+ deviceRoles: TIMED_RUN_DEVICE_ROLES,
57358
58065
  deviceConfig: { ui: {
57359
58066
  kind: "derived-form",
57360
58067
  builderId: "timed-run",
@@ -57515,8 +58222,8 @@ var HeroSceneSchema = object({
57515
58222
  /** 0..1: volume, cover position, cycle progress. */
57516
58223
  level: number$1().min(0).max(1).nullable()
57517
58224
  });
57518
- 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.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway;
57519
- DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
58225
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
58226
+ DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
57520
58227
  /** A string in both languages, as the cap vocabulary writes it (D920): no `t()` in the model. */
57521
58228
  var HeroTextSchema = object({
57522
58229
  en: string(),
@@ -57582,13 +58289,11 @@ var HeroConfirmSchema = _enum([
57582
58289
  "press"
57583
58290
  ]);
57584
58291
  var HeroActionSchema = object({
57585
- /** Unique within the model; the `gated` list and the specs name it. */
57586
58292
  id: string(),
57587
58293
  label: HeroTextSchema,
57588
58294
  icon: IconKeySchema,
57589
58295
  call: HeroCallSchema,
57590
58296
  emphasis: _enum(["primary", "normal"]),
57591
- /** Ask before running it. */
57592
58297
  confirm: HeroConfirmSchema.nullable()
57593
58298
  });
57594
58299
  var HeroControlSchema = discriminatedUnion("kind", [
@@ -57639,6 +58344,8 @@ var HeroPillSchema = object({
57639
58344
  });
57640
58345
  var HeroRowSchema = object({
57641
58346
  id: HeroRowIdSchema,
58347
+ /** `scene`: the row's action and slider controls are drawn on the scene. Absent: an ordinary row. */
58348
+ placement: _enum(["row", "scene"]).optional(),
57642
58349
  /** The row's own name when the kind's label would not tell rows of one kind apart (a circuit's label). */
57643
58350
  label: HeroTextSchema.optional(),
57644
58351
  /** A group header drawn above the row when it differs from the previous row's ("System"). */
@@ -57669,9 +58376,16 @@ var HeroBadgeSchema = object({
57669
58376
  value: number$1().nullable(),
57670
58377
  label: HeroTextSchema
57671
58378
  });
57672
- var HeroRemoteSlotSchema = object({
57673
- /** Saved commands; `null` = not known yet (the button still shows). */
57674
- commands: number$1().int().nullable() });
58379
+ var HeroRemoteSlotSchema = object({
58380
+ /** Saved commands; `null` = not known yet (the button still shows). */
58381
+ commands: number$1().int().nullable(),
58382
+ /**
58383
+ * The control a list row draws as the "open the remote" icon. Recognised by its id
58384
+ * ({@link REMOTE_OPEN_ACTION_ID}); it changes no state, so a client opens the remote
58385
+ * instead of running `call`. Absent on a model from an older server.
58386
+ */
58387
+ open: HeroActionSchema.optional()
58388
+ });
57675
58389
  var HeroConsumablesSlotSchema = object({
57676
58390
  items: array(object({
57677
58391
  key: string(),
@@ -57839,6 +58553,8 @@ var HeroModelSchema = object({
57839
58553
  * the FIRST row that has any (a later row's control is never promoted). When
57840
58554
  * the model lists that part in `gated`, the row has no inline control: the
57841
58555
  * projection never falls through to another control the caller could use.
58556
+ * - a climate or thermostat row's primary is its `climate.mode` control (no power
58557
+ * toggle: "off" is a mode); when the model gates it the rule above applies as before;
57842
58558
  * - a timed run, when the model carries the slot, sits beside that primary:
57843
58559
  * Run while idle, Stop while armed. Gating the slot hides the control.
57844
58560
  * - the status line is the head (what plays, else the state) plus at most
@@ -57846,6 +58562,13 @@ var HeroModelSchema = object({
57846
58562
  * time left on an armed timed run;
57847
58563
  * - the trailing fact is the first of power, battery, consumables.
57848
58564
  *
58565
+ * - `extras` are the further inline controls of the types that carry more than one
58566
+ * ({@link ROW_EXTRAS_BY_TYPE}): climate setpoint, a robot's return to base,
58567
+ * a player's volume and remote. Each is a control the model already has, named by id,
58568
+ * in that order and at most {@link ROW_EXTRAS_MAX}; one the model lacks, or lists in
58569
+ * `gated`, is absent, and the one `primary` already is never repeats. Empty = the
58570
+ * row of an older server: `primary` alone.
58571
+ *
57849
58572
  * `projectDeviceRow` is pure and computes nothing: it selects from a
57850
58573
  * {@link HeroModel}. A row that needed a value the hero lacks would mean the
57851
58574
  * model is missing it, so the fix goes in the model.
@@ -57877,8 +58600,16 @@ var HeroRowModelSchema = object({
57877
58600
  * while armed. `null` when there is no slot, or the caller may not act.
57878
58601
  */
57879
58602
  timedRun: HeroRowTimedRunSchema.nullable(),
58603
+ /**
58604
+ * The further inline controls after `primary`, in order (see the header). The remote
58605
+ * is an `action` with id `remote.open`: the client opens the remote, it does not run
58606
+ * the call. Absent or empty = `primary` alone.
58607
+ */
58608
+ extras: array(HeroControlSchema).max(2).optional(),
57880
58609
  trailing: HeroFactSchema.nullable()
57881
58610
  });
58611
+ DeviceType.Climate;
58612
+ DeviceType.Climate, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer;
57882
58613
  /**
57883
58614
  * hero-layout — what a device's hero says (D1023). Read-only: the FIXED
57884
58615
  * layouts live in `@camstack/types` and nothing here stores or edits one.
@@ -57910,7 +58641,10 @@ method(heroInput, HeroModelSchema.nullable(), {
57910
58641
  }), method(rowModelsInput, array(HeroRowModelSchema.nullable()), {
57911
58642
  auth: "protected",
57912
58643
  role: "viewer"
57913
- }), method(object({ deviceType: string() }), HeroLayoutRowsSchema, {
58644
+ }), method(object({
58645
+ deviceType: string(),
58646
+ role: string().nullable().optional()
58647
+ }), HeroLayoutRowsSchema, {
57914
58648
  auth: "protected",
57915
58649
  role: "viewer"
57916
58650
  });
@@ -57957,6 +58691,11 @@ var humidifierCapability = {
57957
58691
  deviceNative: true,
57958
58692
  mode: "singleton",
57959
58693
  deviceTypes: [DeviceType.Humidifier],
58694
+ power: {
58695
+ kind: "field",
58696
+ field: "on",
58697
+ set: "setOn"
58698
+ },
57960
58699
  methods: {
57961
58700
  setOn: method(object({
57962
58701
  deviceId: number$1().int().nonnegative(),
@@ -58030,7 +58769,7 @@ var humiditySensorCapability = {
58030
58769
  scope: "device",
58031
58770
  deviceNative: true,
58032
58771
  mode: "singleton",
58033
- deviceTypes: [DeviceType.Sensor, DeviceType.Thermostat],
58772
+ deviceTypes: [DeviceType.Sensor, DeviceType.Climate],
58034
58773
  methods: {},
58035
58774
  status: {
58036
58775
  schema: HumiditySensorStatusSchema,
@@ -69428,13 +70167,23 @@ var NcRuleTargetSchema = object({
69428
70167
  */
69429
70168
  params: record(string(), unknown()).optional()
69430
70169
  });
70170
+ /** Which picture kind one target receives (#487). */
70171
+ var NcTargetAttachmentSchema = _enum([
70172
+ "none",
70173
+ "image",
70174
+ "clip",
70175
+ "gif"
70176
+ ]);
69431
70177
  var NcTargetOverrideSchema = object({
69432
70178
  template: object({
69433
70179
  title: string().max(500).optional(),
69434
70180
  body: string().max(2e3).optional()
69435
70181
  }).optional(),
69436
70182
  schedule: NcScheduleSchema.optional(),
69437
- priority: number$1().int().min(1).max(5).optional()
70183
+ priority: number$1().int().min(1).max(5).optional(),
70184
+ attachment: NcTargetAttachmentSchema.optional(),
70185
+ /** `false` = no buttons for this target; `true` is the same as absent. */
70186
+ actions: boolean().optional()
69438
70187
  });
69439
70188
  /** Per-target settings keyed by target id (#487). */
69440
70189
  var NcTargetOverridesSchema = record(string(), NcTargetOverrideSchema);
@@ -71625,9 +72374,13 @@ var petFeederCapability = {
71625
72374
  */
71626
72375
  durability: "session",
71627
72376
  /**
71628
- * History (D850): recorded series.
72377
+ * History (D850): recorded series. `feeding` / `eating` are the meals the
72378
+ * device hero's "Meals" button names — change-only booleans, so a dispense
72379
+ * or a pet at the bowl is one span on the history.
71629
72380
  */
71630
72381
  history: { fields: {
72382
+ feeding: { kind: "boolean" },
72383
+ eating: { kind: "boolean" },
71631
72384
  foodLevel: { kind: "gauge" },
71632
72385
  bowlFood: { kind: "gauge" },
71633
72386
  food1: { kind: "gauge" },
@@ -71688,6 +72441,11 @@ var petFountainCapability = {
71688
72441
  deviceNative: true,
71689
72442
  mode: "singleton",
71690
72443
  deviceTypes: [DeviceType.PetFountain],
72444
+ power: {
72445
+ kind: "field",
72446
+ field: "pumpRunning",
72447
+ set: "setPump"
72448
+ },
71691
72449
  methods: {
71692
72450
  /** Start or stop the pump. */
71693
72451
  setPump: method(object({
@@ -73263,7 +74021,6 @@ var POWER_METER_DEVICE_TYPES = [
73263
74021
  DeviceType.Light,
73264
74022
  DeviceType.Fan,
73265
74023
  DeviceType.Climate,
73266
- DeviceType.Thermostat,
73267
74024
  DeviceType.Humidifier,
73268
74025
  DeviceType.WaterHeater,
73269
74026
  DeviceType.MediaPlayer,
@@ -73272,8 +74029,7 @@ var POWER_METER_DEVICE_TYPES = [
73272
74029
  DeviceType.Dishwasher,
73273
74030
  DeviceType.Vacuum,
73274
74031
  DeviceType.LawnMower,
73275
- DeviceType.PetFeeder,
73276
- DeviceType.Heater
74032
+ DeviceType.PetFeeder
73277
74033
  ];
73278
74034
  /** Everything but a bare `Sensor`: a sensor that takes its reading from another sensor adds nothing. */
73279
74035
  var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== DeviceType.Sensor);
@@ -73386,118 +74142,6 @@ var powerMeterCapability = {
73386
74142
  volatileStateFields: ["lastFetchedAt"],
73387
74143
  customize: powerMeterCustomize
73388
74144
  };
73389
- var PowerSourceRefusalReasonSchema = _enum([
73390
- "no-power-source",
73391
- "switch-missing",
73392
- "switch-offline",
73393
- "switch-unknown",
73394
- "restart-in-progress",
73395
- "switch-call-failed"
73396
- ]);
73397
- var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
73398
- accepted: literal(false),
73399
- reason: PowerSourceRefusalReasonSchema,
73400
- /** One line for the operator, naming the switch. */
73401
- message: string()
73402
- })]);
73403
- var PowerSourceInfoSchema = object({
73404
- /** False when the device has no power source linked; the rest is then empty. */
73405
- linked: boolean(),
73406
- switchDeviceId: number$1().nullable(),
73407
- switchName: string().nullable(),
73408
- /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
73409
- switchOn: boolean().nullable(),
73410
- switchOnline: boolean().nullable(),
73411
- restartInProgress: boolean(),
73412
- offSeconds: number$1().int()
73413
- });
73414
- /** The composed slice: the switch state the link mirrors, plus the stored off time. */
73415
- var PowerSourceStateSchema = object({
73416
- /** Null while the switch has not reported: unknown is never `false` (D393). */
73417
- switchOn: boolean().nullable(),
73418
- offSeconds: number$1().int(),
73419
- lastFetchedAt: number$1()
73420
- });
73421
- var POWER_SOURCE_DEVICE_TYPES = [
73422
- DeviceType.Gateway,
73423
- DeviceType.Hub,
73424
- DeviceType.Camera,
73425
- DeviceType.Sensor,
73426
- DeviceType.MediaPlayer,
73427
- DeviceType.Vacuum,
73428
- DeviceType.Generic,
73429
- DeviceType.Washer,
73430
- DeviceType.Dryer,
73431
- DeviceType.Dishwasher,
73432
- DeviceType.PetFountain,
73433
- DeviceType.Fan,
73434
- DeviceType.Humidifier,
73435
- DeviceType.Climate,
73436
- DeviceType.WaterHeater
73437
- ];
73438
- var powerSourceCustomize = {
73439
- version: 1,
73440
- targets: [{
73441
- id: "switch",
73442
- cardinality: "scalar",
73443
- vocabulary: {
73444
- cap: "power-source",
73445
- stateField: "switchOn"
73446
- },
73447
- deviceTypes: POWER_SOURCE_DEVICE_TYPES,
73448
- apply: "add",
73449
- path: "switchOn",
73450
- sources: [{
73451
- kind: "switch",
73452
- transforms: [{ kind: "identity" }]
73453
- }],
73454
- companions: [{
73455
- kind: "constant",
73456
- path: "offSeconds",
73457
- value: 10,
73458
- when: "add",
73459
- formerValues: [0]
73460
- }, {
73461
- kind: "clock",
73462
- path: "lastFetchedAt",
73463
- when: "always"
73464
- }],
73465
- sourceReport: { status: "assignment-status" }
73466
- }]
73467
- };
73468
- var deviceInput$1 = object({ deviceId: number$1().int().nonnegative() });
73469
- var powerSourceCapability = {
73470
- name: "power-source",
73471
- scope: "device",
73472
- mode: "singleton",
73473
- deviceTypes: POWER_SOURCE_DEVICE_TYPES,
73474
- methods: {
73475
- getStatus: systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "admin" }),
73476
- powerOn: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
73477
- kind: "mutation",
73478
- auth: "admin"
73479
- }),
73480
- powerOff: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
73481
- kind: "mutation",
73482
- auth: "admin"
73483
- }),
73484
- forceRestart: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
73485
- kind: "mutation",
73486
- auth: "admin"
73487
- })
73488
- },
73489
- runtimeState: PowerSourceStateSchema,
73490
- customize: powerSourceCustomize,
73491
- /**
73492
- * Runtime-state durability: **session** — mirrored from the linked switch on
73493
- * its next report; a restored value would outlive the reading it names.
73494
- *
73495
- * See `RuntimeStateDurability`. Enforced by
73496
- * `scripts/check-runtime-state-durability.ts`.
73497
- */
73498
- durability: "session",
73499
- history: "none"
73500
- };
73501
74145
  /**
73502
74146
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
73503
74147
  * on `DeviceType.Presence`. Read-only — no setters: presence is
@@ -76964,9 +77608,7 @@ var RUNNING_CUSTOMIZE_DEVICE_TYPES = [
76964
77608
  DeviceType.Humidifier,
76965
77609
  DeviceType.Fan,
76966
77610
  DeviceType.Climate,
76967
- DeviceType.Thermostat,
76968
- DeviceType.PetFeeder,
76969
- DeviceType.Heater
77611
+ DeviceType.PetFeeder
76970
77612
  ];
76971
77613
  var runningStateCapability = {
76972
77614
  name: "running-state",
@@ -79054,8 +79696,7 @@ var switchCapability = {
79054
79696
  DeviceType.Switch,
79055
79697
  DeviceType.Siren,
79056
79698
  DeviceType.Light,
79057
- DeviceType.Fan,
79058
- DeviceType.Heater
79699
+ DeviceType.Fan
79059
79700
  ],
79060
79701
  methods: { setState: method(object({
79061
79702
  deviceId: number$1(),
@@ -79749,7 +80390,7 @@ var temperatureSensorCapability = {
79749
80390
  scope: "device",
79750
80391
  deviceNative: true,
79751
80392
  mode: "singleton",
79752
- deviceTypes: [DeviceType.Sensor, DeviceType.Thermostat],
80393
+ deviceTypes: [DeviceType.Sensor, DeviceType.Climate],
79753
80394
  methods: {},
79754
80395
  status: {
79755
80396
  schema: TemperatureSensorStatusSchema,
@@ -81396,6 +82037,13 @@ var waterHeaterCapability = {
81396
82037
  deviceNative: true,
81397
82038
  mode: "singleton",
81398
82039
  deviceTypes: [DeviceType.WaterHeater],
82040
+ power: {
82041
+ kind: "mode",
82042
+ field: "operationMode",
82043
+ offValue: "off",
82044
+ set: "setOperationMode",
82045
+ lastField: "lastActiveMode"
82046
+ },
81399
82047
  methods: {
81400
82048
  setTargetTemp: method(object({
81401
82049
  deviceId: number$1().int().nonnegative(),
@@ -83054,7 +83702,6 @@ var DEVICE_LOCAL_STATE_CAPS = {
83054
83702
  control: controlCapability,
83055
83703
  cover: coverCapability,
83056
83704
  dayNight: dayNightCapability,
83057
- deviceDiscovery: deviceDiscoveryCapability,
83058
83705
  deviceStatus: deviceStatusCapability,
83059
83706
  dishwasher: dishwasherCapability,
83060
83707
  doNotDisturb: doNotDisturbCapability,
@@ -84149,15 +84796,16 @@ var BaseDeviceProvider = class extends BaseAddon {
84149
84796
  });
84150
84797
  const meta = await this.ctx.api.deviceManager.loadMeta.query({ deviceId: id });
84151
84798
  if (meta === null) throw new Error(`${this.providerName}: no persisted meta for "${stableId}" (id ${id}) — cannot reload`);
84152
- const deviceType = Object.values(DeviceType).find((t) => t === meta.type);
84153
- const Class = deviceType !== void 0 ? this.deviceClasses[deviceType] : void 0;
84799
+ const Class = this.deviceClassForRow({
84800
+ type: meta.type,
84801
+ stableId
84802
+ });
84154
84803
  if (!Class) throw new Error(`${this.providerName}: no device class for type "${meta.type}" — "${stableId}" is an accessory child; reload its parent instead`);
84155
84804
  await devices.create(stableId, Class, {}, meta.parentDeviceId ?? null);
84156
84805
  const rows = await this.ctx.api.deviceManager.listPersistedByAddon.query({ addonId: this.addonId });
84157
84806
  for (const row of rows) {
84158
84807
  if (row.parentDeviceId !== id) continue;
84159
- const childType = Object.values(DeviceType).find((t) => t === row.type);
84160
- const ChildClass = childType !== void 0 ? this.deviceClasses[childType] : void 0;
84808
+ const ChildClass = this.deviceClassForRow(row);
84161
84809
  if (!ChildClass) continue;
84162
84810
  try {
84163
84811
  await devices.create(row.stableId, ChildClass, {}, id);
@@ -84184,6 +84832,16 @@ var BaseDeviceProvider = class extends BaseAddon {
84184
84832
  return { deviceId: id };
84185
84833
  }
84186
84834
  /**
84835
+ * The class a PERSISTED row is rebuilt with. Default: by type, from
84836
+ * `deviceClasses`. A provider whose distinct devices share one type (D1033:
84837
+ * a radiator valve and a room climate are both `climate`) overrides this
84838
+ * and tells them apart by the row's stable id or config.
84839
+ */
84840
+ deviceClassForRow(row) {
84841
+ const type = Object.values(DeviceType).find((t) => t === row.type);
84842
+ return type !== void 0 ? this.deviceClasses[type] : void 0;
84843
+ }
84844
+ /**
84187
84845
  * Restore devices from persisted state. Two-pass:
84188
84846
  *
84189
84847
  * 1. **Top-level pass** — invokes `kernel.devices.create()` for every
@@ -84244,7 +84902,7 @@ var BaseDeviceProvider = class extends BaseAddon {
84244
84902
  restored.add(saved.id);
84245
84903
  return;
84246
84904
  }
84247
- const Class = this.deviceClasses[saved.type];
84905
+ const Class = this.deviceClassForRow(saved);
84248
84906
  if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
84249
84907
  if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
84250
84908
  await this.healSavedConfig(saved, savedDevices);
@@ -84261,7 +84919,7 @@ var BaseDeviceProvider = class extends BaseAddon {
84261
84919
  };
84262
84920
  const topLevel = savedDevices.filter((saved) => saved.parentDeviceId === null);
84263
84921
  const restoreOne = async (saved) => {
84264
- if (!this.deviceClasses[saved.type]) {
84922
+ if (!this.deviceClassForRow(saved)) {
84265
84923
  this.ctx.logger.warn("No device class registered for restored type — skipping", {
84266
84924
  tags: {
84267
84925
  deviceId: saved.id,
@@ -84300,7 +84958,7 @@ var BaseDeviceProvider = class extends BaseAddon {
84300
84958
  const failedTopLevelIds = new Set(failures.map((failure) => failure.saved.id));
84301
84959
  const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
84302
84960
  for (const saved of childRows) {
84303
- if (!this.deviceClasses[saved.type]) continue;
84961
+ if (!this.deviceClassForRow(saved)) continue;
84304
84962
  if (saved.parentDeviceId === null) continue;
84305
84963
  if (restored.has(saved.parentDeviceId)) {
84306
84964
  try {
@@ -84354,7 +85012,9 @@ var BaseDeviceProvider = class extends BaseAddon {
84354
85012
  }
84355
85013
  };
84356
85014
  DeviceType.HeatPump;
84357
- DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
85015
+ DeviceType.Climate;
85016
+ DeviceRole.ClimateThermostat, DeviceRole.ClimateAc, DeviceRole.ClimateRadiator, DeviceRole.ClimateFloor, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit;
85017
+ DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
84358
85018
  new Set(Object.values(DeviceType));
84359
85019
  /** Parses the raw slice with the cap's own schema; `undefined` when it does not parse. */
84360
85020
  function contribution(cap, schema, build) {
@@ -86360,7 +87020,7 @@ var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pu
86360
87020
  ...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
86361
87021
  ...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
86362
87022
  ];
86363
- 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.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway;
87023
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
86364
87024
  /**
86365
87025
  * Who looks like what (D1023). One look per {@link DeviceType}, refined by a
86366
87026
  * {@link DeviceRole} where the role changes how the device reads (a leak
@@ -87004,9 +87664,9 @@ lookOf({
87004
87664
  idle: INFO,
87005
87665
  standby: MUTED
87006
87666
  });
87007
- DeviceType.Climate, DeviceType.Thermostat;
87008
- 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.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway;
87009
- DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
87667
+ DeviceType.Climate;
87668
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
87669
+ DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
87010
87670
  Object.freeze({
87011
87671
  "accessories.getStatus": {
87012
87672
  capName: "accessories",
@@ -88233,6 +88893,27 @@ Object.freeze({
88233
88893
  access: "create",
88234
88894
  role: "viewer"
88235
88895
  },
88896
+ "clusterUpdate.getClusterUpdateJob": {
88897
+ capName: "cluster-update",
88898
+ capScope: "system",
88899
+ addonId: null,
88900
+ access: "view",
88901
+ role: "admin"
88902
+ },
88903
+ "clusterUpdate.previewClusterUpdate": {
88904
+ capName: "cluster-update",
88905
+ capScope: "system",
88906
+ addonId: null,
88907
+ access: "view",
88908
+ role: "admin"
88909
+ },
88910
+ "clusterUpdate.startClusterUpdate": {
88911
+ capName: "cluster-update",
88912
+ capScope: "system",
88913
+ addonId: null,
88914
+ access: "create",
88915
+ role: "admin"
88916
+ },
88236
88917
  "color.getStatus": {
88237
88918
  capName: "color",
88238
88919
  capScope: "device",
@@ -88835,41 +89516,6 @@ Object.freeze({
88835
89516
  access: "create",
88836
89517
  role: "admin"
88837
89518
  },
88838
- "deviceDiscovery.adoptDevice": {
88839
- capName: "device-discovery",
88840
- capScope: "device",
88841
- addonId: null,
88842
- access: "create",
88843
- role: "admin"
88844
- },
88845
- "deviceDiscovery.getStatus": {
88846
- capName: "device-discovery",
88847
- capScope: "device",
88848
- addonId: null,
88849
- access: "view",
88850
- role: "viewer"
88851
- },
88852
- "deviceDiscovery.listDiscovered": {
88853
- capName: "device-discovery",
88854
- capScope: "device",
88855
- addonId: null,
88856
- access: "view",
88857
- role: "viewer"
88858
- },
88859
- "deviceDiscovery.refreshDiscovery": {
88860
- capName: "device-discovery",
88861
- capScope: "device",
88862
- addonId: null,
88863
- access: "create",
88864
- role: "admin"
88865
- },
88866
- "deviceDiscovery.releaseDevice": {
88867
- capName: "device-discovery",
88868
- capScope: "device",
88869
- addonId: null,
88870
- access: "create",
88871
- role: "admin"
88872
- },
88873
89519
  "deviceExport.applyDeviceSettingsPatch": {
88874
89520
  capName: "device-export",
88875
89521
  capScope: "system",
@@ -89605,6 +90251,13 @@ Object.freeze({
89605
90251
  access: "create",
89606
90252
  role: "admin"
89607
90253
  },
90254
+ "deviceManager.search": {
90255
+ capName: "device-manager",
90256
+ capScope: "system",
90257
+ addonId: null,
90258
+ access: "view",
90259
+ role: "viewer"
90260
+ },
89608
90261
  "deviceManager.setAlias": {
89609
90262
  capName: "device-manager",
89610
90263
  capScope: "system",
@@ -89696,6 +90349,13 @@ Object.freeze({
89696
90349
  access: "create",
89697
90350
  role: "admin"
89698
90351
  },
90352
+ "deviceManager.setPrimaryChildPreference": {
90353
+ capName: "device-manager",
90354
+ capScope: "system",
90355
+ addonId: null,
90356
+ access: "create",
90357
+ role: "admin"
90358
+ },
89699
90359
  "deviceManager.setRole": {
89700
90360
  capName: "device-manager",
89701
90361
  capScope: "system",
@@ -90403,6 +91063,13 @@ Object.freeze({
90403
91063
  access: "create",
90404
91064
  role: "viewer"
90405
91065
  },
91066
+ "fanControl.setOscillationAxis": {
91067
+ capName: "fan-control",
91068
+ capScope: "device",
91069
+ addonId: null,
91070
+ access: "create",
91071
+ role: "viewer"
91072
+ },
90406
91073
  "fanControl.setPercentage": {
90407
91074
  capName: "fan-control",
90408
91075
  capScope: "device",
@@ -94335,28 +95002,28 @@ Object.freeze({
94335
95002
  capScope: "device",
94336
95003
  addonId: null,
94337
95004
  access: "create",
94338
- role: "admin"
95005
+ role: "viewer"
94339
95006
  },
94340
95007
  "powerSource.getStatus": {
94341
95008
  capName: "power-source",
94342
95009
  capScope: "device",
94343
95010
  addonId: null,
94344
95011
  access: "view",
94345
- role: "admin"
95012
+ role: "viewer"
94346
95013
  },
94347
95014
  "powerSource.powerOff": {
94348
95015
  capName: "power-source",
94349
95016
  capScope: "device",
94350
95017
  addonId: null,
94351
95018
  access: "create",
94352
- role: "admin"
95019
+ role: "viewer"
94353
95020
  },
94354
95021
  "powerSource.powerOn": {
94355
95022
  capName: "power-source",
94356
95023
  capScope: "device",
94357
95024
  addonId: null,
94358
95025
  access: "create",
94359
- role: "admin"
95026
+ role: "viewer"
94360
95027
  },
94361
95028
  "presence.getStatus": {
94362
95029
  capName: "presence",
@@ -97424,7 +98091,7 @@ function projectAction(cap, action) {
97424
98091
  };
97425
98092
  }
97426
98093
  Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
97427
- 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.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
98094
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
97428
98095
  DeviceFeature.BatteryOperated;
97429
98096
  function bound(cap, methods = [], authority = "reported") {
97430
98097
  return {
@@ -97913,35 +98580,6 @@ Object.freeze({
97913
98580
  form: "single",
97914
98581
  optional: false
97915
98582
  }],
97916
- "deviceDiscovery.adoptDevice": [{
97917
- name: "deviceId",
97918
- form: "single",
97919
- optional: false
97920
- }],
97921
- "deviceDiscovery.getStatus": [{
97922
- name: "deviceId",
97923
- form: "single",
97924
- optional: false
97925
- }],
97926
- "deviceDiscovery.listDiscovered": [{
97927
- name: "deviceId",
97928
- form: "single",
97929
- optional: false
97930
- }],
97931
- "deviceDiscovery.refreshDiscovery": [{
97932
- name: "deviceId",
97933
- form: "single",
97934
- optional: false
97935
- }],
97936
- "deviceDiscovery.releaseDevice": [{
97937
- name: "childDeviceId",
97938
- form: "single",
97939
- optional: false
97940
- }, {
97941
- name: "deviceId",
97942
- form: "single",
97943
- optional: false
97944
- }],
97945
98583
  "deviceExport.applyDeviceSettingsPatch": [{
97946
98584
  name: "deviceId",
97947
98585
  form: "single",
@@ -98220,6 +98858,11 @@ Object.freeze({
98220
98858
  form: "single",
98221
98859
  optional: false
98222
98860
  }],
98861
+ "deviceManager.setPrimaryChildPreference": [{
98862
+ name: "deviceId",
98863
+ form: "single",
98864
+ optional: false
98865
+ }],
98223
98866
  "deviceManager.setRole": [{
98224
98867
  name: "deviceId",
98225
98868
  form: "single",
@@ -98500,6 +99143,11 @@ Object.freeze({
98500
99143
  form: "single",
98501
99144
  optional: false
98502
99145
  }],
99146
+ "fanControl.setOscillationAxis": [{
99147
+ name: "deviceId",
99148
+ form: "single",
99149
+ optional: false
99150
+ }],
98503
99151
  "fanControl.setPercentage": [{
98504
99152
  name: "deviceId",
98505
99153
  form: "single",
@@ -101688,7 +102336,9 @@ var TimelapseRuleInputSchema = object({
101688
102336
  /** Classes the notification counts — see {@link ReportClassesField}. */
101689
102337
  reportClasses: ReportClassesField.optional(),
101690
102338
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
101691
- priority: PriorityField.default(3)
102339
+ priority: PriorityField.default(3),
102340
+ /** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
102341
+ targetOverrides: NcTargetOverridesSchema.optional()
101692
102342
  });
101693
102343
  object({
101694
102344
  name: NameField.optional(),
@@ -101704,7 +102354,9 @@ object({
101704
102354
  previewText: PreviewTextField.optional(),
101705
102355
  previewMode: PreviewModeField.optional(),
101706
102356
  reportClasses: ReportClassesField.optional(),
101707
- priority: PriorityField.optional()
102357
+ priority: PriorityField.optional(),
102358
+ /** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
102359
+ targetOverrides: NcTargetOverridesSchema.optional()
101708
102360
  });
101709
102361
  TimelapseRuleInputSchema.extend({
101710
102362
  id: string(),
@@ -126884,7 +127536,7 @@ function mapHmChannel(channelType) {
126884
127536
  capabilities: ["cover"]
126885
127537
  };
126886
127538
  case "HEATING_CLIMATECONTROL_TRANSCEIVER": return {
126887
- deviceType: DeviceType.Thermostat,
127539
+ deviceType: DeviceType.Climate,
126888
127540
  role: null,
126889
127541
  capabilities: [
126890
127542
  "climate-control",
@@ -126923,12 +127575,12 @@ function mapHmChannel(channelType) {
126923
127575
  * from the union of its channel mappings. Actuators win over sensors so
126924
127576
  * a switch + energy-meter device (HmIP-BSM) reports as a Switch, not a
126925
127577
  * Sensor, and a thermostat with a humidity sensor reports as a
126926
- * Thermostat. A remote/wall-switch is primarily an EventEmitter: it is
127578
+ * Climate device (D1033). A remote/wall-switch is primarily an EventEmitter: it is
126927
127579
  * ranked above Sensor so its battery / maintenance sensor channels don't
126928
127580
  * win the parent type. Returns `DeviceType.Generic` when no channel maps.
126929
127581
  */
126930
127582
  var PARENT_TYPE_PRIORITY = [
126931
- DeviceType.Thermostat,
127583
+ DeviceType.Climate,
126932
127584
  DeviceType.Lock,
126933
127585
  DeviceType.Cover,
126934
127586
  DeviceType.Light,
@@ -127112,7 +127764,7 @@ function actuatorInfo(kind) {
127112
127764
  case "climate": return {
127113
127765
  kind: "climate",
127114
127766
  capName: "climate-control",
127115
- type: DeviceType.Thermostat
127767
+ type: DeviceType.Climate
127116
127768
  };
127117
127769
  default: return null;
127118
127770
  }
@@ -127122,13 +127774,28 @@ function actuatorInfo(kind) {
127122
127774
  * tilt), a plain `cover` entity is the roller shutter (HmIP-BROLL). Exporters
127123
127775
  * read it; every other actuator has no role.
127124
127776
  */
127125
- function actuatorRole(kind) {
127777
+ function actuatorRole(kind, model) {
127126
127778
  if (kind === "blind") return DeviceRole.CoverBlind;
127127
127779
  if (kind === "cover") return DeviceRole.CoverShutter;
127780
+ if (kind === "climate") return climateRoleOfModel(model);
127128
127781
  return null;
127129
127782
  }
127783
+ /** Radiator valves: HmIP-eTRV-* and the classic HM-CC-RT-DN. */
127784
+ var RADIATOR_MODEL = /eTRV|HM-CC-RT-DN/i;
127785
+ /** Floor-heating actuators: HmIP-FAL* / HmIP-FALMOT-*. */
127786
+ var FLOOR_MODEL = /FAL/i;
127787
+ /**
127788
+ * D1033 — which climate device a Homematic model is. A radiator valve and a
127789
+ * floor-heating actuator are told apart by model; a wall thermostat, a
127790
+ * heating group and an unknown model are thermostats.
127791
+ */
127792
+ function climateRoleOfModel(model) {
127793
+ if (model !== void 0 && RADIATOR_MODEL.test(model)) return DeviceRole.ClimateRadiator;
127794
+ if (model !== void 0 && FLOOR_MODEL.test(model)) return DeviceRole.ClimateFloor;
127795
+ return DeviceRole.ClimateThermostat;
127796
+ }
127130
127797
  /** Actuator specs from the library's typed custom entities (correct channel). */
127131
- function deriveActuatorSpecs(customEntities) {
127798
+ function deriveActuatorSpecs(customEntities, model) {
127132
127799
  const out = [];
127133
127800
  for (const entity of customEntities) {
127134
127801
  const info = actuatorInfo(entity.kind);
@@ -127136,7 +127803,7 @@ function deriveActuatorSpecs(customEntities) {
127136
127803
  out.push({
127137
127804
  key: `act-${entity.channel}`,
127138
127805
  deviceType: info.type,
127139
- role: actuatorRole(entity.kind),
127806
+ role: actuatorRole(entity.kind, model),
127140
127807
  capabilities: [info.capName],
127141
127808
  name: `${entity.kind} ${entity.channel}`,
127142
127809
  config: {
@@ -127236,7 +127903,7 @@ function deriveUpdateSpec(device) {
127236
127903
  */
127237
127904
  function deriveHmEntitySpecs(device, customEntities) {
127238
127905
  return [
127239
- ...deriveActuatorSpecs(customEntities),
127906
+ ...deriveActuatorSpecs(customEntities, device.type),
127240
127907
  ...deriveSensorAndEventSpecs(device),
127241
127908
  ...deriveDiagnosticSpecs(device, device.address),
127242
127909
  ...deriveUpdateSpec(device)