@camstack/types 1.2.535 → 1.2.537

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +18 -9
  2. package/dist/addon.d.ts +1 -0
  3. package/dist/addon.js +5 -4
  4. package/dist/addon.mjs +3 -3
  5. package/dist/automation/action.d.ts +105 -0
  6. package/dist/automation/index.d.ts +1 -0
  7. package/dist/automation/recipe.d.ts +450 -6
  8. package/dist/automation/scheduler.d.ts +208 -0
  9. package/dist/automation/step-condition.d.ts +19 -0
  10. package/dist/automation/step-runner.d.ts +50 -5
  11. package/dist/automation/trace.d.ts +129 -0
  12. package/dist/capabilities/action-source.cap.d.ts +52 -0
  13. package/dist/capabilities/actions.cap.d.ts +406 -0
  14. package/dist/capabilities/core-blocks.cap.d.ts +3782 -120
  15. package/dist/capabilities/device-manager.cap.d.ts +97 -0
  16. package/dist/capabilities/fan-presets.cap.d.ts +312 -0
  17. package/dist/capabilities/hero-layout.cap.d.ts +12 -0
  18. package/dist/capabilities/index.d.ts +1 -1
  19. package/dist/capabilities/schedulers.cap.d.ts +458 -0
  20. package/dist/capabilities/timed-run.cap.d.ts +5 -0
  21. package/dist/client.d.ts +1 -1
  22. package/dist/client.js +45 -8
  23. package/dist/client.mjs +45 -9
  24. package/dist/{device-type-BfvqqzRp.js → composed-stable-id-C3J6LxC9.js} +14 -0
  25. package/dist/{device-type-DTTZKB2I.mjs → composed-stable-id-DLcPInGv.mjs} +9 -1
  26. package/dist/composition/composed-stable-id.d.ts +6 -0
  27. package/dist/composition/composition.d.ts +2 -2
  28. package/dist/{composition-C6TZGqUb.mjs → composition-BFJq1Y88.mjs} +2 -4
  29. package/dist/{composition-BxalDSTt.js → composition-BcVAbtBc.js} +4 -12
  30. package/dist/device/container-primary-child.d.ts +37 -5
  31. package/dist/device/device-context.d.ts +9 -2
  32. package/dist/device/hero/hero-model.d.ts +2 -0
  33. package/dist/device/hero/hero-row.d.ts +33 -2
  34. package/dist/expression/device-template.d.ts +80 -19
  35. package/dist/generated/addon-api.d.ts +14 -0
  36. package/dist/generated/method-access-map.d.ts +1 -1
  37. package/dist/generated/system-proxy.d.ts +1 -1
  38. package/dist/index.d.ts +4 -3
  39. package/dist/index.js +1564 -1024
  40. package/dist/index.mjs +705 -178
  41. package/dist/node.js +6 -6
  42. package/dist/node.mjs +2 -2
  43. package/dist/{sleep-DnVqHJc4.mjs → sleep-B36hHDDz.mjs} +1 -1
  44. package/dist/{sleep-CCAQ_PEp.js → sleep-DIg2Mx82.js} +36 -36
  45. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-CCAQ_PEp.js");
2
+ const require_sleep = require("./sleep-DIg2Mx82.js");
3
3
  const require_event_category = require("./event-category-BC4RRerT.js");
4
- const require_device_type = require("./device-type-BfvqqzRp.js");
5
- const require_composition = require("./composition-BxalDSTt.js");
4
+ const require_composed_stable_id = require("./composed-stable-id-C3J6LxC9.js");
5
+ const require_composition = require("./composition-BcVAbtBc.js");
6
6
  const require_node_color = require("./node-color.js");
7
7
  const require_convert = require("./convert-BmtM6K-5.js");
8
8
  const require_enums = require("./enums.js");
@@ -10025,7 +10025,7 @@ var DeviceSelectorSchema = zod.z.discriminatedUnion("kind", [
10025
10025
  }),
10026
10026
  zod.z.object({
10027
10027
  kind: zod.z.literal("types"),
10028
- types: zod.z.array(zod.z.enum(require_device_type.DeviceType)).min(1)
10028
+ types: zod.z.array(zod.z.enum(require_composed_stable_id.DeviceType)).min(1)
10029
10029
  }),
10030
10030
  zod.z.object({
10031
10031
  kind: zod.z.literal("locations"),
@@ -30980,7 +30980,7 @@ var ActionTargetSchema = zod.z.discriminatedUnion("kind", [
30980
30980
  zod.z.object({
30981
30981
  kind: zod.z.literal("domain"),
30982
30982
  /** Narrow to one kind of device. */
30983
- deviceType: zod.z.enum(require_device_type.DeviceType).optional(),
30983
+ deviceType: zod.z.enum(require_composed_stable_id.DeviceType).optional(),
30984
30984
  /** Narrow to one room: the `location` label devices carry. */
30985
30985
  roomId: zod.z.string().min(1).optional()
30986
30986
  }),
@@ -33008,11 +33008,35 @@ function normalizeStepTargets(steps) {
33008
33008
  /**
33009
33009
  * The steps an internal Action may contain: cap and wait, and nothing that can
33010
33010
  * call back into an Action — so an Action can never reach itself (no cycles).
33011
+ * This is the LEAF shape: no condition of its own.
33011
33012
  */
33012
- var ActionStepSchema = zod.z.discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
33013
+ var LeafActionStepSchema = zod.z.discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
33014
+ /**
33015
+ * The optional guard of a step (#472): `if` is the ONE `when` tree (D980), read
33016
+ * on the state mirror when the step is reached; `else` runs when it is false.
33017
+ * An `else` holds leaf steps only — the nesting is bounded at ONE level, so a
33018
+ * branch can never grow a tree the trace has to draw.
33019
+ */
33020
+ var stepGuardShape = {
33021
+ if: AutomationWhenSchema.optional(),
33022
+ else: zod.z.array(LeafActionStepSchema).max(10).optional()
33023
+ };
33024
+ var elseNeedsIf = {
33025
+ message: "an else list needs the condition it is the other side of (if)",
33026
+ path: ["else"]
33027
+ };
33028
+ var GuardedWaitStepSchema = AutomationWaitStepSchema.extend(stepGuardShape).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
33029
+ var GuardedCapStepSchema = AutomationCapStepBaseSchema.extend(stepGuardShape).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
33030
+ message: "a cap step needs a target",
33031
+ path: ["target"]
33032
+ }).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
33033
+ message: "a domain target needs the vocabulary action it applies to (actionId)",
33034
+ path: ["actionId"]
33035
+ }).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
33036
+ var ActionStepSchema = zod.z.discriminatedUnion("kind", [GuardedWaitStepSchema, GuardedCapStepSchema]);
33013
33037
  var AutomationActionSchema = zod.z.discriminatedUnion("kind", [
33014
- AutomationWaitStepSchema,
33015
- AutomationCapStepSchema,
33038
+ GuardedWaitStepSchema,
33039
+ GuardedCapStepSchema,
33016
33040
  zod.z.object({
33017
33041
  kind: zod.z.literal("action"),
33018
33042
  /** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
@@ -33358,10 +33382,32 @@ function emitLeaf(trigger, path) {
33358
33382
  }`;
33359
33383
  }
33360
33384
  }
33385
+ /** The body of a wait or cap step, shared by a top-level step and an else step. */
33386
+ function emitLeafBody(action) {
33387
+ switch (action.kind) {
33388
+ case "wait": return ` await sleep(${j(action.seconds * 1e3)})`;
33389
+ case "cap": {
33390
+ const { target, actionId } = normalizeCapStep(action);
33391
+ return ` await actuateTarget(scope, ${j(target)}, ${j(actionId)}, ${j(action.cap)}, ${j(action.method)}, ${j(action.args ?? {})}, vars)`;
33392
+ }
33393
+ default: return null;
33394
+ }
33395
+ }
33396
+ /** A step's `if` (#472) and its else list, as the fields of a RunnableStep. */
33397
+ function emitGuard(action) {
33398
+ if (action.kind !== "wait" && action.kind !== "cap") return "";
33399
+ if (action.if === void 0) return "";
33400
+ const otherwise = (action.else ?? []).map((el) => {
33401
+ const body = emitLeafBody(el);
33402
+ return `{ meta: ${j(stepMetaOf(el))}, run: async (scope) => {\n${body ?? ""}\n } }`;
33403
+ }).join(", ");
33404
+ return ` guard: () => evaluateCondition(${j(action.if)}),${otherwise === "" ? "" : `\n otherwise: [${otherwise}],`}
33405
+ `;
33406
+ }
33361
33407
  function emitAction(action, index) {
33362
33408
  const step = (body) => ` {
33363
33409
  meta: STEP_META[${index}]!,
33364
- run: async (scope) => {
33410
+ ${emitGuard(action)} run: async (scope) => {
33365
33411
  ${body}
33366
33412
  },
33367
33413
  },`;
@@ -33414,6 +33460,7 @@ function generateAutomationBlock(input) {
33414
33460
  AutomationConditionTraceNode,
33415
33461
  AutomationRunTrace,
33416
33462
  AutomationRunVerdict,
33463
+ AutomationWhen,
33417
33464
  AutomationStepTrace,
33418
33465
  RunnableStep,
33419
33466
  StepScope,
@@ -33437,7 +33484,9 @@ import {
33437
33484
  nextOccurrence,
33438
33485
  stableIdMapOf,
33439
33486
  resolveStepArgs,
33487
+ resolveStepArgsWithTemplates,
33440
33488
  runForDevices,
33489
+ evaluateStepCondition,
33441
33490
  runSteps,
33442
33491
  validateTimeSpecForSite,
33443
33492
  zoneOnlySite,
@@ -33636,7 +33685,7 @@ export default function block(ctx: AddonContext) {
33636
33685
  fetchSlice: (deviceId, cap) => ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap }),
33637
33686
  fetchStableIds: async () => {
33638
33687
  const all = await ctx.api.deviceManager.listAll.query({})
33639
- return stableIdMapOf(all.devices)
33688
+ return stableIdMapOf(all)
33640
33689
  },
33641
33690
  })
33642
33691
  if (report.kept > 0) {
@@ -33743,6 +33792,12 @@ export default function block(ctx: AddonContext) {
33743
33792
  ctx.logger.warn('template referenced a var that was never set', { var: name })
33744
33793
  }
33745
33794
 
33795
+ /** Device value templates (D1021) render on the hub through the ONE renderer; this block keeps no copy. */
33796
+ async function renderTemplates(templates: readonly string[]) {
33797
+ const out = await ctx.api.deviceManager.renderDeviceTemplates.query({ templates: [...templates] })
33798
+ return out.results
33799
+ }
33800
+
33746
33801
  /** Substitute {{vars.x}} slots and { $var } values. Substitution only — never evaluation. */
33747
33802
  function substitute(value: unknown, vars: Record<string, unknown>): unknown {
33748
33803
  return resolveStepArgs(value, vars, warnMissingVar)
@@ -33771,7 +33826,9 @@ export default function block(ctx: AddonContext) {
33771
33826
  args: Record<string, unknown>,
33772
33827
  vars: Record<string, unknown>,
33773
33828
  ): Promise<void> {
33774
- const substituted = substitute(args, vars)
33829
+ const templated = await resolveStepArgsWithTemplates(args, vars, warnMissingVar, renderTemplates)
33830
+ if (templated.notes.length > 0) scope.setTemplateNotes(templated.notes)
33831
+ const substituted = templated.value
33775
33832
  const resolved: Record<string, unknown> =
33776
33833
  substituted !== null && typeof substituted === 'object' ? { ...substituted } : {}
33777
33834
  scope.setArgs(resolved)
@@ -33788,6 +33845,17 @@ export default function block(ctx: AddonContext) {
33788
33845
  await mutate({ ...resolved, deviceId })
33789
33846
  }
33790
33847
 
33848
+ /** A step's \`if\` (#472), read on a mirror filled for exactly its leaves, NOW (D49: unread = unknown). */
33849
+ function evaluateCondition(when: AutomationWhen) {
33850
+ return evaluateStepCondition(when, {
33851
+ fetchSlice: (deviceId, cap) => ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap }),
33852
+ fetchStableIds: async () => {
33853
+ const all = await ctx.api.deviceManager.listAll.query({})
33854
+ return stableIdMapOf(all)
33855
+ },
33856
+ })
33857
+ }
33858
+
33791
33859
  /** The THEN half, through the ONE shared step runner: stops at the first
33792
33860
  * failure (continuing past a failed step executes an intent the operator
33793
33861
  * never expressed); every step is traced, the ones after a failure (or an
@@ -33812,6 +33880,13 @@ ${recipe.actions.map((a, i) => emitAction(a, i)).join("\n")}
33812
33880
  error: failure.message,
33813
33881
  })
33814
33882
  },
33883
+ onGuardUnknown: (skipped) => {
33884
+ ctx.logger.warn('step skipped — its condition could not be read', {
33885
+ ...(skipped.deviceId === undefined ? {} : { tags: { deviceId: skipped.deviceId } }),
33886
+ step: skipped.index,
33887
+ reason: skipped.reason,
33888
+ })
33889
+ },
33815
33890
  })
33816
33891
  }
33817
33892
 
@@ -35182,7 +35257,7 @@ var StepDeviceTraceSchema = zod.z.object({
35182
35257
  outcome: zod.z.enum(["ok", "error"]),
35183
35258
  message: zod.z.string().optional()
35184
35259
  });
35185
- var AutomationStepTraceSchema = zod.z.object({
35260
+ var StepTraceBaseSchema = zod.z.object({
35186
35261
  /** `actions.<i>` */
35187
35262
  path: zod.z.string().min(1),
35188
35263
  kind: zod.z.string().min(1),
@@ -35201,15 +35276,35 @@ var AutomationStepTraceSchema = zod.z.object({
35201
35276
  * is shown as {@link REDACTED_ARG}. Absent on traces written before it existed.
35202
35277
  */
35203
35278
  args: zod.z.record(zod.z.string(), TraceValueSchema).optional(),
35204
- /** `empty`: the target resolved to no device, so nothing was done — never silently `ok`. */
35279
+ /**
35280
+ * The device values a templated arg printed as `—`, one `ref: reason` each
35281
+ * (D1021): why a sentence says "—" where a number was expected. Bounded.
35282
+ */
35283
+ templates: zod.z.array(zod.z.string()).max(20).optional(),
35284
+ /**
35285
+ * What the step's own `if` read when the step was reached (#472): `true` the
35286
+ * step ran, `false` its `else` ran (or nothing did), `unknown` a state leaf
35287
+ * could not be read, so NEITHER side ran. Absent on an unguarded step.
35288
+ */
35289
+ condition: zod.z.enum([
35290
+ "true",
35291
+ "false",
35292
+ "unknown"
35293
+ ]).optional(),
35294
+ /** Why the condition read what it read, in the evaluator's own words. */
35295
+ conditionReason: zod.z.string().optional(),
35296
+ /** `empty`: the target resolved to no device, so nothing was done — never silently `ok`. `skipped`: its `if` was false (or unknown) and nothing ran in its place. */
35205
35297
  outcome: zod.z.enum([
35206
35298
  "ok",
35207
35299
  "error",
35208
35300
  "not-run",
35209
- "empty"
35301
+ "empty",
35302
+ "skipped"
35210
35303
  ]),
35211
35304
  message: zod.z.string().optional()
35212
35305
  });
35306
+ /** A step trace; the `else` steps that ran are one level of the same shape (the nesting is bounded at one). */
35307
+ var AutomationStepTraceSchema = StepTraceBaseSchema.extend({ else: zod.z.array(StepTraceBaseSchema).optional() });
35213
35308
  var AutomationRunTraceSchema = zod.z.object({
35214
35309
  runId: zod.z.string().min(1),
35215
35310
  startedAt: zod.z.number(),
@@ -35545,6 +35640,7 @@ var ActionErrorCodeSchema = zod.z.enum([
35545
35640
  "invalid-variables",
35546
35641
  "invalid-steps",
35547
35642
  "not-linked",
35643
+ "template-scope",
35548
35644
  "busy"
35549
35645
  ]);
35550
35646
  /**
@@ -35594,10 +35690,53 @@ function normalizeNcAction(action) {
35594
35690
  };
35595
35691
  }
35596
35692
  //#endregion
35693
+ //#region src/automation/step-condition.ts
35694
+ /**
35695
+ * The guard of a conditional step (#472): the step's `if` is the ONE `when`
35696
+ * tree (D980), read on a {@link ConditionMirror} filled for exactly the leaves
35697
+ * the tree names, at the moment the step is reached. A state that cannot be
35698
+ * read is UNKNOWN, and unknown runs neither side (D49: a failed read changes
35699
+ * nothing, and never decides a branch).
35700
+ */
35701
+ /** Fill a mirror for the tree's leaves from `fetchers` and judge it NOW. */
35702
+ async function evaluateStepCondition(when, fetchers, now = Date.now) {
35703
+ const mirror = new ConditionMirror(collectWhenMirrorSources(when));
35704
+ await mirror.refresh(fetchers);
35705
+ const evaluation = evaluateWhenTree(when, mirror, now());
35706
+ const first = evaluation.nodes.filter((n) => n.outcome !== "pass").map((n) => n.reason)[0];
35707
+ if (evaluation.unknown) return {
35708
+ result: "unknown",
35709
+ reason: `a state the condition reads is not known${first === void 0 ? "" : ` (${first})`}`
35710
+ };
35711
+ return evaluation.pass ? {
35712
+ result: "true",
35713
+ reason: "the condition holds"
35714
+ } : {
35715
+ result: "false",
35716
+ reason: first ?? "the condition does not hold"
35717
+ };
35718
+ }
35719
+ //#endregion
35597
35720
  //#region src/automation/step-runner.ts
35598
35721
  function errorMessage(err) {
35599
35722
  return err instanceof Error ? err.message : String(err);
35600
35723
  }
35724
+ /** A guard that throws is an unknown, never a crash of the run. */
35725
+ async function readGuard(guard) {
35726
+ try {
35727
+ return await guard();
35728
+ } catch (err) {
35729
+ return {
35730
+ result: "unknown",
35731
+ reason: `the condition could not be read: ${errorMessage(err)}`
35732
+ };
35733
+ }
35734
+ }
35735
+ /** The else level of a trace is one level deep: a nested trace carries no `else` of its own. */
35736
+ function withoutElse(trace) {
35737
+ const { else: _else, ...rest } = trace;
35738
+ return rest;
35739
+ }
35601
35740
  async function runSteps(steps, options) {
35602
35741
  const traces = [];
35603
35742
  let failed = false;
@@ -35615,10 +35754,57 @@ async function runSteps(steps, options) {
35615
35754
  continue;
35616
35755
  }
35617
35756
  const startedAt = options.now();
35757
+ let guardTrace = {};
35758
+ if (step.guard !== void 0) {
35759
+ const verdict = await readGuard(step.guard);
35760
+ guardTrace = {
35761
+ condition: verdict.result,
35762
+ conditionReason: verdict.reason
35763
+ };
35764
+ if (verdict.result === "unknown") options.onGuardUnknown?.({
35765
+ index,
35766
+ path,
35767
+ reason: verdict.reason,
35768
+ deviceId: step.meta.deviceId
35769
+ });
35770
+ if (verdict.result !== "true") {
35771
+ const branch = verdict.result === "false" ? step.otherwise ?? [] : [];
35772
+ if (branch.length === 0) {
35773
+ traces.push({
35774
+ ...step.meta,
35775
+ ...guardTrace,
35776
+ path,
35777
+ startedAt,
35778
+ endedAt: options.now(),
35779
+ outcome: "skipped",
35780
+ message: verdict.result === "unknown" ? `not run: ${verdict.reason}` : `not run: the condition is false (${verdict.reason})`
35781
+ });
35782
+ continue;
35783
+ }
35784
+ const sub = await runSteps(branch, {
35785
+ ...options,
35786
+ pathPrefix: `${path}.else`
35787
+ });
35788
+ if (sub.failed) failed = true;
35789
+ else if (sub.aborted) aborted = true;
35790
+ traces.push({
35791
+ ...step.meta,
35792
+ ...guardTrace,
35793
+ path,
35794
+ startedAt,
35795
+ endedAt: options.now(),
35796
+ outcome: sub.failed ? "error" : "ok",
35797
+ ...sub.failed ? { message: "an else step failed" } : {},
35798
+ else: sub.steps.map(withoutElse)
35799
+ });
35800
+ continue;
35801
+ }
35802
+ }
35618
35803
  let deviceId = step.meta.deviceId;
35619
35804
  let sent;
35620
35805
  const perDevice = [];
35621
35806
  let emptyReason;
35807
+ let templateNotes = [];
35622
35808
  const scope = {
35623
35809
  setDeviceId: (id) => {
35624
35810
  deviceId = id;
@@ -35631,8 +35817,12 @@ async function runSteps(steps, options) {
35631
35817
  },
35632
35818
  setArgs: (args) => {
35633
35819
  sent = args;
35820
+ },
35821
+ setTemplateNotes: (notes) => {
35822
+ templateNotes = notes.slice(0, 20);
35634
35823
  }
35635
35824
  };
35825
+ const templatesTrace = () => templateNotes.length === 0 ? {} : { templates: [...templateNotes] };
35636
35826
  const argsTrace = () => sent === void 0 ? {} : { args: buildStepArgsTrace(sent) };
35637
35827
  const devicesTrace = () => perDevice.length === 0 ? {} : { devices: perDevice.slice(0, 200) };
35638
35828
  try {
@@ -35641,7 +35831,9 @@ async function runSteps(steps, options) {
35641
35831
  ...step.meta,
35642
35832
  ...deviceId === void 0 || perDevice.length > 1 ? {} : { deviceId },
35643
35833
  ...argsTrace(),
35834
+ ...templatesTrace(),
35644
35835
  ...devicesTrace(),
35836
+ ...guardTrace,
35645
35837
  path,
35646
35838
  startedAt,
35647
35839
  endedAt: options.now(),
@@ -35661,7 +35853,9 @@ async function runSteps(steps, options) {
35661
35853
  ...step.meta,
35662
35854
  ...deviceId === void 0 || perDevice.length > 1 ? {} : { deviceId },
35663
35855
  ...argsTrace(),
35856
+ ...templatesTrace(),
35664
35857
  ...devicesTrace(),
35858
+ ...guardTrace,
35665
35859
  path,
35666
35860
  startedAt,
35667
35861
  endedAt: options.now(),
@@ -35710,6 +35904,125 @@ function resolveStepArgs(value, vars, onMissing) {
35710
35904
  if (value !== null && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, resolveStepArgs(v, vars, onMissing)]));
35711
35905
  return value;
35712
35906
  }
35907
+ /** A device template that did not render: the step fails with this, never throws past `runSteps`. */
35908
+ var StepTemplateError = class extends Error {
35909
+ reason;
35910
+ constructor(reason, message) {
35911
+ super(`device template [${reason}]: ${message}`);
35912
+ this.reason = reason;
35913
+ this.name = "StepTemplateError";
35914
+ }
35915
+ };
35916
+ /**
35917
+ * A `{{vars.x}}` slot, set aside while a template renders. The slot carries a
35918
+ * nonce drawn per call, so a device value that happens to contain the sentinel
35919
+ * characters can never name a held variable.
35920
+ */
35921
+ var VAR_SLOT_OPEN = "";
35922
+ var VAR_SLOT_CLOSE = "";
35923
+ var TEMPLATE_MARKUP_RE = /\{\{|\{%/;
35924
+ function newSlotNonce() {
35925
+ return Math.random().toString(36).slice(2, 12);
35926
+ }
35927
+ function slotPattern(nonce) {
35928
+ return new RegExp(`${VAR_SLOT_OPEN}${nonce}:([A-Za-z_][A-Za-z0-9_]*)${VAR_SLOT_CLOSE}`, "g");
35929
+ }
35930
+ /** True when a string, once its `{{vars.x}}` slots are set aside, still carries template markup. */
35931
+ function carriesDeviceTemplate(text) {
35932
+ return TEMPLATE_MARKUP_RE.test(text.replace(TEMPLATE_RE, ""));
35933
+ }
35934
+ /** Every string in `value` that is a device template (D1021), de-duplicated, in walk order. */
35935
+ function collectDeviceTemplates(value) {
35936
+ const found = /* @__PURE__ */ new Set();
35937
+ const walk = (node) => {
35938
+ if (typeof node === "string") {
35939
+ if (carriesDeviceTemplate(node)) found.add(node);
35940
+ } else if (Array.isArray(node)) for (const item of node) walk(item);
35941
+ else if (node !== null && typeof node === "object") for (const item of Object.values(node)) walk(item);
35942
+ };
35943
+ walk(value);
35944
+ return [...found];
35945
+ }
35946
+ function protectVarSlots(text, nonce) {
35947
+ return text.replace(TEMPLATE_RE, (_m, key) => `${VAR_SLOT_OPEN}${nonce}:${key}${VAR_SLOT_CLOSE}`);
35948
+ }
35949
+ function restoreVarSlots(text, nonce, vars, onMissing) {
35950
+ return text.replace(slotPattern(nonce), (_m, key) => {
35951
+ const v = vars[key];
35952
+ if (v === void 0) {
35953
+ onMissing(key);
35954
+ return "";
35955
+ }
35956
+ return String(v);
35957
+ });
35958
+ }
35959
+ /**
35960
+ * {@link resolveStepArgs} plus the device templates of a step (D1021). A string
35961
+ * that carries `{{ … }}` / `{% … %}` beyond a `{{vars.x}}` slot is rendered by
35962
+ * `render` BEFORE the variables are put in, so a variable's value is data and
35963
+ * never template source (an action variable can come from a non-admin caller).
35964
+ * A refused render, or no renderer, throws {@link StepTemplateError}: the step
35965
+ * fails with the typed reason and nothing is dispatched.
35966
+ */
35967
+ async function resolveStepArgsWithTemplates(value, vars, onMissing, render) {
35968
+ const nonce = newSlotNonce();
35969
+ const sources = [];
35970
+ const indexOf = /* @__PURE__ */ new Map();
35971
+ const hold = (text) => {
35972
+ const known = indexOf.get(text);
35973
+ if (known !== void 0) return known;
35974
+ sources.push(text);
35975
+ indexOf.set(text, sources.length - 1);
35976
+ return sources.length - 1;
35977
+ };
35978
+ class Pending {
35979
+ index;
35980
+ constructor(index) {
35981
+ this.index = index;
35982
+ }
35983
+ }
35984
+ const collect = (node) => {
35985
+ if (isVarRef(node)) return resolveStepArgs(node, vars, onMissing);
35986
+ if (typeof node === "string") return carriesDeviceTemplate(node) ? new Pending(hold(protectVarSlots(node, nonce))) : resolveStepArgs(node, vars, onMissing);
35987
+ if (Array.isArray(node)) return node.map(collect);
35988
+ if (node !== null && typeof node === "object") return Object.fromEntries(Object.entries(node).map(([k, v]) => [k, collect(v)]));
35989
+ return node;
35990
+ };
35991
+ const skeleton = collect(value);
35992
+ if (sources.length === 0) return {
35993
+ value: skeleton,
35994
+ notes: []
35995
+ };
35996
+ if (render === void 0) throw new StepTemplateError("unavailable", "this node has no device template renderer");
35997
+ let answers;
35998
+ try {
35999
+ answers = await render(sources);
36000
+ } catch (err) {
36001
+ throw new StepTemplateError("unavailable", errorMessage(err));
36002
+ }
36003
+ const texts = [];
36004
+ const notes = [];
36005
+ for (const index of sources.keys()) {
36006
+ const answer = answers[index];
36007
+ if (answer === void 0) throw new StepTemplateError("unavailable", `no answer for template ${index + 1}`);
36008
+ if (!answer.ok) throw new StepTemplateError(answer.refusal.reason, answer.refusal.message);
36009
+ texts.push(restoreVarSlots(answer.text, nonce, vars, onMissing));
36010
+ for (const entry of answer.trace) {
36011
+ const note = `${entry.ref}: ${entry.reason}`;
36012
+ if (!notes.includes(note)) notes.push(note);
36013
+ }
36014
+ }
36015
+ const fill = (node) => {
36016
+ if (node instanceof Pending) return texts[node.index] ?? "";
36017
+ if (Array.isArray(node)) return node.map(fill);
36018
+ if (node !== null && typeof node === "object") return Object.fromEntries(Object.entries(node).map(([k, v]) => [k, fill(v)]));
36019
+ return node;
36020
+ };
36021
+ return {
36022
+ value: fill(skeleton),
36023
+ notes
36024
+ };
36025
+ }
35713
36026
  /** A `{ $var }` device target, resolved from the bag BEFORE dispatch. */
35714
36027
  function resolveDeviceTarget(vars, name) {
35715
36028
  const raw = vars[name];
@@ -35771,19 +36084,36 @@ async function runForDevices(deviceIds, scope, work, concurrency = 4) {
35771
36084
  * variables. Variables are substituted per step, at the moment it runs, so a
35772
36085
  * missing one fails THAT step (traced) and leaves the later ones not-run.
35773
36086
  */
36087
+ /** The guard and the else list of a step, bound to the run (#472); `{}` for an unguarded step. */
36088
+ function guardOf(step, vars, deps) {
36089
+ const when = step.if;
36090
+ if (when === void 0) return {};
36091
+ const evaluate = deps.evaluateCondition;
36092
+ return {
36093
+ guard: async () => evaluate === void 0 ? {
36094
+ result: "unknown",
36095
+ reason: "this consumer has no condition evaluator"
36096
+ } : evaluate(when),
36097
+ ...step.else === void 0 ? {} : { otherwise: buildActionSteps(step.else, vars, deps) }
36098
+ };
36099
+ }
35774
36100
  function buildActionSteps(steps, vars, deps) {
35775
36101
  return steps.map((step) => {
36102
+ const guarded = guardOf(step, vars, deps);
35776
36103
  const meta = stepMetaOfAction(step);
35777
36104
  if (step.kind === "wait") return {
35778
36105
  meta,
36106
+ ...guarded,
35779
36107
  run: () => deps.sleep(step.seconds * 1e3)
35780
36108
  };
35781
36109
  const normalized = normalizeCapStep(step);
35782
36110
  return {
35783
36111
  meta,
36112
+ ...guarded,
35784
36113
  run: async (scope) => {
35785
- const resolved = resolveStepArgs(step.args ?? {}, vars, deps.onMissingVar);
35786
- const args = isPlainRecord(resolved) ? resolved : {};
36114
+ const templated = await resolveStepArgsWithTemplates(step.args ?? {}, vars, deps.onMissingVar, deps.renderTemplates);
36115
+ if (templated.notes.length > 0) scope.setTemplateNotes(templated.notes);
36116
+ const args = isPlainRecord(templated.value) ? templated.value : {};
35787
36117
  const target = await deps.resolveTarget(normalized.target, normalized.actionId, vars, {
35788
36118
  actionId: normalized.actionId,
35789
36119
  owner: deps.owner
@@ -36356,18 +36686,18 @@ var accessoriesCapability = {
36356
36686
  deviceNative: true,
36357
36687
  mode: "singleton",
36358
36688
  deviceTypes: [
36359
- require_device_type.DeviceType.Camera,
36360
- require_device_type.DeviceType.Hub,
36361
- require_device_type.DeviceType.Switch,
36362
- require_device_type.DeviceType.Light,
36363
- require_device_type.DeviceType.Sensor,
36364
- require_device_type.DeviceType.Thermostat,
36365
- require_device_type.DeviceType.Cover,
36366
- require_device_type.DeviceType.Lock,
36367
- require_device_type.DeviceType.Fan,
36368
- require_device_type.DeviceType.MediaPlayer,
36369
- require_device_type.DeviceType.AlarmPanel,
36370
- require_device_type.DeviceType.Generic
36689
+ require_composed_stable_id.DeviceType.Camera,
36690
+ require_composed_stable_id.DeviceType.Hub,
36691
+ require_composed_stable_id.DeviceType.Switch,
36692
+ require_composed_stable_id.DeviceType.Light,
36693
+ require_composed_stable_id.DeviceType.Sensor,
36694
+ require_composed_stable_id.DeviceType.Thermostat,
36695
+ require_composed_stable_id.DeviceType.Cover,
36696
+ require_composed_stable_id.DeviceType.Lock,
36697
+ require_composed_stable_id.DeviceType.Fan,
36698
+ require_composed_stable_id.DeviceType.MediaPlayer,
36699
+ require_composed_stable_id.DeviceType.AlarmPanel,
36700
+ require_composed_stable_id.DeviceType.Generic
36371
36701
  ],
36372
36702
  methods: {
36373
36703
  /**
@@ -37757,7 +38087,7 @@ var airQualitySensorCapability = {
37757
38087
  scope: "device",
37758
38088
  deviceNative: true,
37759
38089
  mode: "singleton",
37760
- deviceTypes: [require_device_type.DeviceType.Sensor],
38090
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
37761
38091
  methods: {},
37762
38092
  status: {
37763
38093
  schema: AirQualitySensorStatusSchema,
@@ -37868,7 +38198,7 @@ var alarmPanelCapability = {
37868
38198
  scope: "device",
37869
38199
  deviceNative: true,
37870
38200
  mode: "singleton",
37871
- deviceTypes: [require_device_type.DeviceType.AlarmPanel],
38201
+ deviceTypes: [require_composed_stable_id.DeviceType.AlarmPanel],
37872
38202
  methods: {
37873
38203
  arm: require_sleep.method(zod.z.object({
37874
38204
  deviceId: zod.z.number().int().nonnegative(),
@@ -38031,7 +38361,7 @@ var ambientLightSensorCapability = {
38031
38361
  scope: "device",
38032
38362
  deviceNative: true,
38033
38363
  mode: "singleton",
38034
- deviceTypes: [require_device_type.DeviceType.Sensor],
38364
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
38035
38365
  methods: {},
38036
38366
  status: {
38037
38367
  schema: AmbientLightSensorStatusSchema,
@@ -38082,7 +38412,7 @@ var audioAnalysisCapability = {
38082
38412
  mode: "singleton",
38083
38413
  kind: "wrapper",
38084
38414
  defaultActive: true,
38085
- deviceTypes: [require_device_type.DeviceType.Camera],
38415
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
38086
38416
  exposesDeviceSettings: true,
38087
38417
  methods: {
38088
38418
  /**
@@ -38575,7 +38905,7 @@ var audioMetricsCapability = {
38575
38905
  name: "audio-metrics",
38576
38906
  scope: "device",
38577
38907
  mode: "singleton",
38578
- deviceTypes: [require_device_type.DeviceType.Camera],
38908
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
38579
38909
  methods: {
38580
38910
  /** Latest snapshot for this device. Null until the analytics
38581
38911
  * pipeline has processed at least one audio window. */
@@ -38680,7 +39010,7 @@ var automationControlCapability = {
38680
39010
  scope: "device",
38681
39011
  deviceNative: true,
38682
39012
  mode: "singleton",
38683
- deviceTypes: [require_device_type.DeviceType.Automation],
39013
+ deviceTypes: [require_composed_stable_id.DeviceType.Automation],
38684
39014
  methods: {
38685
39015
  enable: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
38686
39016
  kind: "mutation",
@@ -39484,14 +39814,14 @@ var BatteryStatusSchema = zod.z.object({
39484
39814
  binary: zod.z.boolean().optional().meta({ label: "Binary indicator" })
39485
39815
  });
39486
39816
  var BATTERY_DEVICE_TYPES = [
39487
- require_device_type.DeviceType.Camera,
39488
- require_device_type.DeviceType.Sensor,
39489
- require_device_type.DeviceType.Button,
39490
- require_device_type.DeviceType.Switch,
39491
- require_device_type.DeviceType.PetFeeder,
39492
- require_device_type.DeviceType.Container,
39493
- require_device_type.DeviceType.Thermostat,
39494
- require_device_type.DeviceType.EventEmitter
39817
+ require_composed_stable_id.DeviceType.Camera,
39818
+ require_composed_stable_id.DeviceType.Sensor,
39819
+ require_composed_stable_id.DeviceType.Button,
39820
+ require_composed_stable_id.DeviceType.Switch,
39821
+ require_composed_stable_id.DeviceType.PetFeeder,
39822
+ require_composed_stable_id.DeviceType.Container,
39823
+ require_composed_stable_id.DeviceType.Thermostat,
39824
+ require_composed_stable_id.DeviceType.EventEmitter
39495
39825
  ];
39496
39826
  /** Generic Customize target for the percentage reading (D936). */
39497
39827
  var batteryCustomize = {
@@ -39663,7 +39993,7 @@ var binaryCapability = {
39663
39993
  scope: "device",
39664
39994
  deviceNative: true,
39665
39995
  mode: "singleton",
39666
- deviceTypes: [require_device_type.DeviceType.Sensor],
39996
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
39667
39997
  methods: {},
39668
39998
  status: {
39669
39999
  schema: BinaryStatusSchema,
@@ -39769,7 +40099,7 @@ var brightnessCapability = {
39769
40099
  scope: "device",
39770
40100
  deviceNative: true,
39771
40101
  mode: "singleton",
39772
- deviceTypes: [require_device_type.DeviceType.Light],
40102
+ deviceTypes: [require_composed_stable_id.DeviceType.Light],
39773
40103
  methods: { setBrightness: require_sleep.method(zod.z.object({
39774
40104
  deviceId: zod.z.number().int().nonnegative(),
39775
40105
  level: zod.z.number().min(0).max(100)
@@ -39933,7 +40263,7 @@ var buttonCapability = {
39933
40263
  scope: "device",
39934
40264
  deviceNative: true,
39935
40265
  mode: "singleton",
39936
- deviceTypes: [require_device_type.DeviceType.Button],
40266
+ deviceTypes: [require_composed_stable_id.DeviceType.Button],
39937
40267
  methods: { press: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
39938
40268
  kind: "mutation",
39939
40269
  auth: "protected"
@@ -40176,7 +40506,7 @@ var cameraCredentialsCapability = {
40176
40506
  scope: "device",
40177
40507
  deviceNative: true,
40178
40508
  mode: "singleton",
40179
- deviceTypes: [require_device_type.DeviceType.Camera],
40509
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
40180
40510
  methods: {
40181
40511
  /**
40182
40512
  * Return the camera's full credential bundle for admin consumers.
@@ -40333,7 +40663,7 @@ var cameraGridLayoutCapability = {
40333
40663
  scope: "device",
40334
40664
  deviceNative: true,
40335
40665
  mode: "singleton",
40336
- deviceTypes: [require_device_type.DeviceType.Camera],
40666
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
40337
40667
  /**
40338
40668
  * The section is built by the ADDON and returned from
40339
40669
  * `getDeviceSettingsContribution`, not derived by the framework from a
@@ -40405,7 +40735,7 @@ var cameraPipelineConfigCapability = {
40405
40735
  mode: "singleton",
40406
40736
  kind: "wrapper",
40407
40737
  defaultActive: true,
40408
- deviceTypes: [require_device_type.DeviceType.Camera],
40738
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
40409
40739
  exposesDeviceSettings: true,
40410
40740
  methods: {}
40411
40741
  };
@@ -41506,7 +41836,7 @@ var cameraStreamsCapability = {
41506
41836
  mode: "singleton",
41507
41837
  kind: "wrapper",
41508
41838
  defaultActive: true,
41509
- deviceTypes: [require_device_type.DeviceType.Camera],
41839
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
41510
41840
  methods: {
41511
41841
  getCameraStreams: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.array(require_sleep.CameraStreamSchema).readonly()),
41512
41842
  getBrokerStreams: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.array(require_sleep.ProfileSlotSchema).readonly()),
@@ -41636,7 +41966,7 @@ var carbonMonoxideCapability = {
41636
41966
  scope: "device",
41637
41967
  deviceNative: true,
41638
41968
  mode: "singleton",
41639
- deviceTypes: [require_device_type.DeviceType.Sensor],
41969
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
41640
41970
  methods: {},
41641
41971
  status: {
41642
41972
  schema: CarbonMonoxideStatusSchema,
@@ -41761,7 +42091,7 @@ var climateControlCapability = {
41761
42091
  scope: "device",
41762
42092
  deviceNative: true,
41763
42093
  mode: "singleton",
41764
- deviceTypes: [require_device_type.DeviceType.Thermostat, require_device_type.DeviceType.Climate],
42094
+ deviceTypes: [require_composed_stable_id.DeviceType.Thermostat, require_composed_stable_id.DeviceType.Climate],
41765
42095
  methods: {
41766
42096
  setMode: require_sleep.method(zod.z.object({
41767
42097
  deviceId: zod.z.number().int().nonnegative(),
@@ -41949,7 +42279,7 @@ var colorCapability = {
41949
42279
  scope: "device",
41950
42280
  deviceNative: true,
41951
42281
  mode: "singleton",
41952
- deviceTypes: [require_device_type.DeviceType.Light],
42282
+ deviceTypes: [require_composed_stable_id.DeviceType.Light],
41953
42283
  methods: { setColor: require_sleep.method(zod.z.object({
41954
42284
  deviceId: zod.z.number().int().nonnegative(),
41955
42285
  color: ColorInputSchema
@@ -42415,7 +42745,7 @@ var connectivityCapability = {
42415
42745
  scope: "device",
42416
42746
  deviceNative: true,
42417
42747
  mode: "singleton",
42418
- deviceTypes: [require_device_type.DeviceType.Sensor],
42748
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
42419
42749
  methods: {},
42420
42750
  status: {
42421
42751
  schema: ConnectivityStatusSchema,
@@ -42595,7 +42925,7 @@ var consumablesCustomize = {
42595
42925
  id: "items",
42596
42926
  cardinality: "keyedArray",
42597
42927
  vocabulary: { cap: "consumables" },
42598
- deviceTypes: Object.values(require_device_type.DeviceType),
42928
+ deviceTypes: Object.values(require_composed_stable_id.DeviceType),
42599
42929
  apply: "add",
42600
42930
  path: "items",
42601
42931
  keyField: "key",
@@ -42666,7 +42996,7 @@ var consumablesCapability = {
42666
42996
  scope: "device",
42667
42997
  deviceNative: true,
42668
42998
  mode: "singleton",
42669
- deviceTypes: Object.values(require_device_type.DeviceType),
42999
+ deviceTypes: Object.values(require_composed_stable_id.DeviceType),
42670
43000
  deviceConfig: { ui: {
42671
43001
  kind: "widget",
42672
43002
  widgetId: "host/consumables-panel",
@@ -42787,7 +43117,7 @@ var contactCapability = {
42787
43117
  scope: "device",
42788
43118
  deviceNative: true,
42789
43119
  mode: "singleton",
42790
- deviceTypes: [require_device_type.DeviceType.Sensor],
43120
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
42791
43121
  methods: {},
42792
43122
  status: {
42793
43123
  schema: ContactStatusSchema,
@@ -42899,7 +43229,7 @@ var controlCapability = {
42899
43229
  scope: "device",
42900
43230
  deviceNative: true,
42901
43231
  mode: "singleton",
42902
- deviceTypes: [require_device_type.DeviceType.Control],
43232
+ deviceTypes: [require_composed_stable_id.DeviceType.Control],
42903
43233
  methods: { setValue: require_sleep.method(zod.z.object({
42904
43234
  deviceId: zod.z.number().int().nonnegative(),
42905
43235
  control: ControlSetValueInputSchema
@@ -43343,7 +43673,7 @@ var mediaPlayerCapability = {
43343
43673
  scope: "device",
43344
43674
  deviceNative: true,
43345
43675
  mode: "singleton",
43346
- deviceTypes: [require_device_type.DeviceType.MediaPlayer],
43676
+ deviceTypes: [require_composed_stable_id.DeviceType.MediaPlayer],
43347
43677
  methods: {
43348
43678
  turnOn: require_sleep.method(deviceOnly, zod.z.void(), {
43349
43679
  kind: "mutation",
@@ -43487,14 +43817,14 @@ var CAP_CUSTOMIZE_CATALOG = {
43487
43817
  id: "level",
43488
43818
  cardinality: "scalar",
43489
43819
  deviceTypes: [
43490
- require_device_type.DeviceType.Camera,
43491
- require_device_type.DeviceType.Sensor,
43492
- require_device_type.DeviceType.Button,
43493
- require_device_type.DeviceType.Switch,
43494
- require_device_type.DeviceType.PetFeeder,
43495
- require_device_type.DeviceType.Container,
43496
- require_device_type.DeviceType.Thermostat,
43497
- require_device_type.DeviceType.EventEmitter
43820
+ require_composed_stable_id.DeviceType.Camera,
43821
+ require_composed_stable_id.DeviceType.Sensor,
43822
+ require_composed_stable_id.DeviceType.Button,
43823
+ require_composed_stable_id.DeviceType.Switch,
43824
+ require_composed_stable_id.DeviceType.PetFeeder,
43825
+ require_composed_stable_id.DeviceType.Container,
43826
+ require_composed_stable_id.DeviceType.Thermostat,
43827
+ require_composed_stable_id.DeviceType.EventEmitter
43498
43828
  ],
43499
43829
  apply: "add",
43500
43830
  vocabularyCap: "battery",
@@ -43543,44 +43873,44 @@ var CAP_CUSTOMIZE_CATALOG = {
43543
43873
  id: "items",
43544
43874
  cardinality: "keyedArray",
43545
43875
  deviceTypes: [
43546
- require_device_type.DeviceType.Camera,
43547
- require_device_type.DeviceType.Hub,
43548
- require_device_type.DeviceType.Light,
43549
- require_device_type.DeviceType.Siren,
43550
- require_device_type.DeviceType.Switch,
43551
- require_device_type.DeviceType.Sensor,
43552
- require_device_type.DeviceType.Thermostat,
43553
- require_device_type.DeviceType.Climate,
43554
- require_device_type.DeviceType.Button,
43555
- require_device_type.DeviceType.EventEmitter,
43556
- require_device_type.DeviceType.Update,
43557
- require_device_type.DeviceType.Generic,
43558
- require_device_type.DeviceType.Notifier,
43559
- require_device_type.DeviceType.Script,
43560
- require_device_type.DeviceType.Automation,
43561
- require_device_type.DeviceType.Lock,
43562
- require_device_type.DeviceType.Cover,
43563
- require_device_type.DeviceType.Valve,
43564
- require_device_type.DeviceType.Humidifier,
43565
- require_device_type.DeviceType.WaterHeater,
43566
- require_device_type.DeviceType.Fan,
43567
- require_device_type.DeviceType.MediaPlayer,
43568
- require_device_type.DeviceType.AlarmPanel,
43569
- require_device_type.DeviceType.Control,
43570
- require_device_type.DeviceType.Presence,
43571
- require_device_type.DeviceType.Weather,
43572
- require_device_type.DeviceType.Vacuum,
43573
- require_device_type.DeviceType.LawnMower,
43574
- require_device_type.DeviceType.Container,
43575
- require_device_type.DeviceType.Image,
43576
- require_device_type.DeviceType.PetFeeder,
43577
- require_device_type.DeviceType.PetFountain,
43578
- require_device_type.DeviceType.Dishwasher,
43579
- require_device_type.DeviceType.Washer,
43580
- require_device_type.DeviceType.Heater,
43581
- require_device_type.DeviceType.Dryer,
43582
- require_device_type.DeviceType.Gateway,
43583
- require_device_type.DeviceType.HeatPump
43876
+ require_composed_stable_id.DeviceType.Camera,
43877
+ require_composed_stable_id.DeviceType.Hub,
43878
+ require_composed_stable_id.DeviceType.Light,
43879
+ require_composed_stable_id.DeviceType.Siren,
43880
+ require_composed_stable_id.DeviceType.Switch,
43881
+ require_composed_stable_id.DeviceType.Sensor,
43882
+ require_composed_stable_id.DeviceType.Thermostat,
43883
+ require_composed_stable_id.DeviceType.Climate,
43884
+ require_composed_stable_id.DeviceType.Button,
43885
+ require_composed_stable_id.DeviceType.EventEmitter,
43886
+ require_composed_stable_id.DeviceType.Update,
43887
+ require_composed_stable_id.DeviceType.Generic,
43888
+ require_composed_stable_id.DeviceType.Notifier,
43889
+ require_composed_stable_id.DeviceType.Script,
43890
+ require_composed_stable_id.DeviceType.Automation,
43891
+ require_composed_stable_id.DeviceType.Lock,
43892
+ require_composed_stable_id.DeviceType.Cover,
43893
+ require_composed_stable_id.DeviceType.Valve,
43894
+ require_composed_stable_id.DeviceType.Humidifier,
43895
+ require_composed_stable_id.DeviceType.WaterHeater,
43896
+ require_composed_stable_id.DeviceType.Fan,
43897
+ require_composed_stable_id.DeviceType.MediaPlayer,
43898
+ require_composed_stable_id.DeviceType.AlarmPanel,
43899
+ require_composed_stable_id.DeviceType.Control,
43900
+ require_composed_stable_id.DeviceType.Presence,
43901
+ require_composed_stable_id.DeviceType.Weather,
43902
+ require_composed_stable_id.DeviceType.Vacuum,
43903
+ require_composed_stable_id.DeviceType.LawnMower,
43904
+ require_composed_stable_id.DeviceType.Container,
43905
+ require_composed_stable_id.DeviceType.Image,
43906
+ require_composed_stable_id.DeviceType.PetFeeder,
43907
+ require_composed_stable_id.DeviceType.PetFountain,
43908
+ require_composed_stable_id.DeviceType.Dishwasher,
43909
+ require_composed_stable_id.DeviceType.Washer,
43910
+ require_composed_stable_id.DeviceType.Heater,
43911
+ require_composed_stable_id.DeviceType.Dryer,
43912
+ require_composed_stable_id.DeviceType.Gateway,
43913
+ require_composed_stable_id.DeviceType.HeatPump
43584
43914
  ],
43585
43915
  apply: "add",
43586
43916
  vocabularyCap: "consumables",
@@ -43684,7 +44014,7 @@ var CAP_CUSTOMIZE_CATALOG = {
43684
44014
  targets: [{
43685
44015
  id: "pressed",
43686
44016
  cardinality: "event",
43687
- deviceTypes: [require_device_type.DeviceType.Camera],
44017
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
43688
44018
  apply: "add",
43689
44019
  vocabularyCap: "doorbell",
43690
44020
  vocabularyEvent: "onPressed",
@@ -43716,7 +44046,7 @@ var CAP_CUSTOMIZE_CATALOG = {
43716
44046
  targets: [{
43717
44047
  id: "presets",
43718
44048
  cardinality: "config",
43719
- deviceTypes: [require_device_type.DeviceType.Fan],
44049
+ deviceTypes: [require_composed_stable_id.DeviceType.Fan],
43720
44050
  apply: "add",
43721
44051
  readMethod: "getPresets",
43722
44052
  writeMethod: "setPresets",
@@ -43731,7 +44061,7 @@ var CAP_CUSTOMIZE_CATALOG = {
43731
44061
  targets: [{
43732
44062
  id: "door-contact",
43733
44063
  cardinality: "scalar",
43734
- deviceTypes: [require_device_type.DeviceType.Lock],
44064
+ deviceTypes: [require_composed_stable_id.DeviceType.Lock],
43735
44065
  apply: "replace",
43736
44066
  vocabularyCap: "lock-control",
43737
44067
  vocabularyStateField: "state",
@@ -43768,7 +44098,7 @@ var CAP_CUSTOMIZE_CATALOG = {
43768
44098
  targets: [{
43769
44099
  id: "detected",
43770
44100
  cardinality: "event",
43771
- deviceTypes: [require_device_type.DeviceType.Camera],
44101
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
43772
44102
  apply: "add",
43773
44103
  vocabularyCap: "motion",
43774
44104
  vocabularyEvent: "onMotionChanged",
@@ -43807,21 +44137,21 @@ var CAP_CUSTOMIZE_CATALOG = {
43807
44137
  id: "power",
43808
44138
  cardinality: "scalar",
43809
44139
  deviceTypes: [
43810
- require_device_type.DeviceType.Switch,
43811
- require_device_type.DeviceType.Light,
43812
- require_device_type.DeviceType.Fan,
43813
- require_device_type.DeviceType.Climate,
43814
- require_device_type.DeviceType.Thermostat,
43815
- require_device_type.DeviceType.Humidifier,
43816
- require_device_type.DeviceType.WaterHeater,
43817
- require_device_type.DeviceType.MediaPlayer,
43818
- require_device_type.DeviceType.Washer,
43819
- require_device_type.DeviceType.Dryer,
43820
- require_device_type.DeviceType.Dishwasher,
43821
- require_device_type.DeviceType.Vacuum,
43822
- require_device_type.DeviceType.LawnMower,
43823
- require_device_type.DeviceType.PetFeeder,
43824
- require_device_type.DeviceType.Heater
44140
+ require_composed_stable_id.DeviceType.Switch,
44141
+ require_composed_stable_id.DeviceType.Light,
44142
+ require_composed_stable_id.DeviceType.Fan,
44143
+ require_composed_stable_id.DeviceType.Climate,
44144
+ require_composed_stable_id.DeviceType.Thermostat,
44145
+ require_composed_stable_id.DeviceType.Humidifier,
44146
+ require_composed_stable_id.DeviceType.WaterHeater,
44147
+ require_composed_stable_id.DeviceType.MediaPlayer,
44148
+ require_composed_stable_id.DeviceType.Washer,
44149
+ require_composed_stable_id.DeviceType.Dryer,
44150
+ require_composed_stable_id.DeviceType.Dishwasher,
44151
+ require_composed_stable_id.DeviceType.Vacuum,
44152
+ require_composed_stable_id.DeviceType.LawnMower,
44153
+ require_composed_stable_id.DeviceType.PetFeeder,
44154
+ require_composed_stable_id.DeviceType.Heater
43825
44155
  ],
43826
44156
  apply: "add",
43827
44157
  vocabularyCap: "power-meter",
@@ -43847,21 +44177,21 @@ var CAP_CUSTOMIZE_CATALOG = {
43847
44177
  id: "energy",
43848
44178
  cardinality: "scalar",
43849
44179
  deviceTypes: [
43850
- require_device_type.DeviceType.Switch,
43851
- require_device_type.DeviceType.Light,
43852
- require_device_type.DeviceType.Fan,
43853
- require_device_type.DeviceType.Climate,
43854
- require_device_type.DeviceType.Thermostat,
43855
- require_device_type.DeviceType.Humidifier,
43856
- require_device_type.DeviceType.WaterHeater,
43857
- require_device_type.DeviceType.MediaPlayer,
43858
- require_device_type.DeviceType.Washer,
43859
- require_device_type.DeviceType.Dryer,
43860
- require_device_type.DeviceType.Dishwasher,
43861
- require_device_type.DeviceType.Vacuum,
43862
- require_device_type.DeviceType.LawnMower,
43863
- require_device_type.DeviceType.PetFeeder,
43864
- require_device_type.DeviceType.Heater
44180
+ require_composed_stable_id.DeviceType.Switch,
44181
+ require_composed_stable_id.DeviceType.Light,
44182
+ require_composed_stable_id.DeviceType.Fan,
44183
+ require_composed_stable_id.DeviceType.Climate,
44184
+ require_composed_stable_id.DeviceType.Thermostat,
44185
+ require_composed_stable_id.DeviceType.Humidifier,
44186
+ require_composed_stable_id.DeviceType.WaterHeater,
44187
+ require_composed_stable_id.DeviceType.MediaPlayer,
44188
+ require_composed_stable_id.DeviceType.Washer,
44189
+ require_composed_stable_id.DeviceType.Dryer,
44190
+ require_composed_stable_id.DeviceType.Dishwasher,
44191
+ require_composed_stable_id.DeviceType.Vacuum,
44192
+ require_composed_stable_id.DeviceType.LawnMower,
44193
+ require_composed_stable_id.DeviceType.PetFeeder,
44194
+ require_composed_stable_id.DeviceType.Heater
43865
44195
  ],
43866
44196
  apply: "add",
43867
44197
  vocabularyCap: "power-meter",
@@ -43887,21 +44217,21 @@ var CAP_CUSTOMIZE_CATALOG = {
43887
44217
  id: "voltage",
43888
44218
  cardinality: "scalar",
43889
44219
  deviceTypes: [
43890
- require_device_type.DeviceType.Switch,
43891
- require_device_type.DeviceType.Light,
43892
- require_device_type.DeviceType.Fan,
43893
- require_device_type.DeviceType.Climate,
43894
- require_device_type.DeviceType.Thermostat,
43895
- require_device_type.DeviceType.Humidifier,
43896
- require_device_type.DeviceType.WaterHeater,
43897
- require_device_type.DeviceType.MediaPlayer,
43898
- require_device_type.DeviceType.Washer,
43899
- require_device_type.DeviceType.Dryer,
43900
- require_device_type.DeviceType.Dishwasher,
43901
- require_device_type.DeviceType.Vacuum,
43902
- require_device_type.DeviceType.LawnMower,
43903
- require_device_type.DeviceType.PetFeeder,
43904
- require_device_type.DeviceType.Heater
44220
+ require_composed_stable_id.DeviceType.Switch,
44221
+ require_composed_stable_id.DeviceType.Light,
44222
+ require_composed_stable_id.DeviceType.Fan,
44223
+ require_composed_stable_id.DeviceType.Climate,
44224
+ require_composed_stable_id.DeviceType.Thermostat,
44225
+ require_composed_stable_id.DeviceType.Humidifier,
44226
+ require_composed_stable_id.DeviceType.WaterHeater,
44227
+ require_composed_stable_id.DeviceType.MediaPlayer,
44228
+ require_composed_stable_id.DeviceType.Washer,
44229
+ require_composed_stable_id.DeviceType.Dryer,
44230
+ require_composed_stable_id.DeviceType.Dishwasher,
44231
+ require_composed_stable_id.DeviceType.Vacuum,
44232
+ require_composed_stable_id.DeviceType.LawnMower,
44233
+ require_composed_stable_id.DeviceType.PetFeeder,
44234
+ require_composed_stable_id.DeviceType.Heater
43905
44235
  ],
43906
44236
  apply: "add",
43907
44237
  vocabularyCap: "power-meter",
@@ -43927,21 +44257,21 @@ var CAP_CUSTOMIZE_CATALOG = {
43927
44257
  id: "current",
43928
44258
  cardinality: "scalar",
43929
44259
  deviceTypes: [
43930
- require_device_type.DeviceType.Switch,
43931
- require_device_type.DeviceType.Light,
43932
- require_device_type.DeviceType.Fan,
43933
- require_device_type.DeviceType.Climate,
43934
- require_device_type.DeviceType.Thermostat,
43935
- require_device_type.DeviceType.Humidifier,
43936
- require_device_type.DeviceType.WaterHeater,
43937
- require_device_type.DeviceType.MediaPlayer,
43938
- require_device_type.DeviceType.Washer,
43939
- require_device_type.DeviceType.Dryer,
43940
- require_device_type.DeviceType.Dishwasher,
43941
- require_device_type.DeviceType.Vacuum,
43942
- require_device_type.DeviceType.LawnMower,
43943
- require_device_type.DeviceType.PetFeeder,
43944
- require_device_type.DeviceType.Heater
44260
+ require_composed_stable_id.DeviceType.Switch,
44261
+ require_composed_stable_id.DeviceType.Light,
44262
+ require_composed_stable_id.DeviceType.Fan,
44263
+ require_composed_stable_id.DeviceType.Climate,
44264
+ require_composed_stable_id.DeviceType.Thermostat,
44265
+ require_composed_stable_id.DeviceType.Humidifier,
44266
+ require_composed_stable_id.DeviceType.WaterHeater,
44267
+ require_composed_stable_id.DeviceType.MediaPlayer,
44268
+ require_composed_stable_id.DeviceType.Washer,
44269
+ require_composed_stable_id.DeviceType.Dryer,
44270
+ require_composed_stable_id.DeviceType.Dishwasher,
44271
+ require_composed_stable_id.DeviceType.Vacuum,
44272
+ require_composed_stable_id.DeviceType.LawnMower,
44273
+ require_composed_stable_id.DeviceType.PetFeeder,
44274
+ require_composed_stable_id.DeviceType.Heater
43945
44275
  ],
43946
44276
  apply: "add",
43947
44277
  vocabularyCap: "power-meter",
@@ -43971,21 +44301,21 @@ var CAP_CUSTOMIZE_CATALOG = {
43971
44301
  id: "switch",
43972
44302
  cardinality: "scalar",
43973
44303
  deviceTypes: [
43974
- require_device_type.DeviceType.Gateway,
43975
- require_device_type.DeviceType.Hub,
43976
- require_device_type.DeviceType.Camera,
43977
- require_device_type.DeviceType.Sensor,
43978
- require_device_type.DeviceType.MediaPlayer,
43979
- require_device_type.DeviceType.Vacuum,
43980
- require_device_type.DeviceType.Generic,
43981
- require_device_type.DeviceType.Washer,
43982
- require_device_type.DeviceType.Dryer,
43983
- require_device_type.DeviceType.Dishwasher,
43984
- require_device_type.DeviceType.PetFountain,
43985
- require_device_type.DeviceType.Fan,
43986
- require_device_type.DeviceType.Humidifier,
43987
- require_device_type.DeviceType.Climate,
43988
- require_device_type.DeviceType.WaterHeater
44304
+ require_composed_stable_id.DeviceType.Gateway,
44305
+ require_composed_stable_id.DeviceType.Hub,
44306
+ require_composed_stable_id.DeviceType.Camera,
44307
+ require_composed_stable_id.DeviceType.Sensor,
44308
+ require_composed_stable_id.DeviceType.MediaPlayer,
44309
+ require_composed_stable_id.DeviceType.Vacuum,
44310
+ require_composed_stable_id.DeviceType.Generic,
44311
+ require_composed_stable_id.DeviceType.Washer,
44312
+ require_composed_stable_id.DeviceType.Dryer,
44313
+ require_composed_stable_id.DeviceType.Dishwasher,
44314
+ require_composed_stable_id.DeviceType.PetFountain,
44315
+ require_composed_stable_id.DeviceType.Fan,
44316
+ require_composed_stable_id.DeviceType.Humidifier,
44317
+ require_composed_stable_id.DeviceType.Climate,
44318
+ require_composed_stable_id.DeviceType.WaterHeater
43989
44319
  ],
43990
44320
  apply: "add",
43991
44321
  vocabularyCap: "power-source",
@@ -44018,7 +44348,7 @@ var CAP_CUSTOMIZE_CATALOG = {
44018
44348
  targets: [{
44019
44349
  id: "remote",
44020
44350
  cardinality: "config",
44021
- deviceTypes: [require_device_type.DeviceType.MediaPlayer],
44351
+ deviceTypes: [require_composed_stable_id.DeviceType.MediaPlayer],
44022
44352
  apply: "add",
44023
44353
  readMethod: "getConfig",
44024
44354
  writeMethod: "setConfig",
@@ -44034,19 +44364,19 @@ var CAP_CUSTOMIZE_CATALOG = {
44034
44364
  id: "running",
44035
44365
  cardinality: "scalar",
44036
44366
  deviceTypes: [
44037
- require_device_type.DeviceType.Washer,
44038
- require_device_type.DeviceType.Dryer,
44039
- require_device_type.DeviceType.Dishwasher,
44040
- require_device_type.DeviceType.Vacuum,
44041
- require_device_type.DeviceType.LawnMower,
44042
- require_device_type.DeviceType.MediaPlayer,
44043
- require_device_type.DeviceType.WaterHeater,
44044
- require_device_type.DeviceType.Humidifier,
44045
- require_device_type.DeviceType.Fan,
44046
- require_device_type.DeviceType.Climate,
44047
- require_device_type.DeviceType.Thermostat,
44048
- require_device_type.DeviceType.PetFeeder,
44049
- require_device_type.DeviceType.Heater
44367
+ require_composed_stable_id.DeviceType.Washer,
44368
+ require_composed_stable_id.DeviceType.Dryer,
44369
+ require_composed_stable_id.DeviceType.Dishwasher,
44370
+ require_composed_stable_id.DeviceType.Vacuum,
44371
+ require_composed_stable_id.DeviceType.LawnMower,
44372
+ require_composed_stable_id.DeviceType.MediaPlayer,
44373
+ require_composed_stable_id.DeviceType.WaterHeater,
44374
+ require_composed_stable_id.DeviceType.Humidifier,
44375
+ require_composed_stable_id.DeviceType.Fan,
44376
+ require_composed_stable_id.DeviceType.Climate,
44377
+ require_composed_stable_id.DeviceType.Thermostat,
44378
+ require_composed_stable_id.DeviceType.PetFeeder,
44379
+ require_composed_stable_id.DeviceType.Heater
44050
44380
  ],
44051
44381
  apply: "add",
44052
44382
  vocabularyCap: "running-state",
@@ -44073,7 +44403,7 @@ var CAP_CUSTOMIZE_CATALOG = {
44073
44403
  defaultThreshold: 5,
44074
44404
  defaultStartDwellMs: 3e4,
44075
44405
  defaultStopDwellMs: 18e4,
44076
- deviceTypeDefaults: { [require_device_type.DeviceType.MediaPlayer]: {
44406
+ deviceTypeDefaults: { [require_composed_stable_id.DeviceType.MediaPlayer]: {
44077
44407
  startDwellMs: 1e4,
44078
44408
  stopDwellMs: 1e4,
44079
44409
  minSamples: 1
@@ -44762,9 +45092,9 @@ function numeric(input) {
44762
45092
  return {
44763
45093
  ...base,
44764
45094
  family: "numeric",
44765
- deviceType: require_device_type.DeviceType.Sensor,
44766
- memberDeviceType: require_device_type.DeviceType.Sensor,
44767
- memberDeviceTypes: [require_device_type.DeviceType.Sensor, ...alsoFrom?.deviceTypes ?? []],
45095
+ deviceType: require_composed_stable_id.DeviceType.Sensor,
45096
+ memberDeviceType: require_composed_stable_id.DeviceType.Sensor,
45097
+ memberDeviceTypes: [require_composed_stable_id.DeviceType.Sensor, ...alsoFrom?.deviceTypes ?? []],
44768
45098
  activeWhen: void 0,
44769
45099
  commandCaps: [],
44770
45100
  baseUnit: require_sleep.baseUnitOf(input.quantity),
@@ -44775,14 +45105,14 @@ function numeric(input) {
44775
45105
  }, ...alsoFrom === void 0 ? [] : [alsoFrom.accept]]
44776
45106
  };
44777
45107
  }
44778
- var CLIMATE_DEVICES = [require_device_type.DeviceType.Thermostat, require_device_type.DeviceType.Climate];
45108
+ var CLIMATE_DEVICES = [require_composed_stable_id.DeviceType.Thermostat, require_composed_stable_id.DeviceType.Climate];
44779
45109
  function binary(input) {
44780
45110
  return {
44781
45111
  ...input,
44782
45112
  family: "binary",
44783
- deviceType: require_device_type.DeviceType.Sensor,
44784
- memberDeviceType: require_device_type.DeviceType.Sensor,
44785
- memberDeviceTypes: [require_device_type.DeviceType.Sensor],
45113
+ deviceType: require_composed_stable_id.DeviceType.Sensor,
45114
+ memberDeviceType: require_composed_stable_id.DeviceType.Sensor,
45115
+ memberDeviceTypes: [require_composed_stable_id.DeviceType.Sensor],
44786
45116
  activeWhen: void 0,
44787
45117
  commandCaps: [],
44788
45118
  quantity: "none",
@@ -44795,7 +45125,7 @@ var GROUP_TEMPLATES = [
44795
45125
  numeric({
44796
45126
  id: "temperature",
44797
45127
  summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
44798
- role: require_device_type.DeviceRole.TemperatureSensor,
45128
+ role: require_composed_stable_id.DeviceRole.TemperatureSensor,
44799
45129
  outputCap: "temperature-sensor",
44800
45130
  outputField: "temperature",
44801
45131
  quantity: "temperature",
@@ -44813,7 +45143,7 @@ var GROUP_TEMPLATES = [
44813
45143
  numeric({
44814
45144
  id: "humidity",
44815
45145
  summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
44816
- role: require_device_type.DeviceRole.HumiditySensor,
45146
+ role: require_composed_stable_id.DeviceRole.HumiditySensor,
44817
45147
  outputCap: "humidity-sensor",
44818
45148
  outputField: "humidity",
44819
45149
  quantity: "humidity",
@@ -44831,7 +45161,7 @@ var GROUP_TEMPLATES = [
44831
45161
  numeric({
44832
45162
  id: "pressure",
44833
45163
  summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
44834
- role: require_device_type.DeviceRole.PressureSensor,
45164
+ role: require_composed_stable_id.DeviceRole.PressureSensor,
44835
45165
  outputCap: "pressure-sensor",
44836
45166
  outputField: "pressure",
44837
45167
  quantity: "pressure",
@@ -44842,7 +45172,7 @@ var GROUP_TEMPLATES = [
44842
45172
  numeric({
44843
45173
  id: "illuminance",
44844
45174
  summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
44845
- role: require_device_type.DeviceRole.AmbientLightSensor,
45175
+ role: require_composed_stable_id.DeviceRole.AmbientLightSensor,
44846
45176
  outputCap: "ambient-light-sensor",
44847
45177
  outputField: "illuminance",
44848
45178
  quantity: "illuminance",
@@ -44853,7 +45183,7 @@ var GROUP_TEMPLATES = [
44853
45183
  numeric({
44854
45184
  id: "power",
44855
45185
  summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
44856
- role: require_device_type.DeviceRole.PowerSensor,
45186
+ role: require_composed_stable_id.DeviceRole.PowerSensor,
44857
45187
  outputCap: "power-meter",
44858
45188
  outputField: "power",
44859
45189
  quantity: "power",
@@ -44864,7 +45194,7 @@ var GROUP_TEMPLATES = [
44864
45194
  numeric({
44865
45195
  id: "energy",
44866
45196
  summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
44867
- role: require_device_type.DeviceRole.EnergySensor,
45197
+ role: require_composed_stable_id.DeviceRole.EnergySensor,
44868
45198
  outputCap: "power-meter",
44869
45199
  outputField: "energy",
44870
45200
  quantity: "energy",
@@ -44875,7 +45205,7 @@ var GROUP_TEMPLATES = [
44875
45205
  numeric({
44876
45206
  id: "battery",
44877
45207
  summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
44878
- role: require_device_type.DeviceRole.BatterySensor,
45208
+ role: require_composed_stable_id.DeviceRole.BatterySensor,
44879
45209
  outputCap: "battery",
44880
45210
  outputField: "level",
44881
45211
  quantity: "percentage",
@@ -44899,7 +45229,7 @@ var GROUP_TEMPLATES = [
44899
45229
  numeric({
44900
45230
  id: "numeric",
44901
45231
  summary: "A numeric reading in the members’ shared quantity. Mixed quantities are refused. Nobody reporting publishes null, not 0.",
44902
- role: require_device_type.DeviceRole.NumericSensor,
45232
+ role: require_composed_stable_id.DeviceRole.NumericSensor,
44903
45233
  outputCap: "numeric-sensor",
44904
45234
  outputField: "value",
44905
45235
  quantity: "device",
@@ -44910,7 +45240,7 @@ var GROUP_TEMPLATES = [
44910
45240
  binary({
44911
45241
  id: "motion",
44912
45242
  summary: "Any or all motion. Offline and unknown members are left out, never read as off. Nobody reporting takes the device offline.",
44913
- role: require_device_type.DeviceRole.MotionSensor,
45243
+ role: require_composed_stable_id.DeviceRole.MotionSensor,
44914
45244
  outputCap: "motion",
44915
45245
  outputField: "detected",
44916
45246
  defaultAggregate: "any",
@@ -44929,7 +45259,7 @@ var GROUP_TEMPLATES = [
44929
45259
  binary({
44930
45260
  id: "contact",
44931
45261
  summary: "Any or all open contacts. Offline and unknown members are left out, never read as closed.",
44932
- role: require_device_type.DeviceRole.ContactSensor,
45262
+ role: require_composed_stable_id.DeviceRole.ContactSensor,
44933
45263
  outputCap: "contact",
44934
45264
  outputField: "entryOpen",
44935
45265
  defaultAggregate: "any",
@@ -44942,7 +45272,7 @@ var GROUP_TEMPLATES = [
44942
45272
  binary({
44943
45273
  id: "leak",
44944
45274
  summary: "Any or all leak detections. Offline and unknown members are left out, never read as dry.",
44945
- role: require_device_type.DeviceRole.LeakSensor,
45275
+ role: require_composed_stable_id.DeviceRole.LeakSensor,
44946
45276
  outputCap: "flood",
44947
45277
  outputField: "flooded",
44948
45278
  defaultAggregate: "any",
@@ -44955,7 +45285,7 @@ var GROUP_TEMPLATES = [
44955
45285
  binary({
44956
45286
  id: "smoke",
44957
45287
  summary: "Any or all smoke detections. Offline and unknown members are left out, never read as clear.",
44958
- role: require_device_type.DeviceRole.SmokeSensor,
45288
+ role: require_composed_stable_id.DeviceRole.SmokeSensor,
44959
45289
  outputCap: "smoke",
44960
45290
  outputField: "detected",
44961
45291
  defaultAggregate: "any",
@@ -44968,7 +45298,7 @@ var GROUP_TEMPLATES = [
44968
45298
  binary({
44969
45299
  id: "occupancy",
44970
45300
  summary: "Any or all of motion or binary sensors, published as a binary. Presence zones are not aggregated. Nobody reporting is offline, not off.",
44971
- role: require_device_type.DeviceRole.BinarySensor,
45301
+ role: require_composed_stable_id.DeviceRole.BinarySensor,
44972
45302
  outputCap: "binary",
44973
45303
  outputField: "on",
44974
45304
  defaultAggregate: "any",
@@ -44984,7 +45314,7 @@ var GROUP_TEMPLATES = [
44984
45314
  binary({
44985
45315
  id: "binary",
44986
45316
  summary: "Any or all generic binary sensors. Offline and unknown members are left out, never read as off.",
44987
- role: require_device_type.DeviceRole.BinarySensor,
45317
+ role: require_composed_stable_id.DeviceRole.BinarySensor,
44988
45318
  outputCap: "binary",
44989
45319
  outputField: "on",
44990
45320
  defaultAggregate: "any",
@@ -44997,7 +45327,7 @@ var GROUP_TEMPLATES = [
44997
45327
  actuator({
44998
45328
  id: "switch",
44999
45329
  summary: "On when at least one switch is on, or when all of them are. Offline and unknown members are left out of that decision, never read as off, and still receive the command.",
45000
- deviceType: require_device_type.DeviceType.Switch,
45330
+ deviceType: require_composed_stable_id.DeviceType.Switch,
45001
45331
  outputCap: "switch",
45002
45332
  outputField: "on",
45003
45333
  member: {
@@ -45009,7 +45339,7 @@ var GROUP_TEMPLATES = [
45009
45339
  actuator({
45010
45340
  id: "light",
45011
45341
  summary: "On when at least one light is on, or when all of them are. Brightness and colour are offered only when every member has them. A command is not sent to a member that lacks it.",
45012
- deviceType: require_device_type.DeviceType.Light,
45342
+ deviceType: require_composed_stable_id.DeviceType.Light,
45013
45343
  outputCap: "switch",
45014
45344
  outputField: "on",
45015
45345
  member: {
@@ -45025,7 +45355,7 @@ var GROUP_TEMPLATES = [
45025
45355
  actuator({
45026
45356
  id: "fan",
45027
45357
  summary: "On when at least one fan is on, or when all of them are. Speed, preset, direction and oscillation are offered only when every fan has them. A command is not sent to a fan that lacks it.",
45028
- deviceType: require_device_type.DeviceType.Fan,
45358
+ deviceType: require_composed_stable_id.DeviceType.Fan,
45029
45359
  outputCap: "switch",
45030
45360
  outputField: "on",
45031
45361
  member: {
@@ -45037,7 +45367,7 @@ var GROUP_TEMPLATES = [
45037
45367
  actuator({
45038
45368
  id: "cover",
45039
45369
  summary: "Open when at least one cover is open or part-open, or only when all of them are. Position and tilt are offered only when every cover has them. A cover that reports nothing is left out, never read as closed.",
45040
- deviceType: require_device_type.DeviceType.Cover,
45370
+ deviceType: require_composed_stable_id.DeviceType.Cover,
45041
45371
  outputCap: "group-active",
45042
45372
  outputField: "active",
45043
45373
  member: {
@@ -45054,7 +45384,7 @@ var GROUP_TEMPLATES = [
45054
45384
  actuator({
45055
45385
  id: "valve",
45056
45386
  summary: "Open when at least one valve is open or part-open, or only when all of them are. Position is offered only when every valve has it. A valve that reports nothing is left out, never read as closed.",
45057
- deviceType: require_device_type.DeviceType.Valve,
45387
+ deviceType: require_composed_stable_id.DeviceType.Valve,
45058
45388
  outputCap: "group-active",
45059
45389
  outputField: "active",
45060
45390
  member: {
@@ -45071,7 +45401,7 @@ var GROUP_TEMPLATES = [
45071
45401
  actuator({
45072
45402
  id: "lock",
45073
45403
  summary: "Locked when at least one lock is locked, or only when all of them are. A jammed or moving lock is not locked. Locking is one tap; unlocking the group needs a confirmation every time, and nothing is sent without it.",
45074
- deviceType: require_device_type.DeviceType.Lock,
45404
+ deviceType: require_composed_stable_id.DeviceType.Lock,
45075
45405
  outputCap: "group-active",
45076
45406
  outputField: "active",
45077
45407
  member: {
@@ -45084,7 +45414,7 @@ var GROUP_TEMPLATES = [
45084
45414
  actuator({
45085
45415
  id: "media-player",
45086
45416
  summary: "Playing when at least one player is playing, or only when all of them are. Volume is offered only when every player has it. A player that reports nothing is left out, never read as stopped.",
45087
- deviceType: require_device_type.DeviceType.MediaPlayer,
45417
+ deviceType: require_composed_stable_id.DeviceType.MediaPlayer,
45088
45418
  outputCap: "group-active",
45089
45419
  outputField: "active",
45090
45420
  member: {
@@ -45097,8 +45427,8 @@ var GROUP_TEMPLATES = [
45097
45427
  actuator({
45098
45428
  id: "climate",
45099
45429
  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.",
45100
- deviceType: require_device_type.DeviceType.Thermostat,
45101
- memberDeviceTypes: [require_device_type.DeviceType.Thermostat, require_device_type.DeviceType.Climate],
45430
+ deviceType: require_composed_stable_id.DeviceType.Thermostat,
45431
+ memberDeviceTypes: [require_composed_stable_id.DeviceType.Thermostat, require_composed_stable_id.DeviceType.Climate],
45102
45432
  outputCap: "group-active",
45103
45433
  outputField: "active",
45104
45434
  member: {
@@ -45157,9 +45487,9 @@ var LIGHT_SHARED_CAPS = [
45157
45487
  "color"
45158
45488
  ];
45159
45489
  var COLOR_MODE_FEATURES = [
45160
- require_device_type.DeviceFeature.LightColorRgb,
45161
- require_device_type.DeviceFeature.LightColorHsv,
45162
- require_device_type.DeviceFeature.LightColorMired
45490
+ require_composed_stable_id.DeviceFeature.LightColorRgb,
45491
+ require_composed_stable_id.DeviceFeature.LightColorHsv,
45492
+ require_composed_stable_id.DeviceFeature.LightColorMired
45163
45493
  ];
45164
45494
  /** How many member calls run at once. The rest wait; none are dropped. */
45165
45495
  var FAN_OUT_CONCURRENCY = 4;
@@ -45490,7 +45820,7 @@ var HISTORY_CATALOG = {
45490
45820
  } },
45491
45821
  "motion": { "detected": {
45492
45822
  kind: "boolean",
45493
- excludeDeviceTypes: [require_device_type.DeviceType.Camera]
45823
+ excludeDeviceTypes: [require_composed_stable_id.DeviceType.Camera]
45494
45824
  } },
45495
45825
  "network-link": {
45496
45826
  "signal": {
@@ -45812,7 +46142,7 @@ function draft(input) {
45812
46142
  return {
45813
46143
  target: {
45814
46144
  kind: "new",
45815
- type: require_device_type.DeviceType.Sensor,
46145
+ type: require_composed_stable_id.DeviceType.Sensor,
45816
46146
  role: input.role
45817
46147
  },
45818
46148
  helper: input.spec,
@@ -45840,7 +46170,7 @@ function statisticDraft(spec, retention = require_composition.DEFAULT_HISTORY_RE
45840
46170
  return {
45841
46171
  problems,
45842
46172
  draft: draft({
45843
- role: require_device_type.DeviceRole.NumericSensor,
46173
+ role: require_composed_stable_id.DeviceRole.NumericSensor,
45844
46174
  cap: "numeric-sensor",
45845
46175
  field: "value",
45846
46176
  empty: "null",
@@ -45863,7 +46193,7 @@ function derivativeDraft(spec, retention = require_composition.DEFAULT_HISTORY_R
45863
46193
  return {
45864
46194
  problems,
45865
46195
  draft: draft({
45866
- role: require_device_type.DeviceRole.NumericSensor,
46196
+ role: require_composed_stable_id.DeviceRole.NumericSensor,
45867
46197
  cap: "numeric-sensor",
45868
46198
  field: "value",
45869
46199
  empty: "null",
@@ -45885,7 +46215,7 @@ function integralDraft(spec, retention = require_composition.DEFAULT_HISTORY_RET
45885
46215
  return {
45886
46216
  problems,
45887
46217
  draft: draft({
45888
- role: energy ? require_device_type.DeviceRole.EnergySensor : require_device_type.DeviceRole.NumericSensor,
46218
+ role: energy ? require_composed_stable_id.DeviceRole.EnergySensor : require_composed_stable_id.DeviceRole.NumericSensor,
45889
46219
  cap: energy ? "power-meter" : "meter",
45890
46220
  field: energy ? "energy" : "value",
45891
46221
  empty: "offline",
@@ -46041,8 +46371,8 @@ function numericSensor(helper, value, extra = []) {
46041
46371
  return {
46042
46372
  target: {
46043
46373
  kind: "new",
46044
- type: require_device_type.DeviceType.Sensor,
46045
- role: require_device_type.DeviceRole.NumericSensor
46374
+ type: require_composed_stable_id.DeviceType.Sensor,
46375
+ role: require_composed_stable_id.DeviceRole.NumericSensor
46046
46376
  },
46047
46377
  helper,
46048
46378
  features: [{
@@ -46059,8 +46389,8 @@ function binarySensor(helper, on) {
46059
46389
  return {
46060
46390
  target: {
46061
46391
  kind: "new",
46062
- type: require_device_type.DeviceType.Sensor,
46063
- role: require_device_type.DeviceRole.BinarySensor
46392
+ type: require_composed_stable_id.DeviceType.Sensor,
46393
+ role: require_composed_stable_id.DeviceRole.BinarySensor
46064
46394
  },
46065
46395
  helper,
46066
46396
  features: [{
@@ -46570,7 +46900,7 @@ function buildCapabilityLookup(defs) {
46570
46900
  var BASE_DEVICE_CAPS = new Set(["device-status", "feature-probe"]);
46571
46901
  var PENDING_SELF = {
46572
46902
  addonId: require_composition.COMPOSER_ADDON_ID,
46573
- stableId: `${require_composition.COMPOSED_DEVICE_STABLE_ID_PREFIX}(unsaved)`
46903
+ stableId: `${require_composed_stable_id.COMPOSED_DEVICE_STABLE_ID_PREFIX}(unsaved)`
46574
46904
  };
46575
46905
  /** The candidate's block id before its first save. Stored block ids are `randomUUID()`, so none can carry it. */
46576
46906
  var PENDING_BLOCK_ID = "(unsaved)";
@@ -47693,7 +48023,7 @@ var coreBlocksCapability = {
47693
48023
  * from the validator's own blockers; a replace of a BOUND cap is not
47694
48024
  * listed here (the device's bindings say what it has).
47695
48025
  */
47696
- listComposableCaps: require_sleep.method(zod.z.object({ deviceType: zod.z.enum(require_device_type.DeviceType) }), ComposableCapabilitiesSchema, { auth: "admin" }),
48026
+ listComposableCaps: require_sleep.method(zod.z.object({ deviceType: zod.z.enum(require_composed_stable_id.DeviceType) }), ComposableCapabilitiesSchema, { auth: "admin" }),
47697
48027
  /**
47698
48028
  * Validate without saving — the same verdict the save reaches. A mutation
47699
48029
  * for its body size; it writes nothing, so its access is `view`.
@@ -47716,7 +48046,7 @@ var coreBlocksCapability = {
47716
48046
  deviceId: zod.z.number().int(),
47717
48047
  cap: zod.z.string().min(1),
47718
48048
  fieldPath: zod.z.string().min(1),
47719
- deviceType: zod.z.enum(require_device_type.DeviceType).optional()
48049
+ deviceType: zod.z.enum(require_composed_stable_id.DeviceType).optional()
47720
48050
  }), RunningThresholdProposalSchema, {
47721
48051
  auth: "admin",
47722
48052
  access: "view"
@@ -47792,7 +48122,7 @@ var coverCapability = {
47792
48122
  scope: "device",
47793
48123
  deviceNative: true,
47794
48124
  mode: "singleton",
47795
- deviceTypes: [require_device_type.DeviceType.Cover],
48125
+ deviceTypes: [require_composed_stable_id.DeviceType.Cover],
47796
48126
  methods: {
47797
48127
  open: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
47798
48128
  kind: "mutation",
@@ -48283,7 +48613,7 @@ var dayNightCapability = {
48283
48613
  scope: "device",
48284
48614
  deviceNative: true,
48285
48615
  mode: "singleton",
48286
- deviceTypes: [require_device_type.DeviceType.Camera],
48616
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
48287
48617
  deviceConfig: { ui: {
48288
48618
  kind: "derived-form",
48289
48619
  builderId: "day-night",
@@ -48441,7 +48771,7 @@ var detectionPipelineCapability = {
48441
48771
  mode: "singleton",
48442
48772
  kind: "wrapper",
48443
48773
  defaultActive: true,
48444
- deviceTypes: [require_device_type.DeviceType.Camera],
48774
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
48445
48775
  exposesDeviceSettings: true,
48446
48776
  methods: {}
48447
48777
  };
@@ -48597,7 +48927,7 @@ var DiscoveredChildDeviceSchema = zod.z.lazy(() => zod.z.object({
48597
48927
  /** Friendly name as reported by the source (Reolink camera name, ONVIF profile, ...). */
48598
48928
  name: zod.z.string(),
48599
48929
  /** DeviceType the child should be created with on adopt. */
48600
- type: zod.z.enum(require_device_type.DeviceType),
48930
+ type: zod.z.enum(require_composed_stable_id.DeviceType),
48601
48931
  status: DiscoveredChildStatusSchema,
48602
48932
  /** Free-form integration-specific metadata surfaced in the panel. */
48603
48933
  metadata: zod.z.object({
@@ -48655,7 +48985,7 @@ var deviceDiscoveryCapability = {
48655
48985
  scope: "device",
48656
48986
  deviceNative: true,
48657
48987
  mode: "singleton",
48658
- deviceTypes: [require_device_type.DeviceType.Hub],
48988
+ deviceTypes: [require_composed_stable_id.DeviceType.Hub],
48659
48989
  status: {
48660
48990
  schema: DeviceDiscoveryStatusSchema,
48661
48991
  kind: "poll"
@@ -49331,6 +49661,169 @@ function checkDeviceAlias(alias, isTaken) {
49331
49661
  };
49332
49662
  }
49333
49663
  //#endregion
49664
+ //#region src/expression/device-template.ts
49665
+ /**
49666
+ * Device value templates, the parts that need no template engine (D1021).
49667
+ *
49668
+ * A template is plain text with Jinja-style `{{ … }}` / `{% … %}` blocks:
49669
+ * `{{ stufa_veranda.temperature | unit('°F') | round(1) }}`. Devices are named
49670
+ * by their alias (`device-alias.ts`); a field is `alias.field` when the field
49671
+ * name is unique across the device's capabilities, else `alias.<cap>.field`,
49672
+ * and an ambiguous `alias.field` is refused by name.
49673
+ *
49674
+ * The engine itself (nunjucks) lives ONLY in the hub's renderer
49675
+ * (`packages/system/src/builtins/device-manager/device-template/`, guard
49676
+ * `check-device-template-grammar`): it does not sandbox, so it renders only in
49677
+ * a worker thread under a wall-time budget, over frozen plain data. This file
49678
+ * is the shared vocabulary — limits, refusal reasons, the trace, and how a
49679
+ * `(alias, path)` reference resolves against a device's slices.
49680
+ */
49681
+ var DEVICE_TEMPLATE_MAX_LENGTH = 4096;
49682
+ /** Wall time a render may take, host-measured; the worker is terminated past it. */
49683
+ var DEVICE_TEMPLATE_BUDGET_MS = 50;
49684
+ var DEVICE_TEMPLATE_MAX_OUTPUT = 4096;
49685
+ /** What an unknown or unavailable value renders as. */
49686
+ var DEVICE_TEMPLATE_UNAVAILABLE = "—";
49687
+ var DeviceTemplateSchema = zod.z.string().min(1).max(DEVICE_TEMPLATE_MAX_LENGTH);
49688
+ /** The filters a template may use. Anything else is refused at parse time. */
49689
+ var DEVICE_TEMPLATE_FILTERS = [
49690
+ "unit",
49691
+ "round",
49692
+ "default",
49693
+ "since",
49694
+ "ago",
49695
+ "format",
49696
+ "upper",
49697
+ "lower",
49698
+ "title",
49699
+ "capitalize",
49700
+ "trim",
49701
+ "abs",
49702
+ "int",
49703
+ "float",
49704
+ "length",
49705
+ "d",
49706
+ "join",
49707
+ "replace",
49708
+ "first",
49709
+ "last",
49710
+ "sort",
49711
+ "reverse",
49712
+ "sum",
49713
+ "string",
49714
+ "list",
49715
+ "truncate"
49716
+ ];
49717
+ var DEVICE_TEMPLATE_REFUSAL_REASONS = [
49718
+ "too-long",
49719
+ "syntax",
49720
+ "forbidden-syntax",
49721
+ "forbidden-member",
49722
+ "unknown-filter",
49723
+ "ambiguous-field",
49724
+ "busy",
49725
+ "budget-exceeded",
49726
+ "timeout",
49727
+ "output-too-large",
49728
+ "render-failed",
49729
+ "out-of-scope",
49730
+ "unavailable"
49731
+ ];
49732
+ var DeviceTemplateRefusalSchema = zod.z.object({
49733
+ reason: zod.z.enum(DEVICE_TEMPLATE_REFUSAL_REASONS),
49734
+ message: zod.z.string()
49735
+ });
49736
+ var DEVICE_TEMPLATE_TRACE_REASONS = [
49737
+ "unknown-alias",
49738
+ "unknown-field",
49739
+ "no-field",
49740
+ "unavailable"
49741
+ ];
49742
+ var DeviceTemplateTraceEntrySchema = zod.z.object({
49743
+ ref: zod.z.string(),
49744
+ reason: zod.z.enum(DEVICE_TEMPLATE_TRACE_REASONS)
49745
+ });
49746
+ var DeviceTemplateRenderSchema = zod.z.discriminatedUnion("ok", [zod.z.object({
49747
+ ok: zod.z.literal(true),
49748
+ text: zod.z.string(),
49749
+ trace: zod.z.array(DeviceTemplateTraceEntrySchema)
49750
+ }), zod.z.object({
49751
+ ok: zod.z.literal(false),
49752
+ refusal: DeviceTemplateRefusalSchema,
49753
+ trace: zod.z.array(DeviceTemplateTraceEntrySchema)
49754
+ })]);
49755
+ /** A capability name as a template spells it: `temperature-sensor` → `temperature_sensor`. */
49756
+ function templateCapKey(cap) {
49757
+ return cap.replace(/-/g, "_");
49758
+ }
49759
+ function isRecord$3(value) {
49760
+ return typeof value === "object" && value !== null && !Array.isArray(value);
49761
+ }
49762
+ function pickPath(root, path) {
49763
+ let cursor = root;
49764
+ for (const part of path) if (Array.isArray(cursor) && typeof part === "number") cursor = cursor[part];
49765
+ else if (isRecord$3(cursor) && Object.hasOwn(cursor, String(part))) cursor = cursor[String(part)];
49766
+ else return;
49767
+ return cursor;
49768
+ }
49769
+ /**
49770
+ * Resolve the path after an alias. `<cap>.field…` when the first segment names
49771
+ * one of the device's caps; otherwise `field…` when exactly one cap carries a
49772
+ * field of that name; several caps carrying it is `ambiguous`, naming them.
49773
+ */
49774
+ function resolveTemplateRef(view, path) {
49775
+ const head = path[0];
49776
+ if (head === void 0) return {
49777
+ kind: "missing",
49778
+ reason: "no-field"
49779
+ };
49780
+ const caps = Object.keys(view.slices);
49781
+ const named = caps.find((cap) => cap === head || templateCapKey(cap) === head);
49782
+ if (named !== void 0) {
49783
+ const rest = path.slice(1);
49784
+ if (rest.length === 0) return {
49785
+ kind: "missing",
49786
+ reason: "no-field"
49787
+ };
49788
+ const value = pickPath(view.slices[named], rest);
49789
+ if (value === void 0) return {
49790
+ kind: "missing",
49791
+ reason: "unknown-field"
49792
+ };
49793
+ return {
49794
+ kind: "value",
49795
+ cap: named,
49796
+ fieldPath: rest,
49797
+ value
49798
+ };
49799
+ }
49800
+ const owners = caps.filter((cap) => {
49801
+ const slice = view.slices[cap];
49802
+ return isRecord$3(slice) && Object.hasOwn(slice, String(head));
49803
+ });
49804
+ if (owners.length === 0) return {
49805
+ kind: "missing",
49806
+ reason: "unknown-field"
49807
+ };
49808
+ const [only] = owners;
49809
+ if (owners.length > 1 || only === void 0) return {
49810
+ kind: "ambiguous",
49811
+ field: String(head),
49812
+ caps: owners
49813
+ };
49814
+ const value = pickPath(view.slices[only], path);
49815
+ if (value === void 0) return {
49816
+ kind: "missing",
49817
+ reason: "unknown-field"
49818
+ };
49819
+ return {
49820
+ kind: "value",
49821
+ cap: only,
49822
+ fieldPath: path,
49823
+ value
49824
+ };
49825
+ }
49826
+ //#endregion
49334
49827
  //#region src/device/site-zone.ts
49335
49828
  /**
49336
49829
  * A SITE ZONE — a named part of the property that several locations belong to.
@@ -49495,7 +49988,7 @@ var DiscoveryHitSchema = zod.z.object({
49495
49988
  */
49496
49989
  var DiscoveryCandidateSchema = zod.z.object({
49497
49990
  stableId: zod.z.string(),
49498
- type: zod.z.enum(require_device_type.DeviceType),
49991
+ type: zod.z.enum(require_composed_stable_id.DeviceType),
49499
49992
  suggestedName: zod.z.string(),
49500
49993
  prefilledConfig: zod.z.record(zod.z.string(), zod.z.unknown()),
49501
49994
  /**
@@ -49669,7 +50162,7 @@ var deviceProviderCapability = {
49669
50162
  */
49670
50163
  getManualCreationType: require_sleep.method(zod.z.object({
49671
50164
  /** The integration asked about; a provider whose integrations differ answers per one. */
49672
- integrationId: zod.z.string().optional() }), zod.z.object({ deviceType: zod.z.enum(require_device_type.DeviceType).nullable() })),
50165
+ integrationId: zod.z.string().optional() }), zod.z.object({ deviceType: zod.z.enum(require_composed_stable_id.DeviceType).nullable() })),
49673
50166
  adoptDiscoveredDevice: require_sleep.method(zod.z.object({
49674
50167
  candidate: DiscoveryCandidateSchema,
49675
50168
  /** The integration the operator adopts into; a provider with several instances needs it. */
@@ -49686,12 +50179,12 @@ integrationId: zod.z.string().optional() }), zod.z.object({ deviceType: zod.z.en
49686
50179
  * router type-asserts it at the boundary.
49687
50180
  */
49688
50181
  getChildCreationSchema: require_sleep.method(zod.z.object({
49689
- type: zod.z.enum(require_device_type.DeviceType),
50182
+ type: zod.z.enum(require_composed_stable_id.DeviceType),
49690
50183
  /** The integration asked about; a provider whose integrations differ answers per one. */
49691
50184
  integrationId: zod.z.string().optional()
49692
50185
  }), CreationSchemaOutputSchema),
49693
50186
  createDevice: require_sleep.method(zod.z.object({
49694
- type: zod.z.enum(require_device_type.DeviceType),
50187
+ type: zod.z.enum(require_composed_stable_id.DeviceType),
49695
50188
  config: zod.z.record(zod.z.string(), zod.z.unknown()),
49696
50189
  /** The integration the operator adds the device to; a provider with several instances needs it. */
49697
50190
  integrationId: zod.z.string().optional()
@@ -49712,7 +50205,7 @@ integrationId: zod.z.string().optional() }), zod.z.object({ deviceType: zod.z.en
49712
50205
  * for backwards compatibility; providers free to ignore it.
49713
50206
  */
49714
50207
  testCreationField: require_sleep.method(zod.z.object({
49715
- type: zod.z.enum(require_device_type.DeviceType),
50208
+ type: zod.z.enum(require_composed_stable_id.DeviceType),
49716
50209
  key: zod.z.string(),
49717
50210
  value: zod.z.unknown(),
49718
50211
  formValues: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
@@ -49833,7 +50326,7 @@ var DeviceInfoSchema = zod.z.object({
49833
50326
  id: zod.z.number(),
49834
50327
  stableId: zod.z.string(),
49835
50328
  addonId: zod.z.string(),
49836
- type: zod.z.enum(require_device_type.DeviceType),
50329
+ type: zod.z.enum(require_composed_stable_id.DeviceType),
49837
50330
  name: zod.z.string(),
49838
50331
  /** The name a value template uses for this device (`{{ stufa_veranda.temperature }}`),
49839
50332
  * entity_id style. Generated once from the name at first registration, unique
@@ -49936,7 +50429,7 @@ var LINKED_DEVICES_SLOT = {
49936
50429
  label: "Linked devices",
49937
50430
  description: "Companion devices of this camera: their controls appear with it, and the ones you opt in produce tracked events on it.",
49938
50431
  shape: "association",
49939
- hostDeviceTypes: [require_device_type.DeviceType.Camera],
50432
+ hostDeviceTypes: [require_composed_stable_id.DeviceType.Camera],
49940
50433
  sourceCaps: "any",
49941
50434
  cardinality: "many",
49942
50435
  value: LinkedDevicesSlotValueSchema
@@ -50231,7 +50724,13 @@ var deviceManagerCapability = {
50231
50724
  * row + emits `EventCategory.DeviceMetaChanged`. */
50232
50725
  setName: require_sleep.method(zod.z.object({
50233
50726
  deviceId: zod.z.number(),
50234
- name: zod.z.string()
50727
+ name: zod.z.string(),
50728
+ /**
50729
+ * Absent or true: an operator rename, which stamps `userNamed`.
50730
+ * False: the system copying a block name onto the device. That write
50731
+ * must not look like the operator's, or the next reconcile freezes it.
50732
+ */
50733
+ stampUserNamed: zod.z.boolean().optional()
50235
50734
  }), zod.z.void(), {
50236
50735
  kind: "mutation",
50237
50736
  auth: "admin"
@@ -50260,6 +50759,38 @@ var deviceManagerCapability = {
50260
50759
  kind: "mutation",
50261
50760
  auth: "admin"
50262
50761
  }),
50762
+ /**
50763
+ * Render device value templates (D1021). The ONE door every consumer uses:
50764
+ * an action step, a scheduler point, a notification rule, a generated
50765
+ * automation block. Admin-only (an in-process block carries the mesh
50766
+ * principal): it reads device state by alias, so a non-admin never calls it
50767
+ * directly. `allowedDeviceIds` is the set the END caller was proven to see;
50768
+ * a template naming another device answers `out-of-scope`. Answers are
50769
+ * index-aligned with `templates`.
50770
+ */
50771
+ renderDeviceTemplates: require_sleep.method(zod.z.object({
50772
+ templates: zod.z.array(DeviceTemplateSchema).max(64),
50773
+ allowedDeviceIds: zod.z.array(zod.z.number().int()).optional()
50774
+ }), zod.z.object({ results: zod.z.array(DeviceTemplateRenderSchema) }), { auth: "admin" }),
50775
+ /**
50776
+ * Vet templates without rendering them: the syntax refusal, or the devices
50777
+ * each names and whether `allowedDeviceIds` covers them. The save door and
50778
+ * the run-time scope check both ask this.
50779
+ */
50780
+ checkDeviceTemplates: require_sleep.method(zod.z.object({
50781
+ templates: zod.z.array(zod.z.string()).max(64),
50782
+ allowedDeviceIds: zod.z.array(zod.z.number().int()).optional()
50783
+ }), zod.z.object({ results: zod.z.array(zod.z.discriminatedUnion("ok", [zod.z.object({
50784
+ ok: zod.z.literal(true),
50785
+ aliases: zod.z.array(zod.z.object({
50786
+ alias: zod.z.string(),
50787
+ deviceId: zod.z.number().int().nullable(),
50788
+ allowed: zod.z.boolean()
50789
+ }))
50790
+ }), zod.z.object({
50791
+ ok: zod.z.literal(false),
50792
+ refusal: DeviceTemplateRefusalSchema
50793
+ })])) }), { auth: "admin" }),
50263
50794
  /** Update the operator-organisational location label. `null`
50264
50795
  * clears it. */
50265
50796
  setLocation: require_sleep.method(zod.z.object({
@@ -50276,7 +50807,7 @@ var deviceManagerCapability = {
50276
50807
  * placeholder `'generic'`. */
50277
50808
  setType: require_sleep.method(zod.z.object({
50278
50809
  deviceId: zod.z.number(),
50279
- type: zod.z.enum(require_device_type.DeviceType)
50810
+ type: zod.z.enum(require_composed_stable_id.DeviceType)
50280
50811
  }), zod.z.void(), {
50281
50812
  kind: "mutation",
50282
50813
  auth: "admin"
@@ -50408,7 +50939,7 @@ var deviceManagerCapability = {
50408
50939
  deviceId: zod.z.number(),
50409
50940
  name: zod.z.string().optional(),
50410
50941
  location: zod.z.string().nullable().optional(),
50411
- type: zod.z.enum(require_device_type.DeviceType).optional(),
50942
+ type: zod.z.enum(require_composed_stable_id.DeviceType).optional(),
50412
50943
  integrationId: zod.z.string().optional(),
50413
50944
  linkDeviceId: zod.z.number().nullable().optional(),
50414
50945
  role: zod.z.string().nullable().optional()
@@ -50995,7 +51526,7 @@ var deviceManagerCapability = {
50995
51526
  */
50996
51527
  getCreationSchema: require_sleep.method(zod.z.object({
50997
51528
  addonId: zod.z.string(),
50998
- type: zod.z.enum(require_device_type.DeviceType),
51529
+ type: zod.z.enum(require_composed_stable_id.DeviceType),
50999
51530
  /** The integration the form is for; a provider whose integrations differ (a hub
51000
51531
  * integration takes no manual add) answers per integration. Absent = the addon's own. */
51001
51532
  integrationId: zod.z.string().optional()
@@ -51003,7 +51534,7 @@ var deviceManagerCapability = {
51003
51534
  /** Create a new device via the device-provider capability. */
51004
51535
  createDevice: require_sleep.method(zod.z.object({
51005
51536
  addonId: zod.z.string(),
51006
- type: zod.z.enum(require_device_type.DeviceType),
51537
+ type: zod.z.enum(require_composed_stable_id.DeviceType),
51007
51538
  config: zod.z.record(zod.z.string(), zod.z.unknown()),
51008
51539
  /** Owning integration id, stamped onto the new device's meta by the
51009
51540
  * device-manager forwarder so `removeByIntegration` can cascade it.
@@ -51023,7 +51554,7 @@ var deviceManagerCapability = {
51023
51554
  */
51024
51555
  testCreationField: require_sleep.method(zod.z.object({
51025
51556
  addonId: zod.z.string(),
51026
- type: zod.z.enum(require_device_type.DeviceType),
51557
+ type: zod.z.enum(require_composed_stable_id.DeviceType),
51027
51558
  key: zod.z.string(),
51028
51559
  value: zod.z.unknown(),
51029
51560
  formValues: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
@@ -51149,7 +51680,7 @@ var deviceManagerCapability = {
51149
51680
  addonId: zod.z.string(),
51150
51681
  /** The integration the Add-Device dialog is open on; absent = the addon's own. */
51151
51682
  integrationId: zod.z.string().optional()
51152
- }), zod.z.object({ deviceType: zod.z.enum(require_device_type.DeviceType).nullable() }), { auth: "admin" }),
51683
+ }), zod.z.object({ deviceType: zod.z.enum(require_composed_stable_id.DeviceType).nullable() }), { auth: "admin" }),
51153
51684
  /** A provider's extra per-scan param form (ConfigUISchema) for the
51154
51685
  * per-integration scan, or null when it takes none. */
51155
51686
  providerDiscoveryParamsSchema: require_sleep.method(zod.z.object({ addonId: zod.z.string() }), zod.z.unknown(), { auth: "admin" }),
@@ -51230,12 +51761,12 @@ var ExtensionSlotIdSchema = zod.z.enum(EXTENSION_SLOT_IDS);
51230
51761
  var EXTENSION_SLOTS = { "linked-devices": {
51231
51762
  descriptor: LINKED_DEVICES_SLOT,
51232
51763
  declaringCap: "device-manager",
51233
- hostDeviceTypes: [require_device_type.DeviceType.Camera]
51764
+ hostDeviceTypes: [require_composed_stable_id.DeviceType.Camera]
51234
51765
  } };
51235
51766
  /** A slot's editable value, discriminated on `slot`. */
51236
51767
  var ExtensionSlotValueSchema = zod.z.discriminatedUnion("slot", [LinkedDevicesSlotValueSchema.extend({ slot: zod.z.literal("linked-devices") })]);
51237
51768
  /** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
51238
- var EXTENSION_HOST_DEVICE_TYPES = [require_device_type.DeviceType.Camera];
51769
+ var EXTENSION_HOST_DEVICE_TYPES = [require_composed_stable_id.DeviceType.Camera];
51239
51770
  //#endregion
51240
51771
  //#region src/capabilities/device-extension.cap.ts
51241
51772
  /**
@@ -51985,9 +52516,9 @@ var DeviceRunSchema = zod.z.object({
51985
52516
  });
51986
52517
  /** Runs of these types are recorded in P1. */
51987
52518
  var DEVICE_RUNS_DEVICE_TYPES = [
51988
- require_device_type.DeviceType.Washer,
51989
- require_device_type.DeviceType.Dryer,
51990
- require_device_type.DeviceType.Dishwasher
52519
+ require_composed_stable_id.DeviceType.Washer,
52520
+ require_composed_stable_id.DeviceType.Dryer,
52521
+ require_composed_stable_id.DeviceType.Dishwasher
51991
52522
  ];
51992
52523
  var DEVICE_RUNS_MAX_PAGE = 200;
51993
52524
  var deviceRunsCapability = {
@@ -52329,7 +52860,7 @@ var deviceTransitionsCapability = {
52329
52860
  mode: "singleton",
52330
52861
  kind: "wrapper",
52331
52862
  defaultActive: true,
52332
- deviceTypes: Object.values(require_device_type.DeviceType).filter((type) => type !== require_device_type.DeviceType.Hub && type !== require_device_type.DeviceType.Container),
52863
+ deviceTypes: Object.values(require_composed_stable_id.DeviceType).filter((type) => type !== require_composed_stable_id.DeviceType.Hub && type !== require_composed_stable_id.DeviceType.Container),
52333
52864
  methods: {
52334
52865
  /**
52335
52866
  * Transitions of a device, newest first. `limit` is bounded; page with `cursor`.
@@ -52555,7 +53086,7 @@ var dishwasherCapability = {
52555
53086
  scope: "device",
52556
53087
  deviceNative: true,
52557
53088
  mode: "singleton",
52558
- deviceTypes: [require_device_type.DeviceType.Dishwasher],
53089
+ deviceTypes: [require_composed_stable_id.DeviceType.Dishwasher],
52559
53090
  methods: {
52560
53091
  /**
52561
53092
  * Start a program. Without `program` the selected one starts. `options` are
@@ -53405,7 +53936,7 @@ var doNotDisturbCapability = {
53405
53936
  scope: "device",
53406
53937
  deviceNative: true,
53407
53938
  mode: "singleton",
53408
- deviceTypes: [require_device_type.DeviceType.MediaPlayer],
53939
+ deviceTypes: [require_composed_stable_id.DeviceType.MediaPlayer],
53409
53940
  methods: { setEnabled: require_sleep.method(zod.z.object({
53410
53941
  deviceId: zod.z.number().int(),
53411
53942
  enabled: zod.z.boolean()
@@ -53444,7 +53975,7 @@ var doorbellCustomize = {
53444
53975
  cap: "doorbell",
53445
53976
  eventName: "onPressed"
53446
53977
  },
53447
- deviceTypes: [require_device_type.DeviceType.Camera],
53978
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
53448
53979
  apply: "add",
53449
53980
  applyAuthority: { kind: "composition-claim" },
53450
53981
  eventName: "onPressed",
@@ -53494,7 +54025,7 @@ var doorbellCapability = {
53494
54025
  scope: "device",
53495
54026
  deviceNative: true,
53496
54027
  mode: "singleton",
53497
- deviceTypes: [require_device_type.DeviceType.Button, require_device_type.DeviceType.Camera],
54028
+ deviceTypes: [require_composed_stable_id.DeviceType.Button, require_composed_stable_id.DeviceType.Camera],
53498
54029
  methods: {},
53499
54030
  events: {
53500
54031
  /**
@@ -53760,7 +54291,7 @@ var enumSensorCapability = {
53760
54291
  scope: "device",
53761
54292
  deviceNative: true,
53762
54293
  mode: "singleton",
53763
- deviceTypes: [require_device_type.DeviceType.Sensor],
54294
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
53764
54295
  methods: {},
53765
54296
  status: {
53766
54297
  schema: EnumSensorStatusSchema,
@@ -53817,7 +54348,7 @@ var eventEmitterCapability = {
53817
54348
  scope: "device",
53818
54349
  deviceNative: true,
53819
54350
  mode: "singleton",
53820
- deviceTypes: [require_device_type.DeviceType.EventEmitter],
54351
+ deviceTypes: [require_composed_stable_id.DeviceType.EventEmitter],
53821
54352
  methods: {},
53822
54353
  events: { onEvent: { data: EventFireSchema } },
53823
54354
  status: {
@@ -54419,7 +54950,7 @@ var fanControlCapability = {
54419
54950
  scope: "device",
54420
54951
  deviceNative: true,
54421
54952
  mode: "singleton",
54422
- deviceTypes: [require_device_type.DeviceType.Fan],
54953
+ deviceTypes: [require_composed_stable_id.DeviceType.Fan],
54423
54954
  methods: {
54424
54955
  setPercentage: require_sleep.method(zod.z.object({
54425
54956
  deviceId: zod.z.number().int().nonnegative(),
@@ -54584,7 +55115,7 @@ var fanPresetsCustomize = {
54584
55115
  id: "presets",
54585
55116
  cardinality: "config",
54586
55117
  vocabulary: { cap: "fan-presets" },
54587
- deviceTypes: [require_device_type.DeviceType.Fan],
55118
+ deviceTypes: [require_composed_stable_id.DeviceType.Fan],
54588
55119
  apply: "add",
54589
55120
  readMethod: "getPresets",
54590
55121
  writeMethod: "setPresets"
@@ -54767,7 +55298,7 @@ var floodCapability = {
54767
55298
  scope: "device",
54768
55299
  deviceNative: true,
54769
55300
  mode: "singleton",
54770
- deviceTypes: [require_device_type.DeviceType.Sensor],
55301
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
54771
55302
  methods: {},
54772
55303
  status: {
54773
55304
  schema: FloodStatusSchema,
@@ -54806,7 +55337,7 @@ var gasCapability = {
54806
55337
  scope: "device",
54807
55338
  deviceNative: true,
54808
55339
  mode: "singleton",
54809
- deviceTypes: [require_device_type.DeviceType.Sensor],
55340
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
54810
55341
  methods: {},
54811
55342
  status: {
54812
55343
  schema: GasStatusSchema,
@@ -54850,12 +55381,12 @@ var groupActiveCapability = {
54850
55381
  deviceNative: true,
54851
55382
  mode: "singleton",
54852
55383
  deviceTypes: [
54853
- require_device_type.DeviceType.Cover,
54854
- require_device_type.DeviceType.Valve,
54855
- require_device_type.DeviceType.Lock,
54856
- require_device_type.DeviceType.MediaPlayer,
54857
- require_device_type.DeviceType.Climate,
54858
- require_device_type.DeviceType.Thermostat
55384
+ require_composed_stable_id.DeviceType.Cover,
55385
+ require_composed_stable_id.DeviceType.Valve,
55386
+ require_composed_stable_id.DeviceType.Lock,
55387
+ require_composed_stable_id.DeviceType.MediaPlayer,
55388
+ require_composed_stable_id.DeviceType.Climate,
55389
+ require_composed_stable_id.DeviceType.Thermostat
54859
55390
  ],
54860
55391
  methods: {},
54861
55392
  status: {
@@ -54899,15 +55430,15 @@ var groupCommandsCapability = {
54899
55430
  deviceNative: true,
54900
55431
  mode: "singleton",
54901
55432
  deviceTypes: [
54902
- require_device_type.DeviceType.Switch,
54903
- require_device_type.DeviceType.Light,
54904
- require_device_type.DeviceType.Fan,
54905
- require_device_type.DeviceType.Cover,
54906
- require_device_type.DeviceType.Valve,
54907
- require_device_type.DeviceType.Lock,
54908
- require_device_type.DeviceType.MediaPlayer,
54909
- require_device_type.DeviceType.Thermostat,
54910
- require_device_type.DeviceType.Climate
55433
+ require_composed_stable_id.DeviceType.Switch,
55434
+ require_composed_stable_id.DeviceType.Light,
55435
+ require_composed_stable_id.DeviceType.Fan,
55436
+ require_composed_stable_id.DeviceType.Cover,
55437
+ require_composed_stable_id.DeviceType.Valve,
55438
+ require_composed_stable_id.DeviceType.Lock,
55439
+ require_composed_stable_id.DeviceType.MediaPlayer,
55440
+ require_composed_stable_id.DeviceType.Thermostat,
55441
+ require_composed_stable_id.DeviceType.Climate
54911
55442
  ],
54912
55443
  methods: {},
54913
55444
  status: {
@@ -54956,16 +55487,16 @@ var groupStatusCapability = {
54956
55487
  deviceNative: true,
54957
55488
  mode: "singleton",
54958
55489
  deviceTypes: [
54959
- require_device_type.DeviceType.Sensor,
54960
- require_device_type.DeviceType.Switch,
54961
- require_device_type.DeviceType.Light,
54962
- require_device_type.DeviceType.Fan,
54963
- require_device_type.DeviceType.Cover,
54964
- require_device_type.DeviceType.Valve,
54965
- require_device_type.DeviceType.Lock,
54966
- require_device_type.DeviceType.MediaPlayer,
54967
- require_device_type.DeviceType.Thermostat,
54968
- require_device_type.DeviceType.Climate
55490
+ require_composed_stable_id.DeviceType.Sensor,
55491
+ require_composed_stable_id.DeviceType.Switch,
55492
+ require_composed_stable_id.DeviceType.Light,
55493
+ require_composed_stable_id.DeviceType.Fan,
55494
+ require_composed_stable_id.DeviceType.Cover,
55495
+ require_composed_stable_id.DeviceType.Valve,
55496
+ require_composed_stable_id.DeviceType.Lock,
55497
+ require_composed_stable_id.DeviceType.MediaPlayer,
55498
+ require_composed_stable_id.DeviceType.Thermostat,
55499
+ require_composed_stable_id.DeviceType.Climate
54969
55500
  ],
54970
55501
  methods: {},
54971
55502
  status: {
@@ -55001,7 +55532,7 @@ var heatPumpControlCapability = {
55001
55532
  scope: "device",
55002
55533
  deviceNative: true,
55003
55534
  mode: "singleton",
55004
- deviceTypes: [require_device_type.DeviceType.HeatPump],
55535
+ deviceTypes: [require_composed_stable_id.DeviceType.HeatPump],
55005
55536
  methods: {
55006
55537
  /** off / auto / on. */
55007
55538
  setSilentMode: require_sleep.method(zod.z.object({
@@ -55233,7 +55764,7 @@ var heatPumpStatusCapability = {
55233
55764
  scope: "device",
55234
55765
  deviceNative: true,
55235
55766
  mode: "singleton",
55236
- deviceTypes: [require_device_type.DeviceType.HeatPump],
55767
+ deviceTypes: [require_composed_stable_id.DeviceType.HeatPump],
55237
55768
  methods: {},
55238
55769
  status: {
55239
55770
  schema: HeatPumpStatusSchema,
@@ -55340,7 +55871,7 @@ var heatingValveCapability = {
55340
55871
  scope: "device",
55341
55872
  deviceNative: true,
55342
55873
  mode: "singleton",
55343
- deviceTypes: [require_device_type.DeviceType.Thermostat],
55874
+ deviceTypes: [require_composed_stable_id.DeviceType.Thermostat],
55344
55875
  methods: {},
55345
55876
  status: {
55346
55877
  schema: HeatingValveStatusSchema,
@@ -55380,23 +55911,34 @@ var TimedRunUnitSchema = zod.z.enum(["s", "min"]);
55380
55911
  var TimedRunActuatorSchema = zod.z.enum(["switch", "pet-fountain"]);
55381
55912
  /** The longest run, per device type. Only these types are offered `timed-run`. */
55382
55913
  var TIMED_RUN_LIMITS = {
55383
- [require_device_type.DeviceType.Heater]: {
55914
+ [require_composed_stable_id.DeviceType.Heater]: {
55384
55915
  actuator: "switch",
55385
55916
  maxSeconds: 10800,
55386
55917
  unit: "min",
55387
55918
  quickRunDefault: 30
55388
55919
  },
55389
- [require_device_type.DeviceType.PetFountain]: {
55920
+ [require_composed_stable_id.DeviceType.PetFountain]: {
55390
55921
  actuator: "pet-fountain",
55391
55922
  maxSeconds: 300,
55392
55923
  unit: "s",
55393
55924
  quickRunDefault: 60
55394
55925
  }
55395
55926
  };
55396
- var TIMED_RUN_DEVICE_TYPES = [require_device_type.DeviceType.Heater, require_device_type.DeviceType.PetFountain];
55927
+ var TIMED_RUN_DEVICE_TYPES = [require_composed_stable_id.DeviceType.Heater, require_composed_stable_id.DeviceType.PetFountain];
55397
55928
  function timedRunLimitOf(deviceType) {
55398
55929
  return TIMED_RUN_LIMITS[deviceType] ?? null;
55399
55930
  }
55931
+ var MS_PER_SECOND = 1e3;
55932
+ var MS_PER_MINUTE = 6e4;
55933
+ /**
55934
+ * Whole units left on an armed run. Minutes and seconds both ceil, and a run
55935
+ * that has not expired yet never reads as zero.
55936
+ */
55937
+ function timedRunRemaining(activeUntil, now, unit) {
55938
+ const left = activeUntil - now;
55939
+ if (left <= 0) return 0;
55940
+ return Math.max(1, Math.ceil(left / (unit === "min" ? MS_PER_MINUTE : MS_PER_SECOND)));
55941
+ }
55400
55942
  /** Seconds in a duration of `duration` `unit`. */
55401
55943
  function timedRunSeconds(duration, unit) {
55402
55944
  return unit === "min" ? duration * 60 : duration;
@@ -55651,111 +56193,111 @@ var HeroSceneSchema = zod.z.object({
55651
56193
  level: zod.z.number().min(0).max(1).nullable()
55652
56194
  });
55653
56195
  var HERO_SCENE_BY_TYPE = {
55654
- [require_device_type.DeviceType.Camera]: "camera",
55655
- [require_device_type.DeviceType.Hub]: "gateway",
55656
- [require_device_type.DeviceType.Light]: "light",
55657
- [require_device_type.DeviceType.Siren]: "siren",
55658
- [require_device_type.DeviceType.Switch]: "plug",
55659
- [require_device_type.DeviceType.Sensor]: "sensor-sparkline",
55660
- [require_device_type.DeviceType.Thermostat]: "thermostat",
55661
- [require_device_type.DeviceType.Climate]: "ac",
55662
- [require_device_type.DeviceType.Button]: "button",
55663
- [require_device_type.DeviceType.EventEmitter]: "event-stream",
55664
- [require_device_type.DeviceType.Update]: "update",
55665
- [require_device_type.DeviceType.Generic]: "generic",
55666
- [require_device_type.DeviceType.Notifier]: "event-stream",
55667
- [require_device_type.DeviceType.Script]: "event-stream",
55668
- [require_device_type.DeviceType.Automation]: "event-stream",
55669
- [require_device_type.DeviceType.Lock]: "lock",
55670
- [require_device_type.DeviceType.Cover]: "cover",
55671
- [require_device_type.DeviceType.Valve]: "control-dial",
55672
- [require_device_type.DeviceType.Humidifier]: "control-dial",
55673
- [require_device_type.DeviceType.WaterHeater]: "heater",
55674
- [require_device_type.DeviceType.HeatPump]: "heat-pump",
55675
- [require_device_type.DeviceType.Fan]: "fan",
55676
- [require_device_type.DeviceType.MediaPlayer]: "tv",
55677
- [require_device_type.DeviceType.AlarmPanel]: "alarm",
55678
- [require_device_type.DeviceType.Control]: "control-dial",
55679
- [require_device_type.DeviceType.Presence]: "presence",
55680
- [require_device_type.DeviceType.Weather]: "weather",
55681
- [require_device_type.DeviceType.Vacuum]: "vacuum",
55682
- [require_device_type.DeviceType.LawnMower]: "lawn-mower",
55683
- [require_device_type.DeviceType.Container]: "generic",
55684
- [require_device_type.DeviceType.Image]: "camera",
55685
- [require_device_type.DeviceType.PetFeeder]: "pet-feeder",
55686
- [require_device_type.DeviceType.PetFountain]: "pet-fountain",
55687
- [require_device_type.DeviceType.Dishwasher]: "dishwasher",
55688
- [require_device_type.DeviceType.Washer]: "washer",
55689
- [require_device_type.DeviceType.Heater]: "heater",
55690
- [require_device_type.DeviceType.Dryer]: "dryer",
55691
- [require_device_type.DeviceType.Gateway]: "gateway"
56196
+ [require_composed_stable_id.DeviceType.Camera]: "camera",
56197
+ [require_composed_stable_id.DeviceType.Hub]: "gateway",
56198
+ [require_composed_stable_id.DeviceType.Light]: "light",
56199
+ [require_composed_stable_id.DeviceType.Siren]: "siren",
56200
+ [require_composed_stable_id.DeviceType.Switch]: "plug",
56201
+ [require_composed_stable_id.DeviceType.Sensor]: "sensor-sparkline",
56202
+ [require_composed_stable_id.DeviceType.Thermostat]: "thermostat",
56203
+ [require_composed_stable_id.DeviceType.Climate]: "ac",
56204
+ [require_composed_stable_id.DeviceType.Button]: "button",
56205
+ [require_composed_stable_id.DeviceType.EventEmitter]: "event-stream",
56206
+ [require_composed_stable_id.DeviceType.Update]: "update",
56207
+ [require_composed_stable_id.DeviceType.Generic]: "generic",
56208
+ [require_composed_stable_id.DeviceType.Notifier]: "event-stream",
56209
+ [require_composed_stable_id.DeviceType.Script]: "event-stream",
56210
+ [require_composed_stable_id.DeviceType.Automation]: "event-stream",
56211
+ [require_composed_stable_id.DeviceType.Lock]: "lock",
56212
+ [require_composed_stable_id.DeviceType.Cover]: "cover",
56213
+ [require_composed_stable_id.DeviceType.Valve]: "control-dial",
56214
+ [require_composed_stable_id.DeviceType.Humidifier]: "control-dial",
56215
+ [require_composed_stable_id.DeviceType.WaterHeater]: "heater",
56216
+ [require_composed_stable_id.DeviceType.HeatPump]: "heat-pump",
56217
+ [require_composed_stable_id.DeviceType.Fan]: "fan",
56218
+ [require_composed_stable_id.DeviceType.MediaPlayer]: "tv",
56219
+ [require_composed_stable_id.DeviceType.AlarmPanel]: "alarm",
56220
+ [require_composed_stable_id.DeviceType.Control]: "control-dial",
56221
+ [require_composed_stable_id.DeviceType.Presence]: "presence",
56222
+ [require_composed_stable_id.DeviceType.Weather]: "weather",
56223
+ [require_composed_stable_id.DeviceType.Vacuum]: "vacuum",
56224
+ [require_composed_stable_id.DeviceType.LawnMower]: "lawn-mower",
56225
+ [require_composed_stable_id.DeviceType.Container]: "generic",
56226
+ [require_composed_stable_id.DeviceType.Image]: "camera",
56227
+ [require_composed_stable_id.DeviceType.PetFeeder]: "pet-feeder",
56228
+ [require_composed_stable_id.DeviceType.PetFountain]: "pet-fountain",
56229
+ [require_composed_stable_id.DeviceType.Dishwasher]: "dishwasher",
56230
+ [require_composed_stable_id.DeviceType.Washer]: "washer",
56231
+ [require_composed_stable_id.DeviceType.Heater]: "heater",
56232
+ [require_composed_stable_id.DeviceType.Dryer]: "dryer",
56233
+ [require_composed_stable_id.DeviceType.Gateway]: "gateway"
55692
56234
  };
55693
56235
  /** `inherit` = the type's scene. A role only refines a type. */
55694
56236
  var HERO_SCENE_BY_ROLE = {
55695
- [require_device_type.DeviceRole.Siren]: "siren",
55696
- [require_device_type.DeviceRole.Floodlight]: "light",
55697
- [require_device_type.DeviceRole.Spotlight]: "light",
55698
- [require_device_type.DeviceRole.PirSensor]: "presence",
55699
- [require_device_type.DeviceRole.Chime]: "speaker",
55700
- [require_device_type.DeviceRole.Autotrack]: "inherit",
55701
- [require_device_type.DeviceRole.Nightvision]: "inherit",
55702
- [require_device_type.DeviceRole.PrivacyMask]: "inherit",
55703
- [require_device_type.DeviceRole.Doorbell]: "inherit",
55704
- [require_device_type.DeviceRole.CoverBlind]: "inherit",
55705
- [require_device_type.DeviceRole.CoverShutter]: "inherit",
55706
- [require_device_type.DeviceRole.CoverAwning]: "inherit",
55707
- [require_device_type.DeviceRole.CoverCurtain]: "inherit",
55708
- [require_device_type.DeviceRole.CoverGarage]: "inherit",
55709
- [require_device_type.DeviceRole.CoverGate]: "inherit",
55710
- [require_device_type.DeviceRole.CoverDoor]: "inherit",
55711
- [require_device_type.DeviceRole.CoverWindow]: "inherit",
55712
- [require_device_type.DeviceRole.BinaryHelper]: "inherit",
55713
- [require_device_type.DeviceRole.Outlet]: "plug",
55714
- [require_device_type.DeviceRole.MotionSensor]: "presence",
55715
- [require_device_type.DeviceRole.ContactSensor]: "contact",
55716
- [require_device_type.DeviceRole.LeakSensor]: "inherit",
55717
- [require_device_type.DeviceRole.SmokeSensor]: "alarm",
55718
- [require_device_type.DeviceRole.COSensor]: "alarm",
55719
- [require_device_type.DeviceRole.GasSensor]: "alarm",
55720
- [require_device_type.DeviceRole.TamperSensor]: "inherit",
55721
- [require_device_type.DeviceRole.VibrationSensor]: "inherit",
55722
- [require_device_type.DeviceRole.ConnectivitySensor]: "inherit",
55723
- [require_device_type.DeviceRole.SoundSensor]: "inherit",
55724
- [require_device_type.DeviceRole.BinarySensor]: "inherit",
55725
- [require_device_type.DeviceRole.TemperatureSensor]: "sensor-sparkline",
55726
- [require_device_type.DeviceRole.HumiditySensor]: "sensor-sparkline",
55727
- [require_device_type.DeviceRole.AmbientLightSensor]: "inherit",
55728
- [require_device_type.DeviceRole.PressureSensor]: "weather",
55729
- [require_device_type.DeviceRole.WindSensor]: "weather",
55730
- [require_device_type.DeviceRole.RainSensor]: "weather",
55731
- [require_device_type.DeviceRole.UvSensor]: "weather",
55732
- [require_device_type.DeviceRole.SolarRadiationSensor]: "weather",
55733
- [require_device_type.DeviceRole.SoilMoistureSensor]: "inherit",
55734
- [require_device_type.DeviceRole.PowerSensor]: "plug",
55735
- [require_device_type.DeviceRole.EnergySensor]: "plug",
55736
- [require_device_type.DeviceRole.VoltageSensor]: "plug",
55737
- [require_device_type.DeviceRole.CurrentSensor]: "plug",
55738
- [require_device_type.DeviceRole.AirQualitySensor]: "inherit",
55739
- [require_device_type.DeviceRole.BatterySensor]: "inherit",
55740
- [require_device_type.DeviceRole.NumericSensor]: "inherit",
55741
- [require_device_type.DeviceRole.EnumSensor]: "inherit",
55742
- [require_device_type.DeviceRole.DateTimeSensor]: "inherit",
55743
- [require_device_type.DeviceRole.GenericSensor]: "inherit",
55744
- [require_device_type.DeviceRole.NumericControl]: "control-dial",
55745
- [require_device_type.DeviceRole.SelectControl]: "control-dial",
55746
- [require_device_type.DeviceRole.TextControl]: "inherit",
55747
- [require_device_type.DeviceRole.DateTimeControl]: "inherit",
55748
- [require_device_type.DeviceRole.MobilePushNotifier]: "inherit",
55749
- [require_device_type.DeviceRole.MessagingNotifier]: "inherit",
55750
- [require_device_type.DeviceRole.EmailNotifier]: "inherit",
55751
- [require_device_type.DeviceRole.GenericNotifier]: "inherit",
55752
- [require_device_type.DeviceRole.IrTransmitter]: "inherit"
56237
+ [require_composed_stable_id.DeviceRole.Siren]: "siren",
56238
+ [require_composed_stable_id.DeviceRole.Floodlight]: "light",
56239
+ [require_composed_stable_id.DeviceRole.Spotlight]: "light",
56240
+ [require_composed_stable_id.DeviceRole.PirSensor]: "presence",
56241
+ [require_composed_stable_id.DeviceRole.Chime]: "speaker",
56242
+ [require_composed_stable_id.DeviceRole.Autotrack]: "inherit",
56243
+ [require_composed_stable_id.DeviceRole.Nightvision]: "inherit",
56244
+ [require_composed_stable_id.DeviceRole.PrivacyMask]: "inherit",
56245
+ [require_composed_stable_id.DeviceRole.Doorbell]: "inherit",
56246
+ [require_composed_stable_id.DeviceRole.CoverBlind]: "inherit",
56247
+ [require_composed_stable_id.DeviceRole.CoverShutter]: "inherit",
56248
+ [require_composed_stable_id.DeviceRole.CoverAwning]: "inherit",
56249
+ [require_composed_stable_id.DeviceRole.CoverCurtain]: "inherit",
56250
+ [require_composed_stable_id.DeviceRole.CoverGarage]: "inherit",
56251
+ [require_composed_stable_id.DeviceRole.CoverGate]: "inherit",
56252
+ [require_composed_stable_id.DeviceRole.CoverDoor]: "inherit",
56253
+ [require_composed_stable_id.DeviceRole.CoverWindow]: "inherit",
56254
+ [require_composed_stable_id.DeviceRole.BinaryHelper]: "inherit",
56255
+ [require_composed_stable_id.DeviceRole.Outlet]: "plug",
56256
+ [require_composed_stable_id.DeviceRole.MotionSensor]: "presence",
56257
+ [require_composed_stable_id.DeviceRole.ContactSensor]: "contact",
56258
+ [require_composed_stable_id.DeviceRole.LeakSensor]: "inherit",
56259
+ [require_composed_stable_id.DeviceRole.SmokeSensor]: "alarm",
56260
+ [require_composed_stable_id.DeviceRole.COSensor]: "alarm",
56261
+ [require_composed_stable_id.DeviceRole.GasSensor]: "alarm",
56262
+ [require_composed_stable_id.DeviceRole.TamperSensor]: "inherit",
56263
+ [require_composed_stable_id.DeviceRole.VibrationSensor]: "inherit",
56264
+ [require_composed_stable_id.DeviceRole.ConnectivitySensor]: "inherit",
56265
+ [require_composed_stable_id.DeviceRole.SoundSensor]: "inherit",
56266
+ [require_composed_stable_id.DeviceRole.BinarySensor]: "inherit",
56267
+ [require_composed_stable_id.DeviceRole.TemperatureSensor]: "sensor-sparkline",
56268
+ [require_composed_stable_id.DeviceRole.HumiditySensor]: "sensor-sparkline",
56269
+ [require_composed_stable_id.DeviceRole.AmbientLightSensor]: "inherit",
56270
+ [require_composed_stable_id.DeviceRole.PressureSensor]: "weather",
56271
+ [require_composed_stable_id.DeviceRole.WindSensor]: "weather",
56272
+ [require_composed_stable_id.DeviceRole.RainSensor]: "weather",
56273
+ [require_composed_stable_id.DeviceRole.UvSensor]: "weather",
56274
+ [require_composed_stable_id.DeviceRole.SolarRadiationSensor]: "weather",
56275
+ [require_composed_stable_id.DeviceRole.SoilMoistureSensor]: "inherit",
56276
+ [require_composed_stable_id.DeviceRole.PowerSensor]: "plug",
56277
+ [require_composed_stable_id.DeviceRole.EnergySensor]: "plug",
56278
+ [require_composed_stable_id.DeviceRole.VoltageSensor]: "plug",
56279
+ [require_composed_stable_id.DeviceRole.CurrentSensor]: "plug",
56280
+ [require_composed_stable_id.DeviceRole.AirQualitySensor]: "inherit",
56281
+ [require_composed_stable_id.DeviceRole.BatterySensor]: "inherit",
56282
+ [require_composed_stable_id.DeviceRole.NumericSensor]: "inherit",
56283
+ [require_composed_stable_id.DeviceRole.EnumSensor]: "inherit",
56284
+ [require_composed_stable_id.DeviceRole.DateTimeSensor]: "inherit",
56285
+ [require_composed_stable_id.DeviceRole.GenericSensor]: "inherit",
56286
+ [require_composed_stable_id.DeviceRole.NumericControl]: "control-dial",
56287
+ [require_composed_stable_id.DeviceRole.SelectControl]: "control-dial",
56288
+ [require_composed_stable_id.DeviceRole.TextControl]: "inherit",
56289
+ [require_composed_stable_id.DeviceRole.DateTimeControl]: "inherit",
56290
+ [require_composed_stable_id.DeviceRole.MobilePushNotifier]: "inherit",
56291
+ [require_composed_stable_id.DeviceRole.MessagingNotifier]: "inherit",
56292
+ [require_composed_stable_id.DeviceRole.EmailNotifier]: "inherit",
56293
+ [require_composed_stable_id.DeviceRole.GenericNotifier]: "inherit",
56294
+ [require_composed_stable_id.DeviceRole.IrTransmitter]: "inherit"
55753
56295
  };
55754
56296
  function isDeviceType$2(type) {
55755
- return Object.values(require_device_type.DeviceType).includes(type);
56297
+ return Object.values(require_composed_stable_id.DeviceType).includes(type);
55756
56298
  }
55757
56299
  function isDeviceRole$1(role) {
55758
- return Object.values(require_device_type.DeviceRole).includes(role);
56300
+ return Object.values(require_composed_stable_id.DeviceRole).includes(role);
55759
56301
  }
55760
56302
  /** The scene id of a (role, type) pair. Role beats type; a type this build does not know gets the terminal. */
55761
56303
  function resolveHeroSceneId(role, type) {
@@ -56049,7 +56591,13 @@ var HeroTimedRunSlotSchema = zod.z.object({
56049
56591
  activeUntil: zod.z.number().nullable(),
56050
56592
  quickRun: TimedRunQuickRunSchema,
56051
56593
  run: HeroActionSchema,
56052
- cancel: HeroActionSchema
56594
+ cancel: HeroActionSchema,
56595
+ /**
56596
+ * Whole units left (the limit's unit, ceil). `null` while nothing is armed.
56597
+ * A number, not words: the row formats it, and a text here would not fit the
56598
+ * hero-layout declaration.
56599
+ */
56600
+ remaining: zod.z.number().nullable()
56053
56601
  });
56054
56602
  var HeroPowerSupplySlotSchema = zod.z.object({
56055
56603
  /** The plug's state; `null` = unknown, never off. */
@@ -56170,18 +56718,31 @@ var HeroModelSchema = zod.z.object({
56170
56718
  * 4. a trailing fact (power, else battery, else consumables).
56171
56719
  *
56172
56720
  * Selection rules, all taken from the model:
56173
- * - ONE control is ever shown: the device's own power; else the FIRST control of
56721
+ * - the primary control is the device's own power; else the FIRST control of
56174
56722
  * the FIRST row that has any (a later row's control is never promoted). When
56175
56723
  * the model lists that part in `gated`, the row has no inline control: the
56176
56724
  * projection never falls through to another control the caller could use.
56725
+ * - a timed run, when the model carries the slot, sits beside that primary:
56726
+ * Run while idle, Stop while armed. Gating the slot hides the control.
56177
56727
  * - the status line is the head (what plays, else the state) plus at most
56178
- * {@link ROW_STATUS_FACTS_MAX} facts, the trailing fact excluded;
56728
+ * {@link ROW_STATUS_FACTS_MAX} facts, the trailing fact excluded, then the
56729
+ * time left on an armed timed run;
56179
56730
  * - the trailing fact is the first of power, battery, consumables.
56180
56731
  *
56181
56732
  * `projectDeviceRow` is pure and computes nothing: it selects from a
56182
56733
  * {@link HeroModel}. A row that needed a value the hero lacks would mean the
56183
56734
  * model is missing it, so the fix goes in the model.
56184
56735
  */
56736
+ /**
56737
+ * The row's timed-run control. `id` is `timed-run.run` while idle and
56738
+ * `timed-run.cancel` while armed; `duration` and `unit` are the one-tap run
56739
+ * a Run press starts.
56740
+ */
56741
+ var HeroRowTimedRunSchema = zod.z.object({
56742
+ id: zod.z.enum(["timed-run.run", "timed-run.cancel"]),
56743
+ duration: zod.z.number(),
56744
+ unit: zod.z.enum(["min", "s"])
56745
+ });
56185
56746
  var HeroRowModelSchema = zod.z.object({
56186
56747
  deviceId: zod.z.number().int(),
56187
56748
  name: zod.z.string(),
@@ -56194,6 +56755,11 @@ var HeroRowModelSchema = zod.z.object({
56194
56755
  statusLine: zod.z.array(HeroTextSchema),
56195
56756
  /** `null` = the type has no inline control, or the caller may not act on it. */
56196
56757
  primary: HeroControlSchema.nullable(),
56758
+ /**
56759
+ * Beside `primary` when the device offers a timed run: Run while idle, Stop
56760
+ * while armed. `null` when there is no slot, or the caller may not act.
56761
+ */
56762
+ timedRun: HeroRowTimedRunSchema.nullable(),
56197
56763
  trailing: HeroFactSchema.nullable()
56198
56764
  });
56199
56765
  /** The trailing fact, in order of preference. */
@@ -56230,7 +56796,30 @@ function primaryOf(model) {
56230
56796
  return null;
56231
56797
  }
56232
56798
  function statusLineOf(model, trailing) {
56233
- return [model.rows.find((r) => r.id === "now-playing")?.status ?? null ?? model.title, ...model.facts.filter((f) => f !== trailing).map((f) => f.text).slice(0, 3)];
56799
+ const head = model.rows.find((r) => r.id === "now-playing")?.status ?? null ?? model.title;
56800
+ const rest = model.facts.filter((f) => f !== trailing).map((f) => f.text).slice(0, 3);
56801
+ const slot = model.timedRun;
56802
+ if (slot === null || slot.remaining === null) return [head, ...rest];
56803
+ const word = slot.quickRun.unit === "min" ? "min" : "s";
56804
+ const left = {
56805
+ en: `${slot.remaining} ${word}`,
56806
+ it: `${slot.remaining} ${word}`
56807
+ };
56808
+ return [
56809
+ head,
56810
+ ...rest,
56811
+ left
56812
+ ];
56813
+ }
56814
+ /** Run while the slot is idle, Stop while it is armed. Hidden when the caller may not act. */
56815
+ function timedRunOf(model) {
56816
+ const slot = model.timedRun;
56817
+ if (slot === null || model.gated.includes("timed-run")) return null;
56818
+ return {
56819
+ id: slot.activeUntil === null ? "timed-run.run" : "timed-run.cancel",
56820
+ duration: slot.quickRun.duration,
56821
+ unit: slot.quickRun.unit
56822
+ };
56234
56823
  }
56235
56824
  function projectDeviceRow(model) {
56236
56825
  const trailing = trailingOf(model.facts);
@@ -56244,6 +56833,7 @@ function projectDeviceRow(model) {
56244
56833
  scene: model.scene,
56245
56834
  statusLine: statusLineOf(model, trailing),
56246
56835
  primary: primaryOf(model),
56836
+ timedRun: timedRunOf(model),
56247
56837
  trailing
56248
56838
  };
56249
56839
  }
@@ -56346,7 +56936,7 @@ var humidifierCapability = {
56346
56936
  scope: "device",
56347
56937
  deviceNative: true,
56348
56938
  mode: "singleton",
56349
- deviceTypes: [require_device_type.DeviceType.Humidifier],
56939
+ deviceTypes: [require_composed_stable_id.DeviceType.Humidifier],
56350
56940
  methods: {
56351
56941
  setOn: require_sleep.method(zod.z.object({
56352
56942
  deviceId: zod.z.number().int().nonnegative(),
@@ -56422,7 +57012,7 @@ var humiditySensorCapability = {
56422
57012
  scope: "device",
56423
57013
  deviceNative: true,
56424
57014
  mode: "singleton",
56425
- deviceTypes: [require_device_type.DeviceType.Sensor, require_device_type.DeviceType.Thermostat],
57015
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor, require_composed_stable_id.DeviceType.Thermostat],
56426
57016
  methods: {},
56427
57017
  status: {
56428
57018
  schema: HumiditySensorStatusSchema,
@@ -56476,7 +57066,7 @@ var imageCapability = {
56476
57066
  scope: "device",
56477
57067
  deviceNative: true,
56478
57068
  mode: "singleton",
56479
- deviceTypes: [require_device_type.DeviceType.Image],
57069
+ deviceTypes: [require_composed_stable_id.DeviceType.Image],
56480
57070
  methods: {},
56481
57071
  status: {
56482
57072
  schema: ImageStatusSchema,
@@ -56628,7 +57218,7 @@ var imageSettingsCapability = {
56628
57218
  scope: "device",
56629
57219
  deviceNative: true,
56630
57220
  mode: "singleton",
56631
- deviceTypes: [require_device_type.DeviceType.Camera],
57221
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
56632
57222
  deviceConfig: { ui: {
56633
57223
  kind: "derived-form",
56634
57224
  builderId: "image-settings",
@@ -57199,7 +57789,7 @@ var intercomCapability = {
57199
57789
  scope: "device",
57200
57790
  deviceNative: true,
57201
57791
  mode: "singleton",
57202
- deviceTypes: [require_device_type.DeviceType.Camera],
57792
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
57203
57793
  /**
57204
57794
  * **Auth tier: `protected` on every method — deliberate, and load-bearing.**
57205
57795
  *
@@ -57394,7 +57984,7 @@ var irTransmitterCapability = {
57394
57984
  scope: "device",
57395
57985
  deviceNative: true,
57396
57986
  mode: "singleton",
57397
- deviceTypes: [require_device_type.DeviceType.Generic],
57987
+ deviceTypes: [require_composed_stable_id.DeviceType.Generic],
57398
57988
  methods: {
57399
57989
  send: require_sleep.method(zod.z.object({
57400
57990
  deviceId: zod.z.number().int().nonnegative(),
@@ -57853,7 +58443,7 @@ var lawnMowerControlCapability = {
57853
58443
  scope: "device",
57854
58444
  deviceNative: true,
57855
58445
  mode: "singleton",
57856
- deviceTypes: [require_device_type.DeviceType.LawnMower],
58446
+ deviceTypes: [require_composed_stable_id.DeviceType.LawnMower],
57857
58447
  methods: {
57858
58448
  startMowing: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
57859
58449
  kind: "mutation",
@@ -59976,7 +60566,7 @@ var lockControlCustomize = {
59976
60566
  cap: "lock-control",
59977
60567
  stateField: "state"
59978
60568
  },
59979
- deviceTypes: [require_device_type.DeviceType.Lock],
60569
+ deviceTypes: [require_composed_stable_id.DeviceType.Lock],
59980
60570
  apply: "replace",
59981
60571
  path: "state",
59982
60572
  override: {
@@ -59995,7 +60585,7 @@ var lockControlCapability = {
59995
60585
  scope: "device",
59996
60586
  deviceNative: true,
59997
60587
  mode: "singleton",
59998
- deviceTypes: [require_device_type.DeviceType.Lock],
60588
+ deviceTypes: [require_composed_stable_id.DeviceType.Lock],
59999
60589
  methods: {
60000
60590
  lock: require_sleep.method(zod.z.object({
60001
60591
  deviceId: zod.z.number().int().nonnegative(),
@@ -60626,7 +61216,7 @@ var meterCapability = {
60626
61216
  scope: "device",
60627
61217
  deviceNative: true,
60628
61218
  mode: "singleton",
60629
- deviceTypes: [require_device_type.DeviceType.Sensor],
61219
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
60630
61220
  methods: {},
60631
61221
  status: {
60632
61222
  schema: MeterStatusSchema,
@@ -62032,7 +62622,7 @@ var motionDetectionCapability = {
62032
62622
  /** Frame-differencing motion analysis over a video stream — only a camera
62033
62623
  * produces the frames. Read by the `defaultActive` auto-bind in
62034
62624
  * `device-manager.getBindings` to decide which devices it may claim. */
62035
- deviceTypes: [require_device_type.DeviceType.Camera],
62625
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
62036
62626
  exposesDeviceSettings: true,
62037
62627
  methods: {
62038
62628
  analyze: require_sleep.method(zod.z.object({
@@ -64609,7 +65199,7 @@ var pipelineAnalyticsCapability = {
64609
65199
  mode: "singleton",
64610
65200
  kind: "wrapper",
64611
65201
  defaultActive: true,
64612
- deviceTypes: [require_device_type.DeviceType.Camera],
65202
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
64613
65203
  exposesDeviceSettings: true,
64614
65204
  methods: {
64615
65205
  getActiveTracks: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.array(TrackSchema).readonly()),
@@ -66560,7 +67150,7 @@ var zonesCapability = {
66560
67150
  name: "zones",
66561
67151
  scope: "device",
66562
67152
  mode: "singleton",
66563
- deviceTypes: [require_device_type.DeviceType.Camera],
67153
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
66564
67154
  methods: {
66565
67155
  listZones: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.array(ZoneSchema).readonly()),
66566
67156
  addZone: require_sleep.method(zod.z.object({
@@ -68392,7 +68982,7 @@ var motionCustomize = {
68392
68982
  cap: "motion",
68393
68983
  eventName: "onMotionChanged"
68394
68984
  },
68395
- deviceTypes: [require_device_type.DeviceType.Camera],
68985
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
68396
68986
  apply: "add",
68397
68987
  applyAuthority: {
68398
68988
  kind: "camera-sensors",
@@ -68523,7 +69113,7 @@ var motionCapability = {
68523
69113
  * `snapshot` and every other per-device native cap.
68524
69114
  */
68525
69115
  deviceNative: true,
68526
- deviceTypes: [require_device_type.DeviceType.Camera, require_device_type.DeviceType.Sensor],
69116
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera, require_composed_stable_id.DeviceType.Sensor],
68527
69117
  methods: {
68528
69118
  /**
68529
69119
  * Pull the current motion state synchronously. Convenience shortcut
@@ -68582,7 +69172,7 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
68582
69172
  */
68583
69173
  history: { fields: { detected: {
68584
69174
  kind: "boolean",
68585
- excludeDeviceTypes: [require_device_type.DeviceType.Camera]
69175
+ excludeDeviceTypes: [require_composed_stable_id.DeviceType.Camera]
68586
69176
  } } },
68587
69177
  customize: motionCustomize
68588
69178
  };
@@ -68631,9 +69221,9 @@ var motionTriggerCapability = {
68631
69221
  deviceNative: true,
68632
69222
  mode: "singleton",
68633
69223
  deviceTypes: [
68634
- require_device_type.DeviceType.Light,
68635
- require_device_type.DeviceType.Siren,
68636
- require_device_type.DeviceType.Switch
69224
+ require_composed_stable_id.DeviceType.Light,
69225
+ require_composed_stable_id.DeviceType.Siren,
69226
+ require_composed_stable_id.DeviceType.Switch
68637
69227
  ],
68638
69228
  methods: { setMotionTrigger: require_sleep.method(zod.z.object({
68639
69229
  deviceId: zod.z.number().int().nonnegative(),
@@ -68710,7 +69300,7 @@ var motionZonesCapability = {
68710
69300
  scope: "device",
68711
69301
  deviceNative: true,
68712
69302
  mode: "singleton",
68713
- deviceTypes: [require_device_type.DeviceType.Camera],
69303
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
68714
69304
  deviceConfig: { ui: {
68715
69305
  kind: "widget",
68716
69306
  widgetId: "host/motion-zones-grid",
@@ -68970,7 +69560,7 @@ var nativeObjectDetectionCapability = {
68970
69560
  scope: "device",
68971
69561
  deviceNative: true,
68972
69562
  mode: "singleton",
68973
- deviceTypes: [require_device_type.DeviceType.Camera],
69563
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
68974
69564
  methods: {
68975
69565
  getOptions: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), NativeObjectDetectionOptionsSchema),
68976
69566
  setSettings: require_sleep.method(zod.z.object({
@@ -69343,7 +69933,7 @@ var navigationCapability = {
69343
69933
  scope: "device",
69344
69934
  deviceNative: true,
69345
69935
  mode: "singleton",
69346
- deviceTypes: [require_device_type.DeviceType.Camera],
69936
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
69347
69937
  deviceConfig: { ui: {
69348
69938
  kind: "widget",
69349
69939
  widgetId: "host/navigation-panel",
@@ -69587,13 +70177,13 @@ var networkLinkCapability = {
69587
70177
  deviceNative: true,
69588
70178
  mode: "singleton",
69589
70179
  deviceTypes: [
69590
- require_device_type.DeviceType.Camera,
69591
- require_device_type.DeviceType.Sensor,
69592
- require_device_type.DeviceType.Button,
69593
- require_device_type.DeviceType.Switch,
69594
- require_device_type.DeviceType.Light,
69595
- require_device_type.DeviceType.Lock,
69596
- require_device_type.DeviceType.Siren
70180
+ require_composed_stable_id.DeviceType.Camera,
70181
+ require_composed_stable_id.DeviceType.Sensor,
70182
+ require_composed_stable_id.DeviceType.Button,
70183
+ require_composed_stable_id.DeviceType.Switch,
70184
+ require_composed_stable_id.DeviceType.Light,
70185
+ require_composed_stable_id.DeviceType.Lock,
70186
+ require_composed_stable_id.DeviceType.Siren
69597
70187
  ],
69598
70188
  methods: {},
69599
70189
  events: {
@@ -74110,7 +74700,7 @@ var notifierCapability = {
74110
74700
  scope: "device",
74111
74701
  deviceNative: true,
74112
74702
  mode: "singleton",
74113
- deviceTypes: [require_device_type.DeviceType.Notifier],
74703
+ deviceTypes: [require_composed_stable_id.DeviceType.Notifier],
74114
74704
  methods: {
74115
74705
  send: require_sleep.method(NotifierSendInputSchema, NotifierSendResultSchema, {
74116
74706
  kind: "mutation",
@@ -74187,7 +74777,7 @@ var numericSensorCapability = {
74187
74777
  scope: "device",
74188
74778
  deviceNative: true,
74189
74779
  mode: "singleton",
74190
- deviceTypes: [require_device_type.DeviceType.Sensor],
74780
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
74191
74781
  methods: {},
74192
74782
  status: {
74193
74783
  schema: NumericSensorStatusSchema,
@@ -74420,7 +75010,7 @@ var osdCapability = {
74420
75010
  scope: "device",
74421
75011
  deviceNative: true,
74422
75012
  mode: "singleton",
74423
- deviceTypes: [require_device_type.DeviceType.Camera],
75013
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
74424
75014
  methods: {
74425
75015
  /**
74426
75016
  * Patch a single overlay by id. Provider handles read-modify-write
@@ -74894,7 +75484,7 @@ var petFeederCapability = {
74894
75484
  scope: "device",
74895
75485
  deviceNative: true,
74896
75486
  mode: "singleton",
74897
- deviceTypes: [require_device_type.DeviceType.PetFeeder],
75487
+ deviceTypes: [require_composed_stable_id.DeviceType.PetFeeder],
74898
75488
  methods: {
74899
75489
  /**
74900
75490
  * Dispense food now. Single-hopper feeders take `grams`; dual-hopper
@@ -75078,7 +75668,7 @@ var petFountainCapability = {
75078
75668
  scope: "device",
75079
75669
  deviceNative: true,
75080
75670
  mode: "singleton",
75081
- deviceTypes: [require_device_type.DeviceType.PetFountain],
75671
+ deviceTypes: [require_composed_stable_id.DeviceType.PetFountain],
75082
75672
  methods: {
75083
75673
  /** Start or stop the pump. */
75084
75674
  setPump: require_sleep.method(zod.z.object({
@@ -77988,25 +78578,25 @@ var PowerMeterStatusSchema = zod.z.object({
77988
78578
  * camera and the like are left out: their draw is not what anyone meters.
77989
78579
  */
77990
78580
  var POWER_METER_DEVICE_TYPES = [
77991
- require_device_type.DeviceType.Sensor,
77992
- require_device_type.DeviceType.Switch,
77993
- require_device_type.DeviceType.Light,
77994
- require_device_type.DeviceType.Fan,
77995
- require_device_type.DeviceType.Climate,
77996
- require_device_type.DeviceType.Thermostat,
77997
- require_device_type.DeviceType.Humidifier,
77998
- require_device_type.DeviceType.WaterHeater,
77999
- require_device_type.DeviceType.MediaPlayer,
78000
- require_device_type.DeviceType.Washer,
78001
- require_device_type.DeviceType.Dryer,
78002
- require_device_type.DeviceType.Dishwasher,
78003
- require_device_type.DeviceType.Vacuum,
78004
- require_device_type.DeviceType.LawnMower,
78005
- require_device_type.DeviceType.PetFeeder,
78006
- require_device_type.DeviceType.Heater
78581
+ require_composed_stable_id.DeviceType.Sensor,
78582
+ require_composed_stable_id.DeviceType.Switch,
78583
+ require_composed_stable_id.DeviceType.Light,
78584
+ require_composed_stable_id.DeviceType.Fan,
78585
+ require_composed_stable_id.DeviceType.Climate,
78586
+ require_composed_stable_id.DeviceType.Thermostat,
78587
+ require_composed_stable_id.DeviceType.Humidifier,
78588
+ require_composed_stable_id.DeviceType.WaterHeater,
78589
+ require_composed_stable_id.DeviceType.MediaPlayer,
78590
+ require_composed_stable_id.DeviceType.Washer,
78591
+ require_composed_stable_id.DeviceType.Dryer,
78592
+ require_composed_stable_id.DeviceType.Dishwasher,
78593
+ require_composed_stable_id.DeviceType.Vacuum,
78594
+ require_composed_stable_id.DeviceType.LawnMower,
78595
+ require_composed_stable_id.DeviceType.PetFeeder,
78596
+ require_composed_stable_id.DeviceType.Heater
78007
78597
  ];
78008
78598
  /** Everything but a bare `Sensor`: a sensor that takes its reading from another sensor adds nothing. */
78009
- var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== require_device_type.DeviceType.Sensor);
78599
+ var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== require_composed_stable_id.DeviceType.Sensor);
78010
78600
  /** One scalar target per reading; each is sourced from a device of its own (D951). */
78011
78601
  function powerTarget(id, unit) {
78012
78602
  return {
@@ -78178,21 +78768,21 @@ var PowerSourceStateSchema = zod.z.object({
78178
78768
  lastFetchedAt: zod.z.number()
78179
78769
  });
78180
78770
  var POWER_SOURCE_DEVICE_TYPES = [
78181
- require_device_type.DeviceType.Gateway,
78182
- require_device_type.DeviceType.Hub,
78183
- require_device_type.DeviceType.Camera,
78184
- require_device_type.DeviceType.Sensor,
78185
- require_device_type.DeviceType.MediaPlayer,
78186
- require_device_type.DeviceType.Vacuum,
78187
- require_device_type.DeviceType.Generic,
78188
- require_device_type.DeviceType.Washer,
78189
- require_device_type.DeviceType.Dryer,
78190
- require_device_type.DeviceType.Dishwasher,
78191
- require_device_type.DeviceType.PetFountain,
78192
- require_device_type.DeviceType.Fan,
78193
- require_device_type.DeviceType.Humidifier,
78194
- require_device_type.DeviceType.Climate,
78195
- require_device_type.DeviceType.WaterHeater
78771
+ require_composed_stable_id.DeviceType.Gateway,
78772
+ require_composed_stable_id.DeviceType.Hub,
78773
+ require_composed_stable_id.DeviceType.Camera,
78774
+ require_composed_stable_id.DeviceType.Sensor,
78775
+ require_composed_stable_id.DeviceType.MediaPlayer,
78776
+ require_composed_stable_id.DeviceType.Vacuum,
78777
+ require_composed_stable_id.DeviceType.Generic,
78778
+ require_composed_stable_id.DeviceType.Washer,
78779
+ require_composed_stable_id.DeviceType.Dryer,
78780
+ require_composed_stable_id.DeviceType.Dishwasher,
78781
+ require_composed_stable_id.DeviceType.PetFountain,
78782
+ require_composed_stable_id.DeviceType.Fan,
78783
+ require_composed_stable_id.DeviceType.Humidifier,
78784
+ require_composed_stable_id.DeviceType.Climate,
78785
+ require_composed_stable_id.DeviceType.WaterHeater
78196
78786
  ];
78197
78787
  var powerSourceCustomize = {
78198
78788
  version: 1,
@@ -78299,7 +78889,7 @@ var presenceCapability = {
78299
78889
  scope: "device",
78300
78890
  deviceNative: true,
78301
78891
  mode: "singleton",
78302
- deviceTypes: [require_device_type.DeviceType.Presence],
78892
+ deviceTypes: [require_composed_stable_id.DeviceType.Presence],
78303
78893
  methods: {},
78304
78894
  status: {
78305
78895
  schema: PresenceStatusSchema,
@@ -78345,7 +78935,7 @@ var pressureSensorCapability = {
78345
78935
  scope: "device",
78346
78936
  deviceNative: true,
78347
78937
  mode: "singleton",
78348
- deviceTypes: [require_device_type.DeviceType.Sensor],
78938
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
78349
78939
  methods: {},
78350
78940
  status: {
78351
78941
  schema: PressureSensorStatusSchema,
@@ -78478,7 +79068,7 @@ var privacyMaskCapability = {
78478
79068
  scope: "device",
78479
79069
  deviceNative: true,
78480
79070
  mode: "singleton",
78481
- deviceTypes: [require_device_type.DeviceType.Camera],
79071
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
78482
79072
  deviceConfig: { ui: {
78483
79073
  kind: "widget",
78484
79074
  widgetId: "host/privacy-mask-grid",
@@ -78746,7 +79336,7 @@ var ptzCapability = {
78746
79336
  scope: "device",
78747
79337
  deviceNative: true,
78748
79338
  mode: "singleton",
78749
- deviceTypes: [require_device_type.DeviceType.Camera],
79339
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
78750
79340
  deviceConfig: { ui: {
78751
79341
  kind: "widget",
78752
79342
  widgetId: "host/ptz-panel",
@@ -78977,7 +79567,7 @@ var ptzAutotrackCapability = {
78977
79567
  */
78978
79568
  kind: "wrapper",
78979
79569
  defaultActive: false,
78980
- deviceTypes: [require_device_type.DeviceType.Camera],
79570
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
78981
79571
  deviceConfig: { ui: {
78982
79572
  kind: "widget",
78983
79573
  widgetId: "host/ptz-autotrack",
@@ -79085,7 +79675,7 @@ var pumpCycleCapability = {
79085
79675
  scope: "device",
79086
79676
  deviceNative: true,
79087
79677
  mode: "singleton",
79088
- deviceTypes: [require_device_type.DeviceType.PetFountain],
79678
+ deviceTypes: [require_composed_stable_id.DeviceType.PetFountain],
79089
79679
  methods: {
79090
79680
  /** Switch the on/off duty cycle on or off (off = the pump runs continuously). */
79091
79681
  setEnabled: require_sleep.method(zod.z.object({
@@ -79150,10 +79740,10 @@ var rebootCapability = {
79150
79740
  deviceNative: true,
79151
79741
  mode: "singleton",
79152
79742
  deviceTypes: [
79153
- require_device_type.DeviceType.Camera,
79154
- require_device_type.DeviceType.Sensor,
79155
- require_device_type.DeviceType.Switch,
79156
- require_device_type.DeviceType.Gateway
79743
+ require_composed_stable_id.DeviceType.Camera,
79744
+ require_composed_stable_id.DeviceType.Sensor,
79745
+ require_composed_stable_id.DeviceType.Switch,
79746
+ require_composed_stable_id.DeviceType.Gateway
79157
79747
  ],
79158
79748
  methods: { reboot: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.object({ success: zod.z.literal(true) }), {
79159
79749
  kind: "mutation",
@@ -79501,7 +80091,7 @@ var recordingCapability = {
79501
80091
  /** Recorded coverage is a property of a camera — the cap is meaningless on a
79502
80092
  * sensor, a button or an event emitter, and the `defaultActive` auto-bind
79503
80093
  * reads this to decide which devices it may claim. */
79504
- deviceTypes: [require_device_type.DeviceType.Camera],
80094
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
79505
80095
  methods: {
79506
80096
  /**
79507
80097
  * The sources this camera has, WITH the reason any of them cannot answer.
@@ -81098,7 +81688,7 @@ var videoclipsCapability = {
81098
81688
  /** A clip is a window over a camera's footage — the cap is meaningless on a
81099
81689
  * sensor, a button or an event emitter, and the `defaultActive` auto-bind
81100
81690
  * reads this to decide which devices it may claim. */
81101
- deviceTypes: [require_device_type.DeviceType.Camera],
81691
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
81102
81692
  /**
81103
81693
  * The Clips section of a camera's device details is FRAMEWORK-DERIVED (D14):
81104
81694
  * the aggregator turns this declaration into the `type:'widget'` section and
@@ -82333,7 +82923,7 @@ var recordingOnboardCapability = {
82333
82923
  scope: "device",
82334
82924
  deviceNative: true,
82335
82925
  mode: "singleton",
82336
- deviceTypes: [require_device_type.DeviceType.Camera],
82926
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
82337
82927
  deviceConfig: { ui: {
82338
82928
  kind: "derived-form",
82339
82929
  builderId: "recording-onboard",
@@ -82419,7 +83009,7 @@ var recordingSignalCapability = {
82419
83009
  scope: "device",
82420
83010
  deviceNative: true,
82421
83011
  mode: "singleton",
82422
- deviceTypes: [require_device_type.DeviceType.Camera],
83012
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
82423
83013
  methods: {
82424
83014
  /** The current level, straight from the slice the provider keeps fresh. */
82425
83015
  getStatus: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), RecordingSignalStatusSchema) },
@@ -82977,7 +83567,7 @@ var remoteCustomize = {
82977
83567
  id: "remote",
82978
83568
  cardinality: "config",
82979
83569
  vocabulary: { cap: "remote" },
82980
- deviceTypes: [require_device_type.DeviceType.MediaPlayer],
83570
+ deviceTypes: [require_composed_stable_id.DeviceType.MediaPlayer],
82981
83571
  apply: "add",
82982
83572
  readMethod: "getConfig",
82983
83573
  writeMethod: "setConfig"
@@ -83167,7 +83757,7 @@ var RUNNING_POWER_GLOBAL_DEFAULTS = {
83167
83757
  * moment it is on and stops drawing the moment it is off, so it needs neither
83168
83758
  * a long dwell nor a second sample. A type absent here keeps the global values.
83169
83759
  */
83170
- var RUNNING_POWER_DEFAULTS_BY_TYPE = { [require_device_type.DeviceType.MediaPlayer]: {
83760
+ var RUNNING_POWER_DEFAULTS_BY_TYPE = { [require_composed_stable_id.DeviceType.MediaPlayer]: {
83171
83761
  startDwellMs: 1e4,
83172
83762
  stopDwellMs: 1e4,
83173
83763
  minSamples: 1
@@ -83207,7 +83797,7 @@ var RunningFlipEventDataSchema = zod.z.object({
83207
83797
  since: zod.z.number().nullable(),
83208
83798
  phase: zod.z.string().nullable()
83209
83799
  });
83210
- var RUNNING_DEVICE_TYPES = Object.values(require_device_type.DeviceType);
83800
+ var RUNNING_DEVICE_TYPES = Object.values(require_composed_stable_id.DeviceType);
83211
83801
  /**
83212
83802
  * Customize offers "running" only where a job makes sense (D933): a cycle,
83213
83803
  * a clean, a mow, playback, or another appliance that is on and working.
@@ -83215,19 +83805,19 @@ var RUNNING_DEVICE_TYPES = Object.values(require_device_type.DeviceType);
83215
83805
  * natively; it just has no card.
83216
83806
  */
83217
83807
  var RUNNING_CUSTOMIZE_DEVICE_TYPES = [
83218
- require_device_type.DeviceType.Washer,
83219
- require_device_type.DeviceType.Dryer,
83220
- require_device_type.DeviceType.Dishwasher,
83221
- require_device_type.DeviceType.Vacuum,
83222
- require_device_type.DeviceType.LawnMower,
83223
- require_device_type.DeviceType.MediaPlayer,
83224
- require_device_type.DeviceType.WaterHeater,
83225
- require_device_type.DeviceType.Humidifier,
83226
- require_device_type.DeviceType.Fan,
83227
- require_device_type.DeviceType.Climate,
83228
- require_device_type.DeviceType.Thermostat,
83229
- require_device_type.DeviceType.PetFeeder,
83230
- require_device_type.DeviceType.Heater
83808
+ require_composed_stable_id.DeviceType.Washer,
83809
+ require_composed_stable_id.DeviceType.Dryer,
83810
+ require_composed_stable_id.DeviceType.Dishwasher,
83811
+ require_composed_stable_id.DeviceType.Vacuum,
83812
+ require_composed_stable_id.DeviceType.LawnMower,
83813
+ require_composed_stable_id.DeviceType.MediaPlayer,
83814
+ require_composed_stable_id.DeviceType.WaterHeater,
83815
+ require_composed_stable_id.DeviceType.Humidifier,
83816
+ require_composed_stable_id.DeviceType.Fan,
83817
+ require_composed_stable_id.DeviceType.Climate,
83818
+ require_composed_stable_id.DeviceType.Thermostat,
83819
+ require_composed_stable_id.DeviceType.PetFeeder,
83820
+ require_composed_stable_id.DeviceType.Heater
83231
83821
  ];
83232
83822
  var runningStateCapability = {
83233
83823
  name: "running-state",
@@ -83594,7 +84184,7 @@ var sceneMonitorCapability = {
83594
84184
  mode: "singleton",
83595
84185
  kind: "wrapper",
83596
84186
  defaultActive: true,
83597
- deviceTypes: [require_device_type.DeviceType.Camera],
84187
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
83598
84188
  methods: {
83599
84189
  listScenes: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), SceneMonitorStatusSchema),
83600
84190
  /**
@@ -83829,7 +84419,7 @@ var scriptRunnerCapability = {
83829
84419
  scope: "device",
83830
84420
  deviceNative: true,
83831
84421
  mode: "singleton",
83832
- deviceTypes: [require_device_type.DeviceType.Script],
84422
+ deviceTypes: [require_composed_stable_id.DeviceType.Script],
83833
84423
  methods: {
83834
84424
  run: require_sleep.method(zod.z.object({
83835
84425
  deviceId: zod.z.number().int().nonnegative(),
@@ -84426,7 +85016,7 @@ var smokeCapability = {
84426
85016
  scope: "device",
84427
85017
  deviceNative: true,
84428
85018
  mode: "singleton",
84429
- deviceTypes: [require_device_type.DeviceType.Sensor],
85019
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
84430
85020
  methods: {},
84431
85021
  status: {
84432
85022
  schema: SmokeStatusSchema,
@@ -84580,7 +85170,7 @@ var snapshotCapability = {
84580
85170
  mode: "singleton",
84581
85171
  kind: "wrapper",
84582
85172
  defaultActive: true,
84583
- deviceTypes: [require_device_type.DeviceType.Camera],
85173
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
84584
85174
  exposesDeviceSettings: true,
84585
85175
  methods: {
84586
85176
  getSnapshot: require_sleep.method(zod.z.object({
@@ -85602,7 +86192,7 @@ var streamCatalogCapability = {
85602
86192
  scope: "device",
85603
86193
  deviceNative: true,
85604
86194
  mode: "singleton",
85605
- deviceTypes: [require_device_type.DeviceType.Camera],
86195
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
85606
86196
  methods: { getCatalog: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.array(CamStreamDescriptorSchema).readonly()) },
85607
86197
  runtimeState: StreamCatalogStateSchema,
85608
86198
  /**
@@ -85724,7 +86314,7 @@ var streamParamsCapability = {
85724
86314
  scope: "device",
85725
86315
  deviceNative: true,
85726
86316
  mode: "singleton",
85727
- deviceTypes: [require_device_type.DeviceType.Camera],
86317
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
85728
86318
  deviceConfig: { ui: {
85729
86319
  kind: "derived-form",
85730
86320
  builderId: "stream-params",
@@ -85859,7 +86449,7 @@ var streamSignalsCapability = {
85859
86449
  scope: "device",
85860
86450
  deviceNative: true,
85861
86451
  mode: "singleton",
85862
- deviceTypes: Object.values(require_device_type.DeviceType),
86452
+ deviceTypes: Object.values(require_composed_stable_id.DeviceType),
85863
86453
  runtimeState: StreamSignalsStatusSchema,
85864
86454
  /**
85865
86455
  * Runtime-state durability: **session** — mirrored in RAM, never written.
@@ -85912,11 +86502,11 @@ var switchCapability = {
85912
86502
  deviceNative: true,
85913
86503
  mode: "singleton",
85914
86504
  deviceTypes: [
85915
- require_device_type.DeviceType.Switch,
85916
- require_device_type.DeviceType.Siren,
85917
- require_device_type.DeviceType.Light,
85918
- require_device_type.DeviceType.Fan,
85919
- require_device_type.DeviceType.Heater
86505
+ require_composed_stable_id.DeviceType.Switch,
86506
+ require_composed_stable_id.DeviceType.Siren,
86507
+ require_composed_stable_id.DeviceType.Light,
86508
+ require_composed_stable_id.DeviceType.Fan,
86509
+ require_composed_stable_id.DeviceType.Heater
85920
86510
  ],
85921
86511
  methods: { setState: require_sleep.method(zod.z.object({
85922
86512
  deviceId: zod.z.number(),
@@ -86730,7 +87320,7 @@ var tamperCapability = {
86730
87320
  scope: "device",
86731
87321
  deviceNative: true,
86732
87322
  mode: "singleton",
86733
- deviceTypes: [require_device_type.DeviceType.Sensor],
87323
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
86734
87324
  methods: {},
86735
87325
  status: {
86736
87326
  schema: TamperStatusSchema,
@@ -86780,7 +87370,7 @@ var temperatureSensorCapability = {
86780
87370
  scope: "device",
86781
87371
  deviceNative: true,
86782
87372
  mode: "singleton",
86783
- deviceTypes: [require_device_type.DeviceType.Sensor, require_device_type.DeviceType.Thermostat],
87373
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor, require_composed_stable_id.DeviceType.Thermostat],
86784
87374
  methods: {},
86785
87375
  status: {
86786
87376
  schema: TemperatureSensorStatusSchema,
@@ -87798,7 +88388,7 @@ var updateCapability = {
87798
88388
  scope: "device",
87799
88389
  deviceNative: true,
87800
88390
  mode: "singleton",
87801
- deviceTypes: [require_device_type.DeviceType.Update],
88391
+ deviceTypes: [require_composed_stable_id.DeviceType.Update],
87802
88392
  methods: { installUpdate: require_sleep.method(zod.z.void(), zod.z.void(), {
87803
88393
  kind: "mutation",
87804
88394
  auth: "admin"
@@ -88265,7 +88855,7 @@ var vacuumControlCapability = {
88265
88855
  scope: "device",
88266
88856
  deviceNative: true,
88267
88857
  mode: "singleton",
88268
- deviceTypes: [require_device_type.DeviceType.Vacuum],
88858
+ deviceTypes: [require_composed_stable_id.DeviceType.Vacuum],
88269
88859
  methods: {
88270
88860
  start: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
88271
88861
  kind: "mutation",
@@ -88361,7 +88951,7 @@ var valveCapability = {
88361
88951
  scope: "device",
88362
88952
  deviceNative: true,
88363
88953
  mode: "singleton",
88364
- deviceTypes: [require_device_type.DeviceType.Valve],
88954
+ deviceTypes: [require_composed_stable_id.DeviceType.Valve],
88365
88955
  methods: {
88366
88956
  open: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), zod.z.void(), {
88367
88957
  kind: "mutation",
@@ -88742,7 +89332,7 @@ var vibrationCapability = {
88742
89332
  scope: "device",
88743
89333
  deviceNative: true,
88744
89334
  mode: "singleton",
88745
- deviceTypes: [require_device_type.DeviceType.Sensor],
89335
+ deviceTypes: [require_composed_stable_id.DeviceType.Sensor],
88746
89336
  methods: {},
88747
89337
  status: {
88748
89338
  schema: VibrationStatusSchema,
@@ -88811,7 +89401,7 @@ var waterHeaterCapability = {
88811
89401
  scope: "device",
88812
89402
  deviceNative: true,
88813
89403
  mode: "singleton",
88814
- deviceTypes: [require_device_type.DeviceType.WaterHeater],
89404
+ deviceTypes: [require_composed_stable_id.DeviceType.WaterHeater],
88815
89405
  methods: {
88816
89406
  setTargetTemp: require_sleep.method(zod.z.object({
88817
89407
  deviceId: zod.z.number().int().nonnegative(),
@@ -88910,7 +89500,7 @@ var weatherCapability = {
88910
89500
  scope: "device",
88911
89501
  deviceNative: true,
88912
89502
  mode: "singleton",
88913
- deviceTypes: [require_device_type.DeviceType.Weather],
89503
+ deviceTypes: [require_composed_stable_id.DeviceType.Weather],
88914
89504
  methods: {},
88915
89505
  status: {
88916
89506
  schema: WeatherStatusSchema,
@@ -89240,7 +89830,7 @@ var webrtcSessionCapability = {
89240
89830
  kind: "wrapper",
89241
89831
  defaultActive: true,
89242
89832
  preferredProvider: "stream-broker",
89243
- deviceTypes: [require_device_type.DeviceType.Camera],
89833
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
89244
89834
  methods: {
89245
89835
  /**
89246
89836
  * List available WebRTC streams for a device.
@@ -89716,7 +90306,7 @@ var zoneAnalyticsCapability = {
89716
90306
  name: "zone-analytics",
89717
90307
  scope: "device",
89718
90308
  mode: "singleton",
89719
- deviceTypes: [require_device_type.DeviceType.Camera],
90309
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
89720
90310
  methods: {
89721
90311
  /** Latest computed occupancy snapshot for this camera. Null when
89722
90312
  * the analytics pipeline hasn't seen a frame for this device yet
@@ -89917,7 +90507,7 @@ var zoneRulesCapability = {
89917
90507
  name: "zone-rules",
89918
90508
  scope: "device",
89919
90509
  mode: "singleton",
89920
- deviceTypes: [require_device_type.DeviceType.Camera],
90510
+ deviceTypes: [require_composed_stable_id.DeviceType.Camera],
89921
90511
  methods: {
89922
90512
  /** Read the full rule list for a given stage (empty when no rules
89923
90513
  * are defined yet). */
@@ -91228,7 +91818,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
91228
91818
  * step appears (an automation's actions, an action's steps, a scheduler
91229
91819
  * point's steps), and leaves everything else untouched.
91230
91820
  */
91231
- function isRecord$3(value) {
91821
+ function isRecord$2(value) {
91232
91822
  return typeof value === "object" && value !== null && !Array.isArray(value);
91233
91823
  }
91234
91824
  function expandStep(step) {
@@ -91236,7 +91826,7 @@ function expandStep(step) {
91236
91826
  if (step["kind"] !== "cap" || typeof actionId !== "string") return step;
91237
91827
  const found = require_sleep.findVocabAction(actionId);
91238
91828
  if (found === void 0) return step;
91239
- const given = isRecord$3(step["args"]) ? step["args"] : {};
91829
+ const given = isRecord$2(step["args"]) ? step["args"] : {};
91240
91830
  const args = {
91241
91831
  ...found.action.args,
91242
91832
  ...given
@@ -91250,7 +91840,7 @@ function expandStep(step) {
91250
91840
  }
91251
91841
  function expandDraft(value) {
91252
91842
  if (Array.isArray(value)) return value.map(expandDraft);
91253
- if (!isRecord$3(value)) return value;
91843
+ if (!isRecord$2(value)) return value;
91254
91844
  return expandStep(Object.fromEntries(Object.entries(value).map(([k, v]) => [k, expandDraft(v)])));
91255
91845
  }
91256
91846
  //#endregion
@@ -91337,7 +91927,7 @@ function normalise(kind, json) {
91337
91927
  /** A stable string for ordering a set's elements. */
91338
91928
  function keyOf(value) {
91339
91929
  if (Array.isArray(value)) return `[${value.map(keyOf).join(",")}]`;
91340
- if (isRecord$3(value)) return `{${Object.keys(value).filter((k) => !IGNORED_KEYS.has(k)).toSorted().map((k) => `${k}:${keyOf(value[k])}`).join(",")}}`;
91930
+ if (isRecord$2(value)) return `{${Object.keys(value).filter((k) => !IGNORED_KEYS.has(k)).toSorted().map((k) => `${k}:${keyOf(value[k])}`).join(",")}}`;
91341
91931
  if (typeof value === "string") return JSON.stringify(value.trim().toLowerCase());
91342
91932
  if (typeof value === "number") return String(Math.round(value * DECIMALS) / DECIMALS);
91343
91933
  return JSON.stringify(value) ?? "undefined";
@@ -91414,7 +92004,7 @@ function score(a, b, key) {
91414
92004
  misses: missOf(key)
91415
92005
  };
91416
92006
  if (Array.isArray(a) && Array.isArray(b)) return SET_KEYS.has(key) ? setScore(a, b, key) : orderedScore(a, b, key);
91417
- if (isRecord$3(a) && isRecord$3(b)) return objectScore(a, b);
92007
+ if (isRecord$2(a) && isRecord$2(b)) return objectScore(a, b);
91418
92008
  return keyOf(a) === keyOf(b) ? SAME : {
91419
92009
  score: 0,
91420
92010
  misses: missOf(key)
@@ -92352,7 +92942,7 @@ function stepIssues(site, step, at) {
92352
92942
  }
92353
92943
  function describeSource(site) {
92354
92944
  return new Map(site.devices.map((d) => {
92355
- const type = Object.values(require_device_type.DeviceType).find((t) => t === d.type);
92945
+ const type = Object.values(require_composed_stable_id.DeviceType).find((t) => t === d.type);
92356
92946
  const found = {
92357
92947
  kind: "found",
92358
92948
  deviceId: d.id,
@@ -92364,7 +92954,7 @@ function describeSource(site) {
92364
92954
  }
92365
92955
  function describeTarget(site, ref) {
92366
92956
  const device = site.devices.find((d) => d.addonId === ref.addonId && d.stableId === ref.stableId);
92367
- const type = Object.values(require_device_type.DeviceType).find((t) => t === device?.type);
92957
+ const type = Object.values(require_composed_stable_id.DeviceType).find((t) => t === device?.type);
92368
92958
  if (device === void 0 || type === void 0) return { kind: "absent" };
92369
92959
  return {
92370
92960
  kind: "found",
@@ -92463,7 +93053,7 @@ function validateCompositionDraft(site, json) {
92463
93053
  };
92464
93054
  }
92465
93055
  function validateDraft(kind, json, site) {
92466
- if (!isRecord$3(json)) return {
93056
+ if (!isRecord$2(json)) return {
92467
93057
  ok: false,
92468
93058
  issues: ["(root): the draft must be one JSON object"]
92469
93059
  };
@@ -93690,17 +94280,17 @@ function remoteRoleLabel(role, locale) {
93690
94280
  * exporter deciding what to offer.
93691
94281
  */
93692
94282
  var FEATURE_ROLES = [
93693
- [require_device_type.DeviceFeature.MediaPlayerPower, [
94283
+ [require_composed_stable_id.DeviceFeature.MediaPlayerPower, [
93694
94284
  "power",
93695
94285
  "power_on",
93696
94286
  "power_off"
93697
94287
  ]],
93698
- [require_device_type.DeviceFeature.MediaPlayerVolumeStep, ["volume_up", "volume_down"]],
93699
- [require_device_type.DeviceFeature.MediaPlayerChannelStep, ["channel_up", "channel_down"]],
93700
- [require_device_type.DeviceFeature.MediaPlayerMute, ["mute"]],
93701
- [require_device_type.DeviceFeature.MediaPlayerStop, ["stop"]],
93702
- [require_device_type.DeviceFeature.MediaPlayerNext, ["next"]],
93703
- [require_device_type.DeviceFeature.MediaPlayerPrevious, ["previous"]]
94288
+ [require_composed_stable_id.DeviceFeature.MediaPlayerVolumeStep, ["volume_up", "volume_down"]],
94289
+ [require_composed_stable_id.DeviceFeature.MediaPlayerChannelStep, ["channel_up", "channel_down"]],
94290
+ [require_composed_stable_id.DeviceFeature.MediaPlayerMute, ["mute"]],
94291
+ [require_composed_stable_id.DeviceFeature.MediaPlayerStop, ["stop"]],
94292
+ [require_composed_stable_id.DeviceFeature.MediaPlayerNext, ["next"]],
94293
+ [require_composed_stable_id.DeviceFeature.MediaPlayerPrevious, ["previous"]]
93704
94294
  ];
93705
94295
  /**
93706
94296
  * The features the bound roles stand for, in a stable order. A source surface
@@ -93710,7 +94300,7 @@ var FEATURE_ROLES = [
93710
94300
  function mediaPlayerFeaturesOfRoles(roles, declaredSources) {
93711
94301
  const bound = new Set(roles);
93712
94302
  const fixed = FEATURE_ROLES.filter(([, wanted]) => wanted.some((role) => bound.has(role))).map(([feature]) => feature);
93713
- return declaredSources > 0 ? [...fixed, require_device_type.DeviceFeature.MediaPlayerSelectSource] : fixed;
94303
+ return declaredSources > 0 ? [...fixed, require_composed_stable_id.DeviceFeature.MediaPlayerSelectSource] : fixed;
93714
94304
  }
93715
94305
  //#endregion
93716
94306
  //#region src/remote/remote-layout-ops.ts
@@ -94665,9 +95255,9 @@ var PAUSE_MAX_MS = 30 * MINUTE_MS$1;
94665
95255
  var MIN_RUN_MS = 10 * MINUTE_MS$1;
94666
95256
  /** What a kind needs at least before it is called stopped: a soak pause is longer for a washer. */
94667
95257
  var STOP_FLOOR_BY_KIND = {
94668
- [require_device_type.DeviceType.Dryer]: 3 * MINUTE_MS$1,
94669
- [require_device_type.DeviceType.Dishwasher]: 3 * MINUTE_MS$1,
94670
- [require_device_type.DeviceType.Washer]: 10 * MINUTE_MS$1
95258
+ [require_composed_stable_id.DeviceType.Dryer]: 3 * MINUTE_MS$1,
95259
+ [require_composed_stable_id.DeviceType.Dishwasher]: 3 * MINUTE_MS$1,
95260
+ [require_composed_stable_id.DeviceType.Washer]: 10 * MINUTE_MS$1
94671
95261
  };
94672
95262
  var START_STEP_MS = 10 * SECOND_MS;
94673
95263
  var START_MIN_MS = 10 * SECOND_MS;
@@ -95246,33 +95836,33 @@ var ACTUATOR_METHODS = {
95246
95836
  ],
95247
95837
  fan: [
95248
95838
  row$2("switch", "setState"),
95249
- row$2("fan-control", "setPercentage", require_device_type.DeviceFeature.FanSpeed),
95250
- row$2("fan-control", "setPreset", require_device_type.DeviceFeature.FanPreset),
95251
- row$2("fan-control", "setDirection", require_device_type.DeviceFeature.FanDirection),
95252
- row$2("fan-control", "setOscillating", require_device_type.DeviceFeature.FanOscillating)
95839
+ row$2("fan-control", "setPercentage", require_composed_stable_id.DeviceFeature.FanSpeed),
95840
+ row$2("fan-control", "setPreset", require_composed_stable_id.DeviceFeature.FanPreset),
95841
+ row$2("fan-control", "setDirection", require_composed_stable_id.DeviceFeature.FanDirection),
95842
+ row$2("fan-control", "setOscillating", require_composed_stable_id.DeviceFeature.FanOscillating)
95253
95843
  ],
95254
95844
  cover: [
95255
95845
  row$2("cover", "open"),
95256
95846
  row$2("cover", "close"),
95257
- row$2("cover", "stop", require_device_type.DeviceFeature.CoverStoppable),
95258
- row$2("cover", "setPosition", require_device_type.DeviceFeature.CoverPositionable),
95259
- row$2("cover", "setTiltPosition", require_device_type.DeviceFeature.CoverTilt)
95847
+ row$2("cover", "stop", require_composed_stable_id.DeviceFeature.CoverStoppable),
95848
+ row$2("cover", "setPosition", require_composed_stable_id.DeviceFeature.CoverPositionable),
95849
+ row$2("cover", "setTiltPosition", require_composed_stable_id.DeviceFeature.CoverTilt)
95260
95850
  ],
95261
95851
  valve: [
95262
95852
  row$2("valve", "open"),
95263
95853
  row$2("valve", "close"),
95264
- row$2("valve", "setPosition", require_device_type.DeviceFeature.ValvePositionable)
95854
+ row$2("valve", "setPosition", require_composed_stable_id.DeviceFeature.ValvePositionable)
95265
95855
  ],
95266
95856
  lock: [row$2("lock-control", "lock"), row$2("lock-control", "unlock", null, true)],
95267
95857
  "media-player": [
95268
95858
  row$2("media-player", "play"),
95269
95859
  row$2("media-player", "pause"),
95270
- row$2("media-player", "setVolume", require_device_type.DeviceFeature.MediaPlayerVolume)
95860
+ row$2("media-player", "setVolume", require_composed_stable_id.DeviceFeature.MediaPlayerVolume)
95271
95861
  ],
95272
95862
  climate: [
95273
95863
  row$2("climate-control", "setMode"),
95274
95864
  row$2("climate-control", "setTarget"),
95275
- row$2("climate-control", "setFanMode", require_device_type.DeviceFeature.ClimateFanMode)
95865
+ row$2("climate-control", "setFanMode", require_composed_stable_id.DeviceFeature.ClimateFanMode)
95276
95866
  ]
95277
95867
  };
95278
95868
  function actuatorMethodRow(templateId, cap, method) {
@@ -95508,7 +96098,7 @@ function sourcePickForHeaterPlug() {
95508
96098
  purpose: "member",
95509
96099
  multiple: false,
95510
96100
  max: 1,
95511
- deviceTypes: [require_device_type.DeviceType.Switch],
96101
+ deviceTypes: [require_composed_stable_id.DeviceType.Switch],
95512
96102
  accept: [{
95513
96103
  cap: "switch",
95514
96104
  fieldPath: "on",
@@ -96122,8 +96712,8 @@ function roomCompositionExample(input) {
96122
96712
  return require_composition.CompositionSchema.parse({
96123
96713
  target: {
96124
96714
  kind: "new",
96125
- type: require_device_type.DeviceType.Sensor,
96126
- role: require_device_type.DeviceRole.TemperatureSensor
96715
+ type: require_composed_stable_id.DeviceType.Sensor,
96716
+ role: require_composed_stable_id.DeviceRole.TemperatureSensor
96127
96717
  },
96128
96718
  features: [{
96129
96719
  kind: "fields",
@@ -96549,7 +97139,7 @@ function petFountainFromEntitiesComposition(sources) {
96549
97139
  return require_composition.CompositionSchema.parse({
96550
97140
  target: {
96551
97141
  kind: "new",
96552
- type: require_device_type.DeviceType.PetFountain
97142
+ type: require_composed_stable_id.DeviceType.PetFountain
96553
97143
  },
96554
97144
  features: [
96555
97145
  {
@@ -98001,8 +98591,8 @@ function formulaProblem(expr, bindings) {
98001
98591
  * Map a device role to the primary composition cap (D939).
98002
98592
  */
98003
98593
  var ROLE_CAP_ALIASES = {
98004
- [require_device_type.DeviceRole.BinarySensor]: "binary",
98005
- [require_device_type.DeviceRole.MotionSensor]: "motion"
98594
+ [require_composed_stable_id.DeviceRole.BinarySensor]: "binary",
98595
+ [require_composed_stable_id.DeviceRole.MotionSensor]: "motion"
98006
98596
  };
98007
98597
  var KNOWN_CAPS = new Set(require_sleep.CAP_NAMES);
98008
98598
  function primaryCapForRole(role) {
@@ -98330,14 +98920,14 @@ function paletteLegend() {
98330
98920
  * any role works, including non-accessory ones like Doorbell).
98331
98921
  */
98332
98922
  var AccessoryKind = {
98333
- Siren: require_device_type.DeviceRole.Siren,
98334
- Floodlight: require_device_type.DeviceRole.Floodlight,
98335
- Spotlight: require_device_type.DeviceRole.Spotlight,
98336
- PirSensor: require_device_type.DeviceRole.PirSensor,
98337
- Chime: require_device_type.DeviceRole.Chime,
98338
- Autotrack: require_device_type.DeviceRole.Autotrack,
98339
- Nightvision: require_device_type.DeviceRole.Nightvision,
98340
- PrivacyMask: require_device_type.DeviceRole.PrivacyMask
98923
+ Siren: require_composed_stable_id.DeviceRole.Siren,
98924
+ Floodlight: require_composed_stable_id.DeviceRole.Floodlight,
98925
+ Spotlight: require_composed_stable_id.DeviceRole.Spotlight,
98926
+ PirSensor: require_composed_stable_id.DeviceRole.PirSensor,
98927
+ Chime: require_composed_stable_id.DeviceRole.Chime,
98928
+ Autotrack: require_composed_stable_id.DeviceRole.Autotrack,
98929
+ Nightvision: require_composed_stable_id.DeviceRole.Nightvision,
98930
+ PrivacyMask: require_composed_stable_id.DeviceRole.PrivacyMask
98341
98931
  };
98342
98932
  /**
98343
98933
  * Default English label for each accessory kind. Drivers append this
@@ -99500,7 +100090,7 @@ var BaseDeviceProvider = class extends require_sleep.BaseAddon {
99500
100090
  */
99501
100091
  async getManualCreationType(_input) {
99502
100092
  if (!await this.supportsManualCreation()) return { deviceType: null };
99503
- return { deviceType: Object.values(require_device_type.DeviceType).find((t) => this.deviceClasses[t] !== void 0) ?? null };
100093
+ return { deviceType: Object.values(require_composed_stable_id.DeviceType).find((t) => this.deviceClasses[t] !== void 0) ?? null };
99504
100094
  }
99505
100095
  async adoptDiscoveredDevice(_input) {
99506
100096
  throw new Error(`${this.providerName} provider does not support discovery-based adoption`);
@@ -99764,14 +100354,14 @@ var BaseDeviceProvider = class extends require_sleep.BaseAddon {
99764
100354
  });
99765
100355
  const meta = await this.ctx.api.deviceManager.loadMeta.query({ deviceId: id });
99766
100356
  if (meta === null) throw new Error(`${this.providerName}: no persisted meta for "${stableId}" (id ${id}) — cannot reload`);
99767
- const deviceType = Object.values(require_device_type.DeviceType).find((t) => t === meta.type);
100357
+ const deviceType = Object.values(require_composed_stable_id.DeviceType).find((t) => t === meta.type);
99768
100358
  const Class = deviceType !== void 0 ? this.deviceClasses[deviceType] : void 0;
99769
100359
  if (!Class) throw new Error(`${this.providerName}: no device class for type "${meta.type}" — "${stableId}" is an accessory child; reload its parent instead`);
99770
100360
  await devices.create(stableId, Class, {}, meta.parentDeviceId ?? null);
99771
100361
  const rows = await this.ctx.api.deviceManager.listPersistedByAddon.query({ addonId: this.addonId });
99772
100362
  for (const row of rows) {
99773
100363
  if (row.parentDeviceId !== id) continue;
99774
- const childType = Object.values(require_device_type.DeviceType).find((t) => t === row.type);
100364
+ const childType = Object.values(require_composed_stable_id.DeviceType).find((t) => t === row.type);
99775
100365
  const ChildClass = childType !== void 0 ? this.deviceClasses[childType] : void 0;
99776
100366
  if (!ChildClass) continue;
99777
100367
  try {
@@ -100036,12 +100626,42 @@ function isBatteryPresenceFault(presence) {
100036
100626
  * priority-in-sync.ts` fails the build when either drifts — the comment that
100037
100627
  * used to ask for this could not.
100038
100628
  *
100039
- * The rule has two halves and the ORDER matters: an operator's explicit pick
100040
- * wins outright, and only in its absence does type priority decide. The pick is
100041
- * keyed on the child's re-sync-stable `entityId`, not its numeric id, so it
100042
- * survives a re-sync that reallocates ids.
100629
+ * The rule has three halves and the ORDER matters: an operator's explicit pick
100630
+ * wins outright; else a declaration on the device type
100631
+ * ({@link CONTAINER_PRIMARY_CHILD_RULES}); else role, namesake, then type
100632
+ * priority. The pick is keyed on the child's re-sync-stable `entityId`, not
100633
+ * its numeric id, so it survives a re-sync that reallocates ids.
100043
100634
  */
100044
100635
  /**
100636
+ * Device types that name their primary child. A heat pump stands for itself:
100637
+ * its hero is the system row, not the climate circuit that type-rank would
100638
+ * otherwise pick.
100639
+ */
100640
+ var CONTAINER_PRIMARY_CHILD_RULES = [{
100641
+ deviceType: require_composed_stable_id.DeviceType.HeatPump,
100642
+ primary: "self"
100643
+ }];
100644
+ /**
100645
+ * The type declaration, before the heuristic. `fall-through` means the
100646
+ * heuristic still decides: the type declared nothing, or it named a child
100647
+ * type that is not among the children.
100648
+ */
100649
+ function declaredChildType(primary) {
100650
+ if (primary === "self") return void 0;
100651
+ return primary.childType;
100652
+ }
100653
+ function applyPrimaryChildRule(rule, children) {
100654
+ if (rule === void 0) return { kind: "fall-through" };
100655
+ const childType = declaredChildType(rule.primary);
100656
+ if (childType === void 0) return { kind: "none" };
100657
+ const match = children.find((child) => child.type === childType);
100658
+ if (match === void 0) return { kind: "fall-through" };
100659
+ return {
100660
+ kind: "child",
100661
+ child: match
100662
+ };
100663
+ }
100664
+ /**
100045
100665
  * Type priority, most→least "primary". An actuator (climate / lock / cover / …)
100046
100666
  * outranks a bare `switch` so a container's defining child wins over its
100047
100667
  * auxiliary switches. Unknown or absent types sort after every entry.
@@ -100128,9 +100748,10 @@ function rank(type) {
100128
100748
  }
100129
100749
  /**
100130
100750
  * The child a container stands for: the operator's pick when it still exists,
100131
- * else the highest-priority type. `null` for a childless container — a caller
100132
- * must decide what an empty container means for it, rather than being handed a
100133
- * child that is not there.
100751
+ * else the device type's declaration, else the highest-priority type. `null`
100752
+ * for a childless container, and for a type that stands for itself — a caller
100753
+ * must decide what "no child" means for it, rather than being handed a child
100754
+ * that is not the device.
100134
100755
  */
100135
100756
  /**
100136
100757
  * Two names for the same thing, compared the way an integration writes them.
@@ -100159,11 +100780,14 @@ function sameName(childName, containerName) {
100159
100780
  const flatten = (v) => v.toLowerCase().replace(/[-_\s]+/g, " ").trim();
100160
100781
  return flatten(childName) === flatten(containerName);
100161
100782
  }
100162
- function resolveContainerPrimaryChild(children, overrideEntityId, containerName) {
100783
+ function resolveContainerPrimaryChild(children, overrideEntityId, containerName, containerType) {
100163
100784
  if (overrideEntityId !== void 0 && overrideEntityId !== null) {
100164
100785
  const picked = children.find((c) => c.stableId === overrideEntityId) ?? children.find((c) => c.entityId !== void 0 && c.entityId === overrideEntityId);
100165
100786
  if (picked !== void 0) return picked;
100166
100787
  }
100788
+ const declared = applyPrimaryChildRule(CONTAINER_PRIMARY_CHILD_RULES.find((entry) => entry.deviceType === containerType), children);
100789
+ if (declared.kind === "none") return null;
100790
+ if (declared.kind === "child") return declared.child;
100167
100791
  const namesake = (c) => containerName !== void 0 && containerName.length > 0 && c.name !== void 0 && sameName(c.name, containerName) ? 0 : 1;
100168
100792
  return [...children].toSorted((a, b) => roleRank(a.role) - roleRank(b.role) || namesake(a) - namesake(b) || rank(a.type) - rank(b.type))[0] ?? null;
100169
100793
  }
@@ -100201,7 +100825,7 @@ function expandContainer(id, byId, byParent, visited, out) {
100201
100825
  if (visited.has(id)) return;
100202
100826
  const candidate = byId.get(id);
100203
100827
  if (!candidate) return;
100204
- if (candidate.type !== require_device_type.DeviceType.Container) {
100828
+ if (candidate.type !== require_composed_stable_id.DeviceType.Container) {
100205
100829
  out.add(id);
100206
100830
  return;
100207
100831
  }
@@ -100213,7 +100837,7 @@ function expandContainer(id, byId, byParent, visited, out) {
100213
100837
  type: c.type,
100214
100838
  ...c.role !== void 0 && c.role !== null ? { role: c.role } : {},
100215
100839
  ...c.name !== void 0 ? { name: c.name } : {}
100216
- })), byId.get(id)?.primaryChildEntityId, byId.get(id)?.name);
100840
+ })), byId.get(id)?.primaryChildEntityId, byId.get(id)?.name, candidate.type);
100217
100841
  if (primary !== null) expandContainer(primary.id, byId, byParent, nextVisited, out);
100218
100842
  }
100219
100843
  /**
@@ -100245,11 +100869,11 @@ function legacyAutoLinkIds(params) {
100245
100869
  const ids = /* @__PURE__ */ new Set();
100246
100870
  const expand = (id) => expandContainer(id, byId, byParent, /* @__PURE__ */ new Set(), ids);
100247
100871
  for (const c of candidates) {
100248
- if (c.type === require_device_type.DeviceType.Container) continue;
100872
+ if (c.type === require_composed_stable_id.DeviceType.Container) continue;
100249
100873
  if (c.location !== selfLocation) continue;
100250
100874
  if (c.parentDeviceId === selfId) continue;
100251
100875
  const parent = c.parentDeviceId !== null ? byId.get(c.parentDeviceId) : void 0;
100252
- if (parent !== void 0 && parent.type === require_device_type.DeviceType.Container) {
100876
+ if (parent !== void 0 && parent.type === require_composed_stable_id.DeviceType.Container) {
100253
100877
  expand(parent.id);
100254
100878
  continue;
100255
100879
  }
@@ -100398,7 +101022,7 @@ var DeclaredDevices = class {
100398
101022
  } catch (err) {
100399
101023
  this.ports.logger.warn("could not seed the instance record of a declared integration", {
100400
101024
  tags: { integrationId: integration.id },
100401
- meta: { error: require_device_type.errMsg(err) }
101025
+ meta: { error: require_composed_stable_id.errMsg(err) }
100402
101026
  });
100403
101027
  }
100404
101028
  }
@@ -100708,46 +101332,46 @@ function widenDeviceConstructor(ctor) {
100708
101332
  * placeholder HA types whose inline control renders a dash).
100709
101333
  */
100710
101334
  var DEVICE_TYPE_CONTROL_KIND = {
100711
- [require_device_type.DeviceType.Cover]: "cover",
100712
- [require_device_type.DeviceType.Valve]: "valve",
100713
- [require_device_type.DeviceType.Humidifier]: "humidifier",
100714
- [require_device_type.DeviceType.WaterHeater]: "water-heater",
100715
- [require_device_type.DeviceType.HeatPump]: "dummy",
100716
- [require_device_type.DeviceType.Camera]: "dummy",
100717
- [require_device_type.DeviceType.Hub]: "dummy",
100718
- [require_device_type.DeviceType.Switch]: "switch",
100719
- [require_device_type.DeviceType.Siren]: "switch",
100720
- [require_device_type.DeviceType.Light]: "light",
100721
- [require_device_type.DeviceType.Fan]: "fan",
100722
- [require_device_type.DeviceType.Sensor]: "sensor",
100723
- [require_device_type.DeviceType.Thermostat]: "thermostat",
100724
- [require_device_type.DeviceType.Climate]: "climate",
100725
- [require_device_type.DeviceType.Button]: "button",
100726
- [require_device_type.DeviceType.EventEmitter]: "dummy",
100727
- [require_device_type.DeviceType.Update]: "update",
100728
- [require_device_type.DeviceType.Generic]: "dummy",
100729
- [require_device_type.DeviceType.Notifier]: "dummy",
100730
- [require_device_type.DeviceType.Script]: "script",
100731
- [require_device_type.DeviceType.Automation]: "automation",
100732
- [require_device_type.DeviceType.Lock]: "lock",
100733
- [require_device_type.DeviceType.MediaPlayer]: "media-player",
100734
- [require_device_type.DeviceType.AlarmPanel]: "alarm",
100735
- [require_device_type.DeviceType.Control]: "control",
100736
- [require_device_type.DeviceType.Presence]: "sensor",
100737
- [require_device_type.DeviceType.Weather]: "weather",
100738
- [require_device_type.DeviceType.Vacuum]: "vacuum",
100739
- [require_device_type.DeviceType.LawnMower]: "lawn-mower",
100740
- [require_device_type.DeviceType.Container]: "dummy",
100741
- [require_device_type.DeviceType.Image]: "image",
100742
- [require_device_type.DeviceType.PetFeeder]: "pet-feeder",
100743
- [require_device_type.DeviceType.PetFountain]: "pet-fountain",
100744
- [require_device_type.DeviceType.Heater]: "heater",
100745
- [require_device_type.DeviceType.Dishwasher]: "dishwasher",
100746
- [require_device_type.DeviceType.Washer]: "appliance",
100747
- [require_device_type.DeviceType.Dryer]: "appliance",
100748
- [require_device_type.DeviceType.Gateway]: "dummy"
101335
+ [require_composed_stable_id.DeviceType.Cover]: "cover",
101336
+ [require_composed_stable_id.DeviceType.Valve]: "valve",
101337
+ [require_composed_stable_id.DeviceType.Humidifier]: "humidifier",
101338
+ [require_composed_stable_id.DeviceType.WaterHeater]: "water-heater",
101339
+ [require_composed_stable_id.DeviceType.HeatPump]: "dummy",
101340
+ [require_composed_stable_id.DeviceType.Camera]: "dummy",
101341
+ [require_composed_stable_id.DeviceType.Hub]: "dummy",
101342
+ [require_composed_stable_id.DeviceType.Switch]: "switch",
101343
+ [require_composed_stable_id.DeviceType.Siren]: "switch",
101344
+ [require_composed_stable_id.DeviceType.Light]: "light",
101345
+ [require_composed_stable_id.DeviceType.Fan]: "fan",
101346
+ [require_composed_stable_id.DeviceType.Sensor]: "sensor",
101347
+ [require_composed_stable_id.DeviceType.Thermostat]: "thermostat",
101348
+ [require_composed_stable_id.DeviceType.Climate]: "climate",
101349
+ [require_composed_stable_id.DeviceType.Button]: "button",
101350
+ [require_composed_stable_id.DeviceType.EventEmitter]: "dummy",
101351
+ [require_composed_stable_id.DeviceType.Update]: "update",
101352
+ [require_composed_stable_id.DeviceType.Generic]: "dummy",
101353
+ [require_composed_stable_id.DeviceType.Notifier]: "dummy",
101354
+ [require_composed_stable_id.DeviceType.Script]: "script",
101355
+ [require_composed_stable_id.DeviceType.Automation]: "automation",
101356
+ [require_composed_stable_id.DeviceType.Lock]: "lock",
101357
+ [require_composed_stable_id.DeviceType.MediaPlayer]: "media-player",
101358
+ [require_composed_stable_id.DeviceType.AlarmPanel]: "alarm",
101359
+ [require_composed_stable_id.DeviceType.Control]: "control",
101360
+ [require_composed_stable_id.DeviceType.Presence]: "sensor",
101361
+ [require_composed_stable_id.DeviceType.Weather]: "weather",
101362
+ [require_composed_stable_id.DeviceType.Vacuum]: "vacuum",
101363
+ [require_composed_stable_id.DeviceType.LawnMower]: "lawn-mower",
101364
+ [require_composed_stable_id.DeviceType.Container]: "dummy",
101365
+ [require_composed_stable_id.DeviceType.Image]: "image",
101366
+ [require_composed_stable_id.DeviceType.PetFeeder]: "pet-feeder",
101367
+ [require_composed_stable_id.DeviceType.PetFountain]: "pet-fountain",
101368
+ [require_composed_stable_id.DeviceType.Heater]: "heater",
101369
+ [require_composed_stable_id.DeviceType.Dishwasher]: "dishwasher",
101370
+ [require_composed_stable_id.DeviceType.Washer]: "appliance",
101371
+ [require_composed_stable_id.DeviceType.Dryer]: "appliance",
101372
+ [require_composed_stable_id.DeviceType.Gateway]: "dummy"
100749
101373
  };
100750
- var DEVICE_TYPE_VALUES = new Set(Object.values(require_device_type.DeviceType));
101374
+ var DEVICE_TYPE_VALUES = new Set(Object.values(require_composed_stable_id.DeviceType));
100751
101375
  /**
100752
101376
  * Runtime-string-safe base resolver: a device row's `type` crosses the wire as
100753
101377
  * a plain string, so an unrecognised value resolves to `null` instead of
@@ -100791,15 +101415,15 @@ var SENSOR_FEATURES = [
100791
101415
  function pickAccessoryControl(device) {
100792
101416
  const set = new Set(device.features);
100793
101417
  switch (device.type) {
100794
- case require_device_type.DeviceType.Cover: return { kind: "cover" };
100795
- case require_device_type.DeviceType.Valve: return { kind: "valve" };
100796
- case require_device_type.DeviceType.Lock: return { kind: "lock" };
100797
- case require_device_type.DeviceType.AlarmPanel: return { kind: "alarm" };
100798
- case require_device_type.DeviceType.Light: return set.has("brightness") ? { kind: "brightness" } : { kind: "switch" };
100799
- case require_device_type.DeviceType.Switch:
100800
- case require_device_type.DeviceType.Siren: return { kind: "switch" };
100801
- case require_device_type.DeviceType.Sensor:
100802
- case require_device_type.DeviceType.Presence: {
101418
+ case require_composed_stable_id.DeviceType.Cover: return { kind: "cover" };
101419
+ case require_composed_stable_id.DeviceType.Valve: return { kind: "valve" };
101420
+ case require_composed_stable_id.DeviceType.Lock: return { kind: "lock" };
101421
+ case require_composed_stable_id.DeviceType.AlarmPanel: return { kind: "alarm" };
101422
+ case require_composed_stable_id.DeviceType.Light: return set.has("brightness") ? { kind: "brightness" } : { kind: "switch" };
101423
+ case require_composed_stable_id.DeviceType.Switch:
101424
+ case require_composed_stable_id.DeviceType.Siren: return { kind: "switch" };
101425
+ case require_composed_stable_id.DeviceType.Sensor:
101426
+ case require_composed_stable_id.DeviceType.Presence: {
100803
101427
  const sensor = SENSOR_FEATURES.find((f) => set.has(f));
100804
101428
  return sensor ? {
100805
101429
  kind: "sensor",
@@ -100986,7 +101610,7 @@ var lockContribution = contribution("lock-control", LockControlStatusSchema, (sl
100986
101610
  const title = words?.title ?? require_sleep.t("Unknown", "Sconosciuto");
100987
101611
  return {
100988
101612
  reading: reading("lock-control", words?.state ?? "unknown", false, words?.title),
100989
- rows: [row$1("lock", state === "locked" || state === "locking" ? "lock" : "lock-open", joinText([title, since]), lockControls(state, ctx.features.includes(require_device_type.DeviceFeature.LockOpen)))],
101613
+ rows: [row$1("lock", state === "locked" || state === "locking" ? "lock" : "lock-open", joinText([title, since]), lockControls(state, ctx.features.includes(require_composed_stable_id.DeviceFeature.LockOpen)))],
100990
101614
  ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, "muted")] },
100991
101615
  ...words === null ? {} : { tiles: { left: [{
100992
101616
  label: require_sleep.t("Door", "Porta"),
@@ -101164,7 +101788,7 @@ var fanContribution = contribution("fan-control", FanControlStatusSchema, (slice
101164
101788
  const speed = slice?.speed ?? null;
101165
101789
  const state = speed === null ? "unknown" : speed > 0 ? "running" : "off";
101166
101790
  const controls = [];
101167
- if (speed !== null || has$3(ctx, require_device_type.DeviceFeature.FanSpeed)) controls.push({
101791
+ if (speed !== null || has$3(ctx, require_composed_stable_id.DeviceFeature.FanSpeed)) controls.push({
101168
101792
  kind: "slider",
101169
101793
  id: "fan.speed",
101170
101794
  label: require_sleep.t("Speed", "Velocità"),
@@ -101193,7 +101817,7 @@ var fanContribution = contribution("fan-control", FanControlStatusSchema, (slice
101193
101817
  },
101194
101818
  valueArg: "preset"
101195
101819
  });
101196
- if (slice?.oscillating != null || has$3(ctx, require_device_type.DeviceFeature.FanOscillating)) controls.push({
101820
+ if (slice?.oscillating != null || has$3(ctx, require_composed_stable_id.DeviceFeature.FanOscillating)) controls.push({
101197
101821
  kind: "toggle",
101198
101822
  id: "fan.oscillating",
101199
101823
  label: require_sleep.t("Oscillate", "Oscilla"),
@@ -101201,7 +101825,7 @@ var fanContribution = contribution("fan-control", FanControlStatusSchema, (slice
101201
101825
  turnOn: action("fan.oscillate.on", require_sleep.t("Oscillate", "Oscilla"), "refresh-cw", "fan-control", "setOscillating", { oscillating: true }),
101202
101826
  turnOff: action("fan.oscillate.off", require_sleep.t("Hold still", "Fermo"), "square", "fan-control", "setOscillating", { oscillating: false })
101203
101827
  });
101204
- if (slice?.direction != null || has$3(ctx, require_device_type.DeviceFeature.FanDirection)) controls.push({
101828
+ if (slice?.direction != null || has$3(ctx, require_composed_stable_id.DeviceFeature.FanDirection)) controls.push({
101205
101829
  kind: "picker",
101206
101830
  id: "fan.direction",
101207
101831
  label: require_sleep.t("Direction", "Direzione"),
@@ -101644,11 +102268,11 @@ var HUE_PRESETS = [
101644
102268
  ];
101645
102269
  function colorControls(ctx, current) {
101646
102270
  const controls = [];
101647
- if (has$2(ctx, require_device_type.DeviceFeature.LightColorMired)) for (const p of WHITE_PRESETS) controls.push(asAction(action(p.id, require_sleep.t(p.en, p.it), p.icon, "color", "setColor", { color: {
102271
+ if (has$2(ctx, require_composed_stable_id.DeviceFeature.LightColorMired)) for (const p of WHITE_PRESETS) controls.push(asAction(action(p.id, require_sleep.t(p.en, p.it), p.icon, "color", "setColor", { color: {
101648
102272
  mode: "mired",
101649
102273
  colorTemperature: p.mired
101650
102274
  } })));
101651
- if (has$2(ctx, require_device_type.DeviceFeature.LightColorHsv)) {
102275
+ if (has$2(ctx, require_composed_stable_id.DeviceFeature.LightColorHsv)) {
101652
102276
  const s = current?.s ?? 100;
101653
102277
  const v = current?.v ?? 100;
101654
102278
  for (const p of HUE_PRESETS) controls.push(asAction(action(p.id, require_sleep.t(p.en, p.it), "palette", "color", "setColor", { color: {
@@ -101747,7 +102371,7 @@ function travelFragment(s, state, position, tilt, ctx) {
101747
102371
  const words = travelWords(state, position);
101748
102372
  const controls = travelActions(s, state, state === "opening" || state === "closing").map(asAction);
101749
102373
  if (position !== null || s.positionable) controls.push(positionSlider(s, position));
101750
- if (s.cap === "cover" && (tilt !== null || has$2(ctx, require_device_type.DeviceFeature.CoverTilt))) controls.push({
102374
+ if (s.cap === "cover" && (tilt !== null || has$2(ctx, require_composed_stable_id.DeviceFeature.CoverTilt))) controls.push({
101751
102375
  kind: "slider",
101752
102376
  id: "cover.tilt",
101753
102377
  label: require_sleep.t("Tilt", "Inclinazione"),
@@ -101784,15 +102408,15 @@ var ACTUATORS_FAMILY_CONTRIBUTIONS = {
101784
102408
  cap: "cover",
101785
102409
  rowId: "cover",
101786
102410
  source: "cover",
101787
- stoppable: has$2(ctx, require_device_type.DeviceFeature.CoverStoppable),
101788
- positionable: has$2(ctx, require_device_type.DeviceFeature.CoverPositionable)
102411
+ stoppable: has$2(ctx, require_composed_stable_id.DeviceFeature.CoverStoppable),
102412
+ positionable: has$2(ctx, require_composed_stable_id.DeviceFeature.CoverPositionable)
101789
102413
  }, slice?.state, slice?.position ?? null, slice?.tiltPosition ?? null, ctx)),
101790
102414
  valve: contribution("valve", ValveStatusSchema, (slice, ctx) => travelFragment({
101791
102415
  cap: "valve",
101792
102416
  rowId: "valve",
101793
102417
  source: "valve",
101794
102418
  stoppable: false,
101795
- positionable: has$2(ctx, require_device_type.DeviceFeature.ValvePositionable)
102419
+ positionable: has$2(ctx, require_composed_stable_id.DeviceFeature.ValvePositionable)
101796
102420
  }, slice?.state, slice?.position ?? null, null, ctx)),
101797
102421
  humidifier: contribution("humidifier", HumidifierStatusSchema, (slice) => {
101798
102422
  if (slice === void 0) return { reading: reading("humidifier", "unknown") };
@@ -102412,7 +103036,7 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
102412
103036
  turnOn: action(`${id}.on`, require_sleep.t(en, it), "wind", "climate-control", method, { on: true }),
102413
103037
  turnOff: action(`${id}.off`, require_sleep.t(en, it), "wind", "climate-control", method, { on: false })
102414
103038
  }] : [];
102415
- fanControls.push(...swing("climate.swing-vertical", "Swing vertical", "Oscillazione verticale", "setSwingVertical", slice.swingVertical, require_device_type.DeviceFeature.ClimateSwingVertical), ...swing("climate.swing-horizontal", "Swing horizontal", "Oscillazione orizzontale", "setSwingHorizontal", slice.swingHorizontal, require_device_type.DeviceFeature.ClimateSwingHorizontal));
103039
+ fanControls.push(...swing("climate.swing-vertical", "Swing vertical", "Oscillazione verticale", "setSwingVertical", slice.swingVertical, require_composed_stable_id.DeviceFeature.ClimateSwingVertical), ...swing("climate.swing-horizontal", "Swing horizontal", "Oscillazione orizzontale", "setSwingHorizontal", slice.swingHorizontal, require_composed_stable_id.DeviceFeature.ClimateSwingHorizontal));
102416
103040
  const rows = [{
102417
103041
  id: "climate-mode",
102418
103042
  icon: "thermometer",
@@ -102610,7 +103234,7 @@ var CLIMATE_FAMILY_CONTRIBUTIONS = {
102610
103234
  /**
102611
103235
  * The heat pump's contribution to a hero (D1026): the compressor scene, every
102612
103236
  * circuit as a row with its own label and icon, the powers as pills (the
102613
- * instantaneous COP only when both powers are known) and a "System" group with
103237
+ * instantaneous COP is "—" when it cannot be computed) and a "System" group with
102614
103238
  * one selector per mode. Values and their limits come from the slice, which the
102615
103239
  * gateway filled: a selector with no allowed value is not drawn, a missing
102616
103240
  * reading is never a 0 (D393).
@@ -102682,9 +103306,22 @@ function circuitRow(circuit) {
102682
103306
  };
102683
103307
  }
102684
103308
  var kilowatts = (watts) => `${Number((watts / 1e3).toFixed(2))} kW`;
103309
+ /** A COP that cannot be computed is still the pill: "—", never an absent reading (D393). */
103310
+ function copPill(cop) {
103311
+ if (cop === null) return {
103312
+ icon: "gauge",
103313
+ text: require_sleep.t("Instantaneous COP —", "COP istantaneo —"),
103314
+ tone: "muted"
103315
+ };
103316
+ const text = String(Number(cop.toFixed(1)));
103317
+ return {
103318
+ icon: "gauge",
103319
+ text: require_sleep.t(`Instantaneous COP ${text}`, `COP istantaneo ${text}`),
103320
+ tone: "success"
103321
+ };
103322
+ }
102685
103323
  function powerPills(status) {
102686
103324
  const { thermalW, electricalW } = status.power;
102687
- const cop = heatPumpInstantCop(status.power);
102688
103325
  const pills = [];
102689
103326
  if (thermalW !== null) pills.push({
102690
103327
  icon: "flame",
@@ -102696,14 +103333,7 @@ function powerPills(status) {
102696
103333
  text: require_sleep.t(`Electrical ${kilowatts(electricalW)}`, `Elettrica ${kilowatts(electricalW)}`),
102697
103334
  tone: "muted"
102698
103335
  });
102699
- if (cop !== null) {
102700
- const text = String(Number(cop.toFixed(1)));
102701
- pills.push({
102702
- icon: "gauge",
102703
- text: require_sleep.t(`Instantaneous COP ${text}`, `COP istantaneo ${text}`),
102704
- tone: "success"
102705
- });
102706
- }
103336
+ pills.push(copPill(heatPumpInstantCop(status.power)));
102707
103337
  return pills;
102708
103338
  }
102709
103339
  /** The independent system modes, in the order the card draws them. */
@@ -102966,8 +103596,8 @@ function deriveMediaPlayerView(status, features, extras = {}) {
102966
103596
  return {
102967
103597
  ...derivePowerGatedView(status, features, extras),
102968
103598
  nowPlaying: nowPlayingOf(status),
102969
- shuffleReadOnly: status !== void 0 && status.shuffle !== null && !(features?.includes(require_device_type.DeviceFeature.MediaPlayerShuffle) ?? false),
102970
- repeatReadOnly: status !== void 0 && status.repeat !== null && !(features?.includes(require_device_type.DeviceFeature.MediaPlayerRepeat) ?? false)
103599
+ shuffleReadOnly: status !== void 0 && status.shuffle !== null && !(features?.includes(require_composed_stable_id.DeviceFeature.MediaPlayerShuffle) ?? false),
103600
+ repeatReadOnly: status !== void 0 && status.repeat !== null && !(features?.includes(require_composed_stable_id.DeviceFeature.MediaPlayerRepeat) ?? false)
102971
103601
  };
102972
103602
  }
102973
103603
  function derivePowerGatedView(status, features, extras) {
@@ -103004,7 +103634,7 @@ function channelOf(status) {
103004
103634
  }
103005
103635
  function deriveFromStatus(status, features) {
103006
103636
  const has = (f) => features?.includes(f) ?? false;
103007
- const canSwitchPower = has(require_device_type.DeviceFeature.MediaPlayerPower);
103637
+ const canSwitchPower = has(require_composed_stable_id.DeviceFeature.MediaPlayerPower);
103008
103638
  if (status === void 0 || status.state === void 0) return {
103009
103639
  ...UNKNOWN_VIEW,
103010
103640
  canSwitchPower
@@ -103019,8 +103649,8 @@ function deriveFromStatus(status, features) {
103019
103649
  canSwitchPower
103020
103650
  };
103021
103651
  if (power !== "on") return base;
103022
- const hasTransportFeature = has(require_device_type.DeviceFeature.MediaPlayerNext) || has(require_device_type.DeviceFeature.MediaPlayerPrevious) || has(require_device_type.DeviceFeature.MediaPlayerStop) || has(require_device_type.DeviceFeature.MediaPlayerSeek);
103023
- const volume = has(require_device_type.DeviceFeature.MediaPlayerVolume) ? "slider" : has(require_device_type.DeviceFeature.MediaPlayerVolumeStep) ? "steps" : "none";
103652
+ const hasTransportFeature = has(require_composed_stable_id.DeviceFeature.MediaPlayerNext) || has(require_composed_stable_id.DeviceFeature.MediaPlayerPrevious) || has(require_composed_stable_id.DeviceFeature.MediaPlayerStop) || has(require_composed_stable_id.DeviceFeature.MediaPlayerSeek);
103653
+ const volume = has(require_composed_stable_id.DeviceFeature.MediaPlayerVolume) ? "slider" : has(require_composed_stable_id.DeviceFeature.MediaPlayerVolumeStep) ? "steps" : "none";
103024
103654
  const sourceName = typeof status.source === "string" ? status.source.trim() : "";
103025
103655
  const options = status.availableSources ?? [];
103026
103656
  const hasSource = sourceName !== "" || options.length > 0;
@@ -103028,24 +103658,24 @@ function deriveFromStatus(status, features) {
103028
103658
  ...base,
103029
103659
  transport: {
103030
103660
  playPause: running !== "none" || hasTransportFeature,
103031
- previous: has(require_device_type.DeviceFeature.MediaPlayerPrevious),
103032
- next: has(require_device_type.DeviceFeature.MediaPlayerNext),
103033
- stop: has(require_device_type.DeviceFeature.MediaPlayerStop)
103661
+ previous: has(require_composed_stable_id.DeviceFeature.MediaPlayerPrevious),
103662
+ next: has(require_composed_stable_id.DeviceFeature.MediaPlayerNext),
103663
+ stop: has(require_composed_stable_id.DeviceFeature.MediaPlayerStop)
103034
103664
  },
103035
- seek: has(require_device_type.DeviceFeature.MediaPlayerSeek) && status.duration !== null && status.duration > 0,
103665
+ seek: has(require_composed_stable_id.DeviceFeature.MediaPlayerSeek) && status.duration !== null && status.duration > 0,
103036
103666
  volume,
103037
- mute: has(require_device_type.DeviceFeature.MediaPlayerMute) || volume === "slider" && status.isMuted !== null,
103667
+ mute: has(require_composed_stable_id.DeviceFeature.MediaPlayerMute) || volume === "slider" && status.isMuted !== null,
103038
103668
  volumeKnown: status.volumeLevel !== null,
103039
103669
  muteKnown: status.isMuted !== null,
103040
103670
  artworkUrl: artworkOf(status),
103041
103671
  source: hasSource ? {
103042
103672
  current: sourceName,
103043
103673
  options,
103044
- selectable: has(require_device_type.DeviceFeature.MediaPlayerSelectSource) && options.length > 1
103674
+ selectable: has(require_composed_stable_id.DeviceFeature.MediaPlayerSelectSource) && options.length > 1
103045
103675
  } : null,
103046
- channel: has(require_device_type.DeviceFeature.MediaPlayerChannelStep) ? { current: channelOf(status) } : null,
103047
- shuffle: has(require_device_type.DeviceFeature.MediaPlayerShuffle) && status.shuffle !== null,
103048
- repeat: has(require_device_type.DeviceFeature.MediaPlayerRepeat) && status.repeat !== null
103676
+ channel: has(require_composed_stable_id.DeviceFeature.MediaPlayerChannelStep) ? { current: channelOf(status) } : null,
103677
+ shuffle: has(require_composed_stable_id.DeviceFeature.MediaPlayerShuffle) && status.shuffle !== null,
103678
+ repeat: has(require_composed_stable_id.DeviceFeature.MediaPlayerRepeat) && status.repeat !== null
103049
103679
  };
103050
103680
  }
103051
103681
  //#endregion
@@ -103073,7 +103703,7 @@ function durationText(seconds) {
103073
103703
  return require_sleep.t(text, text);
103074
103704
  }
103075
103705
  function deviceTypeOf(type) {
103076
- return Object.values(require_device_type.DeviceType).find((t) => t === type);
103706
+ return Object.values(require_composed_stable_id.DeviceType).find((t) => t === type);
103077
103707
  }
103078
103708
  var switchContribution = contribution("switch", SwitchStatusSchema, (slice) => {
103079
103709
  const on = slice?.on ?? null;
@@ -103250,10 +103880,14 @@ function timerTile(quickRun) {
103250
103880
  value: require_sleep.t(text, text)
103251
103881
  };
103252
103882
  }
103883
+ function remainingWords(amount, unit) {
103884
+ const word = unit === "min" ? "min" : "s";
103885
+ return require_sleep.t(`${amount} ${word}`, `${amount} ${word}`);
103886
+ }
103253
103887
  var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slice, ctx) => {
103254
103888
  const type = deviceTypeOf(ctx.type);
103255
- const limit = type === void 0 ? void 0 : TIMED_RUN_LIMITS[type];
103256
- if (limit === void 0) return {};
103889
+ const limit = type === void 0 ? null : timedRunLimitOf(type);
103890
+ if (limit === null) return {};
103257
103891
  const quickRun = slice?.quickRun ?? timedRunQuickRun(limit, null);
103258
103892
  const activeUntil = slice?.activeUntil != null && slice.activeUntil > ctx.now ? slice.activeUntil : null;
103259
103893
  const runArgs = {
@@ -103263,11 +103897,12 @@ var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slic
103263
103897
  const run = action("timed-run.run", require_sleep.t(`Run ${quickRun.duration} ${quickRun.unit}`, `Avvia ${quickRun.duration} ${quickRun.unit}`), "timer", "timed-run", "runFor", runArgs, "primary");
103264
103898
  const cancel = action("timed-run.cancel", require_sleep.t("Stop", "Ferma"), "timer-off", "timed-run", "cancel");
103265
103899
  const restart = action("timed-run.restart", require_sleep.t("Restart", "Riavvia"), "rotate-cw", "timed-run", "runFor", runArgs);
103266
- const left = activeUntil === null ? 0 : Math.max(1, Math.ceil((activeUntil - ctx.now) / 6e4));
103900
+ const remaining = activeUntil === null ? null : timedRunRemaining(activeUntil, ctx.now, quickRun.unit);
103901
+ const words = remaining === null ? null : remainingWords(remaining, quickRun.unit);
103267
103902
  const row = {
103268
103903
  id: "run-for",
103269
103904
  icon: "timer",
103270
- status: activeUntil === null ? require_sleep.t(`Run for ${quickRun.duration} ${quickRun.unit}`, `Avvia per ${quickRun.duration} ${quickRun.unit}`) : require_sleep.t(`Stops in ${left} min`, `Si ferma tra ${left} min`),
103905
+ status: words === null ? require_sleep.t(`Run for ${quickRun.duration} ${quickRun.unit}`, `Avvia per ${quickRun.duration} ${quickRun.unit}`) : require_sleep.t(`Stops in ${words.en}`, `Si ferma tra ${words.it}`),
103271
103906
  controls: activeUntil === null ? [asAction(run)] : [asAction(cancel), asAction(restart)]
103272
103907
  };
103273
103908
  const armed = activeUntil === null ? {} : { right: [timerTile(quickRun)] };
@@ -103276,7 +103911,8 @@ var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slic
103276
103911
  activeUntil,
103277
103912
  quickRun,
103278
103913
  run,
103279
- cancel
103914
+ cancel,
103915
+ remaining
103280
103916
  },
103281
103917
  rows: [row],
103282
103918
  tilesFallback: true,
@@ -103411,7 +104047,7 @@ function mediaReading(view) {
103411
104047
  var mp = (id, en, it, icon, method, emphasis = "normal") => asAction(action(`playback.${id}`, require_sleep.t(en, it), icon, "media-player", method, {}, emphasis));
103412
104048
  function playbackControls(view, ctx) {
103413
104049
  const controls = [];
103414
- const stop = has$1(ctx, require_device_type.DeviceFeature.MediaPlayerStop);
104050
+ const stop = has$1(ctx, require_composed_stable_id.DeviceFeature.MediaPlayerStop);
103415
104051
  if (view.power === "unknown") {
103416
104052
  controls.push(mp("play", "Play", "Riproduci", "play", "play"), mp("pause", "Pause", "Pausa", "pause", "pause"));
103417
104053
  if (stop) controls.push(mp("stop", "Stop", "Stop", "square", "stop"));
@@ -103682,47 +104318,47 @@ var UPDATE_LAYOUT = { rows: ["update"] };
103682
104318
  var CONTROL_LAYOUT = { rows: ["control"] };
103683
104319
  var BUTTON_LAYOUT = { rows: ["button"] };
103684
104320
  var HERO_LAYOUT_BY_TYPE = {
103685
- [require_device_type.DeviceType.Camera]: HERO_LAYOUT_DEFAULT,
103686
- [require_device_type.DeviceType.Hub]: HERO_LAYOUT_DEFAULT,
103687
- [require_device_type.DeviceType.Light]: LIGHT_LAYOUT,
103688
- [require_device_type.DeviceType.Siren]: HERO_LAYOUT_DEFAULT,
103689
- [require_device_type.DeviceType.Switch]: SWITCH_LAYOUT,
103690
- [require_device_type.DeviceType.Sensor]: HERO_LAYOUT_DEFAULT,
103691
- [require_device_type.DeviceType.Thermostat]: CLIMATE_LAYOUT,
103692
- [require_device_type.DeviceType.Climate]: CLIMATE_LAYOUT,
103693
- [require_device_type.DeviceType.Button]: BUTTON_LAYOUT,
103694
- [require_device_type.DeviceType.EventEmitter]: HERO_LAYOUT_DEFAULT,
103695
- [require_device_type.DeviceType.Update]: UPDATE_LAYOUT,
103696
- [require_device_type.DeviceType.Generic]: HERO_LAYOUT_DEFAULT,
103697
- [require_device_type.DeviceType.Notifier]: HERO_LAYOUT_DEFAULT,
103698
- [require_device_type.DeviceType.Script]: SCRIPT_LAYOUT,
103699
- [require_device_type.DeviceType.Automation]: AUTOMATION_LAYOUT,
103700
- [require_device_type.DeviceType.Lock]: LOCK_LAYOUT,
103701
- [require_device_type.DeviceType.Cover]: COVER_LAYOUT,
103702
- [require_device_type.DeviceType.Valve]: VALVE_LAYOUT,
103703
- [require_device_type.DeviceType.Humidifier]: HUMIDIFIER_LAYOUT,
103704
- [require_device_type.DeviceType.WaterHeater]: CLIMATE_LAYOUT,
103705
- [require_device_type.DeviceType.HeatPump]: HEAT_PUMP_LAYOUT,
103706
- [require_device_type.DeviceType.Fan]: FAN_LAYOUT,
103707
- [require_device_type.DeviceType.MediaPlayer]: MEDIA_PLAYER_LAYOUT,
103708
- [require_device_type.DeviceType.AlarmPanel]: ALARM_LAYOUT,
103709
- [require_device_type.DeviceType.Control]: CONTROL_LAYOUT,
103710
- [require_device_type.DeviceType.Presence]: HERO_LAYOUT_DEFAULT,
103711
- [require_device_type.DeviceType.Weather]: HERO_LAYOUT_DEFAULT,
103712
- [require_device_type.DeviceType.Vacuum]: VACUUM_LAYOUT,
103713
- [require_device_type.DeviceType.LawnMower]: MOWER_LAYOUT,
103714
- [require_device_type.DeviceType.Container]: HERO_LAYOUT_DEFAULT,
103715
- [require_device_type.DeviceType.Image]: HERO_LAYOUT_DEFAULT,
103716
- [require_device_type.DeviceType.PetFeeder]: FEEDER_LAYOUT,
103717
- [require_device_type.DeviceType.PetFountain]: FOUNTAIN_LAYOUT,
103718
- [require_device_type.DeviceType.Dishwasher]: DISHWASHER_LAYOUT,
103719
- [require_device_type.DeviceType.Washer]: APPLIANCE_LAYOUT,
103720
- [require_device_type.DeviceType.Heater]: HEATER_LAYOUT,
103721
- [require_device_type.DeviceType.Dryer]: APPLIANCE_LAYOUT,
103722
- [require_device_type.DeviceType.Gateway]: HERO_LAYOUT_DEFAULT
104321
+ [require_composed_stable_id.DeviceType.Camera]: HERO_LAYOUT_DEFAULT,
104322
+ [require_composed_stable_id.DeviceType.Hub]: HERO_LAYOUT_DEFAULT,
104323
+ [require_composed_stable_id.DeviceType.Light]: LIGHT_LAYOUT,
104324
+ [require_composed_stable_id.DeviceType.Siren]: HERO_LAYOUT_DEFAULT,
104325
+ [require_composed_stable_id.DeviceType.Switch]: SWITCH_LAYOUT,
104326
+ [require_composed_stable_id.DeviceType.Sensor]: HERO_LAYOUT_DEFAULT,
104327
+ [require_composed_stable_id.DeviceType.Thermostat]: CLIMATE_LAYOUT,
104328
+ [require_composed_stable_id.DeviceType.Climate]: CLIMATE_LAYOUT,
104329
+ [require_composed_stable_id.DeviceType.Button]: BUTTON_LAYOUT,
104330
+ [require_composed_stable_id.DeviceType.EventEmitter]: HERO_LAYOUT_DEFAULT,
104331
+ [require_composed_stable_id.DeviceType.Update]: UPDATE_LAYOUT,
104332
+ [require_composed_stable_id.DeviceType.Generic]: HERO_LAYOUT_DEFAULT,
104333
+ [require_composed_stable_id.DeviceType.Notifier]: HERO_LAYOUT_DEFAULT,
104334
+ [require_composed_stable_id.DeviceType.Script]: SCRIPT_LAYOUT,
104335
+ [require_composed_stable_id.DeviceType.Automation]: AUTOMATION_LAYOUT,
104336
+ [require_composed_stable_id.DeviceType.Lock]: LOCK_LAYOUT,
104337
+ [require_composed_stable_id.DeviceType.Cover]: COVER_LAYOUT,
104338
+ [require_composed_stable_id.DeviceType.Valve]: VALVE_LAYOUT,
104339
+ [require_composed_stable_id.DeviceType.Humidifier]: HUMIDIFIER_LAYOUT,
104340
+ [require_composed_stable_id.DeviceType.WaterHeater]: CLIMATE_LAYOUT,
104341
+ [require_composed_stable_id.DeviceType.HeatPump]: HEAT_PUMP_LAYOUT,
104342
+ [require_composed_stable_id.DeviceType.Fan]: FAN_LAYOUT,
104343
+ [require_composed_stable_id.DeviceType.MediaPlayer]: MEDIA_PLAYER_LAYOUT,
104344
+ [require_composed_stable_id.DeviceType.AlarmPanel]: ALARM_LAYOUT,
104345
+ [require_composed_stable_id.DeviceType.Control]: CONTROL_LAYOUT,
104346
+ [require_composed_stable_id.DeviceType.Presence]: HERO_LAYOUT_DEFAULT,
104347
+ [require_composed_stable_id.DeviceType.Weather]: HERO_LAYOUT_DEFAULT,
104348
+ [require_composed_stable_id.DeviceType.Vacuum]: VACUUM_LAYOUT,
104349
+ [require_composed_stable_id.DeviceType.LawnMower]: MOWER_LAYOUT,
104350
+ [require_composed_stable_id.DeviceType.Container]: HERO_LAYOUT_DEFAULT,
104351
+ [require_composed_stable_id.DeviceType.Image]: HERO_LAYOUT_DEFAULT,
104352
+ [require_composed_stable_id.DeviceType.PetFeeder]: FEEDER_LAYOUT,
104353
+ [require_composed_stable_id.DeviceType.PetFountain]: FOUNTAIN_LAYOUT,
104354
+ [require_composed_stable_id.DeviceType.Dishwasher]: DISHWASHER_LAYOUT,
104355
+ [require_composed_stable_id.DeviceType.Washer]: APPLIANCE_LAYOUT,
104356
+ [require_composed_stable_id.DeviceType.Heater]: HEATER_LAYOUT,
104357
+ [require_composed_stable_id.DeviceType.Dryer]: APPLIANCE_LAYOUT,
104358
+ [require_composed_stable_id.DeviceType.Gateway]: HERO_LAYOUT_DEFAULT
103723
104359
  };
103724
104360
  function isDeviceType$1(type) {
103725
- return Object.values(require_device_type.DeviceType).includes(type);
104361
+ return Object.values(require_composed_stable_id.DeviceType).includes(type);
103726
104362
  }
103727
104363
  /** The layout of a type; a type this build does not know gets the default. */
103728
104364
  function resolveHeroLayout(type) {
@@ -104406,113 +105042,113 @@ var HERO_MODE_LOOK = {
104406
105042
  open: null,
104407
105043
  closed: null
104408
105044
  };
104409
- var MODE_LOOK_TYPES = [require_device_type.DeviceType.Climate, require_device_type.DeviceType.Thermostat];
105045
+ var MODE_LOOK_TYPES = [require_composed_stable_id.DeviceType.Climate, require_composed_stable_id.DeviceType.Thermostat];
104410
105046
  var HERO_LOOK_BY_TYPE = {
104411
- [require_device_type.DeviceType.Camera]: CAMERA_LOOK,
104412
- [require_device_type.DeviceType.Hub]: HERO_LOOK_DEFAULT,
104413
- [require_device_type.DeviceType.Light]: LIGHT_LOOK,
104414
- [require_device_type.DeviceType.Siren]: HERO_LOOK_DEFAULT,
104415
- [require_device_type.DeviceType.Switch]: SWITCH_LOOK,
104416
- [require_device_type.DeviceType.Sensor]: READING_SENSOR_LOOK,
104417
- [require_device_type.DeviceType.Thermostat]: THERMOSTAT_LOOK,
104418
- [require_device_type.DeviceType.Climate]: CLIMATE_LOOK,
104419
- [require_device_type.DeviceType.Button]: BUTTON_LOOK,
104420
- [require_device_type.DeviceType.EventEmitter]: EVENT_EMITTER_LOOK,
104421
- [require_device_type.DeviceType.Update]: UPDATE_LOOK,
104422
- [require_device_type.DeviceType.Generic]: HERO_LOOK_DEFAULT,
104423
- [require_device_type.DeviceType.Notifier]: HERO_LOOK_DEFAULT,
104424
- [require_device_type.DeviceType.Script]: SCRIPT_LOOK,
104425
- [require_device_type.DeviceType.Automation]: AUTOMATION_LOOK,
104426
- [require_device_type.DeviceType.Lock]: LOCK_LOOK,
104427
- [require_device_type.DeviceType.Cover]: COVER_LOOK,
104428
- [require_device_type.DeviceType.Valve]: VALVE_LOOK,
104429
- [require_device_type.DeviceType.Humidifier]: HUMIDIFIER_LOOK,
104430
- [require_device_type.DeviceType.WaterHeater]: WATER_HEATER_LOOK,
104431
- [require_device_type.DeviceType.HeatPump]: HEAT_PUMP_LOOK,
104432
- [require_device_type.DeviceType.Fan]: FAN_LOOK,
104433
- [require_device_type.DeviceType.MediaPlayer]: MEDIA_PLAYER_LOOK,
104434
- [require_device_type.DeviceType.AlarmPanel]: ALARM_LOOK,
104435
- [require_device_type.DeviceType.Control]: CONTROL_LOOK,
104436
- [require_device_type.DeviceType.Presence]: PRESENCE_LOOK,
104437
- [require_device_type.DeviceType.Weather]: WEATHER_LOOK,
104438
- [require_device_type.DeviceType.Vacuum]: VACUUM_LOOK,
104439
- [require_device_type.DeviceType.LawnMower]: MOWER_LOOK,
104440
- [require_device_type.DeviceType.Container]: HERO_LOOK_DEFAULT,
104441
- [require_device_type.DeviceType.Image]: IMAGE_LOOK,
104442
- [require_device_type.DeviceType.PetFeeder]: FEEDER_LOOK,
104443
- [require_device_type.DeviceType.PetFountain]: FOUNTAIN_LOOK,
104444
- [require_device_type.DeviceType.Dishwasher]: DISHWASHER_LOOK,
104445
- [require_device_type.DeviceType.Washer]: WASHER_LOOK,
104446
- [require_device_type.DeviceType.Heater]: HEATER_LOOK,
104447
- [require_device_type.DeviceType.Dryer]: DRYER_LOOK,
104448
- [require_device_type.DeviceType.Gateway]: HERO_LOOK_DEFAULT
105047
+ [require_composed_stable_id.DeviceType.Camera]: CAMERA_LOOK,
105048
+ [require_composed_stable_id.DeviceType.Hub]: HERO_LOOK_DEFAULT,
105049
+ [require_composed_stable_id.DeviceType.Light]: LIGHT_LOOK,
105050
+ [require_composed_stable_id.DeviceType.Siren]: HERO_LOOK_DEFAULT,
105051
+ [require_composed_stable_id.DeviceType.Switch]: SWITCH_LOOK,
105052
+ [require_composed_stable_id.DeviceType.Sensor]: READING_SENSOR_LOOK,
105053
+ [require_composed_stable_id.DeviceType.Thermostat]: THERMOSTAT_LOOK,
105054
+ [require_composed_stable_id.DeviceType.Climate]: CLIMATE_LOOK,
105055
+ [require_composed_stable_id.DeviceType.Button]: BUTTON_LOOK,
105056
+ [require_composed_stable_id.DeviceType.EventEmitter]: EVENT_EMITTER_LOOK,
105057
+ [require_composed_stable_id.DeviceType.Update]: UPDATE_LOOK,
105058
+ [require_composed_stable_id.DeviceType.Generic]: HERO_LOOK_DEFAULT,
105059
+ [require_composed_stable_id.DeviceType.Notifier]: HERO_LOOK_DEFAULT,
105060
+ [require_composed_stable_id.DeviceType.Script]: SCRIPT_LOOK,
105061
+ [require_composed_stable_id.DeviceType.Automation]: AUTOMATION_LOOK,
105062
+ [require_composed_stable_id.DeviceType.Lock]: LOCK_LOOK,
105063
+ [require_composed_stable_id.DeviceType.Cover]: COVER_LOOK,
105064
+ [require_composed_stable_id.DeviceType.Valve]: VALVE_LOOK,
105065
+ [require_composed_stable_id.DeviceType.Humidifier]: HUMIDIFIER_LOOK,
105066
+ [require_composed_stable_id.DeviceType.WaterHeater]: WATER_HEATER_LOOK,
105067
+ [require_composed_stable_id.DeviceType.HeatPump]: HEAT_PUMP_LOOK,
105068
+ [require_composed_stable_id.DeviceType.Fan]: FAN_LOOK,
105069
+ [require_composed_stable_id.DeviceType.MediaPlayer]: MEDIA_PLAYER_LOOK,
105070
+ [require_composed_stable_id.DeviceType.AlarmPanel]: ALARM_LOOK,
105071
+ [require_composed_stable_id.DeviceType.Control]: CONTROL_LOOK,
105072
+ [require_composed_stable_id.DeviceType.Presence]: PRESENCE_LOOK,
105073
+ [require_composed_stable_id.DeviceType.Weather]: WEATHER_LOOK,
105074
+ [require_composed_stable_id.DeviceType.Vacuum]: VACUUM_LOOK,
105075
+ [require_composed_stable_id.DeviceType.LawnMower]: MOWER_LOOK,
105076
+ [require_composed_stable_id.DeviceType.Container]: HERO_LOOK_DEFAULT,
105077
+ [require_composed_stable_id.DeviceType.Image]: IMAGE_LOOK,
105078
+ [require_composed_stable_id.DeviceType.PetFeeder]: FEEDER_LOOK,
105079
+ [require_composed_stable_id.DeviceType.PetFountain]: FOUNTAIN_LOOK,
105080
+ [require_composed_stable_id.DeviceType.Dishwasher]: DISHWASHER_LOOK,
105081
+ [require_composed_stable_id.DeviceType.Washer]: WASHER_LOOK,
105082
+ [require_composed_stable_id.DeviceType.Heater]: HEATER_LOOK,
105083
+ [require_composed_stable_id.DeviceType.Dryer]: DRYER_LOOK,
105084
+ [require_composed_stable_id.DeviceType.Gateway]: HERO_LOOK_DEFAULT
104449
105085
  };
104450
105086
  /** `inherit` = take the type's look. A role only REFINES a type; it never replaces the type system. */
104451
105087
  var HERO_LOOK_BY_ROLE = {
104452
- [require_device_type.DeviceRole.Siren]: "inherit",
104453
- [require_device_type.DeviceRole.Floodlight]: "inherit",
104454
- [require_device_type.DeviceRole.Spotlight]: "inherit",
104455
- [require_device_type.DeviceRole.PirSensor]: MOTION_LOOK,
104456
- [require_device_type.DeviceRole.Chime]: "inherit",
104457
- [require_device_type.DeviceRole.Autotrack]: "inherit",
104458
- [require_device_type.DeviceRole.Nightvision]: "inherit",
104459
- [require_device_type.DeviceRole.PrivacyMask]: "inherit",
104460
- [require_device_type.DeviceRole.Doorbell]: DOORBELL_LOOK,
104461
- [require_device_type.DeviceRole.CoverBlind]: "inherit",
104462
- [require_device_type.DeviceRole.CoverShutter]: "inherit",
104463
- [require_device_type.DeviceRole.CoverAwning]: "inherit",
104464
- [require_device_type.DeviceRole.CoverCurtain]: "inherit",
104465
- [require_device_type.DeviceRole.CoverGarage]: "inherit",
104466
- [require_device_type.DeviceRole.CoverGate]: "inherit",
104467
- [require_device_type.DeviceRole.CoverDoor]: "inherit",
104468
- [require_device_type.DeviceRole.CoverWindow]: "inherit",
104469
- [require_device_type.DeviceRole.BinaryHelper]: "inherit",
104470
- [require_device_type.DeviceRole.Outlet]: "inherit",
104471
- [require_device_type.DeviceRole.MotionSensor]: MOTION_LOOK,
104472
- [require_device_type.DeviceRole.ContactSensor]: "inherit",
104473
- [require_device_type.DeviceRole.LeakSensor]: LEAK_LOOK,
104474
- [require_device_type.DeviceRole.SmokeSensor]: SMOKE_LOOK,
104475
- [require_device_type.DeviceRole.COSensor]: CO_LOOK,
104476
- [require_device_type.DeviceRole.GasSensor]: GAS_LOOK,
104477
- [require_device_type.DeviceRole.TamperSensor]: TAMPER_LOOK,
104478
- [require_device_type.DeviceRole.VibrationSensor]: VIBRATION_LOOK,
104479
- [require_device_type.DeviceRole.ConnectivitySensor]: "inherit",
104480
- [require_device_type.DeviceRole.SoundSensor]: "inherit",
104481
- [require_device_type.DeviceRole.BinarySensor]: "inherit",
104482
- [require_device_type.DeviceRole.TemperatureSensor]: TEMPERATURE_LOOK,
104483
- [require_device_type.DeviceRole.HumiditySensor]: HUMIDITY_LOOK,
104484
- [require_device_type.DeviceRole.AmbientLightSensor]: LIGHT_SENSOR_LOOK,
104485
- [require_device_type.DeviceRole.PressureSensor]: READING_SENSOR_LOOK,
104486
- [require_device_type.DeviceRole.WindSensor]: "inherit",
104487
- [require_device_type.DeviceRole.RainSensor]: "inherit",
104488
- [require_device_type.DeviceRole.UvSensor]: "inherit",
104489
- [require_device_type.DeviceRole.SolarRadiationSensor]: "inherit",
104490
- [require_device_type.DeviceRole.SoilMoistureSensor]: "inherit",
104491
- [require_device_type.DeviceRole.PowerSensor]: "inherit",
104492
- [require_device_type.DeviceRole.EnergySensor]: "inherit",
104493
- [require_device_type.DeviceRole.VoltageSensor]: "inherit",
104494
- [require_device_type.DeviceRole.CurrentSensor]: "inherit",
104495
- [require_device_type.DeviceRole.AirQualitySensor]: AIR_QUALITY_LOOK,
104496
- [require_device_type.DeviceRole.BatterySensor]: "inherit",
104497
- [require_device_type.DeviceRole.NumericSensor]: "inherit",
104498
- [require_device_type.DeviceRole.EnumSensor]: "inherit",
104499
- [require_device_type.DeviceRole.DateTimeSensor]: "inherit",
104500
- [require_device_type.DeviceRole.GenericSensor]: "inherit",
104501
- [require_device_type.DeviceRole.NumericControl]: "inherit",
104502
- [require_device_type.DeviceRole.SelectControl]: "inherit",
104503
- [require_device_type.DeviceRole.TextControl]: "inherit",
104504
- [require_device_type.DeviceRole.DateTimeControl]: "inherit",
104505
- [require_device_type.DeviceRole.MobilePushNotifier]: "inherit",
104506
- [require_device_type.DeviceRole.MessagingNotifier]: "inherit",
104507
- [require_device_type.DeviceRole.EmailNotifier]: "inherit",
104508
- [require_device_type.DeviceRole.GenericNotifier]: "inherit",
104509
- [require_device_type.DeviceRole.IrTransmitter]: "inherit"
105088
+ [require_composed_stable_id.DeviceRole.Siren]: "inherit",
105089
+ [require_composed_stable_id.DeviceRole.Floodlight]: "inherit",
105090
+ [require_composed_stable_id.DeviceRole.Spotlight]: "inherit",
105091
+ [require_composed_stable_id.DeviceRole.PirSensor]: MOTION_LOOK,
105092
+ [require_composed_stable_id.DeviceRole.Chime]: "inherit",
105093
+ [require_composed_stable_id.DeviceRole.Autotrack]: "inherit",
105094
+ [require_composed_stable_id.DeviceRole.Nightvision]: "inherit",
105095
+ [require_composed_stable_id.DeviceRole.PrivacyMask]: "inherit",
105096
+ [require_composed_stable_id.DeviceRole.Doorbell]: DOORBELL_LOOK,
105097
+ [require_composed_stable_id.DeviceRole.CoverBlind]: "inherit",
105098
+ [require_composed_stable_id.DeviceRole.CoverShutter]: "inherit",
105099
+ [require_composed_stable_id.DeviceRole.CoverAwning]: "inherit",
105100
+ [require_composed_stable_id.DeviceRole.CoverCurtain]: "inherit",
105101
+ [require_composed_stable_id.DeviceRole.CoverGarage]: "inherit",
105102
+ [require_composed_stable_id.DeviceRole.CoverGate]: "inherit",
105103
+ [require_composed_stable_id.DeviceRole.CoverDoor]: "inherit",
105104
+ [require_composed_stable_id.DeviceRole.CoverWindow]: "inherit",
105105
+ [require_composed_stable_id.DeviceRole.BinaryHelper]: "inherit",
105106
+ [require_composed_stable_id.DeviceRole.Outlet]: "inherit",
105107
+ [require_composed_stable_id.DeviceRole.MotionSensor]: MOTION_LOOK,
105108
+ [require_composed_stable_id.DeviceRole.ContactSensor]: "inherit",
105109
+ [require_composed_stable_id.DeviceRole.LeakSensor]: LEAK_LOOK,
105110
+ [require_composed_stable_id.DeviceRole.SmokeSensor]: SMOKE_LOOK,
105111
+ [require_composed_stable_id.DeviceRole.COSensor]: CO_LOOK,
105112
+ [require_composed_stable_id.DeviceRole.GasSensor]: GAS_LOOK,
105113
+ [require_composed_stable_id.DeviceRole.TamperSensor]: TAMPER_LOOK,
105114
+ [require_composed_stable_id.DeviceRole.VibrationSensor]: VIBRATION_LOOK,
105115
+ [require_composed_stable_id.DeviceRole.ConnectivitySensor]: "inherit",
105116
+ [require_composed_stable_id.DeviceRole.SoundSensor]: "inherit",
105117
+ [require_composed_stable_id.DeviceRole.BinarySensor]: "inherit",
105118
+ [require_composed_stable_id.DeviceRole.TemperatureSensor]: TEMPERATURE_LOOK,
105119
+ [require_composed_stable_id.DeviceRole.HumiditySensor]: HUMIDITY_LOOK,
105120
+ [require_composed_stable_id.DeviceRole.AmbientLightSensor]: LIGHT_SENSOR_LOOK,
105121
+ [require_composed_stable_id.DeviceRole.PressureSensor]: READING_SENSOR_LOOK,
105122
+ [require_composed_stable_id.DeviceRole.WindSensor]: "inherit",
105123
+ [require_composed_stable_id.DeviceRole.RainSensor]: "inherit",
105124
+ [require_composed_stable_id.DeviceRole.UvSensor]: "inherit",
105125
+ [require_composed_stable_id.DeviceRole.SolarRadiationSensor]: "inherit",
105126
+ [require_composed_stable_id.DeviceRole.SoilMoistureSensor]: "inherit",
105127
+ [require_composed_stable_id.DeviceRole.PowerSensor]: "inherit",
105128
+ [require_composed_stable_id.DeviceRole.EnergySensor]: "inherit",
105129
+ [require_composed_stable_id.DeviceRole.VoltageSensor]: "inherit",
105130
+ [require_composed_stable_id.DeviceRole.CurrentSensor]: "inherit",
105131
+ [require_composed_stable_id.DeviceRole.AirQualitySensor]: AIR_QUALITY_LOOK,
105132
+ [require_composed_stable_id.DeviceRole.BatterySensor]: "inherit",
105133
+ [require_composed_stable_id.DeviceRole.NumericSensor]: "inherit",
105134
+ [require_composed_stable_id.DeviceRole.EnumSensor]: "inherit",
105135
+ [require_composed_stable_id.DeviceRole.DateTimeSensor]: "inherit",
105136
+ [require_composed_stable_id.DeviceRole.GenericSensor]: "inherit",
105137
+ [require_composed_stable_id.DeviceRole.NumericControl]: "inherit",
105138
+ [require_composed_stable_id.DeviceRole.SelectControl]: "inherit",
105139
+ [require_composed_stable_id.DeviceRole.TextControl]: "inherit",
105140
+ [require_composed_stable_id.DeviceRole.DateTimeControl]: "inherit",
105141
+ [require_composed_stable_id.DeviceRole.MobilePushNotifier]: "inherit",
105142
+ [require_composed_stable_id.DeviceRole.MessagingNotifier]: "inherit",
105143
+ [require_composed_stable_id.DeviceRole.EmailNotifier]: "inherit",
105144
+ [require_composed_stable_id.DeviceRole.GenericNotifier]: "inherit",
105145
+ [require_composed_stable_id.DeviceRole.IrTransmitter]: "inherit"
104510
105146
  };
104511
105147
  function isDeviceType(type) {
104512
- return Object.values(require_device_type.DeviceType).includes(type);
105148
+ return Object.values(require_composed_stable_id.DeviceType).includes(type);
104513
105149
  }
104514
105150
  function isDeviceRole(role) {
104515
- return Object.values(require_device_type.DeviceRole).includes(role);
105151
+ return Object.values(require_composed_stable_id.DeviceRole).includes(role);
104516
105152
  }
104517
105153
  /**
104518
105154
  * The look of a (role, type) pair, for a state. Role beats type beats the generic default.
@@ -104686,11 +105322,11 @@ function tilesOf(fragments, side) {
104686
105322
  /** The foot button that opens the history, named for what the device keeps. */
104687
105323
  function historyLabelOf(type) {
104688
105324
  switch (type) {
104689
- case require_device_type.DeviceType.Washer:
104690
- case require_device_type.DeviceType.Dryer:
104691
- case require_device_type.DeviceType.Dishwasher: return require_sleep.t("Cycles", "Cicli");
104692
- case require_device_type.DeviceType.PetFeeder: return require_sleep.t("Meals", "Pasti");
104693
- case require_device_type.DeviceType.Lock: return require_sleep.t("Access", "Accessi");
105325
+ case require_composed_stable_id.DeviceType.Washer:
105326
+ case require_composed_stable_id.DeviceType.Dryer:
105327
+ case require_composed_stable_id.DeviceType.Dishwasher: return require_sleep.t("Cycles", "Cicli");
105328
+ case require_composed_stable_id.DeviceType.PetFeeder: return require_sleep.t("Meals", "Pasti");
105329
+ case require_composed_stable_id.DeviceType.Lock: return require_sleep.t("Access", "Accessi");
104694
105330
  default: return require_sleep.t("History", "Storico");
104695
105331
  }
104696
105332
  }
@@ -107078,6 +107714,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
107078
107714
  access: "create",
107079
107715
  role: "admin"
107080
107716
  },
107717
+ "deviceManager.checkDeviceTemplates": {
107718
+ capName: "device-manager",
107719
+ capScope: "system",
107720
+ addonId: null,
107721
+ access: "view",
107722
+ role: "admin"
107723
+ },
107081
107724
  "deviceManager.cleanupDeletedDevicesData": {
107082
107725
  capName: "device-manager",
107083
107726
  capScope: "system",
@@ -107477,6 +108120,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
107477
108120
  access: "create",
107478
108121
  role: "admin"
107479
108122
  },
108123
+ "deviceManager.renderDeviceTemplates": {
108124
+ capName: "device-manager",
108125
+ capScope: "system",
108126
+ addonId: null,
108127
+ access: "view",
108128
+ role: "admin"
108129
+ },
107480
108130
  "deviceManager.reportDiscoveryObservations": {
107481
108131
  capName: "device-manager",
107482
108132
  capScope: "system",
@@ -115837,7 +116487,7 @@ function bakedArgsEqual(action, args) {
115837
116487
  * filters to what the device actually binds.
115838
116488
  */
115839
116489
  var DEVICE_TYPE_DO_CAPS = {
115840
- [require_device_type.DeviceType.Camera]: [
116490
+ [require_composed_stable_id.DeviceType.Camera]: [
115841
116491
  "ptz",
115842
116492
  "ptz-autotrack",
115843
116493
  "privacy-mask",
@@ -115845,43 +116495,43 @@ var DEVICE_TYPE_DO_CAPS = {
115845
116495
  "reboot",
115846
116496
  "motion-trigger"
115847
116497
  ],
115848
- [require_device_type.DeviceType.Hub]: [],
115849
- [require_device_type.DeviceType.Light]: ["switch", "brightness"],
115850
- [require_device_type.DeviceType.Siren]: ["switch", "motion-trigger"],
115851
- [require_device_type.DeviceType.Switch]: ["switch", "motion-trigger"],
115852
- [require_device_type.DeviceType.Sensor]: [],
115853
- [require_device_type.DeviceType.Thermostat]: ["climate-control"],
115854
- [require_device_type.DeviceType.Climate]: ["climate-control"],
115855
- [require_device_type.DeviceType.Button]: ["button"],
115856
- [require_device_type.DeviceType.EventEmitter]: [],
115857
- [require_device_type.DeviceType.Update]: [],
115858
- [require_device_type.DeviceType.Generic]: [],
115859
- [require_device_type.DeviceType.Notifier]: [],
115860
- [require_device_type.DeviceType.Script]: ["script-runner"],
115861
- [require_device_type.DeviceType.Automation]: ["automation-control"],
115862
- [require_device_type.DeviceType.Lock]: ["lock-control"],
115863
- [require_device_type.DeviceType.Cover]: ["cover"],
115864
- [require_device_type.DeviceType.Valve]: ["valve"],
115865
- [require_device_type.DeviceType.Humidifier]: ["humidifier"],
115866
- [require_device_type.DeviceType.WaterHeater]: ["water-heater"],
115867
- [require_device_type.DeviceType.HeatPump]: ["heat-pump-control"],
115868
- [require_device_type.DeviceType.Fan]: ["fan-control", "switch"],
115869
- [require_device_type.DeviceType.MediaPlayer]: ["media-player"],
115870
- [require_device_type.DeviceType.AlarmPanel]: ["alarm-panel"],
115871
- [require_device_type.DeviceType.Control]: [],
115872
- [require_device_type.DeviceType.Presence]: [],
115873
- [require_device_type.DeviceType.Weather]: [],
115874
- [require_device_type.DeviceType.Vacuum]: ["vacuum-control"],
115875
- [require_device_type.DeviceType.LawnMower]: ["lawn-mower-control"],
115876
- [require_device_type.DeviceType.Container]: [],
115877
- [require_device_type.DeviceType.Image]: [],
115878
- [require_device_type.DeviceType.PetFeeder]: ["pet-feeder"],
115879
- [require_device_type.DeviceType.PetFountain]: ["pet-fountain", "timed-run"],
115880
- [require_device_type.DeviceType.Heater]: ["switch", "timed-run"],
115881
- [require_device_type.DeviceType.Dishwasher]: ["dishwasher"],
115882
- [require_device_type.DeviceType.Washer]: [],
115883
- [require_device_type.DeviceType.Dryer]: [],
115884
- [require_device_type.DeviceType.Gateway]: []
116498
+ [require_composed_stable_id.DeviceType.Hub]: [],
116499
+ [require_composed_stable_id.DeviceType.Light]: ["switch", "brightness"],
116500
+ [require_composed_stable_id.DeviceType.Siren]: ["switch", "motion-trigger"],
116501
+ [require_composed_stable_id.DeviceType.Switch]: ["switch", "motion-trigger"],
116502
+ [require_composed_stable_id.DeviceType.Sensor]: [],
116503
+ [require_composed_stable_id.DeviceType.Thermostat]: ["climate-control"],
116504
+ [require_composed_stable_id.DeviceType.Climate]: ["climate-control"],
116505
+ [require_composed_stable_id.DeviceType.Button]: ["button"],
116506
+ [require_composed_stable_id.DeviceType.EventEmitter]: [],
116507
+ [require_composed_stable_id.DeviceType.Update]: [],
116508
+ [require_composed_stable_id.DeviceType.Generic]: [],
116509
+ [require_composed_stable_id.DeviceType.Notifier]: [],
116510
+ [require_composed_stable_id.DeviceType.Script]: ["script-runner"],
116511
+ [require_composed_stable_id.DeviceType.Automation]: ["automation-control"],
116512
+ [require_composed_stable_id.DeviceType.Lock]: ["lock-control"],
116513
+ [require_composed_stable_id.DeviceType.Cover]: ["cover"],
116514
+ [require_composed_stable_id.DeviceType.Valve]: ["valve"],
116515
+ [require_composed_stable_id.DeviceType.Humidifier]: ["humidifier"],
116516
+ [require_composed_stable_id.DeviceType.WaterHeater]: ["water-heater"],
116517
+ [require_composed_stable_id.DeviceType.HeatPump]: ["heat-pump-control"],
116518
+ [require_composed_stable_id.DeviceType.Fan]: ["fan-control", "switch"],
116519
+ [require_composed_stable_id.DeviceType.MediaPlayer]: ["media-player"],
116520
+ [require_composed_stable_id.DeviceType.AlarmPanel]: ["alarm-panel"],
116521
+ [require_composed_stable_id.DeviceType.Control]: [],
116522
+ [require_composed_stable_id.DeviceType.Presence]: [],
116523
+ [require_composed_stable_id.DeviceType.Weather]: [],
116524
+ [require_composed_stable_id.DeviceType.Vacuum]: ["vacuum-control"],
116525
+ [require_composed_stable_id.DeviceType.LawnMower]: ["lawn-mower-control"],
116526
+ [require_composed_stable_id.DeviceType.Container]: [],
116527
+ [require_composed_stable_id.DeviceType.Image]: [],
116528
+ [require_composed_stable_id.DeviceType.PetFeeder]: ["pet-feeder"],
116529
+ [require_composed_stable_id.DeviceType.PetFountain]: ["pet-fountain", "timed-run"],
116530
+ [require_composed_stable_id.DeviceType.Heater]: ["switch", "timed-run"],
116531
+ [require_composed_stable_id.DeviceType.Dishwasher]: ["dishwasher"],
116532
+ [require_composed_stable_id.DeviceType.Washer]: [],
116533
+ [require_composed_stable_id.DeviceType.Dryer]: [],
116534
+ [require_composed_stable_id.DeviceType.Gateway]: []
115885
116535
  };
115886
116536
  /**
115887
116537
  * Whether a device type belongs in a Do / automation action device picker.
@@ -115890,7 +116540,7 @@ var DEVICE_TYPE_DO_CAPS = {
115890
116540
  * but must never appear as selectable targets — actuate the children instead.
115891
116541
  */
115892
116542
  function isDoPickerDeviceType(type) {
115893
- return type !== require_device_type.DeviceType.Container;
116543
+ return type !== require_composed_stable_id.DeviceType.Container;
115894
116544
  }
115895
116545
  /**
115896
116546
  * Do-picker family id — devices that share one may be multi-selected for
@@ -115901,18 +116551,18 @@ function isDoPickerDeviceType(type) {
115901
116551
  */
115902
116552
  function deviceDoFamily(type) {
115903
116553
  switch (type) {
115904
- case require_device_type.DeviceType.Climate:
115905
- case require_device_type.DeviceType.Thermostat:
115906
- case require_device_type.DeviceType.Humidifier:
115907
- case require_device_type.DeviceType.WaterHeater:
115908
- case require_device_type.DeviceType.HeatPump: return "climate-family";
115909
- case require_device_type.DeviceType.Cover:
115910
- case require_device_type.DeviceType.Valve: return "cover-family";
115911
- case require_device_type.DeviceType.Switch:
115912
- case require_device_type.DeviceType.Siren:
115913
- case require_device_type.DeviceType.Light: return "switch-family";
115914
- case require_device_type.DeviceType.Vacuum:
115915
- case require_device_type.DeviceType.LawnMower: return "robot-family";
116554
+ case require_composed_stable_id.DeviceType.Climate:
116555
+ case require_composed_stable_id.DeviceType.Thermostat:
116556
+ case require_composed_stable_id.DeviceType.Humidifier:
116557
+ case require_composed_stable_id.DeviceType.WaterHeater:
116558
+ case require_composed_stable_id.DeviceType.HeatPump: return "climate-family";
116559
+ case require_composed_stable_id.DeviceType.Cover:
116560
+ case require_composed_stable_id.DeviceType.Valve: return "cover-family";
116561
+ case require_composed_stable_id.DeviceType.Switch:
116562
+ case require_composed_stable_id.DeviceType.Siren:
116563
+ case require_composed_stable_id.DeviceType.Light: return "switch-family";
116564
+ case require_composed_stable_id.DeviceType.Vacuum:
116565
+ case require_composed_stable_id.DeviceType.LawnMower: return "robot-family";
115916
116566
  default: return type;
115917
116567
  }
115918
116568
  }
@@ -115937,7 +116587,7 @@ function actionsForBoundCaps(boundCaps) {
115937
116587
  * Unknown type strings → empty.
115938
116588
  */
115939
116589
  function actionsForDeviceType(type) {
115940
- if (!Object.values(require_device_type.DeviceType).includes(type)) return [];
116590
+ if (!Object.values(require_composed_stable_id.DeviceType).includes(type)) return [];
115941
116591
  return actionsForBoundCaps(DEVICE_TYPE_DO_CAPS[type]);
115942
116592
  }
115943
116593
  /**
@@ -116263,7 +116913,7 @@ function deviceMatchesProfile(features, profile) {
116263
116913
  var BATTERY_DEVICE_PROFILE = {
116264
116914
  id: "battery",
116265
116915
  label: "Battery-operated camera",
116266
- when: { hasFeature: require_device_type.DeviceFeature.BatteryOperated },
116916
+ when: { hasFeature: require_composed_stable_id.DeviceFeature.BatteryOperated },
116267
116917
  defaults: {
116268
116918
  audioMode: "disabled",
116269
116919
  detectionMode: "on-motion"
@@ -116293,9 +116943,9 @@ function resolveDeviceProfile(features) {
116293
116943
  * export cannot honour yet, so they are named and withheld.
116294
116944
  */
116295
116945
  var PLUG_APPLIANCE_TYPES = [
116296
- require_device_type.DeviceType.Washer,
116297
- require_device_type.DeviceType.Dryer,
116298
- require_device_type.DeviceType.Dishwasher
116946
+ require_composed_stable_id.DeviceType.Washer,
116947
+ require_composed_stable_id.DeviceType.Dryer,
116948
+ require_composed_stable_id.DeviceType.Dishwasher
116299
116949
  ];
116300
116950
  var HA_AS = "a power sensor (device_class power). Home Assistant has no laundry domain. running-state stays unexported until a null reading can be published as unavailable.";
116301
116951
  var HOMEKIT_REASON = "HomeKit has no laundry-appliance service. The export tab would pair an accessory with nothing on it: running-state is withheld until a null reading can be unavailable, and power is not a HomeKit service this export honours.";
@@ -116304,15 +116954,15 @@ var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A pow
116304
116954
  var MATTER_REASON = "No Matter export is built. The closest device types are Laundry Washer (0x0073) and Laundry Dryer (0x0074); a power threshold is not the Laundry Washer Mode cluster.";
116305
116955
  function withheld(reason) {
116306
116956
  return {
116307
- [require_device_type.DeviceType.Washer]: {
116957
+ [require_composed_stable_id.DeviceType.Washer]: {
116308
116958
  exported: false,
116309
116959
  reason
116310
116960
  },
116311
- [require_device_type.DeviceType.Dryer]: {
116961
+ [require_composed_stable_id.DeviceType.Dryer]: {
116312
116962
  exported: false,
116313
116963
  reason
116314
116964
  },
116315
- [require_device_type.DeviceType.Dishwasher]: {
116965
+ [require_composed_stable_id.DeviceType.Dishwasher]: {
116316
116966
  exported: false,
116317
116967
  reason
116318
116968
  }
@@ -116320,15 +116970,15 @@ function withheld(reason) {
116320
116970
  }
116321
116971
  function offered(received) {
116322
116972
  return {
116323
- [require_device_type.DeviceType.Washer]: {
116973
+ [require_composed_stable_id.DeviceType.Washer]: {
116324
116974
  exported: true,
116325
116975
  as: received
116326
116976
  },
116327
- [require_device_type.DeviceType.Dryer]: {
116977
+ [require_composed_stable_id.DeviceType.Dryer]: {
116328
116978
  exported: true,
116329
116979
  as: received
116330
116980
  },
116331
- [require_device_type.DeviceType.Dishwasher]: {
116981
+ [require_composed_stable_id.DeviceType.Dishwasher]: {
116332
116982
  exported: true,
116333
116983
  as: received
116334
116984
  }
@@ -116352,7 +117002,7 @@ function applianceExport(ecosystem, deviceType) {
116352
117002
  //#endregion
116353
117003
  //#region src/device/path-util.ts
116354
117004
  /** Returns true when `x` is a non-null, non-array plain object. */
116355
- function isRecord$2(x) {
117005
+ function isRecord$1(x) {
116356
117006
  return x !== null && typeof x === "object" && !Array.isArray(x);
116357
117007
  }
116358
117008
  /** Read a dot-path (`a.b.c`) out of an object. Returns `undefined` for any
@@ -116361,7 +117011,7 @@ function getByPath(obj, path) {
116361
117011
  const parts = path.split(".");
116362
117012
  let cur = obj;
116363
117013
  for (const part of parts) {
116364
- if (!isRecord$2(cur)) return void 0;
117014
+ if (!isRecord$1(cur)) return void 0;
116365
117015
  cur = cur[part];
116366
117016
  }
116367
117017
  return cur;
@@ -116383,7 +117033,7 @@ function setByPath(obj, path, value) {
116383
117033
  const head = path.slice(0, dotIndex);
116384
117034
  const tail = path.slice(dotIndex + 1);
116385
117035
  const child = obj[head];
116386
- const childObj = isRecord$2(child) ? child : {};
117036
+ const childObj = isRecord$1(child) ? child : {};
116387
117037
  return {
116388
117038
  ...obj,
116389
117039
  [head]: setByPath(childObj, tail, value)
@@ -117436,131 +118086,6 @@ function humanizeKey(key) {
117436
118086
  return key.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").replace(/^\w/, (c) => c.toUpperCase()).trim();
117437
118087
  }
117438
118088
  //#endregion
117439
- //#region src/expression/device-template.ts
117440
- /**
117441
- * Device value templates, the parts that need no template engine (D1021).
117442
- *
117443
- * A template is plain text with Jinja-style `{{ … }}` / `{% … %}` blocks:
117444
- * `{{ stufa_veranda.temperature | unit('°F') | round(1) }}`. Devices are named
117445
- * by their alias (`device-alias.ts`); a field is `alias.field` when the field
117446
- * name is unique across the device's capabilities, else `alias.<cap>.field`,
117447
- * and an ambiguous `alias.field` is refused by name.
117448
- *
117449
- * The engine itself (nunjucks) lives ONLY in the hub's renderer
117450
- * (`packages/system/src/builtins/device-manager/device-template/`, guard
117451
- * `check-device-template-grammar`): it does not sandbox, so it renders only in
117452
- * a worker thread under a wall-time budget, over frozen plain data. This file
117453
- * is the shared vocabulary — limits, refusal reasons, the trace, and how a
117454
- * `(alias, path)` reference resolves against a device's slices.
117455
- */
117456
- var DEVICE_TEMPLATE_MAX_LENGTH = 4096;
117457
- /** Wall time a render may take, host-measured; the worker is terminated past it. */
117458
- var DEVICE_TEMPLATE_BUDGET_MS = 50;
117459
- var DEVICE_TEMPLATE_MAX_OUTPUT = 4096;
117460
- /** What an unknown or unavailable value renders as. */
117461
- var DEVICE_TEMPLATE_UNAVAILABLE = "—";
117462
- var DeviceTemplateSchema = zod.z.string().min(1).max(DEVICE_TEMPLATE_MAX_LENGTH);
117463
- /** The filters a template may use. Anything else is refused at parse time. */
117464
- var DEVICE_TEMPLATE_FILTERS = [
117465
- "unit",
117466
- "round",
117467
- "default",
117468
- "since",
117469
- "ago",
117470
- "format",
117471
- "upper",
117472
- "lower",
117473
- "title",
117474
- "capitalize",
117475
- "trim",
117476
- "abs",
117477
- "int",
117478
- "float",
117479
- "length",
117480
- "d",
117481
- "join",
117482
- "replace",
117483
- "first",
117484
- "last",
117485
- "sort",
117486
- "reverse",
117487
- "sum",
117488
- "string",
117489
- "list",
117490
- "truncate"
117491
- ];
117492
- /** A capability name as a template spells it: `temperature-sensor` → `temperature_sensor`. */
117493
- function templateCapKey(cap) {
117494
- return cap.replace(/-/g, "_");
117495
- }
117496
- function isRecord$1(value) {
117497
- return typeof value === "object" && value !== null && !Array.isArray(value);
117498
- }
117499
- function pickPath(root, path) {
117500
- let cursor = root;
117501
- for (const part of path) if (Array.isArray(cursor) && typeof part === "number") cursor = cursor[part];
117502
- else if (isRecord$1(cursor) && Object.hasOwn(cursor, String(part))) cursor = cursor[String(part)];
117503
- else return;
117504
- return cursor;
117505
- }
117506
- /**
117507
- * Resolve the path after an alias. `<cap>.field…` when the first segment names
117508
- * one of the device's caps; otherwise `field…` when exactly one cap carries a
117509
- * field of that name; several caps carrying it is `ambiguous`, naming them.
117510
- */
117511
- function resolveTemplateRef(view, path) {
117512
- const head = path[0];
117513
- if (head === void 0) return {
117514
- kind: "missing",
117515
- reason: "no-field"
117516
- };
117517
- const caps = Object.keys(view.slices);
117518
- const named = caps.find((cap) => cap === head || templateCapKey(cap) === head);
117519
- if (named !== void 0) {
117520
- const rest = path.slice(1);
117521
- if (rest.length === 0) return {
117522
- kind: "missing",
117523
- reason: "no-field"
117524
- };
117525
- const value = pickPath(view.slices[named], rest);
117526
- if (value === void 0) return {
117527
- kind: "missing",
117528
- reason: "unknown-field"
117529
- };
117530
- return {
117531
- kind: "value",
117532
- cap: named,
117533
- fieldPath: rest,
117534
- value
117535
- };
117536
- }
117537
- const owners = caps.filter((cap) => {
117538
- const slice = view.slices[cap];
117539
- return isRecord$1(slice) && Object.hasOwn(slice, String(head));
117540
- });
117541
- if (owners.length === 0) return {
117542
- kind: "missing",
117543
- reason: "unknown-field"
117544
- };
117545
- const [only] = owners;
117546
- if (owners.length > 1 || only === void 0) return {
117547
- kind: "ambiguous",
117548
- field: String(head),
117549
- caps: owners
117550
- };
117551
- const value = pickPath(view.slices[only], path);
117552
- if (value === void 0) return {
117553
- kind: "missing",
117554
- reason: "unknown-field"
117555
- };
117556
- return {
117557
- kind: "value",
117558
- cap: only,
117559
- fieldPath: path,
117560
- value
117561
- };
117562
- }
117563
- //#endregion
117564
118089
  //#region src/generated/cap-status-types.ts
117565
118090
  /**
117566
118091
  * Runtime list of cap names with status. Used by the settings
@@ -122162,6 +122687,8 @@ function createSystemProxy(api) {
122162
122687
  registerDevice: (input) => dispatch("deviceManager", "registerDevice", "mutation", input),
122163
122688
  removeDevice: (input) => dispatch("deviceManager", "removeDevice", "mutation", input),
122164
122689
  persistConfig: (input) => dispatch("deviceManager", "persistConfig", "mutation", input),
122690
+ renderDeviceTemplates: (input) => dispatch("deviceManager", "renderDeviceTemplates", "query", input),
122691
+ checkDeviceTemplates: (input) => dispatch("deviceManager", "checkDeviceTemplates", "query", input),
122165
122692
  getRoleDisplayDefaults: (input) => dispatch("deviceManager", "getRoleDisplayDefaults", "query", input),
122166
122693
  setRoleDisplayDefaults: (input) => dispatch("deviceManager", "setRoleDisplayDefaults", "mutation", input),
122167
122694
  listLocations: (input) => dispatch("deviceManager", "listLocations", "query", input),
@@ -132117,7 +132644,7 @@ var OrphanIntegrationSweep = class {
132117
132644
  } catch (err) {
132118
132645
  this.#logger.warn("Orphan integration device removal failed — kept as suspect", { meta: {
132119
132646
  integrationId: id,
132120
- error: require_device_type.errMsg(err)
132647
+ error: require_composed_stable_id.errMsg(err)
132121
132648
  } });
132122
132649
  }
132123
132650
  }
@@ -133398,7 +133925,7 @@ async function runInferenceStep(fn, timeoutMs) {
133398
133925
  output: void 0,
133399
133926
  durationMs: roundMs(performance.now() - t0),
133400
133927
  ok: false,
133401
- error: require_device_type.errMsg(err)
133928
+ error: require_composed_stable_id.errMsg(err)
133402
133929
  };
133403
133930
  }
133404
133931
  }
@@ -133972,7 +134499,7 @@ async function reconcileRemovedDevices(opts) {
133972
134499
  try {
133973
134500
  tombstones = await api.deviceManager.listDeletedSince.query({ sinceMs: now() - DEVICE_TOMBSTONE_RETENTION_MS });
133974
134501
  } catch (err) {
133975
- opts.logger.warn("device removal reconcile skipped — tombstones unreadable, nothing deleted", { meta: { error: require_device_type.errMsg(err) } });
134502
+ opts.logger.warn("device removal reconcile skipped — tombstones unreadable, nothing deleted", { meta: { error: require_composed_stable_id.errMsg(err) } });
133976
134503
  return {
133977
134504
  read: false,
133978
134505
  applied: 0,
@@ -133995,7 +134522,7 @@ async function reconcileRemovedDevices(opts) {
133995
134522
  failed += 1;
133996
134523
  opts.logger.warn("device removal reconcile failed for a device — retried next pass", {
133997
134524
  tags: { deviceId: tombstone.deviceId },
133998
- meta: { error: require_device_type.errMsg(err) }
134525
+ meta: { error: require_composed_stable_id.errMsg(err) }
133999
134526
  });
134000
134527
  }
134001
134528
  return {
@@ -134014,7 +134541,7 @@ function armRemovalReconcile(opts) {
134014
134541
  if (running) return;
134015
134542
  running = true;
134016
134543
  reconcileRemovedDevices(opts).catch((err) => {
134017
- opts.logger.warn("device removal reconcile pass crashed", { meta: { error: require_device_type.errMsg(err) } });
134544
+ opts.logger.warn("device removal reconcile pass crashed", { meta: { error: require_composed_stable_id.errMsg(err) } });
134018
134545
  }).finally(() => {
134019
134546
  running = false;
134020
134547
  });
@@ -134703,7 +135230,7 @@ exports.CLUSTER_MODEL_SECTION_ID = CLUSTER_MODEL_SECTION_ID;
134703
135230
  exports.CLUSTER_STEP_SETTING_FIELDS = CLUSTER_STEP_SETTING_FIELDS;
134704
135231
  exports.COCO_80_LABELS = COCO_80_LABELS;
134705
135232
  exports.COCO_TO_MACRO = COCO_TO_MACRO;
134706
- exports.COMPOSED_DEVICE_STABLE_ID_PREFIX = require_composition.COMPOSED_DEVICE_STABLE_ID_PREFIX;
135233
+ exports.COMPOSED_DEVICE_STABLE_ID_PREFIX = require_composed_stable_id.COMPOSED_DEVICE_STABLE_ID_PREFIX;
134707
135234
  exports.COMPOSED_ITEM_FIXED_FIELDS = COMPOSED_ITEM_FIXED_FIELDS;
134708
135235
  exports.COMPOSER_ADDON_ID = require_composition.COMPOSER_ADDON_ID;
134709
135236
  exports.COMPOSER_RUNNER_ID = COMPOSER_RUNNER_ID;
@@ -134714,6 +135241,7 @@ exports.COMPOSITION_LINK_KINDS = COMPOSITION_LINK_KINDS;
134714
135241
  exports.COMPOSITION_TARGET_CAP_NAMES = COMPOSITION_TARGET_CAP_NAMES;
134715
135242
  exports.CONNECTION_TEST_TIMEOUT_MS = CONNECTION_TEST_TIMEOUT_MS;
134716
135243
  exports.CONTAINER_CHILD_PRIORITY = CONTAINER_CHILD_PRIORITY;
135244
+ exports.CONTAINER_PRIMARY_CHILD_RULES = CONTAINER_PRIMARY_CHILD_RULES;
134717
135245
  exports.CORAL_DEFAULT_MODEL_ID = CORAL_DEFAULT_MODEL_ID;
134718
135246
  exports.CORE_BLOCKS_ADDON_ID = CORE_BLOCKS_ADDON_ID;
134719
135247
  exports.CORE_BLOCK_ADDON_PREFIX = CORE_BLOCK_ADDON_PREFIX;
@@ -134792,7 +135320,7 @@ exports.CapacitySourceSchema = CapacitySourceSchema;
134792
135320
  exports.CarbonMonoxideStatusSchema = CarbonMonoxideStatusSchema;
134793
135321
  exports.CatalogFileSchema = CatalogFileSchema;
134794
135322
  exports.CatalogLangSchema = CatalogLangSchema;
134795
- exports.ChargingStatus = require_device_type.ChargingStatus;
135323
+ exports.ChargingStatus = require_composed_stable_id.ChargingStatus;
134796
135324
  exports.ClaimOutcomeSchema = ClaimOutcomeSchema;
134797
135325
  exports.ClaimsListingSchema = ClaimsListingSchema;
134798
135326
  exports.CleanupDeletedDevicesResultSchema = CleanupDeletedDevicesResultSchema;
@@ -135010,6 +135538,8 @@ exports.DEVICE_TEMPLATE_BUDGET_MS = DEVICE_TEMPLATE_BUDGET_MS;
135010
135538
  exports.DEVICE_TEMPLATE_FILTERS = DEVICE_TEMPLATE_FILTERS;
135011
135539
  exports.DEVICE_TEMPLATE_MAX_LENGTH = DEVICE_TEMPLATE_MAX_LENGTH;
135012
135540
  exports.DEVICE_TEMPLATE_MAX_OUTPUT = DEVICE_TEMPLATE_MAX_OUTPUT;
135541
+ exports.DEVICE_TEMPLATE_REFUSAL_REASONS = DEVICE_TEMPLATE_REFUSAL_REASONS;
135542
+ exports.DEVICE_TEMPLATE_TRACE_REASONS = DEVICE_TEMPLATE_TRACE_REASONS;
135013
135543
  exports.DEVICE_TEMPLATE_UNAVAILABLE = DEVICE_TEMPLATE_UNAVAILABLE;
135014
135544
  exports.DEVICE_TOMBSTONE_RETENTION_MS = DEVICE_TOMBSTONE_RETENTION_MS;
135015
135545
  exports.DEVICE_TRANSITIONS_MAX_PAGE = DEVICE_TRANSITIONS_MAX_PAGE;
@@ -135068,7 +135598,7 @@ exports.DeviceExportExposeInputSchema = ExposeInputSchema;
135068
135598
  exports.DeviceExportInstancePinSchema = InstancePinSchema;
135069
135599
  exports.DeviceExportStatusSchema = DeviceExportStatusSchema;
135070
135600
  exports.DeviceExportUnexposeInputSchema = UnexposeInputSchema;
135071
- exports.DeviceFeature = require_device_type.DeviceFeature;
135601
+ exports.DeviceFeature = require_composed_stable_id.DeviceFeature;
135072
135602
  exports.DeviceHistoryKindSchema = DeviceHistoryKindSchema;
135073
135603
  exports.DeviceHistoryOrphanDeleteRefusalSchema = DeviceHistoryOrphanDeleteRefusalSchema;
135074
135604
  exports.DeviceHistoryOrphanReasonSchema = DeviceHistoryOrphanReasonSchema;
@@ -135088,7 +135618,7 @@ exports.DeviceRefusalSchema = DeviceRefusalSchema;
135088
135618
  exports.DeviceRemovedInputSchema = DeviceRemovedInputSchema;
135089
135619
  exports.DeviceRemovedResultSchema = DeviceRemovedResultSchema;
135090
135620
  exports.DeviceRestoreRetryScheduler = DeviceRestoreRetryScheduler;
135091
- exports.DeviceRole = require_device_type.DeviceRole;
135621
+ exports.DeviceRole = require_composed_stable_id.DeviceRole;
135092
135622
  exports.DeviceRunDetailSchema = DeviceRunDetailSchema;
135093
135623
  exports.DeviceRunEnergyMethodSchema = DeviceRunEnergyMethodSchema;
135094
135624
  exports.DeviceRunKindSchema = DeviceRunKindSchema;
@@ -135101,10 +135631,13 @@ exports.DeviceRuntimeState = DeviceRuntimeState;
135101
135631
  exports.DeviceSelectorSchema = DeviceSelectorSchema;
135102
135632
  exports.DeviceSignaturePurposeSchema = DeviceSignaturePurposeSchema;
135103
135633
  exports.DeviceStatusSchema = DeviceStatusSchema;
135634
+ exports.DeviceTemplateRefusalSchema = DeviceTemplateRefusalSchema;
135635
+ exports.DeviceTemplateRenderSchema = DeviceTemplateRenderSchema;
135104
135636
  exports.DeviceTemplateSchema = DeviceTemplateSchema;
135637
+ exports.DeviceTemplateTraceEntrySchema = DeviceTemplateTraceEntrySchema;
135105
135638
  exports.DeviceTombstoneSchema = DeviceTombstoneSchema;
135106
135639
  exports.DeviceTransitionSchema = require_sleep.DeviceTransitionSchema;
135107
- exports.DeviceType = require_device_type.DeviceType;
135640
+ exports.DeviceType = require_composed_stable_id.DeviceType;
135108
135641
  exports.DiagnosticIdSchema = DiagnosticIdSchema;
135109
135642
  exports.DiagnosticWindowPatchSchema = DiagnosticWindowPatchSchema;
135110
135643
  exports.DiagnosticWindowSchema = DiagnosticWindowSchema;
@@ -136604,6 +137137,7 @@ exports.StationarySubjectSchema = StationarySubjectSchema;
136604
137137
  exports.StatisticHelperSpecSchema = require_composition.StatisticHelperSpecSchema;
136605
137138
  exports.StatisticWindowSchema = require_composition.StatisticWindowSchema;
136606
137139
  exports.StepDeviceTraceSchema = StepDeviceTraceSchema;
137140
+ exports.StepTemplateError = StepTemplateError;
136607
137141
  exports.StorageAbortUploadInputSchema = AbortUploadInputSchema;
136608
137142
  exports.StorageAccessSchema = StorageAccessSchema;
136609
137143
  exports.StorageBeginDownloadInputSchema = BeginDownloadInputSchema;
@@ -136951,6 +137485,7 @@ exports.applyModeDelaysEdits = applyModeDelaysEdits;
136951
137485
  exports.applyModeDeviceListEdit = applyModeDeviceListEdit;
136952
137486
  exports.applyModelBoundSettings = applyModelBoundSettings;
136953
137487
  exports.applyNonBlockingEdit = applyNonBlockingEdit;
137488
+ exports.applyPrimaryChildRule = applyPrimaryChildRule;
136954
137489
  exports.applySecureOnArmEdit = applySecureOnArmEdit;
136955
137490
  exports.arithmeticDraft = arithmeticDraft;
136956
137491
  exports.armRemovalReconcile = armRemovalReconcile;
@@ -137053,6 +137588,7 @@ exports.capabilityScopesOf = capabilityScopesOf;
137053
137588
  exports.capacityForModel = capacityForModel;
137054
137589
  exports.capacitySessionsOf = capacitySessionsOf;
137055
137590
  exports.carbonMonoxideCapability = carbonMonoxideCapability;
137591
+ exports.carriesDeviceTemplate = carriesDeviceTemplate;
137056
137592
  exports.catalogueIssues = catalogueIssues;
137057
137593
  exports.cellsToRects = cellsToRects;
137058
137594
  exports.checkDeviceAlias = checkDeviceAlias;
@@ -137086,6 +137622,7 @@ exports.clusterModelSettingKey = clusterModelSettingKey;
137086
137622
  exports.clusterStepSettingFieldsFor = clusterStepSettingFieldsFor;
137087
137623
  exports.clusterStepSettingKey = clusterStepSettingKey;
137088
137624
  exports.codecIsAccepted = codecIsAccepted;
137625
+ exports.collectDeviceTemplates = collectDeviceTemplates;
137089
137626
  exports.collectHydratedFieldEntries = require_sleep.collectHydratedFieldEntries;
137090
137627
  exports.collectHydratedFieldValues = require_sleep.collectHydratedFieldValues;
137091
137628
  exports.collectKeychainStoredKeys = require_sleep.collectKeychainStoredKeys;
@@ -137302,7 +137839,7 @@ exports.enumSensorCapability = enumSensorCapability;
137302
137839
  exports.enumerateInferenceDevices = enumerateInferenceDevices;
137303
137840
  exports.enumerateItemArrayFields = enumerateItemArrayFields;
137304
137841
  exports.enumerateSchemaFields = enumerateSchemaFields;
137305
- exports.errMsg = require_device_type.errMsg;
137842
+ exports.errMsg = require_composed_stable_id.errMsg;
137306
137843
  exports.estimateNodeBenchmarkDurationMs = estimateNodeBenchmarkDurationMs;
137307
137844
  exports.evaluateAggregate = evaluateAggregate;
137308
137845
  exports.evaluateAst = require_composition.evaluateAst;
@@ -137318,6 +137855,7 @@ exports.evaluateSensorLevelEdge = require_composition.evaluateSensorLevelEdge;
137318
137855
  exports.evaluateStatefulExpressionCall = require_composition.evaluateStatefulExpressionCall;
137319
137856
  exports.evaluateStationaryTrigger = evaluateStationaryTrigger;
137320
137857
  exports.evaluateStatistic = require_composition.evaluateStatistic;
137858
+ exports.evaluateStepCondition = evaluateStepCondition;
137321
137859
  exports.evaluateWhenTree = evaluateWhenTree;
137322
137860
  exports.evaluateZoneRules = evaluateZoneRules;
137323
137861
  exports.event = require_sleep.event;
@@ -137349,7 +137887,7 @@ exports.featureForwards = featureForwards;
137349
137887
  exports.featureOfRole = featureOfRole;
137350
137888
  exports.featureProbeCapability = featureProbeCapability;
137351
137889
  exports.featureSources = require_composition.featureSources;
137352
- exports.featuresOfBoundCaps = require_device_type.featuresOfBoundCaps;
137890
+ exports.featuresOfBoundCaps = require_composed_stable_id.featuresOfBoundCaps;
137353
137891
  exports.feederCustomizationExample = feederCustomizationExample;
137354
137892
  exports.feederExampleSources = feederExampleSources;
137355
137893
  exports.ffmpegRate = ffmpegRate;
@@ -137962,6 +138500,7 @@ exports.resolveSecretMarkers = require_sleep.resolveSecretMarkers;
137962
138500
  exports.resolveSecretViewsIn = require_sleep.resolveSecretViewsIn;
137963
138501
  exports.resolveServerName = resolveServerName;
137964
138502
  exports.resolveStepArgs = resolveStepArgs;
138503
+ exports.resolveStepArgsWithTemplates = resolveStepArgsWithTemplates;
137965
138504
  exports.resolveStreamMaps = require_composition.resolveStreamMaps;
137966
138505
  exports.resolveTemplateRef = resolveTemplateRef;
137967
138506
  exports.resolveVariantModelId = resolveVariantModelId;
@@ -138187,6 +138726,7 @@ exports.timedRunCapability = timedRunCapability;
138187
138726
  exports.timedRunLimitOf = timedRunLimitOf;
138188
138727
  exports.timedRunMaxIn = timedRunMaxIn;
138189
138728
  exports.timedRunQuickRun = timedRunQuickRun;
138729
+ exports.timedRunRemaining = timedRunRemaining;
138190
138730
  exports.timedRunSeconds = timedRunSeconds;
138191
138731
  exports.toAppLinkHubOrigin = toAppLinkHubOrigin;
138192
138732
  exports.toDeviceSummary = toDeviceSummary;