@camstack/server 1.2.839 → 1.2.841

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 (101) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/trpc/generated-cap-routers.js +16 -0
  3. package/package.json +18 -8
  4. package/system/dist/addon-runner.js +4 -2
  5. package/system/dist/addon-runner.mjs +4 -2
  6. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  8. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  10. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  11. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  12. package/system/dist/builtins/autotrack/index.js +1 -1
  13. package/system/dist/builtins/autotrack/index.mjs +1 -1
  14. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  15. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  16. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  17. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  18. package/system/dist/builtins/camera-grid/index.js +1 -1
  19. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  20. package/system/dist/builtins/composer/composer.addon.js +5 -5
  21. package/system/dist/builtins/composer/composer.addon.mjs +5 -5
  22. package/system/dist/builtins/console-logging/index.js +1 -1
  23. package/system/dist/builtins/console-logging/index.mjs +1 -1
  24. package/system/dist/builtins/core-blocks/composition-api.d.ts +2 -2
  25. package/system/dist/builtins/core-blocks/composition-sources.d.ts +9 -2
  26. package/system/dist/builtins/core-blocks/core-blocks.addon.d.ts +2 -0
  27. package/system/dist/builtins/core-blocks/core-blocks.addon.js +598 -395
  28. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +598 -395
  29. package/system/dist/builtins/core-blocks/fan-link-forward.d.ts +42 -0
  30. package/system/dist/builtins/core-blocks/fan-presets-service.d.ts +25 -39
  31. package/system/dist/builtins/core-blocks/fan-presets-wiring.d.ts +5 -3
  32. package/system/dist/builtins/core-blocks/migrations/helper-to-customize.d.ts +3 -1
  33. package/system/dist/builtins/core-blocks/power-source-service.d.ts +2 -0
  34. package/system/dist/builtins/core-blocks/timed-run/timed-run-service.d.ts +8 -2
  35. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  36. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  37. package/system/dist/builtins/device-manager/device-bindings-store.d.ts +8 -5
  38. package/system/dist/builtins/device-manager/device-manager.addon.js +116 -22
  39. package/system/dist/builtins/device-manager/device-manager.addon.mjs +116 -22
  40. package/system/dist/builtins/device-manager/device-row-store.d.ts +0 -52
  41. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  42. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  43. package/system/dist/builtins/keychain/index.js +4 -4
  44. package/system/dist/builtins/keychain/index.mjs +4 -4
  45. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  46. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  47. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  48. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  49. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  50. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  51. package/system/dist/builtins/loki-logging/index.js +1 -1
  52. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  53. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  54. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  55. package/system/dist/builtins/platform-probe/index.js +1 -1
  56. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  57. package/system/dist/builtins/record-entries/index.js +1 -1
  58. package/system/dist/builtins/record-entries/index.mjs +1 -1
  59. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  60. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  61. package/system/dist/builtins/snapshot/index.js +1 -1
  62. package/system/dist/builtins/snapshot/index.mjs +1 -1
  63. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  64. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  65. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  66. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  67. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  68. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  69. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  70. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  71. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  72. package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
  73. package/system/dist/builtins/winston-logging/index.js +1 -1
  74. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  75. package/system/dist/{capture-engine-7E2O4-UN.js → capture-engine-CGU4rnN-.js} +1 -1
  76. package/system/dist/{capture-engine-B5IBWIRT.mjs → capture-engine-CLrh3FG0.mjs} +1 -1
  77. package/system/dist/{composition-sources-Cfqn4cly.mjs → composition-sources-CoLbBru1.mjs} +32 -5
  78. package/system/dist/{composition-sources-DLtc8lSL.js → composition-sources-bhWIz4Rp.js} +32 -5
  79. package/system/dist/{constants-DjsgCnZk.mjs → constants-CfAS4Qm6.mjs} +1 -1
  80. package/system/dist/{constants-Cc70YreG.js → constants-DZwpZY5J.js} +1 -1
  81. package/system/dist/{device-ca-CVP5h3u1.mjs → device-ca-CAbEBLyf.mjs} +1 -1
  82. package/system/dist/{device-ca-C6JqeFfK.js → device-ca-ksS811fC.js} +1 -1
  83. package/system/dist/{dist-OmrC_RZs.mjs → dist-ByiDJLen.mjs} +1081 -327
  84. package/system/dist/{dist-CLnTYKFn.js → dist-DlRUArVs.js} +1128 -338
  85. package/system/dist/file-host-worker.js +1 -1
  86. package/system/dist/file-host-worker.mjs +1 -1
  87. package/system/dist/{hub-identity-CKQVXf4o.mjs → hub-identity-Bh28ooQx.mjs} +1 -1
  88. package/system/dist/{hub-identity-TrZcnJkB.js → hub-identity-C-1NeWlr.js} +1 -1
  89. package/system/dist/{hub-mdns-ciao-ocg6suyX.js → hub-mdns-ciao-CL-Z9yMs.js} +2 -2
  90. package/system/dist/{hub-mdns-ciao-C8G0K1Z1.mjs → hub-mdns-ciao-OWO6Bw-X.mjs} +2 -2
  91. package/system/dist/index.js +16 -12
  92. package/system/dist/index.mjs +16 -12
  93. package/system/dist/{legacy-integration-rows-door-BPkJUGaX.mjs → legacy-integration-rows-door-Be_QKUlY.mjs} +1 -1
  94. package/system/dist/{legacy-integration-rows-door-b6CUxtXX.js → legacy-integration-rows-door-CDPH26e8.js} +1 -1
  95. package/system/dist/{rename-composition-block-N7lslQJK.js → rename-composition-block-Bs5KT3Gn.js} +1 -1
  96. package/system/dist/{rename-composition-block-DPlsP1xF.mjs → rename-composition-block-CncvFIHl.mjs} +1 -1
  97. package/system/dist/{restore-archive-CcuEoEtj.js → restore-archive-CHUKcl3T.js} +1 -1
  98. package/system/dist/{restore-archive-Btc3H-Fg.mjs → restore-archive-DX7kK3LQ.mjs} +1 -1
  99. package/system/dist/{wal-maintenance-g7yvxLMj.mjs → wal-maintenance-Fibm7rsM.mjs} +0 -0
  100. package/system/dist/{wal-maintenance-B2_uCEi5.js → wal-maintenance-GNE9Oqdu.js} +0 -0
  101. package/system/package.json +1 -1
@@ -803,7 +803,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
803
803
  return EventCategory;
804
804
  }({});
805
805
  //#endregion
806
- //#region ../types/dist/composed-stable-id-DFNyOFzz.mjs
806
+ //#region ../types/dist/composed-stable-id-CPp3votu.mjs
807
807
  /**
808
808
  import { errMsg } from '@camstack/types'
809
809
  * Extract a human-readable message from an unknown error value.
@@ -822,12 +822,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
822
822
  DeviceType["Siren"] = "siren";
823
823
  DeviceType["Switch"] = "switch";
824
824
  DeviceType["Sensor"] = "sensor";
825
- DeviceType["Thermostat"] = "thermostat";
826
- /** Air-conditioner / heat-pump climate device (HVAC) — shares the
827
- * `climate-control` cap surface with `Thermostat` but renders a
828
- * dedicated AC-appropriate control UI (mode chips, fan speed,
829
- * independent vertical/horizontal swing). Sources: native Gree, and
830
- * reusable by other AC integrations. */
825
+ /** Every climate device: an air conditioner, a room thermostat, a radiator
826
+ * valve, a floor-heating zone, a heat-pump circuit. They share one set of
827
+ * controls (`climate-control`), so they are one type; WHICH kind of climate
828
+ * device it is is its {@link DeviceRole} (`climate-*`), which the UI and the
829
+ * exports branch on. The retired `thermostat` type is read as this one
830
+ * (`canonicalStoredDeviceType`). */
831
831
  DeviceType["Climate"] = "climate";
832
832
  DeviceType["Button"] = "button";
833
833
  /** Generic stateless event emitter — carries a device's EXACT declared
@@ -918,10 +918,6 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
918
918
  /** Washing machine. A plug-built one is running while its power stays
919
919
  * above a threshold. No program cap — that surface is the dishwasher's. */
920
920
  DeviceType["Washer"] = "washer";
921
- /** A dumb plug-in stove or heater: a switch (and, with a meter, a power
922
- * reading) that only runs while the plug is on. Built from a smart plug;
923
- * the `timed-run` cap switches it off again after a chosen time. */
924
- DeviceType["Heater"] = "heater";
925
921
  /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
926
922
  DeviceType["Dryer"] = "dryer";
927
923
  /** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
@@ -1150,6 +1146,27 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1150
1146
  /** A smart plug: a `switch` whose source says it is an outlet (HA
1151
1147
  * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
1152
1148
  DeviceRole["Outlet"] = "outlet";
1149
+ /** A dumb plug-in stove or heater behind a switch: it runs only while the
1150
+ * switch is on. Offered `timed-run`, which switches it off again after a
1151
+ * chosen time. */
1152
+ DeviceRole["SwitchHeater"] = "switch-heater";
1153
+ /** A plain fan behind a switch (a smart plug powering it): drawn as a fan,
1154
+ * with the switch's on/off only. Speed or oscillation appear only when the
1155
+ * device also has a fan cap (D1033). */
1156
+ DeviceRole["SwitchFan"] = "switch-fan";
1157
+ /** Air conditioner / split unit: cooling, fan speed, louvres. */
1158
+ DeviceRole["ClimateAc"] = "climate-ac";
1159
+ /** Room thermostat: a setpoint and a room temperature. The default. */
1160
+ DeviceRole["ClimateThermostat"] = "climate-thermostat";
1161
+ /** Floor-heating zone actuator. */
1162
+ DeviceRole["ClimateFloor"] = "climate-floor";
1163
+ /** Radiator valve (thermostatic radiator head). */
1164
+ DeviceRole["ClimateRadiator"] = "climate-radiator";
1165
+ /** A heater with its own thermostat (stove, convector). */
1166
+ DeviceRole["ClimateHeater"] = "climate-heater";
1167
+ /** One heating/cooling circuit of a heat pump: a water loop with comfort /
1168
+ * eco setpoints and a heat/cool mode, no room sensor. */
1169
+ DeviceRole["ClimateHeatPumpCircuit"] = "climate-heat-pump-circuit";
1153
1170
  /** Generic motion / occupancy / moving event source. Distinct from
1154
1171
  * the camera accessory PirSensor role: that one is a camera child;
1155
1172
  * this is a standalone HA / 3rd-party motion sensor. */
@@ -1226,7 +1243,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1226
1243
  */
1227
1244
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
1228
1245
  //#endregion
1229
- //#region ../types/dist/sleep-D_NpiLFP.mjs
1246
+ //#region ../types/dist/sleep-Bn346wCJ.mjs
1230
1247
  /**
1231
1248
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1232
1249
  * window to float samples (D455).
@@ -7772,6 +7789,50 @@ var ACTUATOR_CAP_VOCABULARY = {
7772
7789
  value: false
7773
7790
  },
7774
7791
  args: { oscillating: false }
7792
+ },
7793
+ {
7794
+ id: "fan.horizontalOscillateOn",
7795
+ method: "setOscillationAxis",
7796
+ label: t("Horizontal oscillation on", "Oscillazione orizzontale attiva"),
7797
+ phrase: t("Start the horizontal oscillation of {device}", "Attiva l’oscillazione orizzontale di {device}"),
7798
+ icon: "move-horizontal",
7799
+ args: {
7800
+ axis: "horizontal",
7801
+ oscillating: true
7802
+ }
7803
+ },
7804
+ {
7805
+ id: "fan.horizontalOscillateOff",
7806
+ method: "setOscillationAxis",
7807
+ label: t("Horizontal oscillation off", "Oscillazione orizzontale spenta"),
7808
+ phrase: t("Stop the horizontal oscillation of {device}", "Ferma l’oscillazione orizzontale di {device}"),
7809
+ icon: "move-horizontal",
7810
+ args: {
7811
+ axis: "horizontal",
7812
+ oscillating: false
7813
+ }
7814
+ },
7815
+ {
7816
+ id: "fan.verticalOscillateOn",
7817
+ method: "setOscillationAxis",
7818
+ label: t("Vertical oscillation on", "Oscillazione verticale attiva"),
7819
+ phrase: t("Start the vertical oscillation of {device}", "Attiva l’oscillazione verticale di {device}"),
7820
+ icon: "move-vertical",
7821
+ args: {
7822
+ axis: "vertical",
7823
+ oscillating: true
7824
+ }
7825
+ },
7826
+ {
7827
+ id: "fan.verticalOscillateOff",
7828
+ method: "setOscillationAxis",
7829
+ label: t("Vertical oscillation off", "Oscillazione verticale spenta"),
7830
+ phrase: t("Stop the vertical oscillation of {device}", "Ferma l’oscillazione verticale di {device}"),
7831
+ icon: "move-vertical",
7832
+ args: {
7833
+ axis: "vertical",
7834
+ oscillating: false
7835
+ }
7775
7836
  }
7776
7837
  ],
7777
7838
  state: [{
@@ -13849,7 +13910,7 @@ function sleep(ms) {
13849
13910
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
13850
13911
  }
13851
13912
  //#endregion
13852
- //#region ../types/dist/implemented-methods-M5aguGon.mjs
13913
+ //#region ../types/dist/implemented-methods-5YMDeE3f.mjs
13853
13914
  var AUDIO_ENCODER_BY_CODEC = {
13854
13915
  opus: "libopus",
13855
13916
  aac: "aac",
@@ -42541,16 +42602,39 @@ function metaQuantity(schema) {
42541
42602
  function quantityOfField(schema) {
42542
42603
  return metaQuantity(schema) ?? metaQuantity(unwrapSchema(schema));
42543
42604
  }
42605
+ function scalarKind(schema) {
42606
+ const s = unwrapSchema(schema);
42607
+ if (s instanceof z.ZodNumber) return "number";
42608
+ if (s instanceof z.ZodString) return "string";
42609
+ if (s instanceof z.ZodBoolean) return "boolean";
42610
+ return null;
42611
+ }
42612
+ /** A union is a leaf only when EVERY member is a scalar; one object or array member keeps it out. */
42613
+ function unionMembersOf(s) {
42614
+ const members = [];
42615
+ for (const option of s.options) {
42616
+ if (!(option instanceof z.ZodType)) return null;
42617
+ const kind = scalarKind(option);
42618
+ if (kind === null) return null;
42619
+ if (!members.includes(kind)) members.push(kind);
42620
+ }
42621
+ return members.length > 0 ? members : null;
42622
+ }
42544
42623
  function leafKind(schema) {
42545
42624
  const s = unwrapSchema(schema);
42546
42625
  if (s instanceof z.ZodEnum) return {
42547
42626
  kind: "enum",
42548
42627
  enumValues: s.options
42549
42628
  };
42550
- if (s instanceof z.ZodNumber) return { kind: "number" };
42551
- if (s instanceof z.ZodString) return { kind: "string" };
42552
- if (s instanceof z.ZodBoolean) return { kind: "boolean" };
42553
- return null;
42629
+ if (s instanceof z.ZodUnion) {
42630
+ const members = unionMembersOf(s);
42631
+ return members === null ? null : {
42632
+ kind: "union",
42633
+ unionMembers: members
42634
+ };
42635
+ }
42636
+ const scalar = scalarKind(s);
42637
+ return scalar === null ? null : { kind: scalar };
42554
42638
  }
42555
42639
  /** Walk a cap status schema into flat wireable leaf fields (dotted paths).
42556
42640
  * Recurses into nested ZodObject (unwrapping nullable/optional/default first),
@@ -42575,6 +42659,7 @@ function enumerateSchemaFields(schema, prefix = "") {
42575
42659
  path,
42576
42660
  kind: leaf.kind,
42577
42661
  ...leaf.enumValues ? { enumValues: leaf.enumValues } : {},
42662
+ ...leaf.unionMembers ? { unionMembers: leaf.unionMembers } : {},
42578
42663
  ...quantity !== void 0 ? { quantity } : {}
42579
42664
  });
42580
42665
  }
@@ -46419,7 +46504,7 @@ var accessoriesCapability = {
46419
46504
  DeviceType.Switch,
46420
46505
  DeviceType.Light,
46421
46506
  DeviceType.Sensor,
46422
- DeviceType.Thermostat,
46507
+ DeviceType.Climate,
46423
46508
  DeviceType.Cover,
46424
46509
  DeviceType.Lock,
46425
46510
  DeviceType.Fan,
@@ -49457,7 +49542,7 @@ var BATTERY_DEVICE_TYPES = [
49457
49542
  DeviceType.Switch,
49458
49543
  DeviceType.PetFeeder,
49459
49544
  DeviceType.Container,
49460
- DeviceType.Thermostat,
49545
+ DeviceType.Climate,
49461
49546
  DeviceType.EventEmitter
49462
49547
  ];
49463
49548
  /** Generic Customize target for the percentage reading (D936). */
@@ -51653,7 +51738,14 @@ var climateControlCapability = {
51653
51738
  scope: "device",
51654
51739
  deviceNative: true,
51655
51740
  mode: "singleton",
51656
- deviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
51741
+ deviceTypes: [DeviceType.Climate],
51742
+ power: {
51743
+ kind: "mode",
51744
+ field: "mode",
51745
+ offValue: "off",
51746
+ set: "setMode",
51747
+ lastField: "lastActiveMode"
51748
+ },
51657
51749
  methods: {
51658
51750
  setMode: method(z.object({
51659
51751
  deviceId: z.number().int().nonnegative(),
@@ -52067,7 +52159,8 @@ function describeStateField(schema, path) {
52067
52159
  kind: leaf.kind,
52068
52160
  nullable: field.safeParse(null).success,
52069
52161
  required: !field.safeParse(void 0).success,
52070
- ...leaf.enumValues === void 0 ? {} : { enumValues: leaf.enumValues }
52162
+ ...leaf.enumValues === void 0 ? {} : { enumValues: leaf.enumValues },
52163
+ ...leaf.unionMembers === void 0 ? {} : { unionMembers: leaf.unionMembers }
52071
52164
  };
52072
52165
  }
52073
52166
  function describeTopLevelStateFields(schema) {
@@ -52185,6 +52278,7 @@ var CompositionProblemCodeSchema = z.enum([
52185
52278
  "nested-field",
52186
52279
  "missing-field",
52187
52280
  "kind-mismatch",
52281
+ "source-kind-mismatch",
52188
52282
  "may-be-null",
52189
52283
  "source-missing",
52190
52284
  "source-unreadable",
@@ -52206,7 +52300,8 @@ var CompositionProblemCodeSchema = z.enum([
52206
52300
  "command-method-unknown",
52207
52301
  "command-source-unknown",
52208
52302
  "command-input-unknown",
52209
- "command-input-missing"
52303
+ "command-input-missing",
52304
+ "power-source-is-actuator"
52210
52305
  ]);
52211
52306
  /** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
52212
52307
  var CompositionProblemSchema = z.object({
@@ -53323,6 +53418,13 @@ var mediaPlayerCapability = {
53323
53418
  deviceNative: true,
53324
53419
  mode: "singleton",
53325
53420
  deviceTypes: [DeviceType.MediaPlayer],
53421
+ power: {
53422
+ kind: "methods",
53423
+ field: "state",
53424
+ offValues: ["off", "standby"],
53425
+ on: "turnOn",
53426
+ off: "turnOff"
53427
+ },
53326
53428
  methods: {
53327
53429
  turnOn: optionalMethod(deviceOnly, z.void(), {
53328
53430
  kind: "mutation",
@@ -53455,7 +53557,7 @@ var mediaPlayerCapability = {
53455
53557
  };
53456
53558
  /**
53457
53559
  * Customize catalog, projected from every `*.cap.ts` `customize` block.
53458
- * 10 caps. Field keys are `runtimeState` paths. No Zod.
53560
+ * 11 caps. Field keys are `runtimeState` paths. No Zod.
53459
53561
  */
53460
53562
  var CAP_CUSTOMIZE_CATALOG = {
53461
53563
  "battery": {
@@ -53470,7 +53572,7 @@ var CAP_CUSTOMIZE_CATALOG = {
53470
53572
  DeviceType.Switch,
53471
53573
  DeviceType.PetFeeder,
53472
53574
  DeviceType.Container,
53473
- DeviceType.Thermostat,
53575
+ DeviceType.Climate,
53474
53576
  DeviceType.EventEmitter
53475
53577
  ],
53476
53578
  apply: "add",
@@ -53526,7 +53628,6 @@ var CAP_CUSTOMIZE_CATALOG = {
53526
53628
  DeviceType.Siren,
53527
53629
  DeviceType.Switch,
53528
53630
  DeviceType.Sensor,
53529
- DeviceType.Thermostat,
53530
53631
  DeviceType.Climate,
53531
53632
  DeviceType.Button,
53532
53633
  DeviceType.EventEmitter,
@@ -53554,7 +53655,6 @@ var CAP_CUSTOMIZE_CATALOG = {
53554
53655
  DeviceType.PetFountain,
53555
53656
  DeviceType.Dishwasher,
53556
53657
  DeviceType.Washer,
53557
- DeviceType.Heater,
53558
53658
  DeviceType.Dryer,
53559
53659
  DeviceType.Gateway,
53560
53660
  DeviceType.HeatPump
@@ -53688,6 +53788,247 @@ var CAP_CUSTOMIZE_CATALOG = {
53688
53788
  debounceMs: 2e3
53689
53789
  }]
53690
53790
  },
53791
+ "fan-control": {
53792
+ version: 1,
53793
+ targets: [
53794
+ {
53795
+ id: "horizontal-oscillating",
53796
+ cardinality: "scalar",
53797
+ deviceTypes: [DeviceType.Fan],
53798
+ apply: "replace",
53799
+ vocabularyCap: "fan-control",
53800
+ vocabularyStateField: "oscillating",
53801
+ sources: [{
53802
+ kind: "switch",
53803
+ transformKinds: ["identity"],
53804
+ transforms: [{ kind: "identity" }]
53805
+ }],
53806
+ sourceReport: { status: "assignment-status" },
53807
+ advancedExpression: false,
53808
+ section: "oscillation-axes",
53809
+ path: "oscillationAxes.horizontal.oscillating",
53810
+ valueKind: "boolean",
53811
+ nullable: true
53812
+ },
53813
+ {
53814
+ id: "horizontal-angle",
53815
+ cardinality: "scalar",
53816
+ deviceTypes: [DeviceType.Fan],
53817
+ apply: "replace",
53818
+ vocabularyCap: "fan-control",
53819
+ sources: [{
53820
+ kind: "numeric",
53821
+ transformKinds: ["identity"],
53822
+ transforms: [{ kind: "identity" }]
53823
+ }],
53824
+ sourceReport: { status: "assignment-status" },
53825
+ advancedExpression: false,
53826
+ section: "oscillation-axes",
53827
+ path: "oscillationAxes.horizontal.angle",
53828
+ valueKind: "number",
53829
+ nullable: true,
53830
+ companions: [
53831
+ {
53832
+ kind: "source-field",
53833
+ path: "oscillationAxes.horizontal.min",
53834
+ field: "min"
53835
+ },
53836
+ {
53837
+ kind: "source-field",
53838
+ path: "oscillationAxes.horizontal.max",
53839
+ field: "max"
53840
+ },
53841
+ {
53842
+ kind: "source-field",
53843
+ path: "oscillationAxes.horizontal.step",
53844
+ field: "step"
53845
+ }
53846
+ ]
53847
+ },
53848
+ {
53849
+ id: "horizontal-sweepFrom",
53850
+ cardinality: "scalar",
53851
+ deviceTypes: [DeviceType.Fan],
53852
+ apply: "replace",
53853
+ vocabularyCap: "fan-control",
53854
+ sources: [{
53855
+ kind: "numeric",
53856
+ transformKinds: ["identity"],
53857
+ transforms: [{ kind: "identity" }]
53858
+ }],
53859
+ sourceReport: { status: "assignment-status" },
53860
+ advancedExpression: false,
53861
+ section: "oscillation-axes",
53862
+ path: "oscillationAxes.horizontal.sweepFrom",
53863
+ valueKind: "number",
53864
+ nullable: true
53865
+ },
53866
+ {
53867
+ id: "horizontal-sweepTo",
53868
+ cardinality: "scalar",
53869
+ deviceTypes: [DeviceType.Fan],
53870
+ apply: "replace",
53871
+ vocabularyCap: "fan-control",
53872
+ sources: [{
53873
+ kind: "numeric",
53874
+ transformKinds: ["identity"],
53875
+ transforms: [{ kind: "identity" }]
53876
+ }],
53877
+ sourceReport: { status: "assignment-status" },
53878
+ advancedExpression: false,
53879
+ section: "oscillation-axes",
53880
+ path: "oscillationAxes.horizontal.sweepTo",
53881
+ valueKind: "number",
53882
+ nullable: true
53883
+ },
53884
+ {
53885
+ id: "vertical-oscillating",
53886
+ cardinality: "scalar",
53887
+ deviceTypes: [DeviceType.Fan],
53888
+ apply: "replace",
53889
+ vocabularyCap: "fan-control",
53890
+ vocabularyStateField: "oscillating",
53891
+ sources: [{
53892
+ kind: "switch",
53893
+ transformKinds: ["identity"],
53894
+ transforms: [{ kind: "identity" }]
53895
+ }],
53896
+ sourceReport: { status: "assignment-status" },
53897
+ advancedExpression: false,
53898
+ section: "oscillation-axes",
53899
+ path: "oscillationAxes.vertical.oscillating",
53900
+ valueKind: "boolean",
53901
+ nullable: true
53902
+ },
53903
+ {
53904
+ id: "vertical-angle",
53905
+ cardinality: "scalar",
53906
+ deviceTypes: [DeviceType.Fan],
53907
+ apply: "replace",
53908
+ vocabularyCap: "fan-control",
53909
+ sources: [{
53910
+ kind: "numeric",
53911
+ transformKinds: ["identity"],
53912
+ transforms: [{ kind: "identity" }]
53913
+ }],
53914
+ sourceReport: { status: "assignment-status" },
53915
+ advancedExpression: false,
53916
+ section: "oscillation-axes",
53917
+ path: "oscillationAxes.vertical.angle",
53918
+ valueKind: "number",
53919
+ nullable: true,
53920
+ companions: [
53921
+ {
53922
+ kind: "source-field",
53923
+ path: "oscillationAxes.vertical.min",
53924
+ field: "min"
53925
+ },
53926
+ {
53927
+ kind: "source-field",
53928
+ path: "oscillationAxes.vertical.max",
53929
+ field: "max"
53930
+ },
53931
+ {
53932
+ kind: "source-field",
53933
+ path: "oscillationAxes.vertical.step",
53934
+ field: "step"
53935
+ }
53936
+ ]
53937
+ },
53938
+ {
53939
+ id: "vertical-sweepFrom",
53940
+ cardinality: "scalar",
53941
+ deviceTypes: [DeviceType.Fan],
53942
+ apply: "replace",
53943
+ vocabularyCap: "fan-control",
53944
+ sources: [{
53945
+ kind: "numeric",
53946
+ transformKinds: ["identity"],
53947
+ transforms: [{ kind: "identity" }]
53948
+ }],
53949
+ sourceReport: { status: "assignment-status" },
53950
+ advancedExpression: false,
53951
+ section: "oscillation-axes",
53952
+ path: "oscillationAxes.vertical.sweepFrom",
53953
+ valueKind: "number",
53954
+ nullable: true
53955
+ },
53956
+ {
53957
+ id: "vertical-sweepTo",
53958
+ cardinality: "scalar",
53959
+ deviceTypes: [DeviceType.Fan],
53960
+ apply: "replace",
53961
+ vocabularyCap: "fan-control",
53962
+ sources: [{
53963
+ kind: "numeric",
53964
+ transformKinds: ["identity"],
53965
+ transforms: [{ kind: "identity" }]
53966
+ }],
53967
+ sourceReport: { status: "assignment-status" },
53968
+ advancedExpression: false,
53969
+ section: "oscillation-axes",
53970
+ path: "oscillationAxes.vertical.sweepTo",
53971
+ valueKind: "number",
53972
+ nullable: true
53973
+ },
53974
+ {
53975
+ id: "preset",
53976
+ cardinality: "scalar",
53977
+ deviceTypes: [DeviceType.Fan],
53978
+ apply: "replace",
53979
+ vocabularyCap: "fan-control",
53980
+ sources: [{
53981
+ kind: "field",
53982
+ valueKinds: ["string"],
53983
+ transformKinds: ["identity"],
53984
+ transforms: [{ kind: "identity" }]
53985
+ }],
53986
+ sourceReport: { status: "assignment-status" },
53987
+ advancedExpression: false,
53988
+ path: "preset",
53989
+ valueKind: "string",
53990
+ nullable: false
53991
+ }
53992
+ ],
53993
+ overridable: [
53994
+ {
53995
+ path: "oscillationAxes.horizontal.oscillating",
53996
+ by: "horizontal-oscillating"
53997
+ },
53998
+ {
53999
+ path: "oscillationAxes.horizontal.angle",
54000
+ by: "horizontal-angle"
54001
+ },
54002
+ {
54003
+ path: "oscillationAxes.horizontal.sweepFrom",
54004
+ by: "horizontal-sweepFrom"
54005
+ },
54006
+ {
54007
+ path: "oscillationAxes.horizontal.sweepTo",
54008
+ by: "horizontal-sweepTo"
54009
+ },
54010
+ {
54011
+ path: "oscillationAxes.vertical.oscillating",
54012
+ by: "vertical-oscillating"
54013
+ },
54014
+ {
54015
+ path: "oscillationAxes.vertical.angle",
54016
+ by: "vertical-angle"
54017
+ },
54018
+ {
54019
+ path: "oscillationAxes.vertical.sweepFrom",
54020
+ by: "vertical-sweepFrom"
54021
+ },
54022
+ {
54023
+ path: "oscillationAxes.vertical.sweepTo",
54024
+ by: "vertical-sweepTo"
54025
+ },
54026
+ {
54027
+ path: "preset",
54028
+ by: "preset"
54029
+ }
54030
+ ]
54031
+ },
53691
54032
  "fan-presets": {
53692
54033
  version: 1,
53693
54034
  targets: [{
@@ -53788,7 +54129,6 @@ var CAP_CUSTOMIZE_CATALOG = {
53788
54129
  DeviceType.Light,
53789
54130
  DeviceType.Fan,
53790
54131
  DeviceType.Climate,
53791
- DeviceType.Thermostat,
53792
54132
  DeviceType.Humidifier,
53793
54133
  DeviceType.WaterHeater,
53794
54134
  DeviceType.MediaPlayer,
@@ -53797,8 +54137,7 @@ var CAP_CUSTOMIZE_CATALOG = {
53797
54137
  DeviceType.Dishwasher,
53798
54138
  DeviceType.Vacuum,
53799
54139
  DeviceType.LawnMower,
53800
- DeviceType.PetFeeder,
53801
- DeviceType.Heater
54140
+ DeviceType.PetFeeder
53802
54141
  ],
53803
54142
  apply: "add",
53804
54143
  vocabularyCap: "power-meter",
@@ -53828,7 +54167,6 @@ var CAP_CUSTOMIZE_CATALOG = {
53828
54167
  DeviceType.Light,
53829
54168
  DeviceType.Fan,
53830
54169
  DeviceType.Climate,
53831
- DeviceType.Thermostat,
53832
54170
  DeviceType.Humidifier,
53833
54171
  DeviceType.WaterHeater,
53834
54172
  DeviceType.MediaPlayer,
@@ -53837,8 +54175,7 @@ var CAP_CUSTOMIZE_CATALOG = {
53837
54175
  DeviceType.Dishwasher,
53838
54176
  DeviceType.Vacuum,
53839
54177
  DeviceType.LawnMower,
53840
- DeviceType.PetFeeder,
53841
- DeviceType.Heater
54178
+ DeviceType.PetFeeder
53842
54179
  ],
53843
54180
  apply: "add",
53844
54181
  vocabularyCap: "power-meter",
@@ -53868,7 +54205,6 @@ var CAP_CUSTOMIZE_CATALOG = {
53868
54205
  DeviceType.Light,
53869
54206
  DeviceType.Fan,
53870
54207
  DeviceType.Climate,
53871
- DeviceType.Thermostat,
53872
54208
  DeviceType.Humidifier,
53873
54209
  DeviceType.WaterHeater,
53874
54210
  DeviceType.MediaPlayer,
@@ -53877,8 +54213,7 @@ var CAP_CUSTOMIZE_CATALOG = {
53877
54213
  DeviceType.Dishwasher,
53878
54214
  DeviceType.Vacuum,
53879
54215
  DeviceType.LawnMower,
53880
- DeviceType.PetFeeder,
53881
- DeviceType.Heater
54216
+ DeviceType.PetFeeder
53882
54217
  ],
53883
54218
  apply: "add",
53884
54219
  vocabularyCap: "power-meter",
@@ -53908,7 +54243,6 @@ var CAP_CUSTOMIZE_CATALOG = {
53908
54243
  DeviceType.Light,
53909
54244
  DeviceType.Fan,
53910
54245
  DeviceType.Climate,
53911
- DeviceType.Thermostat,
53912
54246
  DeviceType.Humidifier,
53913
54247
  DeviceType.WaterHeater,
53914
54248
  DeviceType.MediaPlayer,
@@ -53917,8 +54251,7 @@ var CAP_CUSTOMIZE_CATALOG = {
53917
54251
  DeviceType.Dishwasher,
53918
54252
  DeviceType.Vacuum,
53919
54253
  DeviceType.LawnMower,
53920
- DeviceType.PetFeeder,
53921
- DeviceType.Heater
54254
+ DeviceType.PetFeeder
53922
54255
  ],
53923
54256
  apply: "add",
53924
54257
  vocabularyCap: "power-meter",
@@ -54020,9 +54353,7 @@ var CAP_CUSTOMIZE_CATALOG = {
54020
54353
  DeviceType.Humidifier,
54021
54354
  DeviceType.Fan,
54022
54355
  DeviceType.Climate,
54023
- DeviceType.Thermostat,
54024
- DeviceType.PetFeeder,
54025
- DeviceType.Heater
54356
+ DeviceType.PetFeeder
54026
54357
  ],
54027
54358
  apply: "add",
54028
54359
  vocabularyCap: "running-state",
@@ -54335,12 +54666,37 @@ function readKinds(read, lookupCap) {
54335
54666
  code: "source-field-unknown",
54336
54667
  message: `\`${read.cap}\` has no field \`${read.fieldPath}\``
54337
54668
  };
54338
- const base = field.kind === "enum" ? "string" : field.kind;
54669
+ const bases = field.kind === "union" ? field.unionMembers ?? [] : [field.kind === "enum" ? "string" : field.kind];
54339
54670
  return {
54340
54671
  ok: true,
54341
- kinds: new Set(field.nullable ? [base, "null"] : [base])
54672
+ kinds: new Set(field.nullable ? [...bases, "null"] : bases)
54342
54673
  };
54343
54674
  }
54675
+ /** A union field is read as a source (D1034), never written: no single kind to check a source against. */
54676
+ function unionTargetProblem(cap, path, at) {
54677
+ return problem("kind-mismatch", at, `\`${cap}.${path}\` is a union — it is read as a source, never written`);
54678
+ }
54679
+ /** The one value kind a target field accepts. */
54680
+ function acceptedKind(target) {
54681
+ if (target.kind === "union") return null;
54682
+ return target.kind === "enum" ? "string" : target.kind;
54683
+ }
54684
+ /**
54685
+ * A direct read of a UNION source field (D1034) is judged by the member that
54686
+ * fits the target: when one does, the read produces that kind only (a reading
54687
+ * of another kind is UNAVAILABLE at read time, never a coerced value); when
54688
+ * none does, the kinds stay as they are and `compatibility` names the mismatch.
54689
+ */
54690
+ function narrowUnionRead(source, target, kinds, lookupCap) {
54691
+ if (source.kind !== "from") return kinds;
54692
+ const def = lookupCap(source.cap);
54693
+ const schema = def?.runtimeState ?? def?.status?.schema;
54694
+ if (schema === void 0) return kinds;
54695
+ const field = describeStateField(schema, source.fieldPath);
54696
+ const accepted = acceptedKind(target);
54697
+ if (field?.kind !== "union" || accepted === null || !kinds.has(accepted)) return kinds;
54698
+ return new Set(kinds.has("null") ? [accepted, "null"] : [accepted]);
54699
+ }
54344
54700
  function sourceKinds(source, lookupCap) {
54345
54701
  if (source.kind === "from") return readKinds(source, lookupCap);
54346
54702
  if (source.kind === "code") return {
@@ -54377,7 +54733,8 @@ function sourceKinds(source, lookupCap) {
54377
54733
  };
54378
54734
  }
54379
54735
  function compatibility(cap, target, kinds, at) {
54380
- const allowed = target.kind === "enum" ? "string" : target.kind;
54736
+ const allowed = acceptedKind(target);
54737
+ if (allowed === null) return [unionTargetProblem(cap, target.path, at)];
54381
54738
  const offending = [...kinds].filter((k) => k !== "null" && k !== allowed);
54382
54739
  const problems = [];
54383
54740
  if (offending.length > 0) problems.push(problem("kind-mismatch", at, `\`${cap}.${target.path}\` is a ${target.kind}; this source can produce ${offending.join(" or ")}`));
@@ -54486,6 +54843,7 @@ function planItemField(ctx, leaf) {
54486
54843
  if (ctx.reserved.has(path)) return refused(problem("item-field-reserved", at, `\`${capName}.${itemArray.path}[].${path}\` is set by the composer itself — it takes no source`));
54487
54844
  const tf = describeStateField(itemArray.itemSchema, path);
54488
54845
  if (tf === null) return refused(problem("unknown-field", at, `a \`${capName}\` item has no field \`${path}\``));
54846
+ if (tf.kind === "union") return refused(unionTargetProblem(capName, path, at));
54489
54847
  const kinds = sourceKinds(source, lookupCap);
54490
54848
  if (!kinds.ok) return refused(problem(kinds.code, at, kinds.message));
54491
54849
  const role = roleOf(source);
@@ -54511,7 +54869,7 @@ function planItemField(ctx, leaf) {
54511
54869
  };
54512
54870
  const enumProblem = enumLiteralProblem(capName, tf, source, at);
54513
54871
  return {
54514
- problems: [...compatibility(capName, tf, kinds.kinds, at), ...enumProblem === null ? [] : [enumProblem]],
54872
+ problems: [...compatibility(capName, tf, narrowUnionRead(source, tf, kinds.kinds, lookupCap), at), ...enumProblem === null ? [] : [enumProblem]],
54515
54873
  fields: [plan],
54516
54874
  features: [],
54517
54875
  events: []
@@ -54728,7 +55086,7 @@ function numeric(input) {
54728
55086
  }, ...alsoFrom === void 0 ? [] : [alsoFrom.accept]]
54729
55087
  };
54730
55088
  }
54731
- var CLIMATE_DEVICES = [DeviceType.Thermostat, DeviceType.Climate];
55089
+ var CLIMATE_DEVICES = [DeviceType.Climate];
54732
55090
  function binary(input) {
54733
55091
  return {
54734
55092
  ...input,
@@ -55050,8 +55408,8 @@ var GROUP_TEMPLATES = [
55050
55408
  actuator({
55051
55409
  id: "climate",
55052
55410
  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.",
55053
- deviceType: DeviceType.Thermostat,
55054
- memberDeviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
55411
+ deviceType: DeviceType.Climate,
55412
+ memberDeviceTypes: [DeviceType.Climate],
55055
55413
  outputCap: "group-active",
55056
55414
  outputField: "active",
55057
55415
  member: {
@@ -56329,6 +56687,202 @@ function findCandidateCycles(candidate, stored) {
56329
56687
  }];
56330
56688
  });
56331
56689
  }
56690
+ var PowerSourceRefusalReasonSchema = z.enum([
56691
+ "no-power-source",
56692
+ "switch-missing",
56693
+ "switch-offline",
56694
+ "switch-unknown",
56695
+ "restart-in-progress",
56696
+ "switch-call-failed",
56697
+ "switch-is-actuator"
56698
+ ]);
56699
+ var PowerSourceActionResultSchema = z.discriminatedUnion("accepted", [z.object({ accepted: z.literal(true) }), z.object({
56700
+ accepted: z.literal(false),
56701
+ reason: PowerSourceRefusalReasonSchema,
56702
+ /** One line for the operator, naming the switch. */
56703
+ message: z.string()
56704
+ })]);
56705
+ var PowerSourceInfoSchema = z.object({
56706
+ /** False when the device has no power source linked; the rest is then empty. */
56707
+ linked: z.boolean(),
56708
+ switchDeviceId: z.number().nullable(),
56709
+ switchName: z.string().nullable(),
56710
+ /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
56711
+ switchOn: z.boolean().nullable(),
56712
+ switchOnline: z.boolean().nullable(),
56713
+ restartInProgress: z.boolean(),
56714
+ offSeconds: z.number().int()
56715
+ });
56716
+ /** The composed slice: the switch state the link mirrors, plus the stored off time. */
56717
+ var PowerSourceStateSchema = z.object({
56718
+ /** Null while the switch has not reported: unknown is never `false` (D393). */
56719
+ switchOn: z.boolean().nullable(),
56720
+ offSeconds: z.number().int(),
56721
+ lastFetchedAt: z.number()
56722
+ });
56723
+ var POWER_SOURCE_DEVICE_TYPES = [
56724
+ DeviceType.Gateway,
56725
+ DeviceType.Camera,
56726
+ DeviceType.Sensor,
56727
+ DeviceType.MediaPlayer,
56728
+ DeviceType.Vacuum,
56729
+ DeviceType.Generic,
56730
+ DeviceType.Washer,
56731
+ DeviceType.Dryer,
56732
+ DeviceType.Dishwasher,
56733
+ DeviceType.PetFountain,
56734
+ DeviceType.Fan,
56735
+ DeviceType.Humidifier,
56736
+ DeviceType.Climate,
56737
+ DeviceType.WaterHeater
56738
+ ];
56739
+ var powerSourceCustomize = {
56740
+ version: 1,
56741
+ targets: [{
56742
+ id: "switch",
56743
+ cardinality: "scalar",
56744
+ vocabulary: {
56745
+ cap: "power-source",
56746
+ stateField: "switchOn"
56747
+ },
56748
+ deviceTypes: POWER_SOURCE_DEVICE_TYPES,
56749
+ apply: "add",
56750
+ path: "switchOn",
56751
+ sources: [{
56752
+ kind: "switch",
56753
+ transforms: [{ kind: "identity" }]
56754
+ }],
56755
+ companions: [{
56756
+ kind: "constant",
56757
+ path: "offSeconds",
56758
+ value: 10,
56759
+ when: "add",
56760
+ formerValues: [0]
56761
+ }, {
56762
+ kind: "clock",
56763
+ path: "lastFetchedAt",
56764
+ when: "always"
56765
+ }],
56766
+ sourceReport: { status: "assignment-status" }
56767
+ }]
56768
+ };
56769
+ var deviceInput$2 = z.object({ deviceId: z.number().int().nonnegative() });
56770
+ var powerSourceCapability = {
56771
+ name: "power-source",
56772
+ scope: "device",
56773
+ mode: "singleton",
56774
+ deviceTypes: POWER_SOURCE_DEVICE_TYPES,
56775
+ methods: {
56776
+ getStatus: systemMethod(deviceInput$2, PowerSourceInfoSchema, { auth: "protected" }),
56777
+ powerOn: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
56778
+ kind: "mutation",
56779
+ auth: "protected"
56780
+ }),
56781
+ powerOff: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
56782
+ kind: "mutation",
56783
+ auth: "protected"
56784
+ }),
56785
+ forceRestart: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
56786
+ kind: "mutation",
56787
+ auth: "protected"
56788
+ })
56789
+ },
56790
+ runtimeState: PowerSourceStateSchema,
56791
+ customize: powerSourceCustomize,
56792
+ /**
56793
+ * Runtime-state durability: **session** — mirrored from the linked switch on
56794
+ * its next report; a restored value would outlive the reading it names.
56795
+ *
56796
+ * See `RuntimeStateDurability`. Enforced by
56797
+ * `scripts/check-runtime-state-durability.ts`.
56798
+ */
56799
+ durability: "session",
56800
+ history: "none"
56801
+ };
56802
+ /**
56803
+ * Which smart switch powers a device (the `power-source` Customize extension):
56804
+ * the source its stored `power-source.switchOn` field reads, and the off time of
56805
+ * a forced restart stored beside it. Read from the STORED composition, never kept
56806
+ * as a second copy (D676). Shared by the hub (which acts on the switch) and the
56807
+ * admin UI (which shows it).
56808
+ */
56809
+ /**
56810
+ * The stored off time, or the default when none is stored. A stored number out
56811
+ * of range is CLAMPED to the bounds (a hand-written value never refuses the
56812
+ * link, it just cannot cut power for an absurd time); a non-integer is rounded.
56813
+ */
56814
+ function normalizeOffSeconds(value) {
56815
+ if (typeof value !== "number" || !Number.isFinite(value)) return 10;
56816
+ return Math.min(120, Math.max(3, Math.round(value)));
56817
+ }
56818
+ /** The constant a stored `offSeconds` field carries, or undefined when it is not a literal number. */
56819
+ function storedOffSeconds(composition) {
56820
+ const feature = composition.features.find((f) => f.cap === "power-source");
56821
+ if (feature === void 0 || feature.kind !== "fields") return void 0;
56822
+ const field = feature.fields["offSeconds"];
56823
+ if (field === void 0 || field.kind !== "expression") return void 0;
56824
+ const n = Number(field.expr);
56825
+ return field.expr.trim() === "" || !Number.isFinite(n) ? void 0 : n;
56826
+ }
56827
+ /**
56828
+ * The link a composition stores. An `existing` target names its own device; a
56829
+ * `new` target (a composed device) is the composer's own device, so the caller
56830
+ * passes the block id and a new-target composition without one has no link.
56831
+ */
56832
+ function powerSourceLinkOfComposition(composition, blockId) {
56833
+ if (composition === null) return null;
56834
+ let device;
56835
+ if (composition.target.kind === "existing") device = composition.target.device;
56836
+ else if (blockId !== void 0) device = composedDeviceRef(blockId);
56837
+ else return null;
56838
+ const feature = composition.features.find((f) => f.cap === "power-source");
56839
+ if (feature === void 0 || feature.kind !== "fields" || feature.enabled === false) return null;
56840
+ const field = feature.fields["switchOn"];
56841
+ if (field === void 0) return null;
56842
+ const read = fieldReads(field).find((r) => r.cap === "switch");
56843
+ if (read === void 0) return null;
56844
+ return {
56845
+ device,
56846
+ switch: read.source,
56847
+ offSeconds: normalizeOffSeconds(storedOffSeconds(composition))
56848
+ };
56849
+ }
56850
+ var ACTUATOR_CAP = "switch";
56851
+ /**
56852
+ * The devices that ACT for this composition: the device itself when it is an
56853
+ * existing one, and every source its own `switch` feature reads or forwards a
56854
+ * command to (a heater's plug, every member of a switch group).
56855
+ */
56856
+ function actuatorKeys(composition) {
56857
+ const keys = /* @__PURE__ */ new Set();
56858
+ if (composition.target.kind === "existing") keys.add(compositionSourceKey(composition.target.device));
56859
+ composition.features.forEach((feature, index) => {
56860
+ if (feature.kind !== "fields" || feature.cap !== ACTUATOR_CAP) return;
56861
+ if (!compositionFeatureEnabled(feature)) return;
56862
+ for (const source of featureSources(feature)) for (const read of fieldReads(source)) keys.add(compositionSourceKey(read.source));
56863
+ for (const forward of featureForwards(feature, index)) keys.add(compositionSourceKey(forward.command.source));
56864
+ });
56865
+ return keys;
56866
+ }
56867
+ /**
56868
+ * The supply plug is never one of the device's own actuators (#462): cutting
56869
+ * power through the switch that IS the device's on/off leaves nothing to
56870
+ * restart, and makes "power off" and "turn off" the same press. Refused at save
56871
+ * time (`power-source-is-actuator`) and again by the power-source provider for a
56872
+ * link stored before this check existed (`switch-is-actuator`).
56873
+ */
56874
+ function powerSourceActuatorConflicts(composition) {
56875
+ const index = composition.features.findIndex((f) => f.cap === "power-source");
56876
+ const feature = composition.features[index];
56877
+ if (feature === void 0 || feature.kind !== "fields" || feature.enabled === false) return [];
56878
+ const field = feature.fields["switchOn"];
56879
+ if (field === void 0) return [];
56880
+ const actuators = actuatorKeys(composition);
56881
+ return fieldReads(field).filter((read) => read.cap === ACTUATOR_CAP && actuators.has(compositionSourceKey(read.source))).map((read) => ({
56882
+ path: `features[${index}].fields.switchOn`,
56883
+ switch: read.source
56884
+ }));
56885
+ }
56332
56886
  function buildCapabilityLookup(defs) {
56333
56887
  const byName = new Map(defs.map((d) => [d.name, d]));
56334
56888
  return (capName) => byName.get(capName) ?? null;
@@ -56387,12 +56941,25 @@ function builtCapProblems({ def, state, fields: targetFields }, feature, at, dev
56387
56941
  }
56388
56942
  return problems;
56389
56943
  }
56390
- function planTopLevelField({ def, fields }, field, mode, lookupCap) {
56944
+ /**
56945
+ * A dotted leaf is planned only on a `replace` (D1034): the feature already
56946
+ * passed `overridesOnlyDeclared`, so the leaf is one the cap lists in its
56947
+ * `overridable`, and the hub sets it into the native object. Anywhere else a
56948
+ * nested field is still refused.
56949
+ */
56950
+ function stateFieldOf({ fields, state }, path, mode) {
56951
+ if (!path.includes(".")) return fields.get(path);
56952
+ if (mode !== "replace") return "nested";
56953
+ return describeStateField(state, path) ?? void 0;
56954
+ }
56955
+ function planTopLevelField(cap, field, mode, lookupCap) {
56956
+ const { def } = cap;
56391
56957
  const { featureIndex, path, source } = field;
56392
56958
  const fieldAt = `features[${featureIndex}].fields.${path}`;
56393
- if (path.includes(".")) return refused(problem("nested-field", fieldAt, `\`${path}\` is nested — nested fields arrive in a later slice`));
56394
- const tf = fields.get(path);
56959
+ const tf = stateFieldOf(cap, path, mode);
56960
+ if (tf === "nested") return refused(problem("nested-field", fieldAt, `\`${path}\` is nested — a nested field is planned only on a declared replace (D1034)`));
56395
56961
  if (tf === void 0) return refused(problem("unknown-field", fieldAt, `\`${def.name}\` has no field \`${path}\``));
56962
+ if (tf.kind === "union") return refused(unionTargetProblem(def.name, path, fieldAt));
56396
56963
  const kinds = sourceKinds(source, lookupCap);
56397
56964
  if (!kinds.ok) return refused(problem(kinds.code, fieldAt, kinds.message));
56398
56965
  const role = roleOf(source);
@@ -56413,7 +56980,7 @@ function planTopLevelField({ def, fields }, field, mode, lookupCap) {
56413
56980
  };
56414
56981
  const enumProblem = enumLiteralProblem(def.name, tf, source, fieldAt);
56415
56982
  return {
56416
- problems: [...compatibility(def.name, tf, kinds.kinds, fieldAt), ...enumProblem === null ? [] : [enumProblem]],
56983
+ problems: [...compatibility(def.name, tf, narrowUnionRead(source, tf, kinds.kinds, lookupCap), fieldAt), ...enumProblem === null ? [] : [enumProblem]],
56417
56984
  fields: [plan],
56418
56985
  features: [],
56419
56986
  events: []
@@ -56516,7 +57083,7 @@ var customizeCatalog = CAP_CUSTOMIZE_CATALOG;
56516
57083
  function overridesOnlyDeclared(feature) {
56517
57084
  const entry = customizeCatalog[feature.cap];
56518
57085
  const allowed = new Set((entry?.overridable ?? []).flatMap((o) => {
56519
- const companions = ((entry?.targets.find((t) => t.id === o.by && t.path === o.path))?.companions ?? []).filter((c) => c.kind === "transition-time" || c.when === "always");
57086
+ const companions = ((entry?.targets.find((t) => t.id === o.by && t.path === o.path))?.companions ?? []).filter((c) => c.kind === "transition-time" || c.kind === "source-field" || c.when === "always");
56520
57087
  return [o.path, ...companions.map((c) => c.path)];
56521
57088
  }));
56522
57089
  const paths = Object.keys(feature.fields);
@@ -56587,6 +57154,20 @@ function compositionSourceRefs(composition) {
56587
57154
  return [...new Map([...refs, ...forwardSourceRefs(composition)].map((r) => [compositionSourceKey(r), r])).values()];
56588
57155
  }
56589
57156
  /**
57157
+ * Every DIRECT read (`from`) of a union source field (D1034): the reads whose
57158
+ * source's live kind a save looks up, so a numeric control is never linked to
57159
+ * a string field. A read inside an expression is judged by the expression.
57160
+ */
57161
+ function compositionUnionReads(composition, lookupCap) {
57162
+ return composition.features.flatMap((f) => compositionFeatureEnabled(f) && f.kind === "fields" ? featureSources(f).flatMap((source) => {
57163
+ if (source.kind !== "from") return [];
57164
+ const def = lookupCap(source.cap);
57165
+ const schema = def?.runtimeState ?? def?.status?.schema;
57166
+ if (schema === void 0) return [];
57167
+ return describeStateField(schema, source.fieldPath)?.kind === "union" ? [source] : [];
57168
+ }) : []);
57169
+ }
57170
+ /**
56590
57171
  * The candidate's device: the existing target itself, else `self`, else a
56591
57172
  * placeholder that cannot collide with a stored target. An existing target is
56592
57173
  * known even on create, so a second customization of it is refused on create too.
@@ -56620,6 +57201,18 @@ function selfReadProblems(read, at, fields, self) {
56620
57201
  if (isNativeCap(self.native, read.cap)) return [];
56621
57202
  return [problem("source-capability-missing", at, `the target device (device ${self.native.deviceId}) has no native \`${read.cap}\``)];
56622
57203
  }
57204
+ /**
57205
+ * A direct read of a union field is judged by the source's LIVE kind when the
57206
+ * save knew it (D1034): a numeric control feeds only a number field, a select
57207
+ * only a string or enum one.
57208
+ */
57209
+ function liveKindProblems(field, read, desc, at) {
57210
+ if (field.source.kind !== "from") return [];
57211
+ const live = desc.liveKinds?.get(`${read.cap}.${read.fieldPath}`);
57212
+ const accepted = field.kind === "enum" ? "string" : field.kind;
57213
+ if (live === void 0 || live === accepted) return [];
57214
+ return [problem("source-kind-mismatch", at, `\`${read.cap}.${read.fieldPath}\` of device ${desc.deviceId} reads a ${live} now; \`${field.cap}.${field.path}\` takes a ${accepted}`)];
57215
+ }
56623
57216
  function sourceProblems(fields, ctx, self) {
56624
57217
  const selfKey = compositionSourceKey(self.ref);
56625
57218
  return fields.flatMap((field) => field.reads.flatMap((read) => {
@@ -56630,7 +57223,7 @@ function sourceProblems(fields, ctx, self) {
56630
57223
  if (desc === void 0 || desc.kind === "unreadable") return [problem("source-unreadable", at, `could not read source \`${key}\` (${desc === void 0 ? "it was not read" : desc.error}) — the save is refused rather than stored unchecked`)];
56631
57224
  if (desc.kind === "absent") return [problem("source-missing", at, `source \`${key}\` does not exist`)];
56632
57225
  if (!desc.caps.has(read.cap)) return [problem("source-capability-missing", at, `source \`${key}\` (device ${desc.deviceId}) has no \`${read.cap}\``)];
56633
- return [];
57226
+ return liveKindProblems(field, read, desc, at);
56634
57227
  }));
56635
57228
  }
56636
57229
  /**
@@ -56722,7 +57315,8 @@ function validateComposition(composition, ctx) {
56722
57315
  ...sourceProblems(plan.fields, ctx, self),
56723
57316
  ...forwardSourceProblems(composition, ctx.sources),
56724
57317
  ...cycles,
56725
- ...helperSaveProblems(composition, facts)
57318
+ ...helperSaveProblems(composition, facts),
57319
+ ...powerSourceActuatorConflicts(composition).map((c) => problem("power-source-is-actuator", c.path, `the power source \`${c.switch.stableId}\` is one of this device's own switches — pick the plug that feeds it`))
56726
57320
  ];
56727
57321
  return {
56728
57322
  ok: problems.length === 0,
@@ -56782,13 +57376,13 @@ function describeComposableCaps(defs, deviceType) {
56782
57376
  const itemArray = def.status?.itemArray;
56783
57377
  return {
56784
57378
  cap: def.name,
56785
- fields: fields.map((f) => ({
57379
+ fields: fields.flatMap((f) => f.kind === "union" ? [] : [{
56786
57380
  path: f.path,
56787
57381
  kind: f.kind,
56788
57382
  nullable: f.nullable,
56789
57383
  required: f.required,
56790
57384
  ...f.enumValues === void 0 ? {} : { enumValues: [...f.enumValues] }
56791
- })),
57385
+ }]),
56792
57386
  ...itemArray === void 0 ? {} : { itemArray: {
56793
57387
  path: itemArray.path,
56794
57388
  keyField: itemArray.keyField
@@ -60220,8 +60814,14 @@ var deviceManagerCapability = {
60220
60814
  "string",
60221
60815
  "number",
60222
60816
  "boolean",
60223
- "enum"
60817
+ "enum",
60818
+ "union"
60224
60819
  ]),
60820
+ unionMembers: z.array(z.enum([
60821
+ "string",
60822
+ "number",
60823
+ "boolean"
60824
+ ])).optional(),
60225
60825
  enumValues: z.array(z.string()).optional(),
60226
60826
  item: z.boolean().optional(),
60227
60827
  quantity: ReadingQuantitySchema.optional()
@@ -63780,8 +64380,87 @@ list: method(z.void(), z.array(FailureContributionSchema).readonly()) },
63780
64380
  * - `FanPreset` — preset selector
63781
64381
  * - `FanDirection` — direction toggle (ceiling fans)
63782
64382
  * - `FanOscillating` — oscillation toggle
64383
+ *
64384
+ * Per-axis oscillation (`oscillationAxes`, `setOscillationAxis`, D1034): an air
64385
+ * circulator sweeps horizontally and vertically, each axis with its own
64386
+ * switch, fixed angle, sweep bounds and limits. A provider may report them
64387
+ * natively; otherwise the OPERATOR links sibling devices to each field in
64388
+ * Customize (a `replace` over the fields listed in `overridable` — nothing is
64389
+ * linked or inferred by itself), and a write to a linked field is forwarded to
64390
+ * its source. `oscillating` stays the single summary flag: when axes exist it
64391
+ * means "any axis oscillates" (`anyAxisOscillating`).
63783
64392
  */
63784
64393
  var FanDirectionSchema = z.enum(["forward", "reverse"]);
64394
+ var FAN_OSCILLATION_AXES = ["horizontal", "vertical"];
64395
+ var FanOscillationAxisNameSchema = z.enum(FAN_OSCILLATION_AXES);
64396
+ /** The fields of one axis a caller may set. */
64397
+ var FAN_OSCILLATION_AXIS_SETTABLE = [
64398
+ "oscillating",
64399
+ "angle",
64400
+ "sweepFrom",
64401
+ "sweepTo"
64402
+ ];
64403
+ var FanOscillationAxisFieldSchema = z.enum(FAN_OSCILLATION_AXIS_SETTABLE);
64404
+ /** The limits of one axis, read from the source that serves its angle. */
64405
+ var FAN_OSCILLATION_AXIS_LIMITS = [
64406
+ "min",
64407
+ "max",
64408
+ "step"
64409
+ ];
64410
+ /**
64411
+ * One oscillation axis. Every reading the device has not reported is `null`,
64412
+ * never `0` (D393): `0°` is a real position. Each leaf defaults to `null`, so
64413
+ * a slice that names only the leaves it knows (a Customize link of one field)
64414
+ * is still a whole axis.
64415
+ */
64416
+ var FanOscillationAxisSchema = z.object({
64417
+ /** Whether the axis sweeps. */
64418
+ oscillating: z.boolean().nullable().default(null),
64419
+ /** The fixed position (degrees) the axis holds when it does not sweep. */
64420
+ angle: z.number().nullable().default(null),
64421
+ /** The sweep bounds (degrees): left → right, bottom → top. */
64422
+ sweepFrom: z.number().nullable().default(null),
64423
+ sweepTo: z.number().nullable().default(null),
64424
+ /** The angles the axis accepts. Null when the device states none. */
64425
+ min: z.number().nullable().default(null),
64426
+ max: z.number().nullable().default(null),
64427
+ step: z.number().nullable().default(null)
64428
+ });
64429
+ /** Both axes; an axis the device does not have is `null`. */
64430
+ var FanOscillationAxesSchema = z.object({
64431
+ horizontal: FanOscillationAxisSchema.nullable().default(null),
64432
+ vertical: FanOscillationAxisSchema.nullable().default(null)
64433
+ });
64434
+ var FanOscillationAxisRefusalSchema = z.enum([
64435
+ "nothing-to-set",
64436
+ "axis-not-linked",
64437
+ "out-of-range",
64438
+ "source-gone",
64439
+ "source-unknown",
64440
+ "source-call-failed"
64441
+ ]);
64442
+ var FanOscillationAxisResultSchema = z.discriminatedUnion("status", [z.object({ status: z.literal("applied") }), z.object({
64443
+ status: z.literal("refused"),
64444
+ reason: FanOscillationAxisRefusalSchema,
64445
+ /** The field at fault, when one is. */
64446
+ field: FanOscillationAxisFieldSchema.optional(),
64447
+ /** One line for the operator, naming the axis, the field and the source. */
64448
+ detail: z.string(),
64449
+ /** Fields that DID land before the refusal (writes run in order, stop at the first failure). */
64450
+ applied: z.array(FanOscillationAxisFieldSchema)
64451
+ })]);
64452
+ var SetOscillationAxisInputSchema = z.object({
64453
+ deviceId: z.number().int().nonnegative(),
64454
+ axis: FanOscillationAxisNameSchema,
64455
+ oscillating: z.boolean().optional(),
64456
+ angle: z.number().optional(),
64457
+ sweepFrom: z.number().optional(),
64458
+ sweepTo: z.number().optional()
64459
+ });
64460
+ /** The state path of one axis field: `oscillationAxes.<axis>.<field>`. */
64461
+ function fanAxisPath(axis, field) {
64462
+ return `oscillationAxes.${axis}.${field}`;
64463
+ }
63785
64464
  var FanControlStatusSchema = z.object({
63786
64465
  /** Active speed as 0..100 inclusive. Null when the device has no
63787
64466
  * speed surface (single-speed fan). */
@@ -63800,9 +64479,102 @@ var FanControlStatusSchema = z.object({
63800
64479
  /** Oscillation toggle. Null when the device has no oscillation
63801
64480
  * surface. */
63802
64481
  oscillating: z.boolean().nullable(),
64482
+ /**
64483
+ * Per-axis oscillation (air circulators). Absent when the device has no
64484
+ * per-axis surface and nothing is linked in Customize.
64485
+ */
64486
+ oscillationAxes: FanOscillationAxesSchema.optional(),
63803
64487
  /** Ms epoch when the slice was last updated. */
63804
64488
  lastChangedAt: z.number()
63805
64489
  });
64490
+ var FAN_CUSTOMIZE_DEVICE_TYPES = [DeviceType.Fan];
64491
+ /** The Customize section the axis targets are listed under. */
64492
+ var AXES_SECTION = "oscillation-axes";
64493
+ function axisOscillatingTarget(axis) {
64494
+ return {
64495
+ id: `${axis}-oscillating`,
64496
+ cardinality: "scalar",
64497
+ vocabulary: {
64498
+ cap: "fan-control",
64499
+ stateField: "oscillating"
64500
+ },
64501
+ deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
64502
+ apply: "replace",
64503
+ section: AXES_SECTION,
64504
+ path: fanAxisPath(axis, "oscillating"),
64505
+ sources: [{
64506
+ kind: "switch",
64507
+ transforms: [{ kind: "identity" }]
64508
+ }],
64509
+ sourceReport: { status: "assignment-status" }
64510
+ };
64511
+ }
64512
+ /**
64513
+ * A numeric axis field. The `angle` link also carries the axis limits, read
64514
+ * from the SAME linked control's own range (`min`/`max`/`step`), so the limits
64515
+ * are the source's, never guessed.
64516
+ */
64517
+ function axisNumericTarget(axis, field) {
64518
+ const base = {
64519
+ id: `${axis}-${field}`,
64520
+ cardinality: "scalar",
64521
+ vocabulary: { cap: "fan-control" },
64522
+ deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
64523
+ apply: "replace",
64524
+ section: AXES_SECTION,
64525
+ path: fanAxisPath(axis, field),
64526
+ sources: [{
64527
+ kind: "numeric",
64528
+ transforms: [{ kind: "identity" }]
64529
+ }],
64530
+ sourceReport: { status: "assignment-status" }
64531
+ };
64532
+ if (field !== "angle") return base;
64533
+ return {
64534
+ ...base,
64535
+ companions: FAN_OSCILLATION_AXIS_LIMITS.map((limit) => ({
64536
+ kind: "source-field",
64537
+ path: fanAxisPath(axis, limit),
64538
+ field: limit
64539
+ }))
64540
+ };
64541
+ }
64542
+ var AXIS_TARGETS = FAN_OSCILLATION_AXES.flatMap((axis) => [
64543
+ axisOscillatingTarget(axis),
64544
+ axisNumericTarget(axis, "angle"),
64545
+ axisNumericTarget(axis, "sweepFrom"),
64546
+ axisNumericTarget(axis, "sweepTo")
64547
+ ]);
64548
+ /** A select (an enum control) the operator links to the fan's `preset`. */
64549
+ var PRESET_TARGET = {
64550
+ id: "preset",
64551
+ cardinality: "scalar",
64552
+ vocabulary: { cap: "fan-control" },
64553
+ deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
64554
+ apply: "replace",
64555
+ path: "preset",
64556
+ sources: [{
64557
+ kind: "field",
64558
+ valueKinds: ["string"],
64559
+ transforms: [{ kind: "identity" }]
64560
+ }],
64561
+ sourceReport: { status: "assignment-status" }
64562
+ };
64563
+ var FAN_CONTROL_TARGETS = [...AXIS_TARGETS, PRESET_TARGET];
64564
+ /**
64565
+ * Customize (D1034): the fan already serves `fan-control` natively, so every
64566
+ * target is a `replace` over a field listed in `overridable` — the axis leaves
64567
+ * and `preset`, nothing else. Nothing is pre-linked: the operator picks each
64568
+ * source (D356).
64569
+ */
64570
+ var fanControlCustomize = {
64571
+ version: 1,
64572
+ overridable: FAN_CONTROL_TARGETS.map((target) => ({
64573
+ path: target.path,
64574
+ by: target.id
64575
+ })),
64576
+ targets: FAN_CONTROL_TARGETS
64577
+ };
63806
64578
  var fanControlCapability = {
63807
64579
  name: "fan-control",
63808
64580
  scope: "device",
@@ -63837,6 +64609,18 @@ var fanControlCapability = {
63837
64609
  }), z.void(), {
63838
64610
  kind: "mutation",
63839
64611
  auth: "protected"
64612
+ }),
64613
+ /**
64614
+ * Sets one oscillation axis: its switch, fixed angle and/or sweep bounds.
64615
+ * Fields left out are untouched. A field linked in Customize is forwarded
64616
+ * to its linked source (D1034); otherwise the native provider serves it;
64617
+ * neither → `axis-not-linked`. Ranges are checked against the axis limits
64618
+ * before anything is written; writes run in order and stop at the first
64619
+ * failure, which the result names.
64620
+ */
64621
+ setOscillationAxis: optionalMethod(SetOscillationAxisInputSchema, FanOscillationAxisResultSchema, {
64622
+ kind: "mutation",
64623
+ auth: "protected"
63840
64624
  })
63841
64625
  },
63842
64626
  status: {
@@ -63848,6 +64632,7 @@ var fanControlCapability = {
63848
64632
  * sliders read `speed` for live updates.
63849
64633
  */
63850
64634
  runtimeState: FanControlStatusSchema,
64635
+ customize: fanControlCustomize,
63851
64636
  /**
63852
64637
  * Runtime-state durability: **session** — as `brightness`.
63853
64638
  *
@@ -63867,16 +64652,33 @@ var fanControlCapability = {
63867
64652
  oscillating: { kind: "boolean" }
63868
64653
  } }
63869
64654
  };
64655
+ /** One axis as a preset wants it; an absent field is left as it is. */
64656
+ var FanPresetAxisSchema = z.object({
64657
+ oscillating: z.boolean().optional(),
64658
+ angle: z.number().optional(),
64659
+ sweepFrom: z.number().optional(),
64660
+ sweepTo: z.number().optional()
64661
+ });
64662
+ /** The fan-control state a preset sets; an absent field is left as it is. */
64663
+ var FanPresetStateSchema = z.object({
64664
+ speed: z.number().min(0).max(100).optional(),
64665
+ /** The fan's own preset mode (or the linked select's option). */
64666
+ preset: z.string().min(1).optional(),
64667
+ direction: FanDirectionSchema.optional(),
64668
+ oscillationAxes: z.object({
64669
+ horizontal: FanPresetAxisSchema.optional(),
64670
+ vertical: FanPresetAxisSchema.optional()
64671
+ }).optional()
64672
+ });
63870
64673
  var FanPresetSchema = z.object({
63871
64674
  /** Stable key; never reused after a delete within one device's list. */
63872
64675
  id: z.string().min(1).max(64),
63873
64676
  /** What the operator and a voice assistant call it. */
63874
64677
  name: z.string().trim().min(1).max(40),
63875
- steps: z.array(ActionStepSchema).min(1).max(20)
64678
+ state: FanPresetStateSchema
63876
64679
  });
63877
64680
  var FanPresetsRefusalSchema = z.enum([
63878
- "not-sibling",
63879
- "bad-target",
64681
+ "empty-state",
63880
64682
  "duplicate-name",
63881
64683
  "duplicate-id",
63882
64684
  "too-many",
@@ -63888,64 +64690,50 @@ var FanPresetsSetResultSchema = z.discriminatedUnion("status", [z.object({
63888
64690
  }), z.object({
63889
64691
  status: z.literal("refused"),
63890
64692
  reason: FanPresetsRefusalSchema,
63891
- /** Names the preset and step at fault. */
64693
+ /** Names the preset at fault. */
63892
64694
  detail: z.string()
63893
64695
  })]);
63894
- var FanPresetStepResultSchema = z.object({
63895
- index: z.number().int().nonnegative(),
64696
+ var FanPresetFieldResultSchema = z.object({
64697
+ /** The state path: `speed`, `preset`, `direction`, `oscillationAxes.horizontal.angle`. */
64698
+ field: z.string(),
63896
64699
  outcome: z.enum([
63897
64700
  "applied",
63898
64701
  "failed",
63899
64702
  "not-run",
63900
64703
  "refused"
63901
64704
  ]),
63902
- deviceId: z.number().int().nonnegative().optional(),
63903
- cap: z.string().optional(),
63904
- method: z.string().optional(),
63905
64705
  /** The cause, for every outcome but `applied`. */
63906
64706
  message: z.string().optional()
63907
64707
  });
63908
64708
  var FanPresetApplyResultSchema = z.object({
63909
- /** `applied`: every step ran. `partial`: some ran, one failed. `refused`: nothing ran. */
64709
+ /** `applied`: every field landed. `partial`: some did, one did not. `refused`: nothing ran. */
63910
64710
  status: z.enum([
63911
64711
  "applied",
63912
64712
  "partial",
63913
64713
  "refused"
63914
64714
  ]),
63915
- steps: z.array(FanPresetStepResultSchema)
64715
+ fields: z.array(FanPresetFieldResultSchema)
63916
64716
  });
63917
- /** The fan's own readings a capture may take. */
64717
+ /** The fan-control fields a capture may take. */
63918
64718
  var FAN_CAPTURE_FIELDS = [
63919
64719
  "speed",
63920
- "oscillating",
63921
64720
  "direction",
63922
- "preset"
64721
+ "preset",
64722
+ "oscillationAxes"
63923
64723
  ];
63924
64724
  var FanCaptureFieldSchema = z.enum(FAN_CAPTURE_FIELDS);
63925
64725
  var FanCaptureOmissionSchema = z.object({
63926
- /** A fan field (`speed`) or `step <n>` for a sibling step. */
64726
+ /** A state path (`speed`, `oscillationAxes.vertical.angle`). */
63927
64727
  what: z.string(),
63928
- /** Why no value was taken: unknown reading (never stored as 0, D393), or a step that cannot be read. */
64728
+ /** Why no value was taken: an unknown reading is never stored as 0 (D393). */
63929
64729
  reason: z.string()
63930
64730
  });
63931
- var FanCaptureGroupSchema = z.enum([
63932
- "fan",
63933
- "oscillation",
63934
- "angles"
63935
- ]);
63936
- var FanCaptureItemSchema = z.object({
63937
- group: FanCaptureGroupSchema,
63938
- /** What the step sets, in the operator's words (a device name, a fan field). */
63939
- label: z.string()
63940
- });
63941
64731
  var FanPresetCaptureResultSchema = z.object({
63942
- /** The steps filled from the device's current values; NOT saved. */
63943
- steps: z.array(ActionStepSchema),
63944
- /** One entry per step, same order: its review group and label. */
63945
- items: z.array(FanCaptureItemSchema),
64732
+ /** The fan's CURRENT fan-control state, as a preset; NOT saved. */
64733
+ state: FanPresetStateSchema,
63946
64734
  omitted: z.array(FanCaptureOmissionSchema)
63947
64735
  });
63948
- var deviceInput$2 = z.object({ deviceId: z.number().int().nonnegative() });
64736
+ var deviceInput$1 = z.object({ deviceId: z.number().int().nonnegative() });
63949
64737
  var fanPresetsCustomize = {
63950
64738
  version: 1,
63951
64739
  targets: [{
@@ -63963,28 +64751,22 @@ var fanPresetsCapability = {
63963
64751
  scope: "system",
63964
64752
  mode: "singleton",
63965
64753
  methods: {
63966
- getPresets: method(deviceInput$2, z.array(FanPresetSchema), { auth: "protected" }),
63967
- setPresets: method(deviceInput$2.extend({ presets: z.array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
64754
+ getPresets: method(deviceInput$1, z.array(FanPresetSchema), { auth: "protected" }),
64755
+ setPresets: method(deviceInput$1.extend({ presets: z.array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
63968
64756
  kind: "mutation",
63969
64757
  auth: "admin"
63970
64758
  }),
63971
- applyPreset: method(deviceInput$2.extend({ presetId: z.string().min(1) }), FanPresetApplyResultSchema, {
64759
+ applyPreset: method(deviceInput$1.extend({ presetId: z.string().min(1) }), FanPresetApplyResultSchema, {
63972
64760
  kind: "mutation",
63973
64761
  auth: "protected"
63974
64762
  }),
63975
64763
  /**
63976
- * Fills steps from the CURRENT values: the fan's own fields named in
63977
- * `fields` (all when absent) and the sibling `steps` already composed
63978
- * (a control value, a switch state). With no `steps` it proposes EVERY
63979
- * switch and control in the fan's container, ordered angle bounds,
63980
- * oscillation, fixed angles, fan fields, speed last. A reading that is
63981
- * unknown is left out and named in `omitted`, never captured as 0. Nothing
63982
- * is saved.
64764
+ * The fan's CURRENT fan-control state as a preset: the fields named in
64765
+ * `fields` (all when absent), read from its merged slice — a field linked
64766
+ * in Customize reads its link. A reading that is unknown is left out and
64767
+ * named in `omitted`, never captured as 0. Nothing is saved.
63983
64768
  */
63984
- capturePreset: method(deviceInput$2.extend({
63985
- fields: z.array(FanCaptureFieldSchema).optional(),
63986
- steps: z.array(ActionStepSchema).max(20).default([])
63987
- }), FanPresetCaptureResultSchema, { auth: "protected" })
64769
+ capturePreset: method(deviceInput$1.extend({ fields: z.array(FanCaptureFieldSchema).optional() }), FanPresetCaptureResultSchema, { auth: "protected" })
63988
64770
  },
63989
64771
  customize: fanPresetsCustomize
63990
64772
  };
@@ -64212,8 +64994,7 @@ var groupActiveCapability = {
64212
64994
  DeviceType.Valve,
64213
64995
  DeviceType.Lock,
64214
64996
  DeviceType.MediaPlayer,
64215
- DeviceType.Climate,
64216
- DeviceType.Thermostat
64997
+ DeviceType.Climate
64217
64998
  ],
64218
64999
  methods: {},
64219
65000
  status: {
@@ -64262,7 +65043,6 @@ var groupCommandsCapability = {
64262
65043
  DeviceType.Valve,
64263
65044
  DeviceType.Lock,
64264
65045
  DeviceType.MediaPlayer,
64265
- DeviceType.Thermostat,
64266
65046
  DeviceType.Climate
64267
65047
  ],
64268
65048
  methods: {},
@@ -64318,7 +65098,6 @@ var groupStatusCapability = {
64318
65098
  DeviceType.Valve,
64319
65099
  DeviceType.Lock,
64320
65100
  DeviceType.MediaPlayer,
64321
- DeviceType.Thermostat,
64322
65101
  DeviceType.Climate
64323
65102
  ],
64324
65103
  methods: {},
@@ -64674,7 +65453,7 @@ var heatingValveCapability = {
64674
65453
  scope: "device",
64675
65454
  deviceNative: true,
64676
65455
  mode: "singleton",
64677
- deviceTypes: [DeviceType.Thermostat],
65456
+ deviceTypes: [DeviceType.Climate],
64678
65457
  methods: {},
64679
65458
  status: {
64680
65459
  schema: HeatingValveStatusSchema,
@@ -64704,29 +65483,41 @@ var heatingValveCapability = {
64704
65483
  * retried in a loop - D49); a future one is re-armed.
64705
65484
  *
64706
65485
  * What a device may be run for, and for how long at most, is per device type
64707
- * ({@link TIMED_RUN_LIMITS}): the maximum is a safety bound, not a preference,
65486
+ * and role ({@link timedRunLimitOf}): the maximum is a safety bound, not a preference,
64708
65487
  * so a request above it is REFUSED with a typed reason, never clamped.
64709
65488
  */
64710
65489
  var TimedRunUnitSchema = z.enum(["s", "min"]);
64711
65490
  z.enum(["switch", "pet-fountain"]);
64712
- /** The longest run, per device type. Only these types are offered `timed-run`. */
64713
- var TIMED_RUN_LIMITS = {
64714
- [DeviceType.Heater]: {
64715
- actuator: "switch",
64716
- maxSeconds: 10800,
64717
- unit: "min",
64718
- quickRunDefault: 30
64719
- },
64720
- [DeviceType.PetFountain]: {
64721
- actuator: "pet-fountain",
64722
- maxSeconds: 300,
64723
- unit: "s",
64724
- quickRunDefault: 60
64725
- }
65491
+ /** A plug-in heater (switch + `switch-heater`): up to 3 h, in minutes. */
65492
+ var TIMED_RUN_HEATER_LIMIT = {
65493
+ actuator: "switch",
65494
+ maxSeconds: 10800,
65495
+ unit: "min",
65496
+ quickRunDefault: 30
65497
+ };
65498
+ /** A pet fountain's pump: up to 5 min, in seconds. */
65499
+ var TIMED_RUN_PET_FOUNTAIN_LIMIT = {
65500
+ actuator: "pet-fountain",
65501
+ maxSeconds: 300,
65502
+ unit: "s",
65503
+ quickRunDefault: 60
64726
65504
  };
64727
- var TIMED_RUN_DEVICE_TYPES = [DeviceType.Heater, DeviceType.PetFountain];
64728
- function timedRunLimitOf(deviceType) {
64729
- return TIMED_RUN_LIMITS[deviceType] ?? null;
65505
+ /**
65506
+ * The device types `timed-run` may be offered on. A `switch` is narrowed by
65507
+ * role ({@link TIMED_RUN_DEVICE_ROLES}): only a plug-in heater runs on a timer.
65508
+ */
65509
+ var TIMED_RUN_DEVICE_TYPES = [DeviceType.Switch, DeviceType.PetFountain];
65510
+ /** The roles that make a device of these types timed-run-able (D1033). */
65511
+ var TIMED_RUN_DEVICE_ROLES = { [DeviceType.Switch]: [DeviceRole.SwitchHeater] };
65512
+ /**
65513
+ * The longest run of a device, by its type AND role (D1033): a `switch` is a
65514
+ * heater only with role `switch-heater`, a pet fountain always is what it is.
65515
+ * `null` - the device is not offered `timed-run`.
65516
+ */
65517
+ function timedRunLimitOf(deviceType, role) {
65518
+ if (deviceType === DeviceType.PetFountain) return TIMED_RUN_PET_FOUNTAIN_LIMIT;
65519
+ if (deviceType === DeviceType.Switch && role === DeviceRole.SwitchHeater) return TIMED_RUN_HEATER_LIMIT;
65520
+ return null;
64730
65521
  }
64731
65522
  var MS_PER_SECOND = 1e3;
64732
65523
  var MS_PER_MINUTE = 6e4;
@@ -64808,6 +65599,7 @@ var timedRunCapability = {
64808
65599
  kind: "wrapper",
64809
65600
  defaultActive: true,
64810
65601
  deviceTypes: TIMED_RUN_DEVICE_TYPES,
65602
+ deviceRoles: TIMED_RUN_DEVICE_ROLES,
64811
65603
  deviceConfig: { ui: {
64812
65604
  kind: "derived-form",
64813
65605
  builderId: "timed-run",
@@ -64978,8 +65770,7 @@ var HERO_SCENE_BY_TYPE = {
64978
65770
  [DeviceType.Siren]: "siren",
64979
65771
  [DeviceType.Switch]: "plug",
64980
65772
  [DeviceType.Sensor]: "sensor-sparkline",
64981
- [DeviceType.Thermostat]: "thermostat",
64982
- [DeviceType.Climate]: "ac",
65773
+ [DeviceType.Climate]: "thermostat",
64983
65774
  [DeviceType.Button]: "button",
64984
65775
  [DeviceType.EventEmitter]: "event-stream",
64985
65776
  [DeviceType.Update]: "update",
@@ -65007,7 +65798,6 @@ var HERO_SCENE_BY_TYPE = {
65007
65798
  [DeviceType.PetFountain]: "pet-fountain",
65008
65799
  [DeviceType.Dishwasher]: "dishwasher",
65009
65800
  [DeviceType.Washer]: "washer",
65010
- [DeviceType.Heater]: "heater",
65011
65801
  [DeviceType.Dryer]: "dryer",
65012
65802
  [DeviceType.Gateway]: "gateway"
65013
65803
  };
@@ -65032,6 +65822,14 @@ var HERO_SCENE_BY_ROLE = {
65032
65822
  [DeviceRole.CoverWindow]: "inherit",
65033
65823
  [DeviceRole.BinaryHelper]: "inherit",
65034
65824
  [DeviceRole.Outlet]: "plug",
65825
+ [DeviceRole.SwitchHeater]: "heater",
65826
+ [DeviceRole.SwitchFan]: "fan",
65827
+ [DeviceRole.ClimateAc]: "ac",
65828
+ [DeviceRole.ClimateThermostat]: "inherit",
65829
+ [DeviceRole.ClimateFloor]: "inherit",
65830
+ [DeviceRole.ClimateRadiator]: "inherit",
65831
+ [DeviceRole.ClimateHeater]: "inherit",
65832
+ [DeviceRole.ClimateHeatPumpCircuit]: "inherit",
65035
65833
  [DeviceRole.MotionSensor]: "presence",
65036
65834
  [DeviceRole.ContactSensor]: "contact",
65037
65835
  [DeviceRole.LeakSensor]: "inherit",
@@ -65501,10 +66299,7 @@ function trailingOf(facts) {
65501
66299
  * A type whose primary is a named control, not its power: a climate row is the mode
65502
66300
  * (which carries "off") and the setpoint, with no power toggle.
65503
66301
  */
65504
- var ROW_PRIMARY_BY_TYPE = {
65505
- [DeviceType.Climate]: "climate.mode",
65506
- [DeviceType.Thermostat]: "climate.mode"
65507
- };
66302
+ var ROW_PRIMARY_BY_TYPE = { [DeviceType.Climate]: "climate.mode" };
65508
66303
  function primaryOf(model) {
65509
66304
  const named = ROW_PRIMARY_BY_TYPE[model.type];
65510
66305
  if (named !== void 0) {
@@ -65537,7 +66332,6 @@ function primaryOf(model) {
65537
66332
  */
65538
66333
  var ROW_EXTRAS_BY_TYPE = {
65539
66334
  [DeviceType.Climate]: ["climate.target"],
65540
- [DeviceType.Thermostat]: ["climate.target"],
65541
66335
  [DeviceType.Vacuum]: ["vacuum.base"],
65542
66336
  [DeviceType.LawnMower]: ["mower.dock"],
65543
66337
  [DeviceType.MediaPlayer]: ["volume.level", REMOTE_OPEN_ACTION_ID]
@@ -65656,7 +66450,11 @@ var heroLayoutCapability = {
65656
66450
  auth: "protected",
65657
66451
  role: "viewer"
65658
66452
  }),
65659
- getLayout: method(z.object({ deviceType: z.string() }), HeroLayoutRowsSchema, {
66453
+ /** The fixed rows of a kind: the type, refined by the role (D1033 — a heater is a switch). */
66454
+ getLayout: method(z.object({
66455
+ deviceType: z.string(),
66456
+ role: z.string().nullable().optional()
66457
+ }), HeroLayoutRowsSchema, {
65660
66458
  auth: "protected",
65661
66459
  role: "viewer"
65662
66460
  })
@@ -65705,6 +66503,11 @@ var humidifierCapability = {
65705
66503
  deviceNative: true,
65706
66504
  mode: "singleton",
65707
66505
  deviceTypes: [DeviceType.Humidifier],
66506
+ power: {
66507
+ kind: "field",
66508
+ field: "on",
66509
+ set: "setOn"
66510
+ },
65708
66511
  methods: {
65709
66512
  setOn: method(z.object({
65710
66513
  deviceId: z.number().int().nonnegative(),
@@ -65778,7 +66581,7 @@ var humiditySensorCapability = {
65778
66581
  scope: "device",
65779
66582
  deviceNative: true,
65780
66583
  mode: "singleton",
65781
- deviceTypes: [DeviceType.Sensor, DeviceType.Thermostat],
66584
+ deviceTypes: [DeviceType.Sensor, DeviceType.Climate],
65782
66585
  methods: {},
65783
66586
  status: {
65784
66587
  schema: HumiditySensorStatusSchema,
@@ -82465,6 +83268,11 @@ var petFountainCapability = {
82465
83268
  deviceNative: true,
82466
83269
  mode: "singleton",
82467
83270
  deviceTypes: [DeviceType.PetFountain],
83271
+ power: {
83272
+ kind: "field",
83273
+ field: "pumpRunning",
83274
+ set: "setPump"
83275
+ },
82468
83276
  methods: {
82469
83277
  /** Start or stop the pump. */
82470
83278
  setPump: method(z.object({
@@ -84579,7 +85387,6 @@ var POWER_METER_DEVICE_TYPES = [
84579
85387
  DeviceType.Light,
84580
85388
  DeviceType.Fan,
84581
85389
  DeviceType.Climate,
84582
- DeviceType.Thermostat,
84583
85390
  DeviceType.Humidifier,
84584
85391
  DeviceType.WaterHeater,
84585
85392
  DeviceType.MediaPlayer,
@@ -84588,8 +85395,7 @@ var POWER_METER_DEVICE_TYPES = [
84588
85395
  DeviceType.Dishwasher,
84589
85396
  DeviceType.Vacuum,
84590
85397
  DeviceType.LawnMower,
84591
- DeviceType.PetFeeder,
84592
- DeviceType.Heater
85398
+ DeviceType.PetFeeder
84593
85399
  ];
84594
85400
  /** Everything but a bare `Sensor`: a sensor that takes its reading from another sensor adds nothing. */
84595
85401
  var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== DeviceType.Sensor);
@@ -84702,117 +85508,6 @@ var powerMeterCapability = {
84702
85508
  volatileStateFields: ["lastFetchedAt"],
84703
85509
  customize: powerMeterCustomize
84704
85510
  };
84705
- var PowerSourceRefusalReasonSchema = z.enum([
84706
- "no-power-source",
84707
- "switch-missing",
84708
- "switch-offline",
84709
- "switch-unknown",
84710
- "restart-in-progress",
84711
- "switch-call-failed"
84712
- ]);
84713
- var PowerSourceActionResultSchema = z.discriminatedUnion("accepted", [z.object({ accepted: z.literal(true) }), z.object({
84714
- accepted: z.literal(false),
84715
- reason: PowerSourceRefusalReasonSchema,
84716
- /** One line for the operator, naming the switch. */
84717
- message: z.string()
84718
- })]);
84719
- var PowerSourceInfoSchema = z.object({
84720
- /** False when the device has no power source linked; the rest is then empty. */
84721
- linked: z.boolean(),
84722
- switchDeviceId: z.number().nullable(),
84723
- switchName: z.string().nullable(),
84724
- /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
84725
- switchOn: z.boolean().nullable(),
84726
- switchOnline: z.boolean().nullable(),
84727
- restartInProgress: z.boolean(),
84728
- offSeconds: z.number().int()
84729
- });
84730
- /** The composed slice: the switch state the link mirrors, plus the stored off time. */
84731
- var PowerSourceStateSchema = z.object({
84732
- /** Null while the switch has not reported: unknown is never `false` (D393). */
84733
- switchOn: z.boolean().nullable(),
84734
- offSeconds: z.number().int(),
84735
- lastFetchedAt: z.number()
84736
- });
84737
- var POWER_SOURCE_DEVICE_TYPES = [
84738
- DeviceType.Gateway,
84739
- DeviceType.Camera,
84740
- DeviceType.Sensor,
84741
- DeviceType.MediaPlayer,
84742
- DeviceType.Vacuum,
84743
- DeviceType.Generic,
84744
- DeviceType.Washer,
84745
- DeviceType.Dryer,
84746
- DeviceType.Dishwasher,
84747
- DeviceType.PetFountain,
84748
- DeviceType.Fan,
84749
- DeviceType.Humidifier,
84750
- DeviceType.Climate,
84751
- DeviceType.WaterHeater
84752
- ];
84753
- var powerSourceCustomize = {
84754
- version: 1,
84755
- targets: [{
84756
- id: "switch",
84757
- cardinality: "scalar",
84758
- vocabulary: {
84759
- cap: "power-source",
84760
- stateField: "switchOn"
84761
- },
84762
- deviceTypes: POWER_SOURCE_DEVICE_TYPES,
84763
- apply: "add",
84764
- path: "switchOn",
84765
- sources: [{
84766
- kind: "switch",
84767
- transforms: [{ kind: "identity" }]
84768
- }],
84769
- companions: [{
84770
- kind: "constant",
84771
- path: "offSeconds",
84772
- value: 10,
84773
- when: "add",
84774
- formerValues: [0]
84775
- }, {
84776
- kind: "clock",
84777
- path: "lastFetchedAt",
84778
- when: "always"
84779
- }],
84780
- sourceReport: { status: "assignment-status" }
84781
- }]
84782
- };
84783
- var deviceInput$1 = z.object({ deviceId: z.number().int().nonnegative() });
84784
- var powerSourceCapability = {
84785
- name: "power-source",
84786
- scope: "device",
84787
- mode: "singleton",
84788
- deviceTypes: POWER_SOURCE_DEVICE_TYPES,
84789
- methods: {
84790
- getStatus: systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "protected" }),
84791
- powerOn: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
84792
- kind: "mutation",
84793
- auth: "protected"
84794
- }),
84795
- powerOff: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
84796
- kind: "mutation",
84797
- auth: "protected"
84798
- }),
84799
- forceRestart: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
84800
- kind: "mutation",
84801
- auth: "protected"
84802
- })
84803
- },
84804
- runtimeState: PowerSourceStateSchema,
84805
- customize: powerSourceCustomize,
84806
- /**
84807
- * Runtime-state durability: **session** — mirrored from the linked switch on
84808
- * its next report; a restored value would outlive the reading it names.
84809
- *
84810
- * See `RuntimeStateDurability`. Enforced by
84811
- * `scripts/check-runtime-state-durability.ts`.
84812
- */
84813
- durability: "session",
84814
- history: "none"
84815
- };
84816
85511
  /**
84817
85512
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
84818
85513
  * on `DeviceType.Presence`. Read-only — no setters: presence is
@@ -89135,9 +89830,7 @@ var RUNNING_CUSTOMIZE_DEVICE_TYPES = [
89135
89830
  DeviceType.Humidifier,
89136
89831
  DeviceType.Fan,
89137
89832
  DeviceType.Climate,
89138
- DeviceType.Thermostat,
89139
- DeviceType.PetFeeder,
89140
- DeviceType.Heater
89833
+ DeviceType.PetFeeder
89141
89834
  ];
89142
89835
  var runningStateCapability = {
89143
89836
  name: "running-state",
@@ -91762,8 +92455,7 @@ var switchCapability = {
91762
92455
  DeviceType.Switch,
91763
92456
  DeviceType.Siren,
91764
92457
  DeviceType.Light,
91765
- DeviceType.Fan,
91766
- DeviceType.Heater
92458
+ DeviceType.Fan
91767
92459
  ],
91768
92460
  methods: { setState: method(z.object({
91769
92461
  deviceId: z.number(),
@@ -92589,7 +93281,7 @@ var temperatureSensorCapability = {
92589
93281
  scope: "device",
92590
93282
  deviceNative: true,
92591
93283
  mode: "singleton",
92592
- deviceTypes: [DeviceType.Sensor, DeviceType.Thermostat],
93284
+ deviceTypes: [DeviceType.Sensor, DeviceType.Climate],
92593
93285
  methods: {},
92594
93286
  status: {
92595
93287
  schema: TemperatureSensorStatusSchema,
@@ -94573,6 +95265,13 @@ var waterHeaterCapability = {
94573
95265
  deviceNative: true,
94574
95266
  mode: "singleton",
94575
95267
  deviceTypes: [DeviceType.WaterHeater],
95268
+ power: {
95269
+ kind: "mode",
95270
+ field: "operationMode",
95271
+ offValue: "off",
95272
+ set: "setOperationMode",
95273
+ lastField: "lastActiveMode"
95274
+ },
94576
95275
  methods: {
94577
95276
  setTargetTemp: method(z.object({
94578
95277
  deviceId: z.number().int().nonnegative(),
@@ -97517,7 +98216,7 @@ function compileValue$1(input) {
97517
98216
  const transform = input.draft.transform;
97518
98217
  if (transform.kind === "identity" || transform.kind === "number") return {
97519
98218
  ok: true,
97520
- value: identityValue(read, input.sourceValueKind)
98219
+ value: identityValue(read, input.sourceValueKind, targetValueKind(input))
97521
98220
  };
97522
98221
  if (transform.kind === "invert") {
97523
98222
  if (input.sourceValueKind !== "boolean") return fail$2("source-kind");
@@ -97530,8 +98229,16 @@ function compileValue$1(input) {
97530
98229
  if (transform.kind === "linear") return linearValue$1(transform, read, input.sourceValueKind);
97531
98230
  return fail$2("transform");
97532
98231
  }
97533
- function identityValue(read, valueKind) {
97534
- if (valueKind === "string") return expression("number(x)", { x: read });
98232
+ /** The kind of the field a draft writes, from the catalog. */
98233
+ function targetValueKind(input) {
98234
+ return catalogTarget$4(input.draft.cap, input.draft.targetId)?.valueKind;
98235
+ }
98236
+ /**
98237
+ * A string reading feeds a NUMBER field through `number(x)`; a string field
98238
+ * (a fan `preset` linked to a select, D1034) takes the string as it is.
98239
+ */
98240
+ function identityValue(read, valueKind, targetKind) {
98241
+ if (valueKind === "string" && targetKind !== "string" && targetKind !== "enum") return expression("number(x)", { x: read });
97535
98242
  return read;
97536
98243
  }
97537
98244
  /**
@@ -97613,7 +98320,7 @@ function compileCompanions$1(input, target, value) {
97613
98320
  });
97614
98321
  }
97615
98322
  function companionIncluded$1(companion, apply) {
97616
- if (companion.kind === "transition-time") return true;
98323
+ if (companion.kind === "transition-time" || companion.kind === "source-field") return true;
97617
98324
  return companion.when === "always" || apply === "add";
97618
98325
  }
97619
98326
  function companionField(input, path, companion, value) {
@@ -97629,6 +98336,10 @@ function companionField(input, path, companion, value) {
97629
98336
  ok: true,
97630
98337
  value: literal("now")
97631
98338
  };
98339
+ if (companion.kind === "source-field") return {
98340
+ ok: true,
98341
+ value: fromRead(refOf$1(input.draft), input.draft.source.cap, companion.field)
98342
+ };
97632
98343
  return transitionField(input, path, companion.sourceChangedAt, value);
97633
98344
  }
97634
98345
  function transitionField(input, path, sourceChangedAt, value) {
@@ -97782,7 +98493,12 @@ function describeRead(read) {
97782
98493
  function isConfirmed(reading) {
97783
98494
  return reading.fatal || reading.confirmed === true;
97784
98495
  }
97785
- function fromReading(reading, read) {
98496
+ /** Whether a non-null value is of the kind a field of `kind` holds. */
98497
+ function valueFitsKind(value, kind) {
98498
+ if (value === null) return true;
98499
+ return typeof value === (kind === "enum" ? "string" : kind);
98500
+ }
98501
+ function fromReading(reading, read, targetKind) {
97786
98502
  if (reading.state === "unavailable") return {
97787
98503
  state: "unavailable",
97788
98504
  value: null,
@@ -97790,6 +98506,13 @@ function fromReading(reading, read) {
97790
98506
  fatal: reading.fatal,
97791
98507
  confirmed: isConfirmed(reading)
97792
98508
  };
98509
+ if (targetKind !== void 0 && !valueFitsKind(reading.value, targetKind)) return {
98510
+ state: "unavailable",
98511
+ value: null,
98512
+ reason: `${describeRead(read)}: source-kind-mismatch, it reads a ${typeof reading.value} and the field takes a ${targetKind}`,
98513
+ fatal: false,
98514
+ confirmed: true
98515
+ };
97793
98516
  return {
97794
98517
  state: reading.state,
97795
98518
  value: reading.value,
@@ -97913,7 +98636,7 @@ function aggregateField(source, read) {
97913
98636
  function evaluateCompositionField(input) {
97914
98637
  const { source } = input;
97915
98638
  switch (source.kind) {
97916
- case "from": return fromReading(input.read(source), source);
98639
+ case "from": return fromReading(input.read(source), source, input.targetKind);
97917
98640
  case "expression": return expressionOutcome(source, input.read, input.now, input.stateful);
97918
98641
  case "aggregate": return aggregateField(source, input.read);
97919
98642
  case "series": return {
@@ -97945,54 +98668,6 @@ function lockDoorLinkOfComposition(composition) {
97945
98668
  sensor: x.source
97946
98669
  };
97947
98670
  }
97948
- /**
97949
- * Which smart switch powers a device (the `power-source` Customize extension):
97950
- * the source its stored `power-source.switchOn` field reads, and the off time of
97951
- * a forced restart stored beside it. Read from the STORED composition, never kept
97952
- * as a second copy (D676). Shared by the hub (which acts on the switch) and the
97953
- * admin UI (which shows it).
97954
- */
97955
- /**
97956
- * The stored off time, or the default when none is stored. A stored number out
97957
- * of range is CLAMPED to the bounds (a hand-written value never refuses the
97958
- * link, it just cannot cut power for an absurd time); a non-integer is rounded.
97959
- */
97960
- function normalizeOffSeconds(value) {
97961
- if (typeof value !== "number" || !Number.isFinite(value)) return 10;
97962
- return Math.min(120, Math.max(3, Math.round(value)));
97963
- }
97964
- /** The constant a stored `offSeconds` field carries, or undefined when it is not a literal number. */
97965
- function storedOffSeconds(composition) {
97966
- const feature = composition.features.find((f) => f.cap === "power-source");
97967
- if (feature === void 0 || feature.kind !== "fields") return void 0;
97968
- const field = feature.fields["offSeconds"];
97969
- if (field === void 0 || field.kind !== "expression") return void 0;
97970
- const n = Number(field.expr);
97971
- return field.expr.trim() === "" || !Number.isFinite(n) ? void 0 : n;
97972
- }
97973
- /**
97974
- * The link a composition stores. An `existing` target names its own device; a
97975
- * `new` target (a composed device) is the composer's own device, so the caller
97976
- * passes the block id and a new-target composition without one has no link.
97977
- */
97978
- function powerSourceLinkOfComposition(composition, blockId) {
97979
- if (composition === null) return null;
97980
- let device;
97981
- if (composition.target.kind === "existing") device = composition.target.device;
97982
- else if (blockId !== void 0) device = composedDeviceRef(blockId);
97983
- else return null;
97984
- const feature = composition.features.find((f) => f.cap === "power-source");
97985
- if (feature === void 0 || feature.kind !== "fields" || feature.enabled === false) return null;
97986
- const field = feature.fields["switchOn"];
97987
- if (field === void 0) return null;
97988
- const read = fieldReads(field).find((r) => r.cap === "switch");
97989
- if (read === void 0) return null;
97990
- return {
97991
- device,
97992
- switch: read.source,
97993
- offSeconds: normalizeOffSeconds(storedOffSeconds(composition))
97994
- };
97995
- }
97996
98671
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
97997
98672
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
97998
98673
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
@@ -98998,7 +99673,6 @@ function applyPrimaryChildRule(rule, children) {
98998
99673
  var CONTAINER_CHILD_PRIORITY = [
98999
99674
  "media-player",
99000
99675
  "alarm-panel",
99001
- "thermostat",
99002
99676
  "climate",
99003
99677
  "humidifier",
99004
99678
  "water-heater",
@@ -99488,7 +100162,72 @@ var DeclaredDevices = class {
99488
100162
  return removed;
99489
100163
  }
99490
100164
  };
99491
- DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
100165
+ /**
100166
+ * A device's KIND is its type plus its role (D1033): the type is the set of
100167
+ * controls it has, the role says which thing it is among the devices that
100168
+ * share those controls. A plug-in heater is a `switch` with role
100169
+ * `switch-heater`; an air conditioner and a radiator valve are both `climate`,
100170
+ * told apart by their `climate-*` role.
100171
+ */
100172
+ /**
100173
+ * Type values a persisted row may still carry after the type was retired, and
100174
+ * the type each one is read as. The row is rewritten by the next registration
100175
+ * of the device (its provider stamps the live type), so this is a read alias,
100176
+ * not a migration.
100177
+ *
100178
+ * `heater` is deliberately absent: the only heaters were composed devices the
100179
+ * operator deletes. Such a row stays an unknown type, which every reader
100180
+ * treats as a generic device.
100181
+ */
100182
+ var RETIRED_DEVICE_TYPES = { thermostat: DeviceType.Climate };
100183
+ /** The live type a stored `type` value stands for (itself unless retired). */
100184
+ function canonicalStoredDeviceType(stored) {
100185
+ return RETIRED_DEVICE_TYPES[stored] ?? stored;
100186
+ }
100187
+ /** The `climate-*` roles, in the order the role picker lists them. */
100188
+ var CLIMATE_ROLES = [
100189
+ DeviceRole.ClimateThermostat,
100190
+ DeviceRole.ClimateAc,
100191
+ DeviceRole.ClimateRadiator,
100192
+ DeviceRole.ClimateFloor,
100193
+ DeviceRole.ClimateHeater,
100194
+ DeviceRole.ClimateHeatPumpCircuit
100195
+ ];
100196
+ function isClimateRole(role) {
100197
+ return CLIMATE_ROLES.some((candidate) => candidate === role);
100198
+ }
100199
+ /**
100200
+ * Which climate device this is. A climate device with no role, or a role that
100201
+ * is not a climate one, is a room thermostat: that is what most of them are,
100202
+ * and it is the presentation a thermostat had before the types were folded.
100203
+ */
100204
+ function climateRoleOf(role) {
100205
+ return role !== null && role !== void 0 && isClimateRole(role) ? role : DeviceRole.ClimateThermostat;
100206
+ }
100207
+ /** An air conditioner: exports present it as an AC unit, not a thermostat. */
100208
+ function isAirConditioner(type, role) {
100209
+ return type === DeviceType.Climate && climateRoleOf(role) === DeviceRole.ClimateAc;
100210
+ }
100211
+ /**
100212
+ * Is a capability offered on a device of this type and role?
100213
+ *
100214
+ * Fails open where the old type-only gate did: no `deviceTypes` (or an empty
100215
+ * list) applies to every device, and an unknown type never filters (a failed
100216
+ * meta read must not destroy work, D49). A type the cap's `deviceRoles` names
100217
+ * is offered only to the roles listed there; an unknown role is NOT one of
100218
+ * them, so a `switch` whose role could not be read is not a heater.
100219
+ */
100220
+ function capAppliesToDeviceKind(gate, deviceType, role) {
100221
+ if (deviceType === void 0) return true;
100222
+ const types = gate?.deviceTypes;
100223
+ if (!types || types.length === 0) return true;
100224
+ const type = types.find((candidate) => candidate === deviceType);
100225
+ if (type === void 0) return false;
100226
+ const roles = gate?.deviceRoles?.[type];
100227
+ if (roles === void 0) return true;
100228
+ return role !== null && role !== void 0 && roles.some((candidate) => candidate === role);
100229
+ }
100230
+ DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
99492
100231
  new Set(Object.values(DeviceType));
99493
100232
  /** True when a value is a navigable node: a plain object OR a tRPC v11 client
99494
100233
  * proxy node (a callable `Proxy(noop)` → `typeof === 'function'`, NOT an
@@ -101700,9 +102439,6 @@ function durationText(seconds) {
101700
102439
  const text = `${Math.floor(m / 60)} h ${String(m % 60).padStart(2, "0")}`;
101701
102440
  return t(text, text);
101702
102441
  }
101703
- function deviceTypeOf(type) {
101704
- return Object.values(DeviceType).find((t) => t === type);
101705
- }
101706
102442
  var switchContribution = contribution("switch", SwitchStatusSchema, (slice) => {
101707
102443
  const on = slice?.on ?? null;
101708
102444
  return {
@@ -101883,8 +102619,7 @@ function remainingWords(amount, unit) {
101883
102619
  return t(`${amount} ${word}`, `${amount} ${word}`);
101884
102620
  }
101885
102621
  var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slice, ctx) => {
101886
- const type = deviceTypeOf(ctx.type);
101887
- const limit = type === void 0 ? null : timedRunLimitOf(type);
102622
+ const limit = timedRunLimitOf(ctx.type, ctx.role);
101888
102623
  if (limit === null) return {};
101889
102624
  const quickRun = slice?.quickRun ?? timedRunQuickRun(limit, null);
101890
102625
  const activeUntil = slice?.activeUntil != null && slice.activeUntil > ctx.now ? slice.activeUntil : null;
@@ -102323,7 +103058,6 @@ var HERO_LAYOUT_BY_TYPE = {
102323
103058
  [DeviceType.Siren]: HERO_LAYOUT_DEFAULT,
102324
103059
  [DeviceType.Switch]: SWITCH_LAYOUT,
102325
103060
  [DeviceType.Sensor]: HERO_LAYOUT_DEFAULT,
102326
- [DeviceType.Thermostat]: CLIMATE_LAYOUT,
102327
103061
  [DeviceType.Climate]: CLIMATE_LAYOUT,
102328
103062
  [DeviceType.Button]: BUTTON_LAYOUT,
102329
103063
  [DeviceType.EventEmitter]: HERO_LAYOUT_DEFAULT,
@@ -102352,7 +103086,6 @@ var HERO_LAYOUT_BY_TYPE = {
102352
103086
  [DeviceType.PetFountain]: FOUNTAIN_LAYOUT,
102353
103087
  [DeviceType.Dishwasher]: DISHWASHER_LAYOUT,
102354
103088
  [DeviceType.Washer]: APPLIANCE_LAYOUT,
102355
- [DeviceType.Heater]: HEATER_LAYOUT,
102356
103089
  [DeviceType.Dryer]: APPLIANCE_LAYOUT,
102357
103090
  [DeviceType.Gateway]: HERO_LAYOUT_DEFAULT
102358
103091
  };
@@ -102360,7 +103093,8 @@ function isDeviceType$1(type) {
102360
103093
  return Object.values(DeviceType).includes(type);
102361
103094
  }
102362
103095
  /** The layout of a type; a type this build does not know gets the default. */
102363
- function resolveHeroLayout(type) {
103096
+ function resolveHeroLayout(type, role = null) {
103097
+ if (type === DeviceType.Switch && role === DeviceRole.SwitchHeater) return HEATER_LAYOUT;
102364
103098
  return isDeviceType$1(type) ? HERO_LAYOUT_BY_TYPE[type] : HERO_LAYOUT_DEFAULT;
102365
103099
  }
102366
103100
  /**
@@ -103039,7 +103773,7 @@ var HERO_MODE_LOOK = {
103039
103773
  open: null,
103040
103774
  closed: null
103041
103775
  };
103042
- var MODE_LOOK_TYPES = [DeviceType.Climate, DeviceType.Thermostat];
103776
+ var MODE_LOOK_TYPES = [DeviceType.Climate];
103043
103777
  var HERO_LOOK_BY_TYPE = {
103044
103778
  [DeviceType.Camera]: CAMERA_LOOK,
103045
103779
  [DeviceType.Hub]: HERO_LOOK_DEFAULT,
@@ -103047,8 +103781,7 @@ var HERO_LOOK_BY_TYPE = {
103047
103781
  [DeviceType.Siren]: HERO_LOOK_DEFAULT,
103048
103782
  [DeviceType.Switch]: SWITCH_LOOK,
103049
103783
  [DeviceType.Sensor]: READING_SENSOR_LOOK,
103050
- [DeviceType.Thermostat]: THERMOSTAT_LOOK,
103051
- [DeviceType.Climate]: CLIMATE_LOOK,
103784
+ [DeviceType.Climate]: THERMOSTAT_LOOK,
103052
103785
  [DeviceType.Button]: BUTTON_LOOK,
103053
103786
  [DeviceType.EventEmitter]: EVENT_EMITTER_LOOK,
103054
103787
  [DeviceType.Update]: UPDATE_LOOK,
@@ -103076,7 +103809,6 @@ var HERO_LOOK_BY_TYPE = {
103076
103809
  [DeviceType.PetFountain]: FOUNTAIN_LOOK,
103077
103810
  [DeviceType.Dishwasher]: DISHWASHER_LOOK,
103078
103811
  [DeviceType.Washer]: WASHER_LOOK,
103079
- [DeviceType.Heater]: HEATER_LOOK,
103080
103812
  [DeviceType.Dryer]: DRYER_LOOK,
103081
103813
  [DeviceType.Gateway]: HERO_LOOK_DEFAULT
103082
103814
  };
@@ -103101,6 +103833,14 @@ var HERO_LOOK_BY_ROLE = {
103101
103833
  [DeviceRole.CoverWindow]: "inherit",
103102
103834
  [DeviceRole.BinaryHelper]: "inherit",
103103
103835
  [DeviceRole.Outlet]: "inherit",
103836
+ [DeviceRole.SwitchHeater]: HEATER_LOOK,
103837
+ [DeviceRole.SwitchFan]: FAN_LOOK,
103838
+ [DeviceRole.ClimateAc]: "inherit",
103839
+ [DeviceRole.ClimateThermostat]: "inherit",
103840
+ [DeviceRole.ClimateFloor]: "inherit",
103841
+ [DeviceRole.ClimateRadiator]: "inherit",
103842
+ [DeviceRole.ClimateHeater]: "inherit",
103843
+ [DeviceRole.ClimateHeatPumpCircuit]: "inherit",
103104
103844
  [DeviceRole.MotionSensor]: MOTION_LOOK,
103105
103845
  [DeviceRole.ContactSensor]: "inherit",
103106
103846
  [DeviceRole.LeakSensor]: LEAK_LOOK,
@@ -103158,6 +103898,7 @@ function resolveHeroLook(role, type, state, mode = null) {
103158
103898
  const byMode = HERO_MODE_LOOK[mode];
103159
103899
  if (byMode !== null) return byMode;
103160
103900
  }
103901
+ if (isAirConditioner(type, role)) return CLIMATE_LOOK[state];
103161
103902
  return ((isDeviceType(type) ? HERO_LOOK_BY_TYPE[type] : void 0) ?? HERO_LOOK_DEFAULT)[state];
103162
103903
  }
103163
103904
  /** The media player's offer outranks a bound switch: the player's own state is the device's. */
@@ -103328,6 +104069,7 @@ function buildHeroModel(input) {
103328
104069
  const ctx = {
103329
104070
  deviceId: device.id,
103330
104071
  type: device.type,
104072
+ role: device.role,
103331
104073
  features: input.features,
103332
104074
  now: input.now,
103333
104075
  running: runningOf(input),
@@ -103356,7 +104098,7 @@ function buildHeroModel(input) {
103356
104098
  }
103357
104099
  };
103358
104100
  const allRows = fragments.flatMap((f) => f.rows ?? []);
103359
- const rows = resolveHeroLayout(device.type).rows.flatMap((id) => {
104101
+ const rows = resolveHeroLayout(device.type, device.role).rows.flatMap((id) => {
103360
104102
  return allRows.filter((r) => r.id === id).map((r) => HERO_SCENE_ROW_IDS.has(r.id) ? {
103361
104103
  ...r,
103362
104104
  placement: "scene"
@@ -106812,6 +107554,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
106812
107554
  access: "create",
106813
107555
  role: "viewer"
106814
107556
  },
107557
+ "fanControl.setOscillationAxis": {
107558
+ capName: "fan-control",
107559
+ capScope: "device",
107560
+ addonId: null,
107561
+ access: "create",
107562
+ role: "viewer"
107563
+ },
106815
107564
  "fanControl.setPercentage": {
106816
107565
  capName: "fan-control",
106817
107566
  capScope: "device",
@@ -113833,7 +114582,7 @@ function projectAction(cap, action) {
113833
114582
  };
113834
114583
  }
113835
114584
  Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
113836
- DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
114585
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
113837
114586
  DeviceFeature.BatteryOperated;
113838
114587
  function bound(cap, methods = [], authority = "reported") {
113839
114588
  return {
@@ -115131,6 +115880,11 @@ Object.freeze({
115131
115880
  form: "single",
115132
115881
  optional: false
115133
115882
  }],
115883
+ "fanControl.setOscillationAxis": [{
115884
+ name: "deviceId",
115885
+ form: "single",
115886
+ optional: false
115887
+ }],
115134
115888
  "fanControl.setPercentage": [{
115135
115889
  name: "deviceId",
115136
115890
  form: "single",
@@ -119401,4 +120155,4 @@ z.object({
119401
120155
  commands: z.record(z.string(), z.unknown())
119402
120156
  });
119403
120157
  //#endregion
119404
- export { DataStoreDatabaseSchema as $, siteFor as $a, secretTreeFromPaths as $c, parseStreamParamsFormPatch as $i, compositionFieldKey as $n, evaluateDerivative as $o, integrationInstancesCapability as $r, asNumber as $s, STORAGE_LOCATION_MODES as $t, ConsumableItemSchema as A, resolveLocationMode as Aa, isInstanceEnabled as Ac, mayWriteToLocation as Ai, batteryCapability as An, weekdayOfLocalDate as Ao, enumerateSchemaFields as Ar, RECORD_BATCH_MAX_BYTES as As, MOTION_CLOSE_AFTER_MS as At, DERIVED_CAMERA_SILENCED_CAP_NAMES as B, runtimeFieldUnit as Ba, nodeIdOfScopedKey as Bc, nextOccurrence as Bi, canonicalIconKey as Bn, HOUR_MS as Bo, fanPresetsCapability as Br, RecordKindDeclarationSchema as Bs, PowerSourceInfoSchema as Bt, COMPOSER_RUNNER_ID as C, resolveActionVariables as Ca, historyItemFieldPath as Cc, locationIconKey as Ci, alertEpisodePayload as Cn, validateComposition as Co, deviceRemovalHookCapability as Cr, FilterRequiredError as Cs, KEYCHAIN_RESET_TRIGGER_ACTOR as Ct, CalendarPreferencesSchema as D, resolveCoreBlockFiles as Da, isDebugChannelName as Dc, logLevelAtMost as Di, authProviderCapability as Dn, vectorDimFromBase64 as Do, deviceTransitionsCapability as Dr, NoCallerError as Ds, METHOD_ACCESS_MAP as Dt, CREDENTIAL_TOKEN_AUDIENCE as E, resolveCoreBlockEntry as Ea, isCommand as Ec, logDestinationCapability as Ei, armRemovalReconcile as En, valveCapability as Eo, deviceStatusCapability as Er, InvalidRecordError as Es, LOG_LEVEL_RANK as Et, DATABASE_SNAPSHOT_SUFFIX as F, resolveRunnerId as Fa, isSecretMarker as Fc, metricsProviderCapability as Fi, buildDeviceSignatureMessage as Fn, CompositionSchema as Fo, expandContainer as Fr, REMOVE_LEAF as Fs, PET_FOUNTAIN_WATER_KEY as Ft, DEVICE_SAN_CREDENTIAL_PREFIX as G, scoreRuntimes as Ga, parseJsonUnknown as Gc, normalizeStepTargets as Gi, checkTemplatePayload as Gn, composedDeviceRef as Go, formatDeviceRevoker as Gr, SECRET_CLEAR as Gs, RECORDING_SOURCE_CAMSTACK_ADDON as Gt, DEVICE_HISTORY_ENERGY_KEY as H, schedulersCapability as Ha, normalizeNodeId as Hc, normalizeActionUnits as Hi, catalogueIssues as Hn, MINUTE_MS as Ho, filesystemBrowseCapability as Hr, RecordTooLargeError as Hs, PreferenceNamespaceSchema as Ht, DATABASE_SNAPSHOT_TIMEOUT_MS as I, resolveStepArgs as Ia, isSecretMarkerLike as Ic, migrationsCapability as Ii, buildHeroModel as In, DAY_MS as Io, expressionContainsBuiltinCall as Ir, RUNTIME_DEFAULTS as Is, PREFERENCES_MAX_VALUE_BYTES as It, DEVICE_TEMPLATE_MAX_LENGTH as J, settleDeviceFeatures as Ja, recordSecretRef as Jc, objectInputDeclaresRequiredDeviceId as Ji, collectWhenMirrorSources as Jn, compositionItemFieldPath as Jo, generateDeviceAlias as Jr, UnindexedFilterError as Js, RecordingStatusSchema as Jt, DEVICE_SAN_USER_PREFIX as K, seedInstanceOnce as Ka, parseSecretRef as Kc, normalizeUnit as Ki, climateControlCapability as Kn, composedDeviceStableId as Ko, formatMinutes as Kr, StoredRecordKindDeclarationSchema as Ks, REMOTE_MEDIA_COMMANDS as Kt, DATA_STORE_DATABASES as L, resolveTemplateRef as La, isSecretRefOwnedBy as Lc, modeForSwitch as Li, buildStreamParamsConfigSchema as Ln, DEFAULT_HISTORY_RETENTION as Lo, extractNestedAddonId as Lr, ReadinessRegistry as Ls, PROPOSAL_MIN_SPAN_MS as Lt, CoreBlockSchema as M, resolveMutate as Ma, isReadingQuantity as Mc, mediaPlayerFeaturesOfRoles as Mi, buildActionSteps as Mn, withLocationMode as Mo, evaluateStepCondition as Mr, RECORD_SECRET_COLLECTION_PREFIX as Ms, MigrationLedgerEntrySchema as Mt, CredentialTokenClaimsSchema as N, resolveNotificationTapAddress as Na, isSecretClear as Nc, memoizePinnedFfmpeg as Ni, buildCapabilityLookup as Nn, zoneOnlySite as No, evaluateWhenTree as Nr, RECORD_SWEEP_INTERVAL_MS as Ns, MigrationMetaSchema as Nt, CatalogFileSchema as O, resolveHeroLayout as Oa, isDeviceConfigCap as Oc, looseSchema as Oi, backupCapability as On, vectorIndexDimConflictError as Oo, enumerateInferenceDevices as Or, PlaintextSecretError as Os, MIGRATION_API_V1_METHODS as Ot, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as P, resolveRemoteSource as Pa, isSecretFieldView as Pc, methodRefusal as Pi, buildDeviceEnrollmentLink as Pn, COMPOSER_ADDON_ID as Po, evictionPolicyOfLocation as Pr, REDACTED_SECRET as Ps, NetworkTunnelStartedDataSchema as Pt, DEVICE_TOMBSTONE_RETENTION_MS as Q, shortHostname as Qa, scopeKey as Qc, parseColorInput as Qi, composerCapability as Qn, disarmRoseMemory as Qo, heroLayoutCapability as Qr, asJsonObject as Qs, STORAGE_ACCESS_FALLBACK as Qt, DAY_NAMES as R, runFanOut as Ra, makeSecretMarker as Rc, modeMayWrite as Ri, calendarsCapability as Rn, HISTORY_FAST_MS as Ro, fanControlCapability as Rr, ReadinessTimeoutError as Rs, PackageRequiresSchema as Rt, COMPOSED_ITEM_FIXED_FIELDS as S, replacedFieldKeys as Sa, getDebugInterest as Sc, localNetworkCapability as Si, alertEpisodeId as Sn, userManagementCapability as So, deviceManagerCapability as Sr, DeviceTransitionSchema as Ss, INTERNAL_ACTION_PREFIX as St, CORE_BLOCK_ADDON_PREFIX as T, resolveBucketMs as Ta, hydrateSchema as Tc, lockDoorLinkOfComposition as Ti, appendTrace as Tn, validateSchedulerInput as To, deviceStateCapability as Tr, HISTORY_DEFAULT_MIN_INTERVAL_MS as Ts, KeychainResetRecordSchema as Tt, DEVICE_ID_FIELD as U, scopesAllowAddon as Ua, normalizeSecretOwner as Uc, normalizeCapStep as Ui, checkDeviceAlias as Un, buildFfmpegArgs as Uo, findChannelSource as Ur, RecordUniqueViolationError as Us, PreferenceValueSchema as Ut, DEVICE_ENROLLMENT_TTL_MS as V, runtimeStatePolicyFor as Va, nodePin as Vc, nextTimeBoundaryInMs as Vi, capUnitResolver as Vn, HelperMemberSchema as Vo, featureForwards as Vr, RecordNotFoundError as Vs, PreferenceDeviceIdSchema as Vt, DEVICE_NONCE_TTL_MS as W, scopesAllowDeviceCap as Wa, parseJsonObject as Wc, normalizeCoreBlockWrite as Wi, checkRoleAddress as Wn, cloneStatefulExpressionMemory as Wo, foldSnapshotByFunction as Wr, RevConflictError as Ws, QuantityUnitError as Wt, DEVICE_TEMPLATE_THIS_ALIAS as X, sharedActuatorMethods as Xa, resolveSecretMarkers as Xc, orderMigrations as Xi, compareVersions as Xn, compositionSourceKey as Xo, groupTemplate as Xr, WELL_KNOWN_TAB_MAP as Xs, RemoteLayoutPayloadSchema as Xt, DEVICE_TEMPLATE_MAX_OUTPUT as Y, sharedActuatorFeatures as Ya, resolveCapMount as Yc, occurrenceOn as Yi, colorCapability as Yn, compositionSliceKey as Yo, groupCommandsCapability as Yr, UnknownRecordKindError as Ys, RemoteAssumedStateSchema as Yt, DEVICE_TEMPLATE_VALUES_CAP as Z, sharedColorModes as Za, ruleFireOfClaim as Zc, parseAcceleratorFactsJson as Zi, compileScalarOverride as Zn, createStatefulExpressionMemory as Zo, hasTimeLeaves as Zr, actionEffect as Zs, RunningStateStatusSchema as Zt, BatteryStatusSchema as _, recordsCapability as _a, emitDownForOwnedCaps as _c, keychainCapability as _i, actionsCapability as _n, timedRunMaxIn as _o, describeComposableCaps as _r, CALLER_STAMPED_CAPABILITIES as _s, HISTORY_ITEM_CATALOG as _t, AGENT_MDNS_SERVICE_TYPE as a, powerSourceCapability as aa, collectSecretConfigKeys as ac, isArrayOutputSchema as ai, transformSecretWrite as al, SsoBridgeClaimsSchema as an, storageCapability as ao, coreBlockSourceKind as ar, isForwardInputRef as as, EMPTY_AUTOMATION_STATE as at, CAP_NAMES_WITH_STATUS as b, remoteLayoutComponentsCapability as ba, expandCapMethods as bc, lifecycleJobSchema as bi, addonSettingsCapability as bn, toTimings as bo, deviceExtensionCapability as br, DEVICE_STATUS_METHOD as bs, HvacModeSchema as bt, ActionError as c, problemsBlockSave as ca, collectZodSecretPaths as cc, isDefaultAppConnectionEndpoint as ci, withoutCallerStamp as cl, StorageLocationTypeSchema as cn, storageProviderCapability as co, createDeviceExtensionProvider as cr, openReset as cs, FAN_CAPTURE_FIELDS as ct, ActionTargetResolver as d, projectDeviceRow as da, createEvent as dc, isLocationEnabled as di, DeviceRole as dl, TemplateKindSchema as dn, supportedRuntimes as do, databaseSnapshotCapability as dr, planStatisticTier as ds, FanDirectionSchema as dt, petFountainCapability as ea, asString$1 as ec, internalActionId as ei, secretTreeFromSchema as el, STREAM_PROFILE_META as en, siteZoneKey as eo, compositionSourceRefs as er, evaluateStatistic as es, DeclaredDevices as et, ActionVariableSchema as f, proposeRunningThreshold as fa, customAction as fc, isObjectInput as fi, DeviceType as fl, TokenScopeSchema as fn, switchCapability as fo, declarationOwnerNodeId as fr, statisticCadenceMs as fs, FanPresetSchema as ft, BaseDevice as g, recordEntriesCapability as ga, defineRecordKinds as gc, keychainAdminCapability as gi, actionWaitTotalMs as gn, timedRunLimitOf as go, deriveBatteryPresence as gr, BatchTooLargeError as gs, HISTORY_CATALOG as gt, BUILTIN_REMOTE_COMPONENTS as h, reconcileReportedFeatures as ha, defineEntryKind as hc, kebabToCamel as hi, EventCategory as hl, actionSourceCapability as hn, timedRunCapability as ho, defineExtensionSlotProvider as hr, BaseAddon as hs, GroupCommandResultSchema as ht, ACTUATOR_TEMPLATE_IDS as i, platformProbeCapability as ia, buildSecretRef as ic, isAppLinkBase as ii, toSecretFieldView as il, ServerNameSchema as in, storageAdminCapability as io, coreBlockIdFromAddonId as ir, integrateReading as is, DiscoveryProposalBodySchema as it, ControlStatusSchema as j, resolveMethodAuth as ja, isKeychainStoredField as jc, mediaPlayerCapability as ji, brightnessCapability as jn, withDefaultRunning as jo, evaluateCompositionField as jr, RECORD_DELETE_BATCH as js, MediaPlayerStatusSchema as jt, ConditionMirror as k, resolveHubAddressRoles as ka, isEvent as kc, mayReadLocation as ki, bareAddonId as kn, vectorStoreCapability as ko, enumerateItemArrayFields as kr, RECORD_BATCH_MAX as ks, MINUTES_PER_DAY as kt, ActionMinDelaySecSchema as l, procedureAuthKey as la, commandEffect as lc, isInternalActionId as li, COMPOSED_DEVICE_STABLE_ID_PREFIX as ll, StorageMigrationJobSchema as ln, streamCatalogCapability as lo, customKeyOfRole as lr, openStatistic as ls, FIRST_LEVEL_MACRO_CLASSES as lt, AutomationStateDocSchema as m, readStoredRemoteConfig as ma, defineCustomActions as mc, isVoidInput as mi, featuresOfBoundCaps as ml, UserRecordSchema as mn, templateCapability as mo, decodeVectorBase64 as mr, wattMillisecondsToKwh as ms, FieldClaimSchema as mt, ACTION_TARGET_INVALIDATION_EVENTS as n, pickAppLinkHub as na, assertValidDeclaration as nc, isAlertEpisodeOpen as ni, sleep as nl, SchedulerSchema as nn, splitTranslationRef as no, coreBlockAddonId as nr, historyRetentionFromSettings as ns, DeviceStatusSchema as nt, AGENT_MDNS_TXT_KEYS as o, powerSourceLinkOfComposition as oa, collectSecretLeaves as oc, isCollectionArrayMethod as oi, userError as ol, StorageCleanupJobSchema as on, storageMigrationCapability as oo, coreBlocksCapability as or, isHistoryHelper as os, EMPTY_REMOTE_ASSUMED_STATE as ot, AlertSchema as p, ptzAutotrackCapability as pa, defineAddonMigrations as pc, isSameAddonId as pi, errMsg as pl, UNATTRIBUTED_BUCKET_KEY as pn, switchStateOfMode as po, declaredSeriesKind as pr, toExpressionValue as ps, FieldClaimModeSchema as pt, DEVICE_TEMPLATE_FILTERS as q, settingsStoreCapability as qa, readinessKey as qc, objectInputDeclaresAddonId as qi, collectDeviceTemplates as qn, compositionFeatureEnabled as qo, gbToBytes as qr, TransactRefusedError as qs, ROOT_BUCKET_KEY as qt, ACTUATOR_METHODS as r, planComposition as ra, auditedFields as rc, isAlertEpisodeSeverity as ri, toNodeId as rl, ScopedTokenSchema as rn, stableIdMapOf as ro, coreBlockComposition as rr, implementedMethodsOf as rs, DeviceTombstoneSchema as rt, ALL_CAPABILITY_DEFINITIONS as s, preconditionOf as sa, collectSecretMarkerRefs as sc, isCredentialTokenPayload as si, vocabActionIdFor as sl, StorageLocationModeSchema as sn, storageOccupancyCapability as so, coverCapability as sr, nextLocalMidnight as ss, EMPTY_REMOTE_CONFIG as st, ACTION_RUN_MAX_MS as t, petFountainWaterItem as ta, assertTransactScope as tc, interpolate as ti, secretViewsOf as tl, SchedulerError as tn, snapshotCapability as to, consumablesCapability as tr, helperMembers as ts, DeviceRunSchema as tt, ActionStepSchema as u, processTimeZoneOr as ua, commandOrigin as uc, isKernelDerivedFeature as ui, DeviceFeature as ul, SwitchStatusSchema as un, streamQualityLabel as uo, dataStoreProviderCapability as ur, planResetTier as us, FanControlStatusSchema as ut, CAMERA_SWITCH_ORDER as v, reducePoints as va, emitReadiness as vc, legacyAutoLinkIds as vi, addonIdOfActionId as vn, timedRunQuickRun as vo, describeUnmet as vr, DATAPLANE_SECRET_HEADER as vs, HUB_MDNS_SERVICE_TYPE as vt, CORE_BLOCKS_ADDON_ID as w, resolveAppConnections as wa, historyUnitFor as wc, lockControlCapability as wi, alertsCapability as wn, validateCustomAddress as wo, deviceRunsCapability as wr, ForeignSecretMarkerError as ws, KeychainAuditEntrySchema as wt, CATALOG_LANGS as x, remoteSourceSteps as xa, formatSecretScope as xc, localDateOf as xi, addonWidgetsCapability as xn, unmetRequirements as xo, deviceHistoryCapability as xr, DeclarationRefusedError as xs, IDLE_ACTION_STATUS as xt, CAMSTACK_APP_LINK_ORIGIN as y, remoteCapability as ya, entryBody as yc, legacyModeOf as yi, addonPagesCapability as yn, timedRunSeconds as yo, deviceCredentialsCapability as yr, DEVICE_SETTINGS_CONTRIBUTION_METHODS as ys, HUB_MDNS_TXT_KEYS as yt, DEFAULT_HOLD_OVERRIDE as z, runSteps as za, mapSecretLeaves as zc, motionCapability as zi, cameraGridLayoutCapability as zn, HISTORY_SLOW_MS as zo, fanOutTargets as zr, RecordIntegrationInstances as zs, PetFountainStatusSchema as zt };
120158
+ export { DeclaredDevices as $, settingsStoreCapability as $a, readinessKey as $c, objectInputDeclaresRequiredDeviceId as $i, compareVersions as $n, compositionFeatureEnabled as $o, generateDeviceAlias as $r, TransactRefusedError as $s, STORAGE_ACCESS_FALLBACK as $t, ConsumableItemSchema as A, resolveAppConnections as Aa, historyUnitFor as Ac, lockDoorLinkOfComposition as Ai, bareAddonId as An, validateCustomAddress as Ao, deviceStatusCapability as Ar, ForeignSecretMarkerError as As, MINUTES_PER_DAY as At, DEVICE_ENROLLMENT_TTL_MS as B, resolveRemoteSource as Ba, isSecretFieldView as Bc, metricsProviderCapability as Bi, cameraGridLayoutCapability as Bn, COMPOSER_ADDON_ID as Bo, expressionContainsBuiltinCall as Br, REDACTED_SECRET as Bs, PetFountainStatusSchema as Bt, COMPOSER_RUNNER_ID as C, recordsCapability as Ca, emitDownForOwnedCaps as Cc, legacyAutoLinkIds as Ci, alertEpisodeId as Cn, timedRunMaxIn as Co, deviceCredentialsCapability as Cr, CALLER_STAMPED_CAPABILITIES as Cs, INTERNAL_ACTION_PREFIX as Ct, CalendarPreferencesSchema as D, remoteSourceSteps as Da, formatSecretScope as Dc, localNetworkCapability as Di, armRemovalReconcile as Dn, unmetRequirements as Do, deviceRemovalHookCapability as Dr, DeclarationRefusedError as Ds, LOG_LEVEL_RANK as Dt, CREDENTIAL_TOKEN_AUDIENCE as E, remoteLayoutComponentsCapability as Ea, expandCapMethods as Ec, localDateOf as Ei, appendTrace as En, toTimings as Eo, deviceManagerCapability as Er, DEVICE_STATUS_METHOD as Es, KeychainResetRecordSchema as Et, DATABASE_SNAPSHOT_TIMEOUT_MS as F, resolveHubAddressRoles as Fa, isEvent as Fc, mayWriteToLocation as Fi, buildDeviceEnrollmentLink as Fn, vectorStoreCapability as Fo, evaluateCompositionField as Fr, RECORD_BATCH_MAX as Fs, NetworkTunnelStartedDataSchema as Ft, DEVICE_SAN_USER_PREFIX as G, runSteps as Ga, mapSecretLeaves as Gc, nextOccurrence as Gi, catalogueIssues as Gn, HISTORY_SLOW_MS as Go, fanPresetsCapability as Gr, RecordIntegrationInstances as Gs, QuantityUnitError as Gt, DEVICE_ID_FIELD as H, resolveStepArgs as Ha, isSecretMarkerLike as Hc, modeForSwitch as Hi, canonicalStoredDeviceType as Hn, DAY_MS as Ho, fanAxisPath as Hr, RUNTIME_DEFAULTS as Hs, PreferenceDeviceIdSchema as Ht, DATA_STORE_DATABASES as I, resolveLocationMode as Ia, isInstanceEnabled as Ic, mediaPlayerCapability as Ii, buildDeviceSignatureMessage as In, weekdayOfLocalDate as Io, evaluateStepCondition as Ir, RECORD_BATCH_MAX_BYTES as Is, PET_FOUNTAIN_WATER_KEY as It, DEVICE_TEMPLATE_MAX_OUTPUT as J, schedulersCapability as Ja, normalizeNodeId as Jc, normalizeCapStep as Ji, checkTemplatePayload as Jn, MINUTE_MS as Jo, findChannelSource as Jr, RecordTooLargeError as Js, ROOT_BUCKET_KEY as Jt, DEVICE_TEMPLATE_FILTERS as K, runtimeFieldUnit as Ka, nodeIdOfScopedKey as Kc, nextTimeBoundaryInMs as Ki, checkDeviceAlias as Kn, HOUR_MS as Ko, featureForwards as Kr, RecordKindDeclarationSchema as Ks, RECORDING_SOURCE_CAMSTACK_ADDON as Kt, DAY_NAMES as L, resolveMethodAuth as La, isKeychainStoredField as Lc, mediaPlayerFeaturesOfRoles as Li, buildHeroModel as Ln, withDefaultRunning as Lo, evaluateWhenTree as Lr, RECORD_DELETE_BATCH as Ls, PREFERENCES_MAX_VALUE_BYTES as Lt, CredentialTokenClaimsSchema as M, resolveCoreBlockEntry as Ma, isCommand as Mc, logLevelAtMost as Mi, brightnessCapability as Mn, valveCapability as Mo, enumerateInferenceDevices as Mr, InvalidRecordError as Ms, MediaPlayerStatusSchema as Mt, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as N, resolveCoreBlockFiles as Na, isDebugChannelName as Nc, looseSchema as Ni, buildActionSteps as Nn, vectorDimFromBase64 as No, enumerateItemArrayFields as Nr, NoCallerError as Ns, MigrationLedgerEntrySchema as Nt, CatalogFileSchema as O, replacedFieldKeys as Oa, getDebugInterest as Oc, locationIconKey as Oi, authProviderCapability as On, userManagementCapability as Oo, deviceRunsCapability as Or, DeviceTransitionSchema as Os, METHOD_ACCESS_MAP as Ot, DATABASE_SNAPSHOT_SUFFIX as P, resolveHeroLayout as Pa, isDeviceConfigCap as Pc, mayReadLocation as Pi, buildCapabilityLookup as Pn, vectorIndexDimConflictError as Po, enumerateSchemaFields as Pr, PlaintextSecretError as Ps, MigrationMetaSchema as Pt, DataStoreDatabaseSchema as Q, seedInstanceOnce as Qa, parseSecretRef as Qc, objectInputDeclaresAddonId as Qi, colorCapability as Qn, composedDeviceStableId as Qo, gbToBytes as Qr, StoredRecordKindDeclarationSchema as Qs, RunningStateStatusSchema as Qt, DEFAULT_HOLD_OVERRIDE as R, resolveMutate as Ra, isReadingQuantity as Rc, memoizePinnedFfmpeg as Ri, buildStreamParamsConfigSchema as Rn, withLocationMode as Ro, evictionPolicyOfLocation as Rr, RECORD_SECRET_COLLECTION_PREFIX as Rs, PROPOSAL_MIN_SPAN_MS as Rt, COMPOSED_ITEM_FIXED_FIELDS as S, recordEntriesCapability as Sa, defineRecordKinds as Sc, keychainCapability as Si, addonWidgetsCapability as Sn, timedRunLimitOf as So, describeUnmet as Sr, BatchTooLargeError as Ss, IDLE_ACTION_STATUS as St, CORE_BLOCK_ADDON_PREFIX as T, remoteCapability as Ta, entryBody as Tc, lifecycleJobSchema as Ti, alertsCapability as Tn, timedRunSeconds as To, deviceHistoryCapability as Tr, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Ts, KeychainAuditEntrySchema as Tt, DEVICE_NONCE_TTL_MS as U, resolveTemplateRef as Ua, isSecretRefOwnedBy as Uc, modeMayWrite as Ui, capAppliesToDeviceKind as Un, DEFAULT_HISTORY_RETENTION as Uo, fanControlCapability as Ur, ReadinessRegistry as Us, PreferenceNamespaceSchema as Ut, DEVICE_HISTORY_ENERGY_KEY as V, resolveRunnerId as Va, isSecretMarker as Vc, migrationsCapability as Vi, canonicalIconKey as Vn, CompositionSchema as Vo, extractNestedAddonId as Vr, REMOVE_LEAF as Vs, PowerSourceInfoSchema as Vt, DEVICE_SAN_CREDENTIAL_PREFIX as W, runFanOut as Wa, makeSecretMarker as Wc, motionCapability as Wi, capUnitResolver as Wn, HISTORY_FAST_MS as Wo, fanOutTargets as Wr, ReadinessTimeoutError as Ws, PreferenceValueSchema as Wt, DEVICE_TEMPLATE_VALUES_CAP as X, scopesAllowDeviceCap as Xa, parseJsonObject as Xc, normalizeStepTargets as Xi, collectDeviceTemplates as Xn, cloneStatefulExpressionMemory as Xo, formatDeviceRevoker as Xr, RevConflictError as Xs, RemoteAssumedStateSchema as Xt, DEVICE_TEMPLATE_THIS_ALIAS as Y, scopesAllowAddon as Ya, normalizeSecretOwner as Yc, normalizeCoreBlockWrite as Yi, climateControlCapability as Yn, buildFfmpegArgs as Yo, foldSnapshotByFunction as Yr, RecordUniqueViolationError as Ys, RecordingStatusSchema as Yt, DEVICE_TOMBSTONE_RETENTION_MS as Z, scoreRuntimes as Za, parseJsonUnknown as Zc, normalizeUnit as Zi, collectWhenMirrorSources as Zn, composedDeviceRef as Zo, formatMinutes as Zr, SECRET_CLEAR as Zs, RemoteLayoutPayloadSchema as Zt, BatteryStatusSchema as _, projectDeviceRow as _a, createEvent as _c, isObjectInput as _i, DeviceRole as _l, actionWaitTotalMs as _n, supportedRuntimes as _o, declaredSeriesKind as _r, planStatisticTier as _s, HISTORY_CATALOG as _t, AGENT_MDNS_SERVICE_TYPE as a, petFountainCapability as aa, asNumber as ac, internalActionId as ai, secretTreeFromPaths as al, ServerNameSchema as an, siteFor as ao, consumablesCapability as ar, evaluateDerivative as as, EMPTY_REMOTE_ASSUMED_STATE as at, CAP_NAMES_WITH_STATUS as b, readStoredRemoteConfig as ba, defineCustomActions as bc, kebabToCamel as bi, featuresOfBoundCaps as bl, addonPagesCapability as bn, templateCapability as bo, deriveBatteryPresence as br, wattMillisecondsToKwh as bs, HUB_MDNS_TXT_KEYS as bt, ActionError as c, planComposition as ca, assertValidDeclaration as cc, isAlertEpisodeSeverity as ci, sleep as cl, StorageCleanupJobSchema as cn, splitTranslationRef as co, coreBlockIdFromAddonId as cr, historyRetentionFromSettings as cs, FAN_OSCILLATION_AXES as ct, ActionTargetResolver as d, powerSourceCapability as da, collectSecretConfigKeys as dc, isCollectionArrayMethod as di, transformSecretWrite as dl, StorageMigrationJobSchema as dn, storageCapability as do, coverCapability as dr, isForwardInputRef as ds, FanControlStatusSchema as dt, occurrenceOn as ea, UnindexedFilterError as ec, groupCommandsCapability as ei, recordSecretRef as el, STORAGE_LOCATION_MODES as en, settleDeviceFeatures as eo, compileScalarOverride as er, compositionItemFieldPath as es, DeviceRunSchema as et, ActionVariableSchema as f, powerSourceLinkOfComposition as fa, collectSecretLeaves as fc, isCredentialTokenPayload as fi, userError as fl, TemplateKindSchema as fn, storageMigrationCapability as fo, createDeviceExtensionProvider as fr, isHistoryHelper as fs, FanDirectionSchema as ft, BaseDevice as g, processTimeZoneOr as ga, commandOrigin as gc, isLocationEnabled as gi, DeviceFeature as gl, actionSourceCapability as gn, streamQualityLabel as go, declarationOwnerNodeId as gr, planResetTier as gs, GroupCommandResultSchema as gt, BUILTIN_REMOTE_COMPONENTS as h, procedureAuthKey as ha, commandEffect as hc, isKernelDerivedFeature as hi, COMPOSED_DEVICE_STABLE_ID_PREFIX as hl, UserRecordSchema as hn, streamCatalogCapability as ho, databaseSnapshotCapability as hr, openStatistic as hs, FieldClaimSchema as ht, ACTUATOR_TEMPLATE_IDS as i, parseStreamParamsFormPatch as ia, asJsonObject as ic, integrationInstancesCapability as ii, scopeKey as il, ScopedTokenSchema as in, shortHostname as io, compositionUnionReads as ir, disarmRoseMemory as is, EMPTY_AUTOMATION_STATE as it, CoreBlockSchema as j, resolveBucketMs as ja, hydrateSchema as jc, logDestinationCapability as ji, batteryCapability as jn, validateSchedulerInput as jo, deviceTransitionsCapability as jr, HISTORY_DEFAULT_MIN_INTERVAL_MS as js, MOTION_CLOSE_AFTER_MS as jt, ConditionMirror as k, resolveActionVariables as ka, historyItemFieldPath as kc, lockControlCapability as ki, backupCapability as kn, validateComposition as ko, deviceStateCapability as kr, FilterRequiredError as ks, MIGRATION_API_V1_METHODS as kt, ActionMinDelaySecSchema as l, platformProbeCapability as la, auditedFields as lc, isAppLinkBase as li, toNodeId as ll, StorageLocationModeSchema as ln, stableIdMapOf as lo, coreBlockSourceKind as lr, implementedMethodsOf as ls, FAN_OSCILLATION_AXIS_SETTABLE as lt, AutomationStateDocSchema as m, problemsBlockSave as ma, collectZodSecretPaths as mc, isInternalActionId as mi, withoutCallerStamp as ml, UNATTRIBUTED_BUCKET_KEY as mn, storageProviderCapability as mo, dataStoreProviderCapability as mr, openReset as ms, FieldClaimModeSchema as mt, ACTION_TARGET_INVALIDATION_EVENTS as n, parseAcceleratorFactsJson as na, WELL_KNOWN_TAB_MAP as nc, hasTimeLeaves as ni, resolveSecretMarkers as nl, SchedulerError as nn, sharedActuatorMethods as no, compositionFieldKey as nr, compositionSourceKey as ns, DeviceTombstoneSchema as nt, AGENT_MDNS_TXT_KEYS as o, petFountainWaterItem as oa, asString$1 as oc, interpolate as oi, secretTreeFromSchema as ol, SetOscillationAxisInputSchema as on, siteZoneKey as oo, coreBlockAddonId as or, evaluateStatistic as os, EMPTY_REMOTE_CONFIG as ot, AlertSchema as p, preconditionOf as pa, collectSecretMarkerRefs as pc, isDefaultAppConnectionEndpoint as pi, vocabActionIdFor as pl, TokenScopeSchema as pn, storageOccupancyCapability as po, customKeyOfRole as pr, nextLocalMidnight as ps, FanPresetSchema as pt, DEVICE_TEMPLATE_MAX_LENGTH as q, runtimeStatePolicyFor as qa, nodePin as qc, normalizeActionUnits as qi, checkRoleAddress as qn, HelperMemberSchema as qo, filesystemBrowseCapability as qr, RecordNotFoundError as qs, REMOTE_MEDIA_COMMANDS as qt, ACTUATOR_METHODS as r, parseColorInput as ra, actionEffect as rc, heroLayoutCapability as ri, ruleFireOfClaim as rl, SchedulerSchema as rn, sharedColorModes as ro, compositionSourceRefs as rr, createStatefulExpressionMemory as rs, DiscoveryProposalBodySchema as rt, ALL_CAPABILITY_DEFINITIONS as s, pickAppLinkHub as sa, assertTransactScope as sc, isAlertEpisodeOpen as si, secretViewsOf as sl, SsoBridgeClaimsSchema as sn, snapshotCapability as so, coreBlockComposition as sr, helperMembers as ss, FAN_CAPTURE_FIELDS as st, ACTION_RUN_MAX_MS as t, orderMigrations as ta, UnknownRecordKindError as tc, groupTemplate as ti, resolveCapMount as tl, STREAM_PROFILE_META as tn, sharedActuatorFeatures as to, composerCapability as tr, compositionSliceKey as ts, DeviceStatusSchema as tt, ActionStepSchema as u, powerSourceActuatorConflicts as ua, buildSecretRef as uc, isArrayOutputSchema as ui, toSecretFieldView as ul, StorageLocationTypeSchema as un, storageAdminCapability as uo, coreBlocksCapability as ur, integrateReading as us, FIRST_LEVEL_MACRO_CLASSES as ut, CAMERA_SWITCH_ORDER as v, proposeRunningThreshold as va, customAction as vc, isSameAddonId as vi, DeviceType as vl, actionsCapability as vn, switchCapability as vo, decodeVectorBase64 as vr, statisticCadenceMs as vs, HISTORY_ITEM_CATALOG as vt, CORE_BLOCKS_ADDON_ID as w, reducePoints as wa, emitReadiness as wc, legacyModeOf as wi, alertEpisodePayload as wn, timedRunQuickRun as wo, deviceExtensionCapability as wr, DATAPLANE_SECRET_HEADER as ws, KEYCHAIN_RESET_TRIGGER_ACTOR as wt, CATALOG_LANGS as x, reconcileReportedFeatures as xa, defineEntryKind as xc, keychainAdminCapability as xi, EventCategory as xl, addonSettingsCapability as xn, timedRunCapability as xo, describeComposableCaps as xr, BaseAddon as xs, HvacModeSchema as xt, CAMSTACK_APP_LINK_ORIGIN as y, ptzAutotrackCapability as ya, defineAddonMigrations as yc, isVoidInput as yi, errMsg as yl, addonIdOfActionId as yn, switchStateOfMode as yo, defineExtensionSlotProvider as yr, toExpressionValue as ys, HUB_MDNS_SERVICE_TYPE as yt, DERIVED_CAMERA_SILENCED_CAP_NAMES as z, resolveNotificationTapAddress as za, isSecretClear as zc, methodRefusal as zi, calendarsCapability as zn, zoneOnlySite as zo, expandContainer as zr, RECORD_SWEEP_INTERVAL_MS as zs, PackageRequiresSchema as zt };