@camstack/addon-provider-homematic 1.2.203 → 1.2.205

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 (18) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/_stub.js +2 -2
  3. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-DjEdBUbH.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-BBYiqZ5h.mjs} +5 -5
  4. package/dist/_virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Civ5HlCQ.mjs +26 -0
  5. package/dist/addon-provider-homematic.css +1 -1
  6. package/dist/addon.js +2467 -224
  7. package/dist/addon.mjs +2467 -224
  8. package/dist/{hostInit-C5XIF453.mjs → hostInit-nT-RhOBP.mjs} +4 -4
  9. package/dist/remoteEntry.js +1 -1
  10. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-BL0O2-to.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-BI01xl_h.mjs} +1 -1
  11. package/dist/widgets/_stub.js +1 -1
  12. package/dist/widgets/{_virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_widgets-Cq-Hf-_G.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_widgets-B0ssCAy7.mjs} +3 -3
  13. package/dist/widgets/_virtual_mf___mfe_internal__addon_provider_homematic_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-De1hiEmR.mjs +26 -0
  14. package/dist/widgets/{hostInit-DzuijAl4.mjs → hostInit-phYEFIYx.mjs} +3 -3
  15. package/dist/widgets/remoteEntry.js +1 -1
  16. package/package.json +4 -4
  17. package/dist/_virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-B48ZmMNz.mjs +0 -26
  18. package/dist/widgets/_virtual_mf___mfe_internal__addon_provider_homematic_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Cy-JR-hp.mjs +0 -26
package/dist/addon.js CHANGED
@@ -8,7 +8,7 @@ let crypto$1 = require("crypto");
8
8
  let fs_promises = require("fs/promises");
9
9
  let path = require("path");
10
10
  let node_os = require("node:os");
11
- //#region ../types/dist/event-category-Dhcd0TRH.mjs
11
+ //#region ../types/dist/event-category-Hwx_JSCU.mjs
12
12
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
13
13
  EventCategory["SystemBoot"] = "system.boot";
14
14
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -530,6 +530,14 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
530
530
  EventCategory["RunningStarted"] = "running.started";
531
531
  /** Mirrors `runningStateCapability.events.onFinished`. */
532
532
  EventCategory["RunningFinished"] = "running.finished";
533
+ /** Mirrors `workloadCapability.events.onStarted` — a workload reached running (#585). */
534
+ EventCategory["WorkloadStarted"] = "workload.started";
535
+ /** Mirrors `workloadCapability.events.onStopped` — a running workload stopped cleanly. */
536
+ EventCategory["WorkloadStopped"] = "workload.stopped";
537
+ /** Mirrors `workloadCapability.events.onCrashed` — a workload stopped without a request. */
538
+ EventCategory["WorkloadCrashed"] = "workload.crashed";
539
+ /** Mirrors `workloadCapability.events.onRecovered` — a crashed workload runs again. */
540
+ EventCategory["WorkloadRecovered"] = "workload.recovered";
533
541
  /** Mirrors `deviceRunsCapability.events.onRunOpened` - a durable run record opened. */
534
542
  EventCategory["DeviceRunOpened"] = "device-run.opened";
535
543
  /** Mirrors `deviceRunsCapability.events.onRunClosed` - a durable run record closed. */
@@ -832,7 +840,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
832
840
  return EventCategory;
833
841
  }({});
834
842
  //#endregion
835
- //#region ../types/dist/composed-stable-id-RvQIEpqg.mjs
843
+ //#region ../types/dist/composed-stable-id-BBL71oUQ.mjs
836
844
  /**
837
845
  import { errMsg } from '@camstack/types'
838
846
  * Extract a human-readable message from an unknown error value.
@@ -964,6 +972,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
964
972
  * and the storage as branches of one bus. One read-only `energy-system` cap carries
965
973
  * every value; the storage is a field of it, never the `battery` cap (#513, #522). */
966
974
  DeviceType["EnergySystem"] = "energy-system";
975
+ /** Something that RUNS on a machine, or the machine itself (#585): a VM, an app
976
+ * container, an LXC, an app, or a host. The kind is the ROLE (D1033, D1056), never
977
+ * a field; one `workload` cap carries the state, the controls and the resources. */
978
+ DeviceType["Workload"] = "workload";
967
979
  return DeviceType;
968
980
  }({});
969
981
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -1184,6 +1196,11 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1184
1196
  * `light` type: the provider owns the type, and a light implies brightness
1185
1197
  * or colour this relay lacks. */
1186
1198
  DeviceRole["SwitchLight"] = "switch-light";
1199
+ /** One port of a network switch that powers the device behind it (PoE): on /
1200
+ * off feeds or cuts that power. Its link is `network-link`, its draw
1201
+ * `power-meter`. Restarting the powered device through the port is that
1202
+ * device's `power-source` cap, never a reboot of the port. */
1203
+ DeviceRole["PoePort"] = "poe-port";
1187
1204
  /** Air conditioner / split unit: cooling, fan speed, louvres. */
1188
1205
  DeviceRole["ClimateAc"] = "climate-ac";
1189
1206
  /** Room thermostat: a setpoint and a room temperature. The default. */
@@ -1264,6 +1281,17 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1264
1281
  /** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
1265
1282
  * cap. A `DeviceType.Generic` device. */
1266
1283
  DeviceRole["IrTransmitter"] = "ir-transmitter";
1284
+ /** A virtual machine on a hypervisor. */
1285
+ DeviceRole["Vm"] = "vm";
1286
+ /** An application container (Docker, Podman). */
1287
+ DeviceRole["AppContainer"] = "app-container";
1288
+ /** A system container (LXC). */
1289
+ DeviceRole["Lxc"] = "lxc";
1290
+ /** An application or service running on a host. */
1291
+ DeviceRole["App"] = "app";
1292
+ /** A machine that runs workloads or is an appliance with its own OS: a
1293
+ * server, a hypervisor, a gateway console, a CCU. */
1294
+ DeviceRole["Host"] = "host";
1267
1295
  return DeviceRole;
1268
1296
  }({});
1269
1297
  /**
@@ -1847,8 +1875,8 @@ var _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
1847
1875
  function emoji() {
1848
1876
  return new RegExp(_emoji$1, "u");
1849
1877
  }
1850
- var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
1851
- var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
1878
+ var ipv4$1 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
1879
+ var ipv6$1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
1852
1880
  var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
1853
1881
  var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
1854
1882
  var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
@@ -2522,12 +2550,12 @@ var $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def)
2522
2550
  $ZodStringFormat.init(inst, def);
2523
2551
  });
2524
2552
  var $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
2525
- def.pattern ?? (def.pattern = ipv4);
2553
+ def.pattern ?? (def.pattern = ipv4$1);
2526
2554
  $ZodStringFormat.init(inst, def);
2527
2555
  inst._zod.bag.format = `ipv4`;
2528
2556
  });
2529
2557
  var $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
2530
- def.pattern ?? (def.pattern = ipv6);
2558
+ def.pattern ?? (def.pattern = ipv6$1);
2531
2559
  $ZodStringFormat.init(inst, def);
2532
2560
  inst._zod.bag.format = `ipv6`;
2533
2561
  inst._zod.check = (payload) => {
@@ -5443,10 +5471,16 @@ var ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
5443
5471
  $ZodIPv4.init(inst, def);
5444
5472
  ZodStringFormat.init(inst, def);
5445
5473
  });
5474
+ function ipv4(params) {
5475
+ return /* @__PURE__ */ _ipv4(ZodIPv4, params);
5476
+ }
5446
5477
  var ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
5447
5478
  $ZodIPv6.init(inst, def);
5448
5479
  ZodStringFormat.init(inst, def);
5449
5480
  });
5481
+ function ipv6(params) {
5482
+ return /* @__PURE__ */ _ipv6(ZodIPv6, params);
5483
+ }
5450
5484
  var ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => {
5451
5485
  $ZodCIDRv4.init(inst, def);
5452
5486
  ZodStringFormat.init(inst, def);
@@ -6084,7 +6118,7 @@ var ZodIssueCode = {
6084
6118
  var ZodFirstPartyTypeKind;
6085
6119
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6086
6120
  //#endregion
6087
- //#region ../types/dist/sleep-C9EWTQr9.mjs
6121
+ //#region ../types/dist/sleep-D6Pih0Qt.mjs
6088
6122
  /**
6089
6123
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6090
6124
  * window to float samples (D455).
@@ -7376,7 +7410,7 @@ var RecordIntegrationInstances = class {
7376
7410
  kindOfBody(body) {
7377
7411
  if (this.hooks.kindOf !== void 0) {
7378
7412
  const id = this.hooks.kindOf(body);
7379
- if (!this.hooks.description.kinds.some((declared) => declared.id === id)) throw new Error(`record kind '${this.kind.name}': kindOf returned '${id}', which describe().kinds does not declare (D1013)`);
7413
+ if (!this.hooks.description.kinds.some((declared) => declared.id === id)) throw new Error(`record kind '${this.kind.name}': kindOf returned '${id}', which describe().kinds does not declare`);
7380
7414
  return id;
7381
7415
  }
7382
7416
  const only = this.hooks.description.kinds[0];
@@ -7406,8 +7440,15 @@ var RecordIntegrationInstances = class {
7406
7440
  field: link.field,
7407
7441
  to: link.to
7408
7442
  })) };
7443
+ const wired = this.hooks.test !== void 0;
7444
+ const stated = this.hooks.description;
7409
7445
  return {
7410
- ...this.hooks.description,
7446
+ ...stated,
7447
+ ...stated.canTest && !wired ? { canTest: false } : {},
7448
+ ...stated.kinds === void 0 ? {} : { kinds: stated.kinds.map((kind) => kind.canTest === true && !wired ? {
7449
+ ...kind,
7450
+ canTest: false
7451
+ } : kind) },
7411
7452
  ...links,
7412
7453
  ...this.hooks.mintId === void 0 ? {} : { mintsId: true }
7413
7454
  };
@@ -10182,6 +10223,18 @@ var RuleFireOriginSchema = object({
10182
10223
  cameraId: number$1().int()
10183
10224
  })).optional()
10184
10225
  });
10226
+ /** WHO an exporter acts for: the ecosystem and the principal it reported, never invented. */
10227
+ var OnBehalfSchema = object({
10228
+ source: _enum([
10229
+ "homeassistant",
10230
+ "homekit",
10231
+ "alexa",
10232
+ "google",
10233
+ "matter"
10234
+ ]),
10235
+ principalId: string(),
10236
+ principalName: string().optional()
10237
+ });
10185
10238
  discriminatedUnion("kind", [
10186
10239
  object({
10187
10240
  kind: literal("action"),
@@ -10198,7 +10251,8 @@ discriminatedUnion("kind", [
10198
10251
  object({
10199
10252
  kind: literal("rule"),
10200
10253
  fire: RuleFireOriginSchema
10201
- })
10254
+ }),
10255
+ OnBehalfSchema.extend({ kind: literal("on-behalf") })
10202
10256
  ]);
10203
10257
  /**
10204
10258
  * One recorded device transition (D1022): a status field of a device went from
@@ -10234,7 +10288,9 @@ var TransitionActorSchema = discriminatedUnion("kind", [
10234
10288
  object({
10235
10289
  kind: literal("addon"),
10236
10290
  addonId: string(),
10237
- nodeId: string().optional()
10291
+ nodeId: string().optional(),
10292
+ /** The ecosystem principal an exporter relayed, when it reported one. */
10293
+ onBehalf: OnBehalfSchema.optional()
10238
10294
  }),
10239
10295
  object({
10240
10296
  kind: literal("action"),
@@ -10764,6 +10820,10 @@ var CAP_VOCABULARY_BY_NAME = {
10764
10820
  effect: {
10765
10821
  field: "on",
10766
10822
  value: true
10823
+ },
10824
+ offeredWhen: {
10825
+ method: "getOptions",
10826
+ field: "supportsSetState"
10767
10827
  }
10768
10828
  },
10769
10829
  {
@@ -10782,6 +10842,10 @@ var CAP_VOCABULARY_BY_NAME = {
10782
10842
  effect: {
10783
10843
  field: "on",
10784
10844
  value: false
10845
+ },
10846
+ offeredWhen: {
10847
+ method: "getOptions",
10848
+ field: "supportsSetState"
10785
10849
  }
10786
10850
  },
10787
10851
  {
@@ -10795,9 +10859,14 @@ var CAP_VOCABULARY_BY_NAME = {
10795
10859
  en: "Toggle {device}",
10796
10860
  it: "Commuta {device}"
10797
10861
  },
10798
- icon: "toggle-right"
10862
+ icon: "toggle-right",
10863
+ offeredWhen: {
10864
+ method: "getOptions",
10865
+ field: "supportsSetState"
10866
+ }
10799
10867
  }
10800
10868
  ],
10869
+ notOperatorFacing: { powerCycle: "a power cycle is the forced restart of the device the switch powers (power-source), never a step of its own" },
10801
10870
  state: [{
10802
10871
  kind: "boolean",
10803
10872
  field: "on",
@@ -11056,6 +11125,47 @@ var CAP_VOCABULARY_BY_NAME = {
11056
11125
  "switch.off": { icon: "plug" }
11057
11126
  },
11058
11127
  state: { on: { icon: "plug-zap" } }
11128
+ },
11129
+ [DeviceRole.PoePort]: {
11130
+ actions: {
11131
+ "switch.on": {
11132
+ label: {
11133
+ en: "Power on",
11134
+ it: "Alimenta"
11135
+ },
11136
+ phrase: {
11137
+ en: "Power on {device}",
11138
+ it: "Alimenta {device}"
11139
+ },
11140
+ icon: "plug-zap"
11141
+ },
11142
+ "switch.off": {
11143
+ label: {
11144
+ en: "Power off",
11145
+ it: "Togli alimentazione"
11146
+ },
11147
+ phrase: {
11148
+ en: "Power off {device}",
11149
+ it: "Togli alimentazione a {device}"
11150
+ },
11151
+ icon: "unplug"
11152
+ }
11153
+ },
11154
+ state: { on: {
11155
+ label: {
11156
+ en: "Powered",
11157
+ it: "Alimentata"
11158
+ },
11159
+ whenTrue: {
11160
+ en: "When {device} is powered",
11161
+ it: "Quando {device} viene alimentata"
11162
+ },
11163
+ whenFalse: {
11164
+ en: "When {device} loses power",
11165
+ it: "Quando {device} perde l’alimentazione"
11166
+ },
11167
+ icon: "plug-zap"
11168
+ } }
11059
11169
  }
11060
11170
  }
11061
11171
  }
@@ -11775,7 +11885,11 @@ var CAP_VOCABULARY_BY_NAME = {
11775
11885
  en: "Power on {device}",
11776
11886
  it: "Dai corrente a {device}"
11777
11887
  },
11778
- icon: "power"
11888
+ icon: "power",
11889
+ offeredWhen: {
11890
+ method: "getStatus",
11891
+ field: "switchSettable"
11892
+ }
11779
11893
  },
11780
11894
  {
11781
11895
  id: "powerSource.off",
@@ -11788,7 +11902,11 @@ var CAP_VOCABULARY_BY_NAME = {
11788
11902
  en: "Cut the power of {device}",
11789
11903
  it: "Togli la corrente a {device}"
11790
11904
  },
11791
- icon: "power-off"
11905
+ icon: "power-off",
11906
+ offeredWhen: {
11907
+ method: "getStatus",
11908
+ field: "switchSettable"
11909
+ }
11792
11910
  },
11793
11911
  {
11794
11912
  id: "powerSource.forceRestart",
@@ -13552,6 +13670,91 @@ var CAP_VOCABULARY_BY_NAME = {
13552
13670
  }],
13553
13671
  events: { onMotionTriggerChanged: { notOperatorFacing: "the `enabled` state trigger phrases both edges of this change" } }
13554
13672
  },
13673
+ "siren": {
13674
+ scope: "device",
13675
+ noun: {
13676
+ en: "Siren",
13677
+ it: "Sirena"
13678
+ },
13679
+ actions: [
13680
+ {
13681
+ id: "siren.trigger",
13682
+ method: "trigger",
13683
+ label: {
13684
+ en: "Sound the siren",
13685
+ it: "Fai suonare la sirena"
13686
+ },
13687
+ phrase: {
13688
+ en: "Sound {device}",
13689
+ it: "Fai suonare {device}"
13690
+ },
13691
+ icon: "siren",
13692
+ args: {}
13693
+ },
13694
+ {
13695
+ id: "siren.triggerPlays",
13696
+ method: "trigger",
13697
+ label: {
13698
+ en: "Sound the siren N times",
13699
+ it: "Fai suonare la sirena N volte"
13700
+ },
13701
+ phrase: {
13702
+ en: "Sound {device} {plays} times",
13703
+ it: "Fai suonare {device} {plays} volte"
13704
+ },
13705
+ icon: "siren",
13706
+ openArgs: [{
13707
+ key: "plays",
13708
+ label: {
13709
+ en: "Plays",
13710
+ it: "Riproduzioni"
13711
+ },
13712
+ offer: {
13713
+ kind: "dynamic",
13714
+ from: "method",
13715
+ method: "getPlayChoices",
13716
+ valueKind: "number"
13717
+ }
13718
+ }]
13719
+ },
13720
+ {
13721
+ id: "siren.stop",
13722
+ method: "stop",
13723
+ label: {
13724
+ en: "Silence the siren",
13725
+ it: "Zittisci la sirena"
13726
+ },
13727
+ phrase: {
13728
+ en: "Silence {device}",
13729
+ it: "Zittisci {device}"
13730
+ },
13731
+ icon: "siren",
13732
+ args: {},
13733
+ effect: {
13734
+ field: "active",
13735
+ value: false
13736
+ }
13737
+ }
13738
+ ],
13739
+ state: [{
13740
+ kind: "boolean",
13741
+ field: "active",
13742
+ label: {
13743
+ en: "Siren sounding",
13744
+ it: "Sirena in funzione"
13745
+ },
13746
+ whenTrue: {
13747
+ en: "When {device} starts sounding",
13748
+ it: "Quando {device} inizia a suonare"
13749
+ },
13750
+ whenFalse: {
13751
+ en: "When {device} falls silent",
13752
+ it: "Quando {device} smette di suonare"
13753
+ },
13754
+ icon: "siren"
13755
+ }],
13756
+ events: { onSirenChanged: { notOperatorFacing: "the `active` state trigger phrases both edges of this change" } }
13757
+ },
13555
13758
  "vacuum-control": {
13556
13759
  scope: "device",
13557
13760
  noun: {
@@ -16127,6 +16330,374 @@ var CAP_VOCABULARY_BY_NAME = {
16127
16330
  icon: "loader"
16128
16331
  }]
16129
16332
  },
16333
+ "workload": {
16334
+ scope: "device",
16335
+ noun: {
16336
+ en: "Workload",
16337
+ it: "Carico di lavoro"
16338
+ },
16339
+ actions: [
16340
+ {
16341
+ id: "workload.start",
16342
+ method: "start",
16343
+ label: {
16344
+ en: "Start",
16345
+ it: "Avvia"
16346
+ },
16347
+ phrase: {
16348
+ en: "Start {device}",
16349
+ it: "Avvia {device}"
16350
+ },
16351
+ icon: "play",
16352
+ effect: {
16353
+ field: "state",
16354
+ value: "running"
16355
+ }
16356
+ },
16357
+ {
16358
+ id: "workload.stop",
16359
+ method: "stop",
16360
+ label: {
16361
+ en: "Stop",
16362
+ it: "Arresta"
16363
+ },
16364
+ phrase: {
16365
+ en: "Stop {device}",
16366
+ it: "Arresta {device}"
16367
+ },
16368
+ icon: "square",
16369
+ effect: {
16370
+ field: "state",
16371
+ value: "stopped"
16372
+ }
16373
+ },
16374
+ {
16375
+ id: "workload.restart",
16376
+ method: "restart",
16377
+ label: {
16378
+ en: "Restart",
16379
+ it: "Riavvia"
16380
+ },
16381
+ phrase: {
16382
+ en: "Restart {device}",
16383
+ it: "Riavvia {device}"
16384
+ },
16385
+ icon: "rotate-ccw"
16386
+ },
16387
+ {
16388
+ id: "workload.pause",
16389
+ method: "pause",
16390
+ label: {
16391
+ en: "Pause",
16392
+ it: "Metti in pausa"
16393
+ },
16394
+ phrase: {
16395
+ en: "Pause {device}",
16396
+ it: "Metti in pausa {device}"
16397
+ },
16398
+ icon: "pause",
16399
+ effect: {
16400
+ field: "state",
16401
+ value: "paused"
16402
+ }
16403
+ },
16404
+ {
16405
+ id: "workload.resume",
16406
+ method: "resume",
16407
+ label: {
16408
+ en: "Resume",
16409
+ it: "Riprendi"
16410
+ },
16411
+ phrase: {
16412
+ en: "Resume {device}",
16413
+ it: "Riprendi {device}"
16414
+ },
16415
+ icon: "circle-play",
16416
+ effect: {
16417
+ field: "state",
16418
+ value: "running"
16419
+ }
16420
+ },
16421
+ {
16422
+ id: "workload.forceStop",
16423
+ method: "forceStop",
16424
+ label: {
16425
+ en: "Force stop",
16426
+ it: "Arresto forzato"
16427
+ },
16428
+ phrase: {
16429
+ en: "Force {device} to stop",
16430
+ it: "Forza l’arresto di {device}"
16431
+ },
16432
+ icon: "octagon-x",
16433
+ effect: {
16434
+ field: "state",
16435
+ value: "stopped"
16436
+ }
16437
+ }
16438
+ ],
16439
+ state: [
16440
+ {
16441
+ kind: "enum",
16442
+ field: "state",
16443
+ label: {
16444
+ en: "State",
16445
+ it: "Stato"
16446
+ },
16447
+ values: [
16448
+ {
16449
+ value: "running",
16450
+ label: {
16451
+ en: "Running",
16452
+ it: "In esecuzione"
16453
+ },
16454
+ phrase: {
16455
+ en: "When {device} is running",
16456
+ it: "Quando {device} è in esecuzione"
16457
+ }
16458
+ },
16459
+ {
16460
+ value: "paused",
16461
+ label: {
16462
+ en: "Paused",
16463
+ it: "In pausa"
16464
+ }
16465
+ },
16466
+ {
16467
+ value: "stopped",
16468
+ label: {
16469
+ en: "Stopped",
16470
+ it: "Arrestato"
16471
+ },
16472
+ phrase: {
16473
+ en: "When {device} is stopped",
16474
+ it: "Quando {device} è arrestato"
16475
+ }
16476
+ },
16477
+ {
16478
+ value: "starting",
16479
+ label: {
16480
+ en: "Starting",
16481
+ it: "In avvio"
16482
+ }
16483
+ },
16484
+ {
16485
+ value: "stopping",
16486
+ label: {
16487
+ en: "Stopping",
16488
+ it: "In arresto"
16489
+ }
16490
+ },
16491
+ {
16492
+ value: "crashed",
16493
+ label: {
16494
+ en: "Crashed",
16495
+ it: "Arrestato in modo anomalo"
16496
+ },
16497
+ phrase: {
16498
+ en: "When {device} has crashed",
16499
+ it: "Quando {device} è arrestato in modo anomalo"
16500
+ }
16501
+ }
16502
+ ],
16503
+ icon: "activity"
16504
+ },
16505
+ {
16506
+ kind: "numeric",
16507
+ field: "resources.cpuPercent",
16508
+ quantity: {
16509
+ en: "the CPU use",
16510
+ it: "l'uso della CPU"
16511
+ },
16512
+ label: {
16513
+ en: "CPU",
16514
+ it: "CPU"
16515
+ },
16516
+ unit: "%",
16517
+ icon: "cpu"
16518
+ },
16519
+ {
16520
+ kind: "numeric",
16521
+ field: "resources.memoryPercent",
16522
+ quantity: {
16523
+ en: "the memory use",
16524
+ it: "l'uso della memoria"
16525
+ },
16526
+ label: {
16527
+ en: "Memory",
16528
+ it: "Memoria"
16529
+ },
16530
+ unit: "%",
16531
+ icon: "memory-stick"
16532
+ },
16533
+ {
16534
+ kind: "numeric",
16535
+ field: "resources.temperature",
16536
+ quantity: {
16537
+ en: "the temperature",
16538
+ it: "la temperatura"
16539
+ },
16540
+ label: {
16541
+ en: "Temperature",
16542
+ it: "Temperatura"
16543
+ },
16544
+ unit: "°C",
16545
+ icon: "thermometer"
16546
+ }
16547
+ ],
16548
+ events: {
16549
+ onStarted: {
16550
+ category: EventCategory.WorkloadStarted,
16551
+ label: {
16552
+ en: "Started",
16553
+ it: "Avviato"
16554
+ },
16555
+ phrase: {
16556
+ en: "When {device} starts",
16557
+ it: "Quando {device} si avvia"
16558
+ },
16559
+ icon: "play"
16560
+ },
16561
+ onStopped: {
16562
+ category: EventCategory.WorkloadStopped,
16563
+ label: {
16564
+ en: "Stopped",
16565
+ it: "Arrestato"
16566
+ },
16567
+ phrase: {
16568
+ en: "When {device} stops",
16569
+ it: "Quando {device} si arresta"
16570
+ },
16571
+ icon: "square"
16572
+ },
16573
+ onCrashed: {
16574
+ category: EventCategory.WorkloadCrashed,
16575
+ label: {
16576
+ en: "Crashed",
16577
+ it: "Arrestato in modo anomalo"
16578
+ },
16579
+ phrase: {
16580
+ en: "When {device} stops without being asked",
16581
+ it: "Quando {device} si arresta senza che sia stato richiesto"
16582
+ },
16583
+ icon: "triangle-alert"
16584
+ },
16585
+ onRecovered: {
16586
+ category: EventCategory.WorkloadRecovered,
16587
+ label: {
16588
+ en: "Recovered",
16589
+ it: "Ripristinato"
16590
+ },
16591
+ phrase: {
16592
+ en: "When {device} runs again after a crash",
16593
+ it: "Quando {device} riparte dopo un arresto anomalo"
16594
+ },
16595
+ icon: "heart-pulse"
16596
+ }
16597
+ },
16598
+ overrides: { byRole: {
16599
+ [DeviceRole.Vm]: {
16600
+ actions: { "workload.start": { icon: "monitor" } },
16601
+ state: { state: { icon: "monitor" } }
16602
+ },
16603
+ [DeviceRole.AppContainer]: {
16604
+ actions: { "workload.start": { icon: "container" } },
16605
+ state: { state: { icon: "container" } }
16606
+ },
16607
+ [DeviceRole.Lxc]: {
16608
+ actions: { "workload.start": { icon: "box" } },
16609
+ state: { state: { icon: "box" } }
16610
+ },
16611
+ [DeviceRole.App]: {
16612
+ actions: { "workload.start": { icon: "app-window" } },
16613
+ state: { state: { icon: "app-window" } }
16614
+ },
16615
+ [DeviceRole.Host]: {
16616
+ actions: {
16617
+ "workload.start": {
16618
+ label: {
16619
+ en: "Power on",
16620
+ it: "Accendi"
16621
+ },
16622
+ phrase: {
16623
+ en: "Power on {device}",
16624
+ it: "Accendi {device}"
16625
+ },
16626
+ icon: "power"
16627
+ },
16628
+ "workload.stop": {
16629
+ label: {
16630
+ en: "Shut down",
16631
+ it: "Spegni"
16632
+ },
16633
+ phrase: {
16634
+ en: "Shut down {device}",
16635
+ it: "Spegni {device}"
16636
+ },
16637
+ icon: "power-off"
16638
+ },
16639
+ "workload.restart": {
16640
+ label: {
16641
+ en: "Reboot",
16642
+ it: "Riavvia"
16643
+ },
16644
+ phrase: {
16645
+ en: "Reboot {device}",
16646
+ it: "Riavvia {device}"
16647
+ },
16648
+ icon: "refresh-cw"
16649
+ }
16650
+ },
16651
+ state: { state: { icon: "server" } },
16652
+ events: {
16653
+ onStarted: {
16654
+ label: {
16655
+ en: "Came online",
16656
+ it: "Tornato in linea"
16657
+ },
16658
+ phrase: {
16659
+ en: "When {device} comes online",
16660
+ it: "Quando {device} torna in linea"
16661
+ },
16662
+ icon: "server"
16663
+ },
16664
+ onStopped: {
16665
+ label: {
16666
+ en: "Shut down",
16667
+ it: "Spento"
16668
+ },
16669
+ phrase: {
16670
+ en: "When {device} shuts down",
16671
+ it: "Quando {device} si spegne"
16672
+ },
16673
+ icon: "server-off"
16674
+ },
16675
+ onCrashed: {
16676
+ label: {
16677
+ en: "Went down",
16678
+ it: "Caduto"
16679
+ },
16680
+ phrase: {
16681
+ en: "When {device} goes down unexpectedly",
16682
+ it: "Quando {device} cade inaspettatamente"
16683
+ },
16684
+ icon: "server-crash"
16685
+ },
16686
+ onRecovered: {
16687
+ label: {
16688
+ en: "Came online",
16689
+ it: "Tornato in linea"
16690
+ },
16691
+ phrase: {
16692
+ en: "When {device} comes back online after going down",
16693
+ it: "Quando {device} torna in linea dopo essere caduto"
16694
+ },
16695
+ icon: "server"
16696
+ }
16697
+ }
16698
+ }
16699
+ } }
16700
+ },
16130
16701
  "accessories": {
16131
16702
  scope: "device",
16132
16703
  noun: {
@@ -19793,6 +20364,15 @@ var PipelineStepInputSchema = lazy(() => object({
19793
20364
  }));
19794
20365
  /** Typed bridge to the recursive `FrameResult` graph; validation is structural. */
19795
20366
  var PipelineRunResultBridge = custom();
20367
+ /**
20368
+ * Whether a switch can be set (D1058), schema-free so the addon runner can import it from
20369
+ * `@camstack/types/addon` without loading the capability schema graph (D28).
20370
+ */
20371
+ /** The read that decides whether a switch is offered on/off (`offeredWhen` of its actions). */
20372
+ var SWITCH_SETTABLE_GATE = {
20373
+ method: "getOptions",
20374
+ field: "supportsSetState"
20375
+ };
19796
20376
  var StaticDirOutputSchema = object({ staticDir: string() });
19797
20377
  var VersionOutputSchema = object({ version: string() });
19798
20378
  method(_void(), StaticDirOutputSchema, { auth: "admin" }), method(_void(), VersionOutputSchema, { auth: "admin" }), NOT_A_DEVICE.UI_PLUMBING;
@@ -19988,6 +20568,7 @@ var CAP_NAMES = Object.freeze([
19988
20568
  "script-runner",
19989
20569
  "server-management",
19990
20570
  "settings-store",
20571
+ "siren",
19991
20572
  "smoke",
19992
20573
  "smtp-provider",
19993
20574
  "snapshot",
@@ -20027,6 +20608,7 @@ var CAP_NAMES = Object.freeze([
20027
20608
  "weather",
20028
20609
  "weather-station",
20029
20610
  "webrtc-session",
20611
+ "workload",
20030
20612
  "zone-analytics",
20031
20613
  "zone-rules",
20032
20614
  "zones"
@@ -21329,6 +21911,14 @@ Object.freeze({
21329
21911
  "path": "ssid",
21330
21912
  "valueType": "string"
21331
21913
  },
21914
+ {
21915
+ "path": "speedKbps",
21916
+ "valueType": "number"
21917
+ },
21918
+ {
21919
+ "path": "linkUp",
21920
+ "valueType": "boolean"
21921
+ },
21332
21922
  {
21333
21923
  "path": "lastUpdated",
21334
21924
  "valueType": "number"
@@ -21712,6 +22302,32 @@ Object.freeze({
21712
22302
  "valueType": "string"
21713
22303
  }
21714
22304
  ],
22305
+ "siren": [
22306
+ {
22307
+ "path": "active",
22308
+ "valueType": "boolean"
22309
+ },
22310
+ {
22311
+ "path": "activeUntil",
22312
+ "valueType": "number"
22313
+ },
22314
+ {
22315
+ "path": "durationSeconds",
22316
+ "valueType": "number"
22317
+ },
22318
+ {
22319
+ "path": "plays",
22320
+ "valueType": "number"
22321
+ },
22322
+ {
22323
+ "path": "activeUntilEstimated",
22324
+ "valueType": "boolean"
22325
+ },
22326
+ {
22327
+ "path": "lastTriggeredAt",
22328
+ "valueType": "number"
22329
+ }
22330
+ ],
21715
22331
  "smoke": [{
21716
22332
  "path": "detected",
21717
22333
  "valueType": "boolean"
@@ -22109,6 +22725,92 @@ Object.freeze({
22109
22725
  "valueType": "number"
22110
22726
  }
22111
22727
  ],
22728
+ "workload": [
22729
+ {
22730
+ "path": "state",
22731
+ "valueType": "enum",
22732
+ "enumValues": [
22733
+ "running",
22734
+ "paused",
22735
+ "stopped",
22736
+ "starting",
22737
+ "stopping",
22738
+ "crashed"
22739
+ ]
22740
+ },
22741
+ {
22742
+ "path": "since",
22743
+ "valueType": "number"
22744
+ },
22745
+ {
22746
+ "path": "hostDeviceId",
22747
+ "valueType": "number"
22748
+ },
22749
+ {
22750
+ "path": "image",
22751
+ "valueType": "string"
22752
+ },
22753
+ {
22754
+ "path": "os",
22755
+ "valueType": "string"
22756
+ },
22757
+ {
22758
+ "path": "version",
22759
+ "valueType": "string"
22760
+ },
22761
+ {
22762
+ "path": "autostart",
22763
+ "valueType": "boolean"
22764
+ },
22765
+ {
22766
+ "path": "resources.cpuPercent",
22767
+ "valueType": "number"
22768
+ },
22769
+ {
22770
+ "path": "resources.memoryUsedBytes",
22771
+ "valueType": "number"
22772
+ },
22773
+ {
22774
+ "path": "resources.memoryPercent",
22775
+ "valueType": "number"
22776
+ },
22777
+ {
22778
+ "path": "resources.memoryLimitBytes",
22779
+ "valueType": "number"
22780
+ },
22781
+ {
22782
+ "path": "resources.vcpus",
22783
+ "valueType": "number"
22784
+ },
22785
+ {
22786
+ "path": "resources.diskUsedBytes",
22787
+ "valueType": "number"
22788
+ },
22789
+ {
22790
+ "path": "resources.diskTotalBytes",
22791
+ "valueType": "number"
22792
+ },
22793
+ {
22794
+ "path": "resources.netRxKbps",
22795
+ "valueType": "number"
22796
+ },
22797
+ {
22798
+ "path": "resources.netTxKbps",
22799
+ "valueType": "number"
22800
+ },
22801
+ {
22802
+ "path": "resources.load1",
22803
+ "valueType": "number"
22804
+ },
22805
+ {
22806
+ "path": "resources.temperature",
22807
+ "valueType": "number"
22808
+ },
22809
+ {
22810
+ "path": "updateAvailable",
22811
+ "valueType": "boolean"
22812
+ }
22813
+ ],
22112
22814
  "zone-analytics": [
22113
22815
  {
22114
22816
  "path": "ts",
@@ -22201,7 +22903,7 @@ Object.freeze({
22201
22903
  }
22202
22904
  });
22203
22905
  //#endregion
22204
- //#region ../types/dist/implemented-methods-C5FMXLGP.mjs
22906
+ //#region ../types/dist/implemented-methods-u7ddjc-_.mjs
22205
22907
  /**
22206
22908
  * The ffmpeg build every CamStack node downloads, per platform and arch.
22207
22909
  *
@@ -23122,63 +23824,99 @@ var HelperMemberSchema = object({
23122
23824
  cap: string().min(1),
23123
23825
  fieldPath: string().min(1)
23124
23826
  });
23827
+ /** A group, a statistic, or an integral (D944). The composer runs all three. */
23828
+ var GroupHelperSpecSchema = object({
23829
+ kind: literal("group"),
23830
+ templateId: GroupTemplateIdSchema,
23831
+ aggregate: AggregateReducerSchema,
23832
+ members: array(HelperMemberSchema).min(1).max(64),
23833
+ /** Actuator groups only. Readings leave this unset. */
23834
+ active: ActiveCriterionSchema.optional()
23835
+ });
23836
+ var statisticHelperObject = object({
23837
+ kind: literal("statistic"),
23838
+ stat: _enum(STATISTIC_STATS),
23839
+ window: StatisticWindowSchema,
23840
+ source: HelperMemberSchema
23841
+ });
23842
+ var integralHelperObject = object({
23843
+ kind: literal("integral"),
23844
+ reset: _enum(RESET_PERIODS),
23845
+ output: _enum(["energy", "meter"]),
23846
+ source: HelperMemberSchema
23847
+ });
23848
+ var thresholdHelperObject = object({
23849
+ kind: literal("threshold"),
23850
+ source: HelperMemberSchema,
23851
+ high: number$1(),
23852
+ low: number$1(),
23853
+ onForMs: number$1().int().nonnegative(),
23854
+ offForMs: number$1().int().nonnegative()
23855
+ });
23856
+ var arithmeticHelperObject = object({
23857
+ kind: literal("arithmetic"),
23858
+ op: _enum([
23859
+ "sum",
23860
+ "difference",
23861
+ "ratio"
23862
+ ]),
23863
+ inputs: array(HelperMemberSchema).min(2).max(64)
23864
+ });
23865
+ var expressionHelperObject = object({
23866
+ kind: literal("expression"),
23867
+ expr: string().min(1),
23868
+ inputs: array(object({
23869
+ name: string().min(1),
23870
+ member: HelperMemberSchema
23871
+ })).min(1).max(64),
23872
+ output: _enum(["number", "boolean"])
23873
+ });
23874
+ var derivativeHelperObject = object({
23875
+ kind: literal("derivative"),
23876
+ window: RollingWindowSchema,
23877
+ per: _enum([
23878
+ "second",
23879
+ "minute",
23880
+ "hour"
23881
+ ]),
23882
+ source: HelperMemberSchema
23883
+ });
23884
+ /** The stream profiles a camera grid can publish. */
23885
+ var GRID_PROFILES = [
23886
+ "high",
23887
+ "mid",
23888
+ "low"
23889
+ ];
23890
+ /** A rectangle in normalized [0,1] coordinates of whatever contains it. */
23891
+ var GridRectSchema = object({
23892
+ x: number$1().min(0).max(1),
23893
+ y: number$1().min(0).max(1),
23894
+ width: number$1().gt(0).max(1),
23895
+ height: number$1().gt(0).max(1)
23896
+ });
23897
+ var GridCellSpecSchema = object({
23898
+ source: CompositionSourceRefSchema,
23899
+ region: GridRectSchema,
23900
+ cell: GridRectSchema
23901
+ });
23125
23902
  var HelperSpecSchema = discriminatedUnion("kind", [
23126
23903
  object({
23127
- kind: literal("group"),
23128
- templateId: GroupTemplateIdSchema,
23129
- aggregate: AggregateReducerSchema,
23130
- members: array(HelperMemberSchema).min(1).max(64),
23131
- /** Actuator groups only. Readings leave this unset. */
23132
- active: ActiveCriterionSchema.optional()
23133
- }),
23134
- object({
23135
- kind: literal("statistic"),
23136
- stat: _enum(STATISTIC_STATS),
23137
- window: StatisticWindowSchema,
23138
- source: HelperMemberSchema
23139
- }),
23140
- object({
23141
- kind: literal("integral"),
23142
- reset: _enum(RESET_PERIODS),
23143
- output: _enum(["energy", "meter"]),
23144
- source: HelperMemberSchema
23145
- }),
23146
- object({
23147
- kind: literal("threshold"),
23148
- source: HelperMemberSchema,
23149
- high: number$1(),
23150
- low: number$1(),
23151
- onForMs: number$1().int().nonnegative(),
23152
- offForMs: number$1().int().nonnegative()
23153
- }),
23154
- object({
23155
- kind: literal("arithmetic"),
23156
- op: _enum([
23157
- "sum",
23158
- "difference",
23159
- "ratio"
23160
- ]),
23161
- inputs: array(HelperMemberSchema).min(2).max(64)
23904
+ kind: literal("grid"),
23905
+ fps: number$1().int().min(1).max(60),
23906
+ publishedProfiles: array(_enum(GRID_PROFILES)).max(3),
23907
+ cells: array(GridCellSpecSchema).max(16)
23162
23908
  }),
23163
23909
  object({
23164
- kind: literal("expression"),
23165
- expr: string().min(1),
23166
- inputs: array(object({
23167
- name: string().min(1),
23168
- member: HelperMemberSchema
23169
- })).min(1).max(64),
23170
- output: _enum(["number", "boolean"])
23910
+ kind: literal("terminal"),
23911
+ terminalId: string().uuid()
23171
23912
  }),
23172
- object({
23173
- kind: literal("derivative"),
23174
- window: RollingWindowSchema,
23175
- per: _enum([
23176
- "second",
23177
- "minute",
23178
- "hour"
23179
- ]),
23180
- source: HelperMemberSchema
23181
- })
23913
+ GroupHelperSpecSchema,
23914
+ statisticHelperObject,
23915
+ integralHelperObject,
23916
+ thresholdHelperObject,
23917
+ arithmeticHelperObject,
23918
+ expressionHelperObject,
23919
+ derivativeHelperObject
23182
23920
  ]);
23183
23921
  /** Longest snippet a `code` source may carry (slice 4). */
23184
23922
  var MAX_COMPOSITION_CODE_LENGTH = 2e4;
@@ -54851,9 +55589,10 @@ var GridProfileOfferSchema = object({
54851
55589
  published: boolean()
54852
55590
  });
54853
55591
  var GridLayoutViewSchema = object({
54854
- /** The persisted grid row this camera was declared from. */
54855
- instanceId: string(),
55592
+ /** The grid block (planning#580) whose camera this is. */
55593
+ blockId: string(),
54856
55594
  deviceId: number$1().int().nonnegative(),
55595
+ /** The device row's name — the only name a grid has; it is renamed on the block or the device. */
54857
55596
  name: string(),
54858
55597
  /**
54859
55598
  * NO canvas size. A grid's resolution is not authored: each profile derives
@@ -54869,7 +55608,6 @@ var GridLayoutViewSchema = object({
54869
55608
  });
54870
55609
  var GridLayoutPatchSchema = object({
54871
55610
  deviceId: number$1().int().nonnegative(),
54872
- name: string().min(1).max(160).optional(),
54873
55611
  fps: number$1().int().min(1).max(60).optional(),
54874
55612
  /** Which profiles to publish. See `GridProfileOffer.published`. */
54875
55613
  publishedProfiles: array(_enum([
@@ -58599,7 +59337,7 @@ var mediaPlayerCapability = {
58599
59337
  ]
58600
59338
  }
58601
59339
  };
58602
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Climate, DeviceType.Climate, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation;
59340
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Climate, DeviceType.Climate, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation;
58603
59341
  var NUMBER = {
58604
59342
  kind: "fixed",
58605
59343
  result: ["number"]
@@ -59049,7 +59787,7 @@ new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
59049
59787
  DeviceType.Camera;
59050
59788
  /**
59051
59789
  * The series a device card trends, per cap (`history.primary` + `history.priority`):
59052
- * 6 caps. The card shows the primary of the enabled cap with the highest priority.
59790
+ * 7 caps. The card shows the primary of the enabled cap with the highest priority.
59053
59791
  */
59054
59792
  var HISTORY_PRIMARY = {
59055
59793
  "climate-control": {
@@ -59075,6 +59813,10 @@ var HISTORY_PRIMARY = {
59075
59813
  "weather-station": {
59076
59814
  field: "temperature",
59077
59815
  priority: 60
59816
+ },
59817
+ "workload": {
59818
+ field: "resources.cpuPercent",
59819
+ priority: 40
59078
59820
  }
59079
59821
  };
59080
59822
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
@@ -59085,6 +59827,8 @@ var PowerSourceRefusalReasonSchema = _enum([
59085
59827
  "switch-unknown",
59086
59828
  "restart-in-progress",
59087
59829
  "switch-call-failed",
59830
+ "switch-options-unreadable",
59831
+ "not-settable",
59088
59832
  "switch-is-actuator"
59089
59833
  ]);
59090
59834
  var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
@@ -59101,6 +59845,14 @@ var PowerSourceInfoSchema = object({
59101
59845
  /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
59102
59846
  switchOn: boolean().nullable(),
59103
59847
  switchOnline: boolean().nullable(),
59848
+ /**
59849
+ * Whether the linked switch can be set (`switch.getOptions().supportsSetState`; a provider
59850
+ * without the method is a plain switch, `true`). `null` = not known: no link, the switch is
59851
+ * missing, or the read FAILED. Absent = a provider that predates the field. Only `false`
59852
+ * withdraws power on / off (`offeredWhen` of `powerSource.on` / `.off`, the device hero) —
59853
+ * unknown keeps them (D315, D1058).
59854
+ */
59855
+ switchSettable: boolean().nullable().optional(),
59104
59856
  restartInProgress: boolean(),
59105
59857
  offSeconds: number$1().int()
59106
59858
  });
@@ -59158,6 +59910,11 @@ var powerSourceCustomize = {
59158
59910
  }]
59159
59911
  };
59160
59912
  var deviceInput$2 = object({ deviceId: number$1().int().nonnegative() });
59913
+ /** The read that decides whether power on / off are offered (`offeredWhen`, D1058). */
59914
+ var POWER_SOURCE_SETTABLE_GATE = {
59915
+ method: "getStatus",
59916
+ field: "switchSettable"
59917
+ };
59161
59918
  var powerSourceCapability = {
59162
59919
  name: "power-source",
59163
59920
  scope: "device",
@@ -59172,7 +59929,8 @@ var powerSourceCapability = {
59172
59929
  id: "powerSource.on",
59173
59930
  label: t("Power on", "Dai corrente"),
59174
59931
  phrase: t("Power on {device}", "Dai corrente a {device}"),
59175
- icon: "power"
59932
+ icon: "power",
59933
+ offeredWhen: POWER_SOURCE_SETTABLE_GATE
59176
59934
  }]
59177
59935
  }),
59178
59936
  powerOff: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
@@ -59182,7 +59940,8 @@ var powerSourceCapability = {
59182
59940
  id: "powerSource.off",
59183
59941
  label: t("Power off", "Togli corrente"),
59184
59942
  phrase: t("Cut the power of {device}", "Togli la corrente a {device}"),
59185
- icon: "power-off"
59943
+ icon: "power-off",
59944
+ offeredWhen: POWER_SOURCE_SETTABLE_GATE
59186
59945
  }]
59187
59946
  }),
59188
59947
  forceRestart: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
@@ -60895,6 +61654,205 @@ var SiteZoneSchema = object({
60895
61654
  * the ones that most want grouping. */
60896
61655
  locationKeys: array(string())
60897
61656
  });
61657
+ /**
61658
+ * Provider-declared device identifiers (D1059, planning#590).
61659
+ *
61660
+ * What a device IS, as its owning provider read it from the hardware: the keys a
61661
+ * later step matches across integrations to tell that two devices are the same
61662
+ * physical object. Separate from `DeviceMetadata` on purpose — metadata is a
61663
+ * free-form blob the operator can edit, identifiers are typed, normalised and
61664
+ * written ONLY by the provider that owns the device (`device-manager.
61665
+ * setIdentifiers`, owner-checked on the transport's caller stamp).
61666
+ *
61667
+ * | Key | Stored form | Strength |
61668
+ * | -------------- | ----------------------------------- | -------- |
61669
+ * | `mac` | `aa:bb:cc:dd:ee:ff`, several | strong |
61670
+ * | `serial` | `<manufacturer>:<serial>` | strong |
61671
+ * | `machine-uuid` | SMBIOS / VM / container uuid | strong |
61672
+ * | `vendor-uid` | `<vendor>:<id>` | strong |
61673
+ * | `hostname` | lower-case, no domain | weak |
61674
+ * | `ip` | IPv4 / IPv6 | weak |
61675
+ *
61676
+ * Strength is a property of the KEY, derived by {@link identifierStrength} —
61677
+ * never stored, so it cannot drift from the table above. A weak key never links
61678
+ * two devices on its own.
61679
+ *
61680
+ * The schema refuses a value that is not in its stored form, so whatever is
61681
+ * persisted is already normalised. Build a declaration with
61682
+ * {@link normaliseIdentifiers}, which turns the raw values a driver read into
61683
+ * that form and names every value it refused.
61684
+ */
61685
+ var DEVICE_IDENTIFIER_KEYS = [
61686
+ "mac",
61687
+ "serial",
61688
+ "machine-uuid",
61689
+ "vendor-uid",
61690
+ "hostname",
61691
+ "ip"
61692
+ ];
61693
+ var DeviceIdentifierKeySchema = _enum(DEVICE_IDENTIFIER_KEYS);
61694
+ /** `read` — the provider read it from the device; `derived` — computed from something else it read. */
61695
+ var DeviceIdentifierOriginSchema = _enum(["read", "derived"]);
61696
+ var MAC_PATTERN = /^[0-9a-f]{2}(?::[0-9a-f]{2}){5}$/;
61697
+ /** `<prefix>:<value>` — prefix a lower-case slug, value lower-case and non-blank. */
61698
+ var PREFIXED_PATTERN = /^[a-z0-9][a-z0-9._-]*:[^\sA-Z]+$/;
61699
+ var MACHINE_UUID_PATTERN = /^[0-9a-f][0-9a-f-]{7,}$/;
61700
+ var HOSTNAME_PATTERN = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
61701
+ function entrySchema(value) {
61702
+ return object({
61703
+ value,
61704
+ origin: DeviceIdentifierOriginSchema,
61705
+ /** Epoch ms of the FIRST read that produced this value (and origin). A later
61706
+ * read of the same value does not move it — see {@link mergeIdentifiers}. */
61707
+ readAt: number$1().int().nonnegative()
61708
+ }).strict();
61709
+ }
61710
+ var MacEntrySchema = entrySchema(string().regex(MAC_PATTERN));
61711
+ var SerialEntrySchema = entrySchema(string().regex(PREFIXED_PATTERN));
61712
+ var MachineUuidEntrySchema = entrySchema(string().regex(MACHINE_UUID_PATTERN));
61713
+ var VendorUidEntrySchema = entrySchema(string().regex(PREFIXED_PATTERN));
61714
+ var HostnameEntrySchema = entrySchema(string().regex(HOSTNAME_PATTERN));
61715
+ var IpEntrySchema = entrySchema(union([ipv4(), ipv6()]));
61716
+ object({
61717
+ value: string().min(1),
61718
+ origin: DeviceIdentifierOriginSchema,
61719
+ readAt: number$1().int().nonnegative()
61720
+ }).strict();
61721
+ /** The typed declaration. Every key optional; `mac` the only one that holds several. */
61722
+ var DeviceIdentifiersSchema = object({
61723
+ mac: array(MacEntrySchema).min(1).readonly().optional(),
61724
+ serial: SerialEntrySchema.optional(),
61725
+ "machine-uuid": MachineUuidEntrySchema.optional(),
61726
+ "vendor-uid": VendorUidEntrySchema.optional(),
61727
+ hostname: HostnameEntrySchema.optional(),
61728
+ ip: IpEntrySchema.optional()
61729
+ }).strict();
61730
+ /** True when the declaration carries no key at all. */
61731
+ function isEmptyIdentifiers(identifiers) {
61732
+ return DEVICE_IDENTIFIER_KEYS.every((key) => identifiers[key] === void 0);
61733
+ }
61734
+ /** Values devices report when they do not know: never an identity. */
61735
+ var PLACEHOLDER_PATTERN = /^(?:unknown|none|n\/?a|null|undefined|default|0+|-+)$/i;
61736
+ var NULL_MACS = new Set(["00:00:00:00:00:00", "ff:ff:ff:ff:ff:ff"]);
61737
+ function rejected(reason) {
61738
+ return {
61739
+ ok: false,
61740
+ reason
61741
+ };
61742
+ }
61743
+ /** `AA-BB-CC-DD-EE-FF`, `aabb.ccdd.eeff`, `AABBCCDDEEFF` → `aa:bb:cc:dd:ee:ff`. */
61744
+ function normaliseMac(raw) {
61745
+ const hex = raw.trim().toLowerCase().replace(/[\s:.-]/g, "");
61746
+ if (!/^[0-9a-f]{12}$/.test(hex)) return rejected("not a 48-bit MAC");
61747
+ const mac = (hex.match(/../g) ?? []).join(":");
61748
+ if (NULL_MACS.has(mac)) return rejected("placeholder MAC");
61749
+ return {
61750
+ ok: true,
61751
+ value: mac
61752
+ };
61753
+ }
61754
+ function slug$2(raw) {
61755
+ return raw.trim().toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[-._]+|[-._]+$/g, "");
61756
+ }
61757
+ function normalisePrefixed(prefixRaw, valueRaw, what) {
61758
+ const prefix = slug$2(prefixRaw);
61759
+ if (prefix.length === 0) return rejected(`no ${what}`);
61760
+ const value = valueRaw.trim().toLowerCase().replace(/\s+/g, "");
61761
+ if (value.length === 0) return rejected("blank value");
61762
+ if (PLACEHOLDER_PATTERN.test(value)) return rejected("placeholder value");
61763
+ return {
61764
+ ok: true,
61765
+ value: `${prefix}:${value}`
61766
+ };
61767
+ }
61768
+ function normaliseMachineUuid(raw) {
61769
+ const value = raw.trim().toLowerCase().replace(/^\{|\}$/g, "");
61770
+ if (!MACHINE_UUID_PATTERN.test(value)) return rejected("not a uuid");
61771
+ if (/^[0-]+$/.test(value) || /^[f-]+$/.test(value)) return rejected("placeholder uuid");
61772
+ return {
61773
+ ok: true,
61774
+ value
61775
+ };
61776
+ }
61777
+ function isIp(value) {
61778
+ return union([ipv4(), ipv6()]).safeParse(value).success;
61779
+ }
61780
+ function normaliseHostname(raw) {
61781
+ const full = raw.trim().toLowerCase().replace(/\.$/, "");
61782
+ if (full.length === 0) return rejected("blank hostname");
61783
+ if (isIp(full)) return rejected("an address, not a hostname");
61784
+ const label = full.split(".")[0] ?? "";
61785
+ if (!HOSTNAME_PATTERN.test(label)) return rejected("not a hostname");
61786
+ if (label === "localhost") return rejected("placeholder hostname");
61787
+ return {
61788
+ ok: true,
61789
+ value: label
61790
+ };
61791
+ }
61792
+ function normaliseIp(raw) {
61793
+ const value = raw.trim().toLowerCase().replace(/^\[|\]$/g, "");
61794
+ if (!isIp(value)) return rejected("not an IP address");
61795
+ if (value === "0.0.0.0" || value === "::" || value === "::1" || value.startsWith("127.")) return rejected("loopback or unspecified address");
61796
+ return {
61797
+ ok: true,
61798
+ value
61799
+ };
61800
+ }
61801
+ function isBlank(value) {
61802
+ return value === null || value === void 0 || value.trim().length === 0;
61803
+ }
61804
+ /**
61805
+ * Turn what a driver read into a valid {@link DeviceIdentifiers}: MACs lower-case
61806
+ * with colons and de-duplicated, a hostname without its domain, an IP validated,
61807
+ * a serial prefixed by its manufacturer, a vendor uid by its vendor. A value that
61808
+ * cannot be normalised is left out and listed in `rejected` — the caller logs it
61809
+ * (with `tags: { deviceId }`), it is never dropped in silence.
61810
+ */
61811
+ function normaliseIdentifiers(raw, options = {}) {
61812
+ const readAt = options.readAt ?? Date.now();
61813
+ const originOf = (key) => options.originByKey?.[key] ?? options.origin ?? "read";
61814
+ const entry = (key, value) => ({
61815
+ value,
61816
+ origin: originOf(key),
61817
+ readAt
61818
+ });
61819
+ const refused = [];
61820
+ const take = (key, input, result) => {
61821
+ if (result.ok) return entry(key, result.value);
61822
+ refused.push({
61823
+ key,
61824
+ value: input,
61825
+ reason: result.reason
61826
+ });
61827
+ };
61828
+ const macInputs = raw.mac === null || raw.mac === void 0 ? [] : [raw.mac].flat();
61829
+ const macs = [];
61830
+ for (const input of macInputs) {
61831
+ if (isBlank(input)) continue;
61832
+ const taken = take("mac", input, normaliseMac(input));
61833
+ if (taken !== void 0 && !macs.some((m) => m.value === taken.value)) macs.push(taken);
61834
+ }
61835
+ const serial = raw.serial === null || raw.serial === void 0 || isBlank(raw.serial.serial) ? void 0 : take("serial", `${raw.serial.manufacturer}:${raw.serial.serial}`, normalisePrefixed(raw.serial.manufacturer, raw.serial.serial, "manufacturer"));
61836
+ const vendorUid = raw.vendorUid === null || raw.vendorUid === void 0 || isBlank(raw.vendorUid.id) ? void 0 : take("vendor-uid", `${raw.vendorUid.vendor}:${raw.vendorUid.id}`, normalisePrefixed(raw.vendorUid.vendor, raw.vendorUid.id, "vendor"));
61837
+ const machineUuid = isBlank(raw.machineUuid) ? void 0 : take("machine-uuid", raw.machineUuid, normaliseMachineUuid(raw.machineUuid));
61838
+ const host = isBlank(raw.host) ? null : raw.host.trim();
61839
+ const hostIsIp = host !== null && isIp(host.toLowerCase().replace(/^\[|\]$/g, ""));
61840
+ const hostnameInput = isBlank(raw.hostname) ? hostIsIp ? null : host : raw.hostname;
61841
+ const ipInput = isBlank(raw.ip) ? hostIsIp ? host : null : raw.ip;
61842
+ const hostname = hostnameInput === null ? void 0 : take("hostname", hostnameInput, normaliseHostname(hostnameInput));
61843
+ const ip = ipInput === null ? void 0 : take("ip", ipInput, normaliseIp(ipInput));
61844
+ return {
61845
+ identifiers: {
61846
+ ...macs.length > 0 ? { mac: macs } : {},
61847
+ ...serial !== void 0 ? { serial } : {},
61848
+ ...machineUuid !== void 0 ? { "machine-uuid": machineUuid } : {},
61849
+ ...vendorUid !== void 0 ? { "vendor-uid": vendorUid } : {},
61850
+ ...hostname !== void 0 ? { hostname } : {},
61851
+ ...ip !== void 0 ? { ip } : {}
61852
+ },
61853
+ rejected: refused
61854
+ };
61855
+ }
60898
61856
  var DeviceSearchRequiresSchema = object({
60899
61857
  /** Capability names the field wants a value of. Absent when the field wants actions only. */
60900
61858
  caps: array(string()).readonly().optional(),
@@ -61457,6 +62415,10 @@ var DeviceInfoSchema = object({
61457
62415
  /** Hardware + identity blob (manufacturer / model / firmware / sn /
61458
62416
  * uid / mac / …). Populated by drivers; editable via setMetadata. */
61459
62417
  metadata: record$1(string(), unknown()).nullable().optional(),
62418
+ /** Provider-declared identifiers (D1059): typed, normalised, written only by
62419
+ * the owning provider via `setIdentifiers`; read-only for the operator.
62420
+ * Absent ⇒ the provider declared none. */
62421
+ identifiers: DeviceIdentifiersSchema.optional(),
61460
62422
  /** Optional upstream-system identity + rendering envelope. See
61461
62423
  * `SourceInfo` in `packages/types/src/device/source-info.ts`. */
61462
62424
  sourceInfo: SourceInfoSchema.optional(),
@@ -61608,6 +62570,8 @@ var DeviceMetaSchema = object({
61608
62570
  disabled: boolean(),
61609
62571
  parentDeviceId: number$1().nullable(),
61610
62572
  metadata: record$1(string(), unknown()).nullable().optional(),
62573
+ /** Provider-declared identifiers (D1059). See `DeviceMeta.identifiers`. */
62574
+ identifiers: DeviceIdentifiersSchema.optional(),
61611
62575
  /** Optional upstream-system identity + rendering envelope. See
61612
62576
  * `SourceInfo`. Present when the device has been persisted with a
61613
62577
  * non-synthetic source identifier (HA entities, vendor MAC, …);
@@ -61921,6 +62885,14 @@ method(object({
61921
62885
  }), _void(), {
61922
62886
  kind: "mutation",
61923
62887
  auth: "admin"
62888
+ }), method(object({
62889
+ deviceId: number$1(),
62890
+ identifiers: DeviceIdentifiersSchema.nullable(),
62891
+ /** Kinds the provider tried to read and could not: their stored value is kept. */
62892
+ unread: array(DeviceIdentifierKeySchema).optional()
62893
+ }), _void(), {
62894
+ kind: "mutation",
62895
+ auth: "admin"
61924
62896
  }), method(_void(), array(string())), method(object({ name: string() }), _void(), {
61925
62897
  kind: "mutation",
61926
62898
  auth: "admin"
@@ -62523,6 +63495,34 @@ var OrphanListSchema = object({
62523
63495
  /** More orphans exist than {@link DEVICE_HISTORY_ORPHAN_LIST_MAX}. */
62524
63496
  truncated: boolean()
62525
63497
  });
63498
+ var DeviceHistoryRangeDeleteRefusalSchema = _enum([
63499
+ "invalid-range",
63500
+ "range-too-large",
63501
+ "series-not-found",
63502
+ "not-a-point-series"
63503
+ ]);
63504
+ var RollupRowsSchema = object({
63505
+ "5m": number$1().int(),
63506
+ "1h": number$1().int(),
63507
+ "1d": number$1().int()
63508
+ });
63509
+ /**
63510
+ * What a time-range delete did, or WOULD do (`dryRun`). `rows` is what was
63511
+ * removed: raw points inside the range, and the rollup rows covering it (those
63512
+ * are removed and rebuilt from what remains, so a gap leaves no stale value).
63513
+ * `rewritten` is how many rollup rows were rebuilt from the remaining points;
63514
+ * `null` on a dry run, which cannot know before it has deleted.
63515
+ */
63516
+ var RangeDeleteResultSchema = discriminatedUnion("ok", [object({
63517
+ ok: literal(true),
63518
+ dryRun: boolean(),
63519
+ seriesId: number$1().int(),
63520
+ rows: TierRowsSchema,
63521
+ rewritten: RollupRowsSchema.nullable()
63522
+ }), object({
63523
+ ok: literal(false),
63524
+ reason: DeviceHistoryRangeDeleteRefusalSchema
63525
+ })]);
62526
63526
  var DeviceHistoryStatusSchema = object({
62527
63527
  startedAt: number$1(),
62528
63528
  /** The store is declared, series loaded and the first reconcile has answered. */
@@ -62623,6 +63623,16 @@ method(object({ deviceId: number$1().int() }), array(SeriesInfoSchema).readonly(
62623
63623
  }), method(object({}), DeviceHistoryStatusSchema, { auth: "admin" }), method(object({}), OrphanListSchema, { auth: "admin" }), method(object({ seriesIds: array(number$1().int()).min(1).max(50) }), object({ results: array(OrphanDeleteEntrySchema).readonly() }), {
62624
63624
  kind: "mutation",
62625
63625
  auth: "admin"
63626
+ }), method(object({
63627
+ deviceId: number$1().int(),
63628
+ key: string().min(1),
63629
+ scope: string(),
63630
+ fromMs: number$1().int().nonnegative(),
63631
+ toMs: number$1().int().nonnegative(),
63632
+ dryRun: boolean()
63633
+ }), RangeDeleteResultSchema, {
63634
+ kind: "mutation",
63635
+ auth: "admin"
62626
63636
  });
62627
63637
  /**
62628
63638
  * `device-removal-hook` — the reliable way an addon learns a device was DELETED,
@@ -67046,8 +68056,8 @@ var HeroSceneSchema = object({
67046
68056
  /** 0..1: volume, cover position, cycle progress. */
67047
68057
  level: number$1().min(0).max(1).nullable()
67048
68058
  });
67049
- DeviceType.Camera, 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.EnergySystem, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
67050
- DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
68059
+ DeviceType.Camera, 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.EnergySystem, DeviceType.Workload, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
68060
+ DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host;
67051
68061
  var HeroRowIdSchema = _enum([
67052
68062
  "progress",
67053
68063
  "run-for",
@@ -67276,8 +68286,12 @@ var HeroPowerSupplySlotSchema = object({
67276
68286
  /** Off asks for a confirmation while the device runs. */
67277
68287
  confirmOffWhileRunning: boolean(),
67278
68288
  running: boolean().nullable(),
67279
- powerOn: HeroActionSchema,
67280
- powerOff: HeroActionSchema,
68289
+ /**
68290
+ * `null` when the linked switch ANSWERED it only reports (a PoE port seen through an
68291
+ * API key): power on / off would always be refused. The restart stays (D1058).
68292
+ */
68293
+ powerOn: HeroActionSchema.nullable(),
68294
+ powerOff: HeroActionSchema.nullable(),
67281
68295
  restart: HeroActionSchema
67282
68296
  });
67283
68297
  var HeroStateBackdropSchema = object({
@@ -67439,6 +68453,12 @@ var HeroRowModelSchema = object({
67439
68453
  /** `null` = the type has no inline control, or the caller may not act on it. */
67440
68454
  primary: HeroControlSchema.nullable(),
67441
68455
  /**
68456
+ * `true` when the primary exists but the model gates it (the caller may not act): the
68457
+ * row is read-only and a client draws no control, not a fallback. `false` = nothing
68458
+ * covers the type yet. Absent = an older server.
68459
+ */
68460
+ primaryGated: boolean().optional(),
68461
+ /**
67442
68462
  * Beside `primary` when the device offers a timed run: Run while idle, Stop
67443
68463
  * while armed. `null` when there is no slot, or the caller may not act.
67444
68464
  */
@@ -75299,6 +76319,12 @@ var CameraMetricsSchema = object({
75299
76319
  queueDepth: number$1(),
75300
76320
  avgInferenceTimeMs: number$1(),
75301
76321
  droppedFrames: number$1(),
76322
+ /**
76323
+ * Native crops this runner could not produce for the camera (the caller was
76324
+ * handed nothing), cumulative since attach. Additive: a runner that predates
76325
+ * it omits the field, which a reader treats as unknown, never zero.
76326
+ */
76327
+ nativeCropMisses: number$1().optional(),
75302
76328
  phase: _enum([
75303
76329
  "idle",
75304
76330
  "watching",
@@ -78003,6 +79029,19 @@ var NetworkLinkStatusSchema = object({
78003
79029
  rssi: number$1().optional().meta(readingMeta("signal-level")),
78004
79030
  /** Network name of a wireless link, when the firmware reports it. */
78005
79031
  ssid: string().optional(),
79032
+ /**
79033
+ * Negotiated link speed of a wired port, the `bitrate` quantity in its base
79034
+ * unit, kbit/s (a gigabit port is 1 000 000); the display picks the unit.
79035
+ * `null` = the port is down or the speed is not known; absent = the provider
79036
+ * never reports one.
79037
+ */
79038
+ speedKbps: number$1().nonnegative().nullable().optional().meta(readingMeta("bitrate")),
79039
+ /**
79040
+ * Whether the link is up. `type` names the medium, not its state, so a wired
79041
+ * port that lost its link is `ethernet` + `linkUp: false`. `null` = not known;
79042
+ * absent = the provider never reports it.
79043
+ */
79044
+ linkUp: boolean().nullable().optional(),
78006
79045
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
78007
79046
  lastUpdated: number$1().meta(readingMeta("none"))
78008
79047
  });
@@ -80187,7 +81226,32 @@ var NcRuleInputSchema = object({
80187
81226
  * authored before this field meant. An editor turns it off by writing
80188
81227
  * `false`, so it needs no `clear` key.
80189
81228
  */
80190
- askVerdict: boolean().optional()
81229
+ askVerdict: boolean().optional(),
81230
+ /**
81231
+ * Operator tags (D1054), kept on the rule like a core block's. Absent = no
81232
+ * tags. `.optional()`, never `.default()`: a partial `updateRule` patch that
81233
+ * does not name `tags` keeps the stored ones (the store merges), and an
81234
+ * editor empties them by sending `[]` (the store drops an empty list).
81235
+ * Renamed or removed fleet-wide only through the `tags` cap, which writes
81236
+ * here with `setRuleTags`.
81237
+ */
81238
+ tags: TagsFieldSchema.optional()
81239
+ });
81240
+ /**
81241
+ * The rule kinds that carry tags (D1054) — each one its own store. Every kind
81242
+ * labels its rules the same way; this names which store a tag write goes to.
81243
+ */
81244
+ var NcTaggedRuleKindSchema = _enum([
81245
+ "event",
81246
+ "summary",
81247
+ "timelapse",
81248
+ "calendar-events"
81249
+ ]);
81250
+ /** One rule's tags, as the `tags` cap reads them across every kind. */
81251
+ var NcRuleTagsEntrySchema = object({
81252
+ kind: NcTaggedRuleKindSchema,
81253
+ ruleId: string(),
81254
+ tags: array(string())
80191
81255
  });
80192
81256
  /**
80193
81257
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -81204,6 +82268,16 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
81204
82268
  }), object({ success: literal(true) }), {
81205
82269
  kind: "mutation",
81206
82270
  auth: "admin"
82271
+ }), method(object({}), object({ rules: array(NcRuleTagsEntrySchema) }), {
82272
+ kind: "query",
82273
+ auth: "admin"
82274
+ }), method(object({
82275
+ kind: NcTaggedRuleKindSchema,
82276
+ ruleId: string(),
82277
+ tags: TagsFieldSchema
82278
+ }), object({ success: literal(true) }), {
82279
+ kind: "mutation",
82280
+ auth: "admin"
81207
82281
  }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number$1().int()).readonly() }), { auth: "admin" }), method(object({
81208
82282
  deviceId: number$1().int(),
81209
82283
  muted: boolean()
@@ -82773,6 +83847,94 @@ var EffectiveSharesSchema = object({
82773
83847
  nodeWeights: record$1(string(), number$1()),
82774
83848
  deviceWeights: record$1(string(), record$1(string(), number$1()))
82775
83849
  });
83850
+ var HealthFindingKindSchema = _enum([
83851
+ "motion-without-detections",
83852
+ "detections-under-floor",
83853
+ "inference-too-slow",
83854
+ "frames-shed",
83855
+ "inference-device-unusable"
83856
+ ]);
83857
+ var HealthSeveritySchema = _enum([
83858
+ "info",
83859
+ "warning",
83860
+ "critical"
83861
+ ]);
83862
+ var HealthSubjectSchema = discriminatedUnion("type", [
83863
+ object({
83864
+ type: literal("camera"),
83865
+ deviceId: number$1()
83866
+ }),
83867
+ object({
83868
+ type: literal("node"),
83869
+ nodeId: string()
83870
+ }),
83871
+ object({
83872
+ type: literal("inference-device"),
83873
+ nodeId: string(),
83874
+ deviceKey: string()
83875
+ })
83876
+ ]);
83877
+ var HealthFindingSchema = object({
83878
+ /** Stable across ticks for the same condition on the same subject. */
83879
+ id: string(),
83880
+ kind: HealthFindingKindSchema,
83881
+ severity: HealthSeveritySchema,
83882
+ subject: HealthSubjectSchema,
83883
+ what: string(),
83884
+ /** The numbers behind the sentence; `null` = the value could not be read. */
83885
+ evidence: record$1(string(), number$1().nullable()),
83886
+ action: string()
83887
+ });
83888
+ /** One in-memory source the tick read, and whether it answered. */
83889
+ var HealthSourceStatusSchema = object({
83890
+ source: string(),
83891
+ /** Entries read; `null` = the read failed. */
83892
+ entries: number$1().nullable()
83893
+ });
83894
+ var HealthNodeSummarySchema = object({
83895
+ nodeId: string(),
83896
+ sessionsNow: number$1(),
83897
+ /** `deviceKey` of every inference device the balancer excludes on this node. */
83898
+ unusableDevices: array(string()).readonly(),
83899
+ devices: array(object({
83900
+ deviceKey: string(),
83901
+ sessionsNow: number$1(),
83902
+ usable: boolean()
83903
+ })).readonly()
83904
+ });
83905
+ /**
83906
+ * Per-camera runner-side signals, as per-tick deltas of the runner's cumulative
83907
+ * counters. A camera is listed only when at least one signal is known and
83908
+ * non-zero; `null` = the runner did not report it (unknown, never zero).
83909
+ */
83910
+ var HealthCameraRunnerSignalsSchema = object({
83911
+ deviceId: number$1(),
83912
+ /** Native crops the runner failed to produce since the previous tick. */
83913
+ nativeCropMissesSincePreviousTick: number$1().nullable()
83914
+ });
83915
+ var HealthDigestSchema = object({
83916
+ generatedAt: number$1(),
83917
+ /** Wall time the tick took to build this digest. */
83918
+ tickMs: number$1(),
83919
+ /** Cameras known to the digest; `null` when a camera source failed to read (the union would be incomplete). */
83920
+ camerasSeen: number$1().nullable(),
83921
+ findings: array(HealthFindingSchema).readonly(),
83922
+ /** Runner-side per-camera deltas worth a look; see {@link HealthCameraRunnerSignalsSchema}. */
83923
+ cameraSignals: array(HealthCameraRunnerSignalsSchema).readonly(),
83924
+ nodes: array(HealthNodeSummarySchema).readonly(),
83925
+ sources: array(HealthSourceStatusSchema).readonly(),
83926
+ /** Signals the digest does not cover yet, and why — never computed by scanning. */
83927
+ notCovered: array(string()).readonly()
83928
+ });
83929
+ var HealthDigestInputSchema = object({
83930
+ /** Newest first; 1 = the latest digest. */
83931
+ history: number$1().int().min(1).max(24).default(1) });
83932
+ var HealthDigestAnswerSchema = object({
83933
+ /** Null until the first tick has run. */
83934
+ latest: HealthDigestSchema.nullable(),
83935
+ /** Older digests, newest first, when `history` > 1. */
83936
+ previous: array(HealthDigestSchema).readonly()
83937
+ });
82776
83938
  var CameraPipelineConfigSchema = object({
82777
83939
  engine: PipelineEngineChoiceSchema.optional(),
82778
83940
  steps: array(PipelineStepInputSchema).readonly(),
@@ -83434,7 +84596,7 @@ method(object({
83434
84596
  }), method(LoadBalancingSharesInputSchema, object({ success: literal(true) }), {
83435
84597
  kind: "mutation",
83436
84598
  auth: "admin"
83437
- }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
84599
+ }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(HealthDigestInputSchema, HealthDigestAnswerSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
83438
84600
  kind: "mutation",
83439
84601
  auth: "admin"
83440
84602
  }), method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }), method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
@@ -86573,7 +87735,18 @@ DeviceType.Camera, method(object({
86573
87735
  * older than this field keeps working unchanged (D382 — an unstated
86574
87736
  * ask is zero).
86575
87737
  */
86576
- audio: ClipStreamAudioSchema.optional()
87738
+ audio: ClipStreamAudioSchema.optional(),
87739
+ /**
87740
+ * The operator's authorisation to wake a sleeping camera for this
87741
+ * dial — the same {@link ClipWakeSchema} the byte reads carry. Absent
87742
+ * — the default — means a sleeping standalone battery camera is
87743
+ * REFUSED by name before any URL is minted. A caller sets it only
87744
+ * when a viewer itself asked for the clip (the broker's `playClip`);
87745
+ * a prefetch, a reconcile or a retry never does. With it, the
87746
+ * provider wakes the camera and waits under a bound; a camera that
87747
+ * does not come up is refused `wake-timeout`, naming the wait.
87748
+ */
87749
+ wake: ClipWakeSchema.optional()
86577
87750
  }), ClipStreamDialSchema, {
86578
87751
  kind: "query",
86579
87752
  auth: "protected"
@@ -86802,7 +87975,8 @@ _enum([
86802
87975
  "camera-refused",
86803
87976
  "fetch-failed",
86804
87977
  "too-large-to-transfer",
86805
- "wake-expired"
87978
+ "wake-expired",
87979
+ "wake-timeout"
86806
87980
  ]);
86807
87981
  /** Candidate download URLs (LAN first, then operator extra hosts). */
86808
87982
  var ExportDownloadSchema = object({
@@ -89021,6 +90195,201 @@ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), S
89021
90195
  auth: "admin"
89022
90196
  }), NOT_A_DEVICE.CLUSTER;
89023
90197
  /**
90198
+ * Timed siren: trigger the siren for a duration and know until when it sounds.
90199
+ *
90200
+ * The plain on/off `switch` of a siren stays as it is (HomeKit / Alexa see a
90201
+ * switch); this cap adds the part a switch cannot say — HOW LONG, and the
90202
+ * moment the siren is expected to fall silent (`activeUntil`, epoch ms), so a
90203
+ * UI can show the activation with a countdown.
90204
+ *
90205
+ * The allowed durations are never hardcoded: `getOptions` answers what the
90206
+ * CAMERA reports (a discrete list or `{min,max,step}`), the default, and the
90207
+ * unit truth — a camera that counts plays rather than seconds says so, with the
90208
+ * seconds-per-play factor used to convert, and whether that factor was read
90209
+ * from the camera or is an estimate.
90210
+ */
90211
+ /** What the camera counts natively. */
90212
+ var SirenDurationUnit = {
90213
+ Seconds: "seconds",
90214
+ Plays: "plays"
90215
+ };
90216
+ /** Where the numbers of an options answer come from. */
90217
+ var SirenOptionsSource = {
90218
+ /** Read from the camera by this fetch. */
90219
+ Camera: "camera",
90220
+ /** The camera did not answer or does not advertise it; a documented fallback. */
90221
+ Fallback: "fallback"
90222
+ };
90223
+ var SirenDurationRangeSchema = object({
90224
+ min: number$1().positive(),
90225
+ max: number$1().positive(),
90226
+ step: number$1().positive()
90227
+ });
90228
+ var SirenOptionsSchema = object({
90229
+ /** Discrete durations in seconds the operator may pick; `null` when the camera gives a range. */
90230
+ allowedSeconds: array(number$1().positive()).nullable(),
90231
+ /** Continuous range in seconds; `null` when the camera gives a discrete list. */
90232
+ rangeSeconds: SirenDurationRangeSchema.nullable(),
90233
+ /** The camera's default duration, seconds. */
90234
+ defaultSeconds: number$1().positive(),
90235
+ /**
90236
+ * Discrete play counts the operator may pick; `null` when the camera gives a
90237
+ * range or does not count plays. Defaults to `null` so a provider that
90238
+ * predates plays (#589) reads as declaring none.
90239
+ */
90240
+ allowedPlays: array(number$1().int().positive()).nullable().default(null),
90241
+ /** Continuous range of play counts; `null` when listed or not counted. */
90242
+ rangePlays: SirenDurationRangeSchema.nullable().default(null),
90243
+ /** The camera's default play count; `null` when the camera does not count plays. */
90244
+ defaultPlays: number$1().int().positive().nullable().default(null),
90245
+ /** What the camera counts natively. */
90246
+ unit: _enum([SirenDurationUnit.Seconds, SirenDurationUnit.Plays]),
90247
+ /** Seconds one play lasts, when `unit` is `plays`; `null` for a seconds camera. */
90248
+ secondsPerPlay: number$1().positive().nullable(),
90249
+ /** `camera` when the values were read from it, `fallback` when the camera could not say. */
90250
+ source: _enum([SirenOptionsSource.Camera, SirenOptionsSource.Fallback]),
90251
+ /** Ms epoch of the read that produced this answer. */
90252
+ fetchedAt: number$1()
90253
+ });
90254
+ var SirenStatusSchema = object({
90255
+ /** True while the siren is sounding by a timed trigger or switched on. */
90256
+ active: boolean(),
90257
+ /** Ms epoch the siren is expected to fall silent; `null` when not active or open-ended. */
90258
+ activeUntil: number$1().nullable(),
90259
+ /** Duration of the current / last activation, seconds; `null` when none yet. */
90260
+ durationSeconds: number$1().nullable(),
90261
+ /**
90262
+ * The play count of the current / last activation when it was asked in plays;
90263
+ * `null` when it was asked in seconds (or none yet). The unit that was asked.
90264
+ */
90265
+ plays: number$1().int().positive().nullable().default(null),
90266
+ /**
90267
+ * True when `activeUntil` comes from a seconds-per-play factor the camera did
90268
+ * not report — the siren may fall silent somewhat earlier or later.
90269
+ */
90270
+ activeUntilEstimated: boolean().default(false),
90271
+ /** Ms epoch of the last trigger (0 = never). */
90272
+ lastTriggeredAt: number$1()
90273
+ });
90274
+ /** A trigger asks seconds OR plays (#589); neither means the camera default. */
90275
+ var SirenTriggerInputSchema = object({
90276
+ deviceId: number$1().int().nonnegative(),
90277
+ durationSeconds: number$1().positive().optional(),
90278
+ plays: number$1().int().positive().optional()
90279
+ }).refine((input) => input.durationSeconds === void 0 || input.plays === void 0, {
90280
+ message: "a siren trigger takes durationSeconds or plays, not both",
90281
+ path: ["plays"]
90282
+ });
90283
+ var SirenRuntimeStateSchema = SirenStatusSchema.extend({
90284
+ /** Ms epoch of the last successful camera read of the options (0 = never). */
90285
+ lastFetchedAt: number$1() });
90286
+ var sirenCapability = {
90287
+ name: "siren",
90288
+ scope: "device",
90289
+ deviceNative: true,
90290
+ mode: "singleton",
90291
+ deviceTypes: [DeviceType.Siren],
90292
+ methods: {
90293
+ /** The durations the camera allows, read from the camera. */
90294
+ getOptions: method(object({ deviceId: number$1().int().nonnegative() }), SirenOptionsSchema, {
90295
+ kind: "query",
90296
+ auth: "protected"
90297
+ }),
90298
+ /**
90299
+ * The play counts a rule may pick: what `getOptions` declares as a list, or
90300
+ * its range spelled out. Empty for a siren that counts seconds.
90301
+ */
90302
+ getPlayChoices: method(object({ deviceId: number$1().int().nonnegative() }), array(number$1().int().positive()), {
90303
+ kind: "query",
90304
+ auth: "protected"
90305
+ }),
90306
+ /**
90307
+ * Sound the siren for `durationSeconds` OR `plays` — never both. With
90308
+ * neither the camera default applies. A count on a siren that declares no
90309
+ * plays is refused. Answers the state at the moment of the trigger
90310
+ * (`activeUntil` included).
90311
+ */
90312
+ trigger: method(SirenTriggerInputSchema, SirenStatusSchema, {
90313
+ kind: "mutation",
90314
+ auth: "protected",
90315
+ actions: [{
90316
+ id: "siren.trigger",
90317
+ label: t("Sound the siren", "Fai suonare la sirena"),
90318
+ phrase: t("Sound {device}", "Fai suonare {device}"),
90319
+ icon: "siren",
90320
+ args: {}
90321
+ }, {
90322
+ id: "siren.triggerPlays",
90323
+ label: t("Sound the siren N times", "Fai suonare la sirena N volte"),
90324
+ phrase: t("Sound {device} {plays} times", "Fai suonare {device} {plays} volte"),
90325
+ icon: "siren",
90326
+ openArgs: [{
90327
+ key: "plays",
90328
+ label: t("Plays", "Riproduzioni"),
90329
+ offer: {
90330
+ kind: "dynamic",
90331
+ from: "method",
90332
+ method: "getPlayChoices",
90333
+ valueKind: "number"
90334
+ }
90335
+ }]
90336
+ }]
90337
+ }),
90338
+ /** Silence the siren now. */
90339
+ stop: method(object({ deviceId: number$1().int().nonnegative() }), SirenStatusSchema, {
90340
+ kind: "mutation",
90341
+ auth: "protected",
90342
+ actions: [{
90343
+ id: "siren.stop",
90344
+ label: t("Silence the siren", "Zittisci la sirena"),
90345
+ phrase: t("Silence {device}", "Zittisci {device}"),
90346
+ icon: "siren",
90347
+ effect: {
90348
+ field: "active",
90349
+ value: false
90350
+ },
90351
+ args: {}
90352
+ }]
90353
+ })
90354
+ },
90355
+ events: { onSirenChanged: {
90356
+ data: object({
90357
+ deviceId: number$1(),
90358
+ active: boolean(),
90359
+ activeUntil: number$1().nullable()
90360
+ }),
90361
+ notOperatorFacing: "the `active` state trigger phrases both edges of this change"
90362
+ } },
90363
+ status: {
90364
+ schema: SirenStatusSchema,
90365
+ kind: "command-driven"
90366
+ },
90367
+ runtimeState: SirenRuntimeStateSchema,
90368
+ /**
90369
+ * Runtime-state durability: **session** — a siren activation is a moment, not a fact to restore after a restart.
90370
+ *
90371
+ * See `RuntimeStateDurability`. Enforced by
90372
+ * `scripts/check-runtime-state-durability.ts`.
90373
+ */
90374
+ durability: "session",
90375
+ /**
90376
+ * History (D850): none — an activation is already recorded by the switch / alarm events.
90377
+ */
90378
+ history: "none",
90379
+ vocabulary: {
90380
+ noun: t("Siren", "Sirena"),
90381
+ order: 1170,
90382
+ state: [{
90383
+ kind: "boolean",
90384
+ field: "active",
90385
+ label: t("Siren sounding", "Sirena in funzione"),
90386
+ whenTrue: t("When {device} starts sounding", "Quando {device} inizia a suonare"),
90387
+ whenFalse: t("When {device} falls silent", "Quando {device} smette di suonare"),
90388
+ icon: "siren"
90389
+ }]
90390
+ }
90391
+ };
90392
+ /**
89024
90393
  * Smoke alarm sensor — boolean "is smoke currently detected" with
89025
90394
  * timestamp of the last transition. Drives Home Assistant
89026
90395
  * `binary_sensor` entries with `device_class: smoke`.
@@ -90146,6 +91515,27 @@ var SwitchStatusSchema = object({
90146
91515
  /** Ms epoch of the last state change. Useful for UI "X minutes ago". */
90147
91516
  lastChangedAt: number$1()
90148
91517
  });
91518
+ /**
91519
+ * What a switch can do, from its provider (`getOptions`). A provider that writes no
91520
+ * `getOptions` is a plain on/off switch: the defaults are the old contract.
91521
+ *
91522
+ * - `supportsSetState: false` — the switch reports its state but cannot be set (a PoE port seen only
91523
+ * through an API key). Its provider refuses `setState`; these surfaces withdraw on/off once the
91524
+ * device ANSWERED this (`switchRefusesSetState`): the device hero, the automation action picker
91525
+ * (`offeredWhen` on `switch.on` / `switch.off` / `switch.toggle`), the default `toggle`, the
91526
+ * HomeKit, Alexa and Google exporters, and `power-source` on a device the switch powers
91527
+ * (`getStatus().switchSettable`, `offeredWhen` on `powerSource.on` / `.off`, `not-settable`). A
91528
+ * read that failed or is pending changes nothing (D315).
91529
+ * - `supportsPowerCycle: true` — the device behind the switch can cut and restore its own output in
91530
+ * one native call (a PoE port's power cycle). It has no control of its own: a linked
91531
+ * `power-source.forceRestart` uses it instead of off / wait / on.
91532
+ */
91533
+ var SwitchOptionsSchema = object({
91534
+ supportsSetState: boolean().default(true),
91535
+ supportsPowerCycle: boolean().default(false)
91536
+ });
91537
+ /** The options of a provider that did not answer `getOptions`: a plain on/off switch. */
91538
+ var SWITCH_DEFAULT_OPTIONS = SwitchOptionsSchema.parse({});
90149
91539
  var switchCapability = {
90150
91540
  name: "switch",
90151
91541
  scope: "device",
@@ -90173,7 +91563,8 @@ var switchCapability = {
90173
91563
  field: "on",
90174
91564
  value: true
90175
91565
  },
90176
- args: { on: true }
91566
+ args: { on: true },
91567
+ offeredWhen: SWITCH_SETTABLE_GATE
90177
91568
  }, {
90178
91569
  id: "switch.off",
90179
91570
  label: t("Turn off", "Spegni"),
@@ -90183,9 +91574,16 @@ var switchCapability = {
90183
91574
  field: "on",
90184
91575
  value: false
90185
91576
  },
90186
- args: { on: false }
91577
+ args: { on: false },
91578
+ offeredWhen: SWITCH_SETTABLE_GATE
90187
91579
  }]
90188
91580
  }),
91581
+ getOptions: optionalMethod(object({ deviceId: number$1() }), SwitchOptionsSchema, { auth: "protected" }),
91582
+ powerCycle: optionalMethod(object({ deviceId: number$1() }), _void(), {
91583
+ kind: "mutation",
91584
+ auth: "protected",
91585
+ notOperatorFacing: "a power cycle is the forced restart of the device the switch powers (power-source), never a step of its own"
91586
+ }),
90189
91587
  toggle: optionalMethod(object({ deviceId: number$1() }), _void(), {
90190
91588
  kind: "mutation",
90191
91589
  auth: "protected",
@@ -90193,7 +91591,8 @@ var switchCapability = {
90193
91591
  id: "switch.toggle",
90194
91592
  label: t("Toggle", "Commuta"),
90195
91593
  phrase: t("Toggle {device}", "Commuta {device}"),
90196
- icon: "toggle-right"
91594
+ icon: "toggle-right",
91595
+ offeredWhen: SWITCH_SETTABLE_GATE
90197
91596
  }]
90198
91597
  })
90199
91598
  },
@@ -90215,6 +91614,16 @@ var switchCapability = {
90215
91614
  * not need to re-query the provider after a setState mutation.
90216
91615
  */
90217
91616
  runtimeState: SwitchStatusSchema,
91617
+ composedMethods: {
91618
+ getOptions: {
91619
+ kind: "answer",
91620
+ value: SWITCH_DEFAULT_OPTIONS
91621
+ },
91622
+ powerCycle: {
91623
+ kind: "refuse",
91624
+ reason: "a composed switch has no native power cycle"
91625
+ }
91626
+ },
90218
91627
  /**
90219
91628
  * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
90220
91629
  *
@@ -90388,6 +91797,26 @@ var switchCapability = {
90388
91797
  "switch.off": { icon: "plug" }
90389
91798
  },
90390
91799
  state: { on: { icon: "plug-zap" } }
91800
+ },
91801
+ [DeviceRole.PoePort]: {
91802
+ actions: {
91803
+ "switch.on": {
91804
+ label: t("Power on", "Alimenta"),
91805
+ phrase: t("Power on {device}", "Alimenta {device}"),
91806
+ icon: "plug-zap"
91807
+ },
91808
+ "switch.off": {
91809
+ label: t("Power off", "Togli alimentazione"),
91810
+ phrase: t("Power off {device}", "Togli alimentazione a {device}"),
91811
+ icon: "unplug"
91812
+ }
91813
+ },
91814
+ state: { on: {
91815
+ label: t("Powered", "Alimentata"),
91816
+ whenTrue: t("When {device} is powered", "Quando {device} viene alimentata"),
91817
+ whenFalse: t("When {device} loses power", "Quando {device} perde l’alimentazione"),
91818
+ icon: "plug-zap"
91819
+ } }
90391
91820
  }
90392
91821
  }
90393
91822
  }
@@ -90977,10 +92406,11 @@ method(_void(), SystemInfoSchema), method(_void(), HealthStatusSchema), method(_
90977
92406
  /**
90978
92407
  * tags — the registry of tag STYLES and the one place that renames or removes a
90979
92408
  * tag everywhere (D1054). A tag itself lives in the `tags` array of the record it
90980
- * labels (a core block, a scheduler, a template, an action, a device); only its
92409
+ * labels (a core block, a scheduler, a template, an action, a device, a
92410
+ * notification rule); only its
90981
92411
  * colour token and icon are registered here. Provided by the core-blocks builtin,
90982
- * the one place that knows every owner kind; devices are reached through
90983
- * `deviceManager` over `ctx.api`.
92412
+ * the one place that knows every owner kind; devices and notification rules
92413
+ * are reached through `deviceManager` / `notificationRules` over `ctx.api`.
90984
92414
  *
90985
92415
  * Tags compare trimmed and case-insensitively. `list` is the union of styled tags
90986
92416
  * and tags in use; a tag with no style answers a colour derived from its name and
@@ -90991,7 +92421,21 @@ var TagUsageCountsSchema = object({
90991
92421
  schedulers: number$1().int().nonnegative(),
90992
92422
  templates: number$1().int().nonnegative(),
90993
92423
  actions: number$1().int().nonnegative(),
90994
- devices: number$1().int().nonnegative()
92424
+ devices: number$1().int().nonnegative(),
92425
+ notificationRules: number$1().int().nonnegative()
92426
+ });
92427
+ /**
92428
+ * The counts `list` answers. An owner that could not be read (a forked addon
92429
+ * that is down, redeploying or not installed) is `null` — unknown, never `0`
92430
+ * (D393) — and `list` still answers with the other owners' tags.
92431
+ */
92432
+ var TagListCountsSchema = object({
92433
+ coreBlocks: number$1().int().nonnegative().nullable(),
92434
+ schedulers: number$1().int().nonnegative().nullable(),
92435
+ templates: number$1().int().nonnegative().nullable(),
92436
+ actions: number$1().int().nonnegative().nullable(),
92437
+ devices: number$1().int().nonnegative().nullable(),
92438
+ notificationRules: number$1().int().nonnegative().nullable()
90995
92439
  });
90996
92440
  var TagEntrySchema = object({
90997
92441
  name: TagNameSchema,
@@ -90999,7 +92443,8 @@ var TagEntrySchema = object({
90999
92443
  icon: IconKeySchema,
91000
92444
  /** `false` when the operator never chose a style: colour and icon are the derived defaults. */
91001
92445
  styled: boolean(),
91002
- counts: TagUsageCountsSchema
92446
+ /** Per owner kind; `null` = that owner could not be read on this call. */
92447
+ counts: TagListCountsSchema
91003
92448
  });
91004
92449
  method(object({}), array(TagEntrySchema), { auth: "protected" }), method(object({
91005
92450
  name: TagNameSchema,
@@ -91540,7 +92985,6 @@ method(object({ kind: TemplateKindSchema.optional() }), array(TemplateRecordSche
91540
92985
  });
91541
92986
  /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
91542
92987
  var ProfileSettingsSchemaBridge = unknown().nullable();
91543
- var ProfileSettingsBagSchema = record$1(string(), unknown());
91544
92988
  /**
91545
92989
  * A live terminal session hosted by the provider addon. Output and input do
91546
92990
  * NOT flow through the capability — they use the addon data plane
@@ -91559,7 +93003,11 @@ var TerminalSessionInfoSchema = object({
91559
93003
  cols: number$1().int().positive(),
91560
93004
  rows: number$1().int().positive(),
91561
93005
  /** ms-epoch the session's pty was spawned. */
91562
- startedAt: number$1()
93006
+ startedAt: number$1(),
93007
+ /** User id of the admin who opened it; `unattributed` when the caller was not passed. */
93008
+ openedBy: string().optional(),
93009
+ /** ms-epoch of the last pty input or output — what the idle timeout measures. */
93010
+ lastActivityAt: number$1().optional()
91563
93011
  });
91564
93012
  /**
91565
93013
  * A profile the operator may open — a pre-declared, allowlisted program
@@ -91579,39 +93027,6 @@ var TerminalProfileInfoSchema = object({
91579
93027
  /** ConfigUISchema for instance knobs, or null when the profile has none. */
91580
93028
  settingsSchema: ProfileSettingsSchemaBridge.optional()
91581
93029
  });
91582
- /**
91583
- * A durable operator-created Terminal instance. Profiles are templates; only
91584
- * an instance declares a camera.
91585
- */
91586
- var TerminalInstanceInfoSchema = object({
91587
- instanceId: string(),
91588
- cameraStableId: string(),
91589
- nodeId: string(),
91590
- /**
91591
- * False while the node the instance is bound to is not in the cluster
91592
- * topology (forgotten, renamed, re-paired). The instance is kept; the
91593
- * operator re-points it on the Terminal page.
91594
- */
91595
- nodeInCluster: boolean(),
91596
- profileId: string(),
91597
- profileLabel: string(),
91598
- name: string(),
91599
- enabled: boolean(),
91600
- executable: string(),
91601
- args: array(string()).readonly(),
91602
- cwd: string(),
91603
- environment: array(string()).readonly(),
91604
- profileSettings: ProfileSettingsBagSchema
91605
- });
91606
- var TerminalLegacyCameraSchema = object({
91607
- stableId: string(),
91608
- nodeId: string(),
91609
- profileId: string(),
91610
- profileLabel: string(),
91611
- name: string(),
91612
- /** Only legacy monitor cameras can retain their historic stable identity. */
91613
- adoptable: boolean()
91614
- });
91615
93030
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
91616
93031
  seq: number$1().int().positive(),
91617
93032
  kind: literal("data"),
@@ -91639,13 +93054,7 @@ var TerminalOutputBatchSchema = object({
91639
93054
  snapshot: string().optional(),
91640
93055
  events: array(TerminalOutputEventSchema).readonly()
91641
93056
  });
91642
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
91643
- stableId: string().min(1),
91644
- name: string().trim().min(1).max(160).optional()
91645
- }), TerminalInstanceInfoSchema, {
91646
- kind: "mutation",
91647
- auth: "admin"
91648
- }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(_void(), ServerShellStatusSchema, { auth: "admin" }), method(object({
93057
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(_void(), ServerShellStatusSchema, { auth: "admin" }), method(object({
91649
93058
  profileId: string(),
91650
93059
  cols: number$1().int().positive(),
91651
93060
  rows: number$1().int().positive(),
@@ -94363,6 +95772,427 @@ DeviceType.Camera, method(object({ deviceId: number$1().int().nonnegative() }),
94363
95772
  deviceId: number$1().int().nonnegative(),
94364
95773
  sessionId: string()
94365
95774
  }), WebrtcSessionDebugSchema, { kind: "query" });
95775
+ var WorkloadStateSchema = _enum([
95776
+ "running",
95777
+ "paused",
95778
+ "stopped",
95779
+ "starting",
95780
+ "stopping",
95781
+ "crashed"
95782
+ ]);
95783
+ /** The five kinds of workload, as roles of the `workload` device type (D1033). */
95784
+ var WORKLOAD_ROLES = [
95785
+ DeviceRole.Vm,
95786
+ DeviceRole.AppContainer,
95787
+ DeviceRole.Lxc,
95788
+ DeviceRole.App,
95789
+ DeviceRole.Host
95790
+ ];
95791
+ /**
95792
+ * What the workload uses. Every value is `null` when not reported (D393). A host
95793
+ * fills `load1` and `temperature`; its uptime is `since` while it runs.
95794
+ */
95795
+ var WorkloadResourcesSchema = object({
95796
+ /** CPU use, percent of the CPUs it may use (0–100). */
95797
+ cpuPercent: number$1().nullable().meta(readingMeta("percentage", { precision: 1 })),
95798
+ memoryUsedBytes: number$1().nullable().meta(readingMeta("information")),
95799
+ /**
95800
+ * Memory use, percent of `memoryLimitBytes`, for a source that reports a share
95801
+ * and not bytes (a Docker container's stats). Absent or `null` = not reported.
95802
+ */
95803
+ memoryPercent: number$1().nullable().optional().meta(readingMeta("percentage", { precision: 1 })),
95804
+ /** The memory it may use: the limit of a container, the RAM of a VM or host. */
95805
+ memoryLimitBytes: number$1().nullable().meta(readingMeta("information")),
95806
+ vcpus: number$1().nullable().meta(readingMeta("count")),
95807
+ diskUsedBytes: number$1().nullable().meta(readingMeta("information")),
95808
+ diskTotalBytes: number$1().nullable().meta(readingMeta("information")),
95809
+ /** Network received, kbit/s. */
95810
+ netRxKbps: number$1().nullable().meta(readingMeta("bitrate")),
95811
+ /** Network sent, kbit/s. */
95812
+ netTxKbps: number$1().nullable().meta(readingMeta("bitrate")),
95813
+ /** One-minute load average (a host). */
95814
+ load1: number$1().nullable().meta(readingMeta("index", { precision: 2 })),
95815
+ /** CPU / board temperature (a host). */
95816
+ temperature: number$1().nullable().meta(readingMeta("temperature", { precision: 1 }))
95817
+ });
95818
+ var WorkloadPortProtocolSchema = _enum(["tcp", "udp"]);
95819
+ /** One published port: the workload's own port and where the host exposes it. */
95820
+ var WorkloadPortSchema = object({
95821
+ port: number$1().int().meta(readingMeta("none")),
95822
+ /** The host port it is published on; null = not published. */
95823
+ hostPort: number$1().int().nullable().meta(readingMeta("none")),
95824
+ /** The host address it is bound to; null = every address. */
95825
+ hostIp: string().nullable(),
95826
+ protocol: WorkloadPortProtocolSchema
95827
+ });
95828
+ var WorkloadStatusSchema = object({
95829
+ /** null = unknown, never stopped (D393). */
95830
+ state: WorkloadStateSchema.nullable().meta({ label: "State" }),
95831
+ /** Epoch ms the current state began (uptime while running); null when unknown. */
95832
+ since: number$1().nullable().meta(readingMeta("none")),
95833
+ /** The `host` device this runs on, when the provider has adopted it. */
95834
+ hostDeviceId: number$1().int().nullable().meta(readingMeta("device")),
95835
+ /** The image a container runs (`nginx:1.27`). */
95836
+ image: string().nullable(),
95837
+ /** The operating system (a VM, an LXC, a host). */
95838
+ os: string().nullable(),
95839
+ /** The version or firmware it runs. */
95840
+ version: string().nullable(),
95841
+ /** Starts with its host; null when the platform does not say. */
95842
+ autostart: boolean().nullable(),
95843
+ resources: WorkloadResourcesSchema,
95844
+ ports: array(WorkloadPortSchema),
95845
+ /** The addresses it is reachable on (IPs or host names). */
95846
+ addresses: array(string()),
95847
+ /** A newer image / version exists. Installing it stays the `update` cap. */
95848
+ updateAvailable: boolean().nullable(),
95849
+ lastFetchedAt: number$1()
95850
+ });
95851
+ /**
95852
+ * What this device can do, probed by its provider (D14 honesty): a flag is
95853
+ * `true` only when the platform really serves it for THIS device.
95854
+ */
95855
+ var WorkloadOptionsSchema = object({
95856
+ supportsStart: boolean(),
95857
+ supportsStop: boolean(),
95858
+ supportsRestart: boolean(),
95859
+ /** Pause AND resume. */
95860
+ supportsPause: boolean(),
95861
+ supportsForceStop: boolean(),
95862
+ hasResources: boolean(),
95863
+ hasPorts: boolean(),
95864
+ hasAddresses: boolean(),
95865
+ hasAutostart: boolean(),
95866
+ hasUpdateCheck: boolean()
95867
+ });
95868
+ var WorkloadDeviceInputSchema = object({ deviceId: number$1().int().nonnegative() });
95869
+ var WorkloadTransitionEventDataSchema = object({
95870
+ deviceId: number$1(),
95871
+ state: WorkloadStateSchema,
95872
+ previous: WorkloadStateSchema,
95873
+ since: number$1().nullable()
95874
+ });
95875
+ EventCategory.WorkloadStarted, EventCategory.WorkloadStopped, EventCategory.WorkloadCrashed, EventCategory.WorkloadRecovered;
95876
+ var workloadCapability = {
95877
+ name: "workload",
95878
+ scope: "device",
95879
+ deviceNative: true,
95880
+ mode: "singleton",
95881
+ deviceTypes: [DeviceType.Workload],
95882
+ deviceRoles: { [DeviceType.Workload]: WORKLOAD_ROLES },
95883
+ /**
95884
+ * On / off is the state (#462): stopped or crashed is off, anything else on.
95885
+ * The owner registers `switch` through `registerPowerSwitch`; there is no
95886
+ * second on/off state. A device whose provider serves no start / stop gets no
95887
+ * switch.
95888
+ */
95889
+ power: {
95890
+ kind: "methods",
95891
+ field: "state",
95892
+ offValues: ["stopped", "crashed"],
95893
+ on: "start",
95894
+ off: "stop"
95895
+ },
95896
+ methods: {
95897
+ start: optionalMethod(WorkloadDeviceInputSchema, _void(), {
95898
+ kind: "mutation",
95899
+ auth: "protected",
95900
+ actions: [{
95901
+ id: "workload.start",
95902
+ label: t("Start", "Avvia"),
95903
+ phrase: t("Start {device}", "Avvia {device}"),
95904
+ icon: "play",
95905
+ effect: {
95906
+ field: "state",
95907
+ value: "running"
95908
+ }
95909
+ }]
95910
+ }),
95911
+ stop: optionalMethod(WorkloadDeviceInputSchema, _void(), {
95912
+ kind: "mutation",
95913
+ auth: "protected",
95914
+ actions: [{
95915
+ id: "workload.stop",
95916
+ label: t("Stop", "Arresta"),
95917
+ phrase: t("Stop {device}", "Arresta {device}"),
95918
+ icon: "square",
95919
+ effect: {
95920
+ field: "state",
95921
+ value: "stopped"
95922
+ }
95923
+ }]
95924
+ }),
95925
+ restart: optionalMethod(WorkloadDeviceInputSchema, _void(), {
95926
+ kind: "mutation",
95927
+ auth: "protected",
95928
+ actions: [{
95929
+ id: "workload.restart",
95930
+ label: t("Restart", "Riavvia"),
95931
+ phrase: t("Restart {device}", "Riavvia {device}"),
95932
+ icon: "rotate-ccw"
95933
+ }]
95934
+ }),
95935
+ pause: optionalMethod(WorkloadDeviceInputSchema, _void(), {
95936
+ kind: "mutation",
95937
+ auth: "protected",
95938
+ actions: [{
95939
+ id: "workload.pause",
95940
+ label: t("Pause", "Metti in pausa"),
95941
+ phrase: t("Pause {device}", "Metti in pausa {device}"),
95942
+ icon: "pause",
95943
+ effect: {
95944
+ field: "state",
95945
+ value: "paused"
95946
+ }
95947
+ }]
95948
+ }),
95949
+ resume: optionalMethod(WorkloadDeviceInputSchema, _void(), {
95950
+ kind: "mutation",
95951
+ auth: "protected",
95952
+ actions: [{
95953
+ id: "workload.resume",
95954
+ label: t("Resume", "Riprendi"),
95955
+ phrase: t("Resume {device}", "Riprendi {device}"),
95956
+ icon: "circle-play",
95957
+ effect: {
95958
+ field: "state",
95959
+ value: "running"
95960
+ }
95961
+ }]
95962
+ }),
95963
+ forceStop: optionalMethod(WorkloadDeviceInputSchema, _void(), {
95964
+ kind: "mutation",
95965
+ auth: "admin",
95966
+ actions: [{
95967
+ id: "workload.forceStop",
95968
+ label: t("Force stop", "Arresto forzato"),
95969
+ phrase: t("Force {device} to stop", "Forza l’arresto di {device}"),
95970
+ icon: "octagon-x",
95971
+ effect: {
95972
+ field: "state",
95973
+ value: "stopped"
95974
+ }
95975
+ }]
95976
+ }),
95977
+ /** What THIS device can do, probed — the UI is derived from it. */
95978
+ getOptions: method(WorkloadDeviceInputSchema, WorkloadOptionsSchema, { auth: "protected" })
95979
+ },
95980
+ events: {
95981
+ onStarted: {
95982
+ data: WorkloadTransitionEventDataSchema,
95983
+ trigger: {
95984
+ category: EventCategory.WorkloadStarted,
95985
+ label: t("Started", "Avviato"),
95986
+ phrase: t("When {device} starts", "Quando {device} si avvia"),
95987
+ icon: "play"
95988
+ }
95989
+ },
95990
+ onStopped: {
95991
+ data: WorkloadTransitionEventDataSchema,
95992
+ trigger: {
95993
+ category: EventCategory.WorkloadStopped,
95994
+ label: t("Stopped", "Arrestato"),
95995
+ phrase: t("When {device} stops", "Quando {device} si arresta"),
95996
+ icon: "square"
95997
+ }
95998
+ },
95999
+ onCrashed: {
96000
+ data: WorkloadTransitionEventDataSchema,
96001
+ trigger: {
96002
+ category: EventCategory.WorkloadCrashed,
96003
+ label: t("Crashed", "Arrestato in modo anomalo"),
96004
+ phrase: t("When {device} stops without being asked", "Quando {device} si arresta senza che sia stato richiesto"),
96005
+ icon: "triangle-alert"
96006
+ }
96007
+ },
96008
+ onRecovered: {
96009
+ data: WorkloadTransitionEventDataSchema,
96010
+ trigger: {
96011
+ category: EventCategory.WorkloadRecovered,
96012
+ label: t("Recovered", "Ripristinato"),
96013
+ phrase: t("When {device} runs again after a crash", "Quando {device} riparte dopo un arresto anomalo"),
96014
+ icon: "heart-pulse"
96015
+ }
96016
+ }
96017
+ },
96018
+ status: {
96019
+ schema: WorkloadStatusSchema,
96020
+ kind: "poll"
96021
+ },
96022
+ runtimeState: WorkloadStatusSchema,
96023
+ /**
96024
+ * Runtime-state durability: **session** — the provider answers on its next
96025
+ * poll; the series are recorded, so a restart that clears the slice loses
96026
+ * nothing a reader needs. The events are judged from the first state seen.
96027
+ */
96028
+ durability: "session",
96029
+ /**
96030
+ * History (D850): the state as an enum, CPU / memory / network as gauges, so
96031
+ * the charts need no per-metric child device.
96032
+ */
96033
+ history: {
96034
+ primary: "resources.cpuPercent",
96035
+ priority: 40,
96036
+ fields: {
96037
+ state: { kind: "enum" },
96038
+ "resources.cpuPercent": {
96039
+ kind: "gauge",
96040
+ unit: "%",
96041
+ deadband: 2,
96042
+ displayName: "CPU"
96043
+ },
96044
+ "resources.memoryUsedBytes": {
96045
+ kind: "gauge",
96046
+ unit: "bytes",
96047
+ displayName: "Memory used"
96048
+ },
96049
+ "resources.memoryPercent": {
96050
+ kind: "gauge",
96051
+ unit: "%",
96052
+ deadband: 2,
96053
+ displayName: "Memory"
96054
+ },
96055
+ "resources.netRxKbps": {
96056
+ group: "network",
96057
+ kind: "gauge",
96058
+ unit: "kbps",
96059
+ displayName: "Network received"
96060
+ },
96061
+ "resources.netTxKbps": {
96062
+ group: "network",
96063
+ kind: "gauge",
96064
+ unit: "kbps",
96065
+ displayName: "Network sent"
96066
+ }
96067
+ }
96068
+ },
96069
+ volatileStateFields: ["lastFetchedAt"],
96070
+ vocabulary: {
96071
+ noun: t("Workload", "Carico di lavoro"),
96072
+ order: 2400,
96073
+ state: [
96074
+ {
96075
+ kind: "enum",
96076
+ field: "state",
96077
+ label: t("State", "Stato"),
96078
+ values: [
96079
+ {
96080
+ value: "running",
96081
+ label: t("Running", "In esecuzione"),
96082
+ phrase: t("When {device} is running", "Quando {device} è in esecuzione")
96083
+ },
96084
+ {
96085
+ value: "paused",
96086
+ label: t("Paused", "In pausa")
96087
+ },
96088
+ {
96089
+ value: "stopped",
96090
+ label: t("Stopped", "Arrestato"),
96091
+ phrase: t("When {device} is stopped", "Quando {device} è arrestato")
96092
+ },
96093
+ {
96094
+ value: "starting",
96095
+ label: t("Starting", "In avvio")
96096
+ },
96097
+ {
96098
+ value: "stopping",
96099
+ label: t("Stopping", "In arresto")
96100
+ },
96101
+ {
96102
+ value: "crashed",
96103
+ label: t("Crashed", "Arrestato in modo anomalo"),
96104
+ phrase: t("When {device} has crashed", "Quando {device} è arrestato in modo anomalo")
96105
+ }
96106
+ ],
96107
+ icon: "activity"
96108
+ },
96109
+ {
96110
+ kind: "numeric",
96111
+ field: "resources.cpuPercent",
96112
+ quantity: t("the CPU use", "l'uso della CPU"),
96113
+ label: t("CPU", "CPU"),
96114
+ unit: "%",
96115
+ icon: "cpu"
96116
+ },
96117
+ {
96118
+ kind: "numeric",
96119
+ field: "resources.memoryPercent",
96120
+ quantity: t("the memory use", "l'uso della memoria"),
96121
+ label: t("Memory", "Memoria"),
96122
+ unit: "%",
96123
+ icon: "memory-stick"
96124
+ },
96125
+ {
96126
+ kind: "numeric",
96127
+ field: "resources.temperature",
96128
+ quantity: t("the temperature", "la temperatura"),
96129
+ label: t("Temperature", "Temperatura"),
96130
+ unit: "°C",
96131
+ icon: "thermometer"
96132
+ }
96133
+ ],
96134
+ overrides: { byRole: {
96135
+ [DeviceRole.Vm]: {
96136
+ actions: { "workload.start": { icon: "monitor" } },
96137
+ state: { state: { icon: "monitor" } }
96138
+ },
96139
+ [DeviceRole.AppContainer]: {
96140
+ actions: { "workload.start": { icon: "container" } },
96141
+ state: { state: { icon: "container" } }
96142
+ },
96143
+ [DeviceRole.Lxc]: {
96144
+ actions: { "workload.start": { icon: "box" } },
96145
+ state: { state: { icon: "box" } }
96146
+ },
96147
+ [DeviceRole.App]: {
96148
+ actions: { "workload.start": { icon: "app-window" } },
96149
+ state: { state: { icon: "app-window" } }
96150
+ },
96151
+ [DeviceRole.Host]: {
96152
+ actions: {
96153
+ "workload.start": {
96154
+ label: t("Power on", "Accendi"),
96155
+ phrase: t("Power on {device}", "Accendi {device}"),
96156
+ icon: "power"
96157
+ },
96158
+ "workload.stop": {
96159
+ label: t("Shut down", "Spegni"),
96160
+ phrase: t("Shut down {device}", "Spegni {device}"),
96161
+ icon: "power-off"
96162
+ },
96163
+ "workload.restart": {
96164
+ label: t("Reboot", "Riavvia"),
96165
+ phrase: t("Reboot {device}", "Riavvia {device}"),
96166
+ icon: "refresh-cw"
96167
+ }
96168
+ },
96169
+ state: { state: { icon: "server" } },
96170
+ events: {
96171
+ onStarted: {
96172
+ label: t("Came online", "Tornato in linea"),
96173
+ phrase: t("When {device} comes online", "Quando {device} torna in linea"),
96174
+ icon: "server"
96175
+ },
96176
+ onStopped: {
96177
+ label: t("Shut down", "Spento"),
96178
+ phrase: t("When {device} shuts down", "Quando {device} si spegne"),
96179
+ icon: "server-off"
96180
+ },
96181
+ onCrashed: {
96182
+ label: t("Went down", "Caduto"),
96183
+ phrase: t("When {device} goes down unexpectedly", "Quando {device} cade inaspettatamente"),
96184
+ icon: "server-crash"
96185
+ },
96186
+ onRecovered: {
96187
+ label: t("Came online", "Tornato in linea"),
96188
+ phrase: t("When {device} comes back online after going down", "Quando {device} torna in linea dopo essere caduto"),
96189
+ icon: "server"
96190
+ }
96191
+ }
96192
+ }
96193
+ } }
96194
+ }
96195
+ };
94366
96196
  /**
94367
96197
  * Per-zone occupancy aggregation produced by the analytics frame
94368
96198
  * processor on every inference result. Covers the full combinatorial
@@ -95531,6 +97361,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
95531
97361
  runningState: runningStateCapability,
95532
97362
  sceneMonitor: sceneMonitorCapability,
95533
97363
  scriptRunner: scriptRunnerCapability,
97364
+ siren: sirenCapability,
95534
97365
  smoke: smokeCapability,
95535
97366
  streamCatalog: streamCatalogCapability,
95536
97367
  streamParams: streamParamsCapability,
@@ -95546,11 +97377,65 @@ var DEVICE_LOCAL_STATE_CAPS = {
95546
97377
  waterHeater: waterHeaterCapability,
95547
97378
  weather: weatherCapability,
95548
97379
  weatherStation: weatherStationCapability,
97380
+ workload: workloadCapability,
95549
97381
  zoneAnalytics: zoneAnalyticsCapability,
95550
97382
  zoneRules: zoneRulesCapability,
95551
97383
  zones: zonesCapability
95552
97384
  };
95553
97385
  /**
97386
+ * Normalise `raw` and declare it: every kind it carries replaces the stored one,
97387
+ * every kind it lacks is removed, except the kinds in `options.unread` (a failed
97388
+ * read keeps what was stored) — pass everything the provider read in one call.
97389
+ */
97390
+ async function declareDeviceIdentifiers(deps, raw, options = {}) {
97391
+ const { deviceId, logger, writer } = deps;
97392
+ const { unread, ...normaliseOptions } = options;
97393
+ const { identifiers, rejected } = normaliseIdentifiers(raw, normaliseOptions);
97394
+ for (const r of rejected) logger.warn("identifier refused — not declared", {
97395
+ tags: { deviceId },
97396
+ meta: {
97397
+ key: r.key,
97398
+ value: r.value,
97399
+ reason: r.reason
97400
+ }
97401
+ });
97402
+ const unreadKinds = new Set(unread ?? []);
97403
+ if (isEmptyIdentifiers(identifiers) && DEVICE_IDENTIFIER_KEYS.every((key) => unreadKinds.has(key))) {
97404
+ logger.debug("no identifier read — nothing declared", { tags: { deviceId } });
97405
+ return {
97406
+ outcome: "nothing-to-declare",
97407
+ identifiers
97408
+ };
97409
+ }
97410
+ if (writer === void 0) {
97411
+ logger.warn("identifiers not declared — device-manager unreachable", { tags: { deviceId } });
97412
+ return {
97413
+ outcome: "unavailable",
97414
+ identifiers
97415
+ };
97416
+ }
97417
+ try {
97418
+ await writer.mutate({
97419
+ deviceId,
97420
+ identifiers,
97421
+ ...unread !== void 0 && unread.length > 0 ? { unread } : {}
97422
+ });
97423
+ return {
97424
+ outcome: "declared",
97425
+ identifiers
97426
+ };
97427
+ } catch (err) {
97428
+ logger.warn("identifiers not declared — setIdentifiers failed", {
97429
+ tags: { deviceId },
97430
+ meta: { error: errMsg(err) }
97431
+ });
97432
+ return {
97433
+ outcome: "failed",
97434
+ identifiers
97435
+ };
97436
+ }
97437
+ }
97438
+ /**
95554
97439
  * The edge between two readings, or `null` for no edge.
95555
97440
  *
95556
97441
  * - `null`/cold → `true` is a START (a fault already open at boot is one);
@@ -95602,6 +97487,8 @@ var BaseDevice = class {
95602
97487
  id;
95603
97488
  stableId;
95604
97489
  type;
97490
+ /** True when another process owns the base slices (`options.deviceStatus: 'external'`). */
97491
+ statusIsExternal;
95605
97492
  name;
95606
97493
  parentDeviceId;
95607
97494
  role;
@@ -95750,21 +97637,26 @@ var BaseDevice = class {
95750
97637
  };
95751
97638
  this.runtimeState = DeviceRuntimeState.fromInitial(initial, writer, onWriteFailed);
95752
97639
  ctx.bindRuntimeState?.(this.runtimeState);
95753
- ctx.registerNativeCap?.(deviceStatusCapability, {});
95754
- const seed = {
95755
- online: true,
95756
- lastChangedAt: Date.now()
95757
- };
95758
- this.runtimeState.setCapState("device-status", seed);
95759
- ctx.registerNativeCap?.(featureProbeCapability, {});
95760
- this.runtimeState.setCapState("feature-probe", {
95761
- flags: {},
95762
- deviceType: null,
95763
- model: null,
95764
- channelCount: null,
95765
- lastProbedAt: 0,
95766
- lastFetchedAt: 0
95767
- });
97640
+ this.statusIsExternal = options.deviceStatus === "external";
97641
+ if (!this.statusIsExternal) ctx.registerNativeCap?.(deviceStatusCapability, {});
97642
+ if (!this.statusIsExternal) {
97643
+ const seed = {
97644
+ online: true,
97645
+ lastChangedAt: Date.now()
97646
+ };
97647
+ this.runtimeState.setCapState("device-status", seed);
97648
+ }
97649
+ if (!this.statusIsExternal) {
97650
+ ctx.registerNativeCap?.(featureProbeCapability, {});
97651
+ this.runtimeState.setCapState("feature-probe", {
97652
+ flags: {},
97653
+ deviceType: null,
97654
+ model: null,
97655
+ channelCount: null,
97656
+ lastProbedAt: 0,
97657
+ lastFetchedAt: 0
97658
+ });
97659
+ }
95768
97660
  }
95769
97661
  deviceActions = /* @__PURE__ */ new Map();
95770
97662
  /** Declare a device custom action + its typed handler. Idempotent per name. */
@@ -95792,7 +97684,7 @@ var BaseDevice = class {
95792
97684
  * override to gate side effects on the transition.
95793
97685
  */
95794
97686
  markOnline(online) {
95795
- if (this.online === online) return;
97687
+ if (this.statusIsExternal || this.online === online) return;
95796
97688
  const next = {
95797
97689
  online,
95798
97690
  lastChangedAt: Date.now()
@@ -95862,6 +97754,24 @@ var BaseDevice = class {
95862
97754
  }));
95863
97755
  }
95864
97756
  /**
97757
+ * Declare this device's identifiers (D1059): MAC(s), serial, vendor uid,
97758
+ * machine uuid, hostname, IP — what a later step matches across integrations.
97759
+ * Normalises `raw` (`normaliseIdentifiers`), logs every refused value, and
97760
+ * writes the result through `device-manager.setIdentifiers`, which accepts it
97761
+ * only from the provider that owns this device. Each kind it carries replaces
97762
+ * the stored one and each kind it lacks is removed — except the kinds listed in
97763
+ * `options.unread` (reads that FAILED), which keep their stored value. Pass
97764
+ * everything read in one call; a call where every kind is unread writes
97765
+ * nothing. Best-effort: never throws.
97766
+ */
97767
+ async declareIdentifiers(raw, options) {
97768
+ return declareDeviceIdentifiers({
97769
+ deviceId: this.id,
97770
+ logger: this.ctx.logger,
97771
+ writer: this.ctx.api.deviceManager?.setIdentifiers
97772
+ }, raw, options);
97773
+ }
97774
+ /**
95865
97775
  * Re-publish the device's current `features` array to the persisted
95866
97776
  * meta blob. Drivers call this after a probe finishes when the live
95867
97777
  * `features` getter has gained new flags (e.g. `hasIntercom` flips
@@ -96066,6 +97976,7 @@ var BaseDevice = class {
96066
97976
  * `lastProbedAt`) once their probe actually succeeds.
96067
97977
  */
96068
97978
  async onProbe() {
97979
+ if (this.statusIsExternal) return;
96069
97980
  const base = this.runtimeState.getCapState("feature-probe") ?? {
96070
97981
  flags: {},
96071
97982
  deviceType: null,
@@ -96906,7 +98817,7 @@ var BaseDeviceProvider = class extends BaseAddon {
96906
98817
  }
96907
98818
  };
96908
98819
  DeviceType.HeatPump;
96909
- DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, 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.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
98820
+ DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Camera, 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.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
96910
98821
  new Set(Object.values(DeviceType));
96911
98822
  /** Parses the raw slice with the cap's own schema; `undefined` when it does not parse. */
96912
98823
  function contribution(cap, schema, build) {
@@ -98962,7 +100873,7 @@ var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pu
98962
100873
  ...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
98963
100874
  ...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
98964
100875
  ];
98965
- DeviceType.Camera, 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.EnergySystem, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
100876
+ DeviceType.Camera, 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.EnergySystem, DeviceType.Workload, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
98966
100877
  /**
98967
100878
  * Who looks like what (D1023). One look per {@link DeviceType}, refined by a
98968
100879
  * {@link DeviceRole} where the role changes how the device reads (a leak
@@ -99606,8 +101517,8 @@ lookOf({
99606
101517
  standby: MUTED
99607
101518
  });
99608
101519
  DeviceType.Climate;
99609
- DeviceType.Camera, 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.EnergySystem, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
99610
- DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
101520
+ DeviceType.Camera, 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.EnergySystem, DeviceType.Workload, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
101521
+ DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host;
99611
101522
  Object.freeze({
99612
101523
  "accessories.getStatus": {
99613
101524
  capName: "accessories",
@@ -101625,6 +103536,13 @@ Object.freeze({
101625
103536
  access: "delete",
101626
103537
  role: "admin"
101627
103538
  },
103539
+ "deviceHistory.deleteSeriesRange": {
103540
+ capName: "device-history",
103541
+ capScope: "system",
103542
+ addonId: null,
103543
+ access: "delete",
103544
+ role: "admin"
103545
+ },
101628
103546
  "deviceHistory.getDeviceEnabled": {
101629
103547
  capName: "device-history",
101630
103548
  capScope: "system",
@@ -102262,6 +104180,13 @@ Object.freeze({
102262
104180
  access: "create",
102263
104181
  role: "admin"
102264
104182
  },
104183
+ "deviceManager.setIdentifiers": {
104184
+ capName: "device-manager",
104185
+ capScope: "system",
104186
+ addonId: null,
104187
+ access: "create",
104188
+ role: "admin"
104189
+ },
102265
104190
  "deviceManager.setIntegrationId": {
102266
104191
  capName: "device-manager",
102267
104192
  capScope: "system",
@@ -105146,6 +107071,13 @@ Object.freeze({
105146
107071
  access: "view",
105147
107072
  role: "admin"
105148
107073
  },
107074
+ "notificationRules.listRuleTags": {
107075
+ capName: "notification-rules",
107076
+ capScope: "system",
107077
+ addonId: null,
107078
+ access: "view",
107079
+ role: "admin"
107080
+ },
105149
107081
  "notificationRules.listSnoozes": {
105150
107082
  capName: "notification-rules",
105151
107083
  capScope: "system",
@@ -105202,6 +107134,13 @@ Object.freeze({
105202
107134
  access: "create",
105203
107135
  role: "admin"
105204
107136
  },
107137
+ "notificationRules.setRuleTags": {
107138
+ capName: "notification-rules",
107139
+ capScope: "system",
107140
+ addonId: null,
107141
+ access: "create",
107142
+ role: "admin"
107143
+ },
105205
107144
  "notificationRules.testRule": {
105206
107145
  capName: "notification-rules",
105207
107146
  capScope: "system",
@@ -106441,6 +108380,13 @@ Object.freeze({
106441
108380
  access: "view",
106442
108381
  role: "admin"
106443
108382
  },
108383
+ "pipelineOrchestrator.getHealthDigest": {
108384
+ capName: "pipeline-orchestrator",
108385
+ capScope: "system",
108386
+ addonId: null,
108387
+ access: "view",
108388
+ role: "admin"
108389
+ },
106444
108390
  "pipelineOrchestrator.getIngestOwner": {
106445
108391
  capName: "pipeline-orchestrator",
106446
108392
  capScope: "system",
@@ -108156,6 +110102,41 @@ Object.freeze({
108156
110102
  access: "create",
108157
110103
  role: "admin"
108158
110104
  },
110105
+ "siren.getOptions": {
110106
+ capName: "siren",
110107
+ capScope: "device",
110108
+ addonId: null,
110109
+ access: "view",
110110
+ role: "viewer"
110111
+ },
110112
+ "siren.getPlayChoices": {
110113
+ capName: "siren",
110114
+ capScope: "device",
110115
+ addonId: null,
110116
+ access: "view",
110117
+ role: "viewer"
110118
+ },
110119
+ "siren.getStatus": {
110120
+ capName: "siren",
110121
+ capScope: "device",
110122
+ addonId: null,
110123
+ access: "view",
110124
+ role: "viewer"
110125
+ },
110126
+ "siren.stop": {
110127
+ capName: "siren",
110128
+ capScope: "device",
110129
+ addonId: null,
110130
+ access: "create",
110131
+ role: "viewer"
110132
+ },
110133
+ "siren.trigger": {
110134
+ capName: "siren",
110135
+ capScope: "device",
110136
+ addonId: null,
110137
+ access: "create",
110138
+ role: "viewer"
110139
+ },
108159
110140
  "smoke.getStatus": {
108160
110141
  capName: "smoke",
108161
110142
  capScope: "device",
@@ -108947,6 +110928,13 @@ Object.freeze({
108947
110928
  access: "view",
108948
110929
  role: "viewer"
108949
110930
  },
110931
+ "switch.getOptions": {
110932
+ capName: "switch",
110933
+ capScope: "device",
110934
+ addonId: null,
110935
+ access: "view",
110936
+ role: "viewer"
110937
+ },
108950
110938
  "switch.getStatus": {
108951
110939
  capName: "switch",
108952
110940
  capScope: "device",
@@ -108954,6 +110942,13 @@ Object.freeze({
108954
110942
  access: "view",
108955
110943
  role: "viewer"
108956
110944
  },
110945
+ "switch.powerCycle": {
110946
+ capName: "switch",
110947
+ capScope: "device",
110948
+ addonId: null,
110949
+ access: "create",
110950
+ role: "viewer"
110951
+ },
108957
110952
  "switch.setState": {
108958
110953
  capName: "switch",
108959
110954
  capScope: "device",
@@ -109157,13 +111152,6 @@ Object.freeze({
109157
111152
  access: "create",
109158
111153
  role: "admin"
109159
111154
  },
109160
- "terminalSession.adoptLegacyMonitor": {
109161
- capName: "terminal-session",
109162
- capScope: "system",
109163
- addonId: null,
109164
- access: "create",
109165
- role: "admin"
109166
- },
109167
111155
  "terminalSession.close": {
109168
111156
  capName: "terminal-session",
109169
111157
  capScope: "system",
@@ -109171,13 +111159,6 @@ Object.freeze({
109171
111159
  access: "create",
109172
111160
  role: "admin"
109173
111161
  },
109174
- "terminalSession.listLegacyCameras": {
109175
- capName: "terminal-session",
109176
- capScope: "system",
109177
- addonId: null,
109178
- access: "view",
109179
- role: "admin"
109180
- },
109181
111162
  "terminalSession.listProfiles": {
109182
111163
  capName: "terminal-session",
109183
111164
  capScope: "system",
@@ -110039,6 +112020,62 @@ Object.freeze({
110039
112020
  access: "view",
110040
112021
  role: "viewer"
110041
112022
  },
112023
+ "workload.forceStop": {
112024
+ capName: "workload",
112025
+ capScope: "device",
112026
+ addonId: null,
112027
+ access: "create",
112028
+ role: "admin"
112029
+ },
112030
+ "workload.getOptions": {
112031
+ capName: "workload",
112032
+ capScope: "device",
112033
+ addonId: null,
112034
+ access: "view",
112035
+ role: "viewer"
112036
+ },
112037
+ "workload.getStatus": {
112038
+ capName: "workload",
112039
+ capScope: "device",
112040
+ addonId: null,
112041
+ access: "view",
112042
+ role: "viewer"
112043
+ },
112044
+ "workload.pause": {
112045
+ capName: "workload",
112046
+ capScope: "device",
112047
+ addonId: null,
112048
+ access: "create",
112049
+ role: "viewer"
112050
+ },
112051
+ "workload.restart": {
112052
+ capName: "workload",
112053
+ capScope: "device",
112054
+ addonId: null,
112055
+ access: "create",
112056
+ role: "viewer"
112057
+ },
112058
+ "workload.resume": {
112059
+ capName: "workload",
112060
+ capScope: "device",
112061
+ addonId: null,
112062
+ access: "create",
112063
+ role: "viewer"
112064
+ },
112065
+ "workload.start": {
112066
+ capName: "workload",
112067
+ capScope: "device",
112068
+ addonId: null,
112069
+ access: "create",
112070
+ role: "viewer"
112071
+ },
112072
+ "workload.stop": {
112073
+ capName: "workload",
112074
+ capScope: "device",
112075
+ addonId: null,
112076
+ access: "create",
112077
+ role: "viewer"
112078
+ },
110042
112079
  "zoneAnalytics.getCameraHistory": {
110043
112080
  capName: "zone-analytics",
110044
112081
  capScope: "device",
@@ -110175,8 +112212,8 @@ function offered(received) {
110175
112212
  };
110176
112213
  }
110177
112214
  offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
110178
- DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
110179
- DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
112215
+ DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
112216
+ DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host;
110180
112217
  new Set(Object.values(DeviceType));
110181
112218
  new Set(Object.values(DeviceRole));
110182
112219
  var PowerSwitchRefusedError = class extends Error {
@@ -110807,6 +112844,11 @@ Object.freeze({
110807
112844
  form: "single",
110808
112845
  optional: false
110809
112846
  }],
112847
+ "deviceHistory.deleteSeriesRange": [{
112848
+ name: "deviceId",
112849
+ form: "single",
112850
+ optional: false
112851
+ }],
110810
112852
  "deviceHistory.getDeviceEnabled": [{
110811
112853
  name: "deviceId",
110812
112854
  form: "single",
@@ -111016,6 +113058,11 @@ Object.freeze({
111016
113058
  form: "single",
111017
113059
  optional: false
111018
113060
  }],
113061
+ "deviceManager.setIdentifiers": [{
113062
+ name: "deviceId",
113063
+ form: "single",
113064
+ optional: false
113065
+ }],
111019
113066
  "deviceManager.setIntegrationId": [{
111020
113067
  name: "deviceId",
111021
113068
  form: "single",
@@ -113005,6 +115052,31 @@ Object.freeze({
113005
115052
  form: "single",
113006
115053
  optional: false
113007
115054
  }],
115055
+ "siren.getOptions": [{
115056
+ name: "deviceId",
115057
+ form: "single",
115058
+ optional: false
115059
+ }],
115060
+ "siren.getPlayChoices": [{
115061
+ name: "deviceId",
115062
+ form: "single",
115063
+ optional: false
115064
+ }],
115065
+ "siren.getStatus": [{
115066
+ name: "deviceId",
115067
+ form: "single",
115068
+ optional: false
115069
+ }],
115070
+ "siren.stop": [{
115071
+ name: "deviceId",
115072
+ form: "single",
115073
+ optional: false
115074
+ }],
115075
+ "siren.trigger": [{
115076
+ name: "deviceId",
115077
+ form: "single",
115078
+ optional: false
115079
+ }],
113008
115080
  "smoke.getStatus": [{
113009
115081
  name: "deviceId",
113010
115082
  form: "single",
@@ -113172,11 +115244,21 @@ Object.freeze({
113172
115244
  form: "single",
113173
115245
  optional: false
113174
115246
  }],
115247
+ "switch.getOptions": [{
115248
+ name: "deviceId",
115249
+ form: "single",
115250
+ optional: false
115251
+ }],
113175
115252
  "switch.getStatus": [{
113176
115253
  name: "deviceId",
113177
115254
  form: "single",
113178
115255
  optional: false
113179
115256
  }],
115257
+ "switch.powerCycle": [{
115258
+ name: "deviceId",
115259
+ form: "single",
115260
+ optional: false
115261
+ }],
113180
115262
  "switch.setState": [{
113181
115263
  name: "deviceId",
113182
115264
  form: "single",
@@ -113417,6 +115499,46 @@ Object.freeze({
113417
115499
  form: "single",
113418
115500
  optional: false
113419
115501
  }],
115502
+ "workload.forceStop": [{
115503
+ name: "deviceId",
115504
+ form: "single",
115505
+ optional: false
115506
+ }],
115507
+ "workload.getOptions": [{
115508
+ name: "deviceId",
115509
+ form: "single",
115510
+ optional: false
115511
+ }],
115512
+ "workload.getStatus": [{
115513
+ name: "deviceId",
115514
+ form: "single",
115515
+ optional: false
115516
+ }],
115517
+ "workload.pause": [{
115518
+ name: "deviceId",
115519
+ form: "single",
115520
+ optional: false
115521
+ }],
115522
+ "workload.restart": [{
115523
+ name: "deviceId",
115524
+ form: "single",
115525
+ optional: false
115526
+ }],
115527
+ "workload.resume": [{
115528
+ name: "deviceId",
115529
+ form: "single",
115530
+ optional: false
115531
+ }],
115532
+ "workload.start": [{
115533
+ name: "deviceId",
115534
+ form: "single",
115535
+ optional: false
115536
+ }],
115537
+ "workload.stop": [{
115538
+ name: "deviceId",
115539
+ form: "single",
115540
+ optional: false
115541
+ }],
113420
115542
  "zoneAnalytics.getCameraHistory": [{
113421
115543
  name: "deviceId",
113422
115544
  form: "single",
@@ -114633,6 +116755,8 @@ var TimelapseRuleInputSchema = object({
114633
116755
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
114634
116756
  priority: PriorityField.default(3),
114635
116757
  /** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
116758
+ /** Operator labels (D1054) — optional and NEVER defaulted: an absent key leaves the stored tags alone; `[]` clears them. Admin-only. */
116759
+ tags: TagsFieldSchema.optional(),
114636
116760
  targetOverrides: NcTargetOverridesSchema.optional()
114637
116761
  });
114638
116762
  object({
@@ -114651,6 +116775,8 @@ object({
114651
116775
  reportClasses: ReportClassesField.optional(),
114652
116776
  priority: PriorityField.optional(),
114653
116777
  /** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
116778
+ /** Absent = keep the stored tags; `[]` clears them (D1054). Never defaulted. */
116779
+ tags: TagsFieldSchema.optional(),
114654
116780
  targetOverrides: NcTargetOverridesSchema.optional()
114655
116781
  });
114656
116782
  TimelapseRuleInputSchema.extend({
@@ -134110,6 +136236,25 @@ var UnsupportedError = class extends BaseHomematicError {};
134110
136236
  var ValidationError = class extends BaseHomematicError {};
134111
136237
  var NoConnectionError = class extends BaseHomematicError {};
134112
136238
  var CircuitBreakerOpenError = class extends BaseHomematicError {};
136239
+ var LoginBackoffError = class extends BaseHomematicError {
136240
+ /** When the next real login attempt may go out (epoch ms). */
136241
+ retryAt;
136242
+ /** Consecutive failed logins so far. */
136243
+ failures;
136244
+ constructor(retryAt, failures) {
136245
+ super(`login backing off after ${failures} consecutive failure(s); next attempt at ${new Date(retryAt).toISOString()}`);
136246
+ this.retryAt = retryAt;
136247
+ this.failures = failures;
136248
+ }
136249
+ };
136250
+ var BackendUnavailableError = class extends BaseHomematicError {
136251
+ /** The HTTP status code the CCU answered. */
136252
+ status;
136253
+ constructor(status, message) {
136254
+ super(message);
136255
+ this.status = status;
136256
+ }
136257
+ };
134113
136258
  var AuthFailureError = class extends BaseHomematicError {};
134114
136259
  var InternalBackendError = class extends BaseHomematicError {};
134115
136260
  var CommandSupersededError = class extends BaseHomematicError {};
@@ -135121,8 +137266,22 @@ var JsonRpcMethod = {
135121
137266
  SESSION_RENEW: "Session.renew",
135122
137267
  SYSTEM_LIST_METHODS: "system.listMethods"
135123
137268
  };
135124
- JsonRpcMethod.SESSION_LOGIN, JsonRpcMethod.SESSION_LOGOUT, JsonRpcMethod.SESSION_RENEW;
137269
+ var SESSION_BYPASS_METHODS = /* @__PURE__ */ new Set([
137270
+ JsonRpcMethod.SESSION_LOGIN,
137271
+ JsonRpcMethod.SESSION_LOGOUT,
137272
+ JsonRpcMethod.SESSION_RENEW
137273
+ ]);
135125
137274
  var DEFAULT_MAX_CONCURRENT = 3;
137275
+ var DEFAULT_RETRY_DELAYS_MS = [
137276
+ 500,
137277
+ 1e3,
137278
+ 2e3
137279
+ ];
137280
+ function delay(ms) {
137281
+ return new Promise((resolve) => {
137282
+ setTimeout(resolve, ms);
137283
+ });
137284
+ }
135126
137285
  function stringifyParams(params) {
135127
137286
  const out = {};
135128
137287
  for (const [key, value] of Object.entries(params)) if (value !== null && typeof value === "object") out[key] = JSON.stringify(value);
@@ -135153,11 +137312,13 @@ var JsonRpcClient = class {
135153
137312
  timeoutMs;
135154
137313
  dispatcher;
135155
137314
  semaphore;
137315
+ retryDelaysMs;
135156
137316
  constructor(options) {
135157
137317
  const base = options.url.replace(/\/+$/, "");
135158
137318
  this.endpoint = `${base}${JSON_RPC_PATH$2}`;
135159
137319
  this.timeoutMs = options.timeoutMs ?? TIMEOUTS.rpc;
135160
137320
  this.semaphore = new Semaphore(options.maxConcurrent ?? DEFAULT_MAX_CONCURRENT);
137321
+ this.retryDelaysMs = options.retryDelaysMs ?? DEFAULT_RETRY_DELAYS_MS;
135161
137322
  if (options.tls?.rejectUnauthorized === false) this.dispatcher = new import_undici.Agent({ connect: { rejectUnauthorized: false } });
135162
137323
  else this.dispatcher = void 0;
135163
137324
  }
@@ -135175,6 +137336,16 @@ var JsonRpcClient = class {
135175
137336
  id: 0
135176
137337
  };
135177
137338
  const body = Buffer.from(JSON.stringify(envelope), "utf-8");
137339
+ const delays = SESSION_BYPASS_METHODS.has(method) ? [] : this.retryDelaysMs;
137340
+ for (let attempt = 0;; attempt += 1) try {
137341
+ return await this.sendGuarded(body);
137342
+ } catch (err) {
137343
+ const wait = delays[attempt];
137344
+ if (!(err instanceof BackendUnavailableError) || wait === void 0) throw err;
137345
+ await delay(wait);
137346
+ }
137347
+ }
137348
+ async sendGuarded(body) {
135178
137349
  await this.semaphore.acquire();
135179
137350
  try {
135180
137351
  return await this.send(body);
@@ -135186,6 +137357,7 @@ var JsonRpcClient = class {
135186
137357
  const controller = new AbortController();
135187
137358
  const timer = setTimeout(() => controller.abort(), this.timeoutMs);
135188
137359
  let raw;
137360
+ let status;
135189
137361
  try {
135190
137362
  const init = {
135191
137363
  method: "POST",
@@ -135197,13 +137369,16 @@ var JsonRpcClient = class {
135197
137369
  signal: controller.signal
135198
137370
  };
135199
137371
  if (this.dispatcher) init.dispatcher = this.dispatcher;
135200
- const arrayBuffer = await (await (0, import_undici.fetch)(this.endpoint, init)).arrayBuffer();
137372
+ const response = await (0, import_undici.fetch)(this.endpoint, init);
137373
+ status = response.status;
137374
+ const arrayBuffer = await response.arrayBuffer();
135201
137375
  raw = Buffer.from(arrayBuffer);
135202
137376
  } catch (err) {
135203
137377
  throw mapTransportError(err);
135204
137378
  } finally {
135205
137379
  clearTimeout(timer);
135206
137380
  }
137381
+ if (status >= 500) throw new BackendUnavailableError(status, `JSON-RPC endpoint answered HTTP ${status}`);
135207
137382
  if (raw.length === 0) throw new ClientError("JSON-RPC response had an empty body");
135208
137383
  let parsed;
135209
137384
  try {
@@ -135221,14 +137396,8 @@ var JsonRpcClient = class {
135221
137396
  };
135222
137397
  var DEFAULT_SESSION_AGE_SECONDS = 90;
135223
137398
  var INITIAL_BACKOFF_MS = 1e3;
135224
- var MAX_BACKOFF_MS = 6e4;
137399
+ var MAX_BACKOFF_MS = 3e5;
135225
137400
  var BACKOFF_FACTOR = 2;
135226
- var MAX_CONSECUTIVE_FAILURES = 10;
135227
- function delay(ms) {
135228
- return new Promise((resolve) => {
135229
- setTimeout(resolve, ms);
135230
- });
135231
- }
135232
137401
  var SessionManager = class {
135233
137402
  client;
135234
137403
  username;
@@ -135238,6 +137407,9 @@ var SessionManager = class {
135238
137407
  currentSessionId;
135239
137408
  lastRefresh = 0;
135240
137409
  consecutiveFailures = 0;
137410
+ nextAttemptAt = 0;
137411
+ inFlightLogin;
137412
+ inFlightEnsure;
135241
137413
  constructor(options) {
135242
137414
  this.client = options.client;
135243
137415
  this.username = options.username;
@@ -135251,65 +137423,127 @@ var SessionManager = class {
135251
137423
  }
135252
137424
  /**
135253
137425
  * Log in with username/password (no session id), store the resulting session
135254
- * id, and return it. Applies failed-login rate limiting: each consecutive
135255
- * failure waits an exponentially growing backoff (1s → 60s); after
135256
- * {@link MAX_CONSECUTIVE_FAILURES} failures it throws without contacting the
135257
- * backend. A success resets the failure counter.
135258
- */
135259
- async login() {
135260
- if (this.consecutiveFailures >= MAX_CONSECUTIVE_FAILURES) throw new BaseHomematicError(`login rate limit reached after ${MAX_CONSECUTIVE_FAILURES} consecutive failures`);
135261
- if (this.consecutiveFailures > 0) await delay(this.backoffDelayMs());
135262
- try {
135263
- const result = await this.client.post(JsonRpcMethod.SESSION_LOGIN, {
135264
- username: this.username,
135265
- password: this.password
135266
- });
135267
- const id = String(result);
135268
- this.currentSessionId = id;
135269
- this.lastRefresh = this.now();
135270
- this.consecutiveFailures = 0;
135271
- return id;
135272
- } catch (err) {
135273
- this.consecutiveFailures += 1;
135274
- throw err;
135275
- }
137426
+ * id, and return it. Inside an open backoff window it throws
137427
+ * {@link LoginBackoffError} without contacting the CCU. Concurrent calls
137428
+ * share one request.
137429
+ */
137430
+ login() {
137431
+ if (this.inFlightLogin !== void 0) return this.inFlightLogin;
137432
+ if (this.consecutiveFailures > 0 && this.now() < this.nextAttemptAt) return Promise.reject(new LoginBackoffError(this.nextAttemptAt, this.consecutiveFailures));
137433
+ const attempt = this.sendLogin().finally(() => {
137434
+ this.inFlightLogin = void 0;
137435
+ });
137436
+ this.inFlightLogin = attempt;
137437
+ return attempt;
137438
+ }
137439
+ /** Close the backoff window: the next login goes out at once (the CCU answered again). */
137440
+ resetBackoff() {
137441
+ this.consecutiveFailures = 0;
137442
+ this.nextAttemptAt = 0;
137443
+ }
137444
+ /** Force a renew on the next {@link ensureSession} (the CCU may have restarted). */
137445
+ markStale() {
137446
+ this.lastRefresh = Number.NEGATIVE_INFINITY;
135276
137447
  }
135277
137448
  /**
135278
137449
  * Renew the current session if it is older than the session-age window. If it
135279
- * was refreshed recently this is a no-op. On {@link AuthFailureError} the old
135280
- * session is logged out (best-effort) and a fresh login is performed.
137450
+ * was refreshed recently this is a no-op. A renew that does not answer `true`
137451
+ * or is refused drops the session and logs in again; a renew that fails for
137452
+ * another reason (CCU unreachable) drops the session and rethrows, so the
137453
+ * next call logs in instead of reusing an id the CCU may have forgotten.
135281
137454
  */
135282
137455
  async renew() {
135283
- if (this.currentSessionId === void 0) {
137456
+ const id = this.currentSessionId;
137457
+ if (id === void 0) {
135284
137458
  await this.login();
135285
137459
  return;
135286
137460
  }
135287
137461
  if (this.now() - this.lastRefresh < this.sessionAgeMs) return;
137462
+ let result;
135288
137463
  try {
135289
- if (await this.client.post(JsonRpcMethod.SESSION_RENEW, void 0, { sessionId: this.currentSessionId }) === true) this.lastRefresh = this.now();
137464
+ result = await this.client.post(JsonRpcMethod.SESSION_RENEW, void 0, { sessionId: id });
135290
137465
  } catch (err) {
137466
+ this.dropSession(id);
135291
137467
  if (err instanceof AuthFailureError) {
135292
- await this.logout();
137468
+ await this.client.post(JsonRpcMethod.SESSION_LOGOUT, void 0, { sessionId: id }).catch(() => void 0);
135293
137469
  await this.login();
135294
137470
  return;
135295
137471
  }
135296
137472
  throw err;
135297
137473
  }
137474
+ if (result === true) {
137475
+ this.lastRefresh = this.now();
137476
+ return;
137477
+ }
137478
+ this.dropSession(id);
137479
+ await this.login();
135298
137480
  }
135299
- /** Log out the current session (best-effort) and clear it. No-op if none. */
137481
+ /**
137482
+ * Log out the current session (best-effort) and clear it. No-op if none. A
137483
+ * login still in flight is awaited first, so its session is logged out too.
137484
+ */
135300
137485
  async logout() {
137486
+ if (this.inFlightLogin !== void 0) await this.inFlightLogin.catch(() => void 0);
135301
137487
  const id = this.currentSessionId;
135302
137488
  if (id === void 0) return;
135303
137489
  this.currentSessionId = void 0;
135304
137490
  await this.client.post(JsonRpcMethod.SESSION_LOGOUT, void 0, { sessionId: id });
135305
137491
  }
135306
- /** Ensure a usable session exists: login if none, else renew. Returns the id. */
135307
- async ensureSession() {
137492
+ /** Ensure a usable session exists: login if none, else renew. Returns the id. Concurrent calls share one pass. */
137493
+ ensureSession() {
137494
+ if (this.inFlightEnsure !== void 0) return this.inFlightEnsure;
137495
+ const pass = this.runEnsure().finally(() => {
137496
+ this.inFlightEnsure = void 0;
137497
+ });
137498
+ this.inFlightEnsure = pass;
137499
+ return pass;
137500
+ }
137501
+ /**
137502
+ * A client that sends through this session: a call carrying a session id that
137503
+ * the CCU refuses as `access denied` drops that session, logs in again and is
137504
+ * retried once with the new id. Calls without a session id pass through.
137505
+ */
137506
+ boundClient() {
137507
+ return { post: async (method, params, opts) => {
137508
+ const sid = opts?.sessionId;
137509
+ if (sid === void 0) return this.client.post(method, params, opts);
137510
+ try {
137511
+ return await this.client.post(method, params, opts);
137512
+ } catch (err) {
137513
+ if (!(err instanceof AuthFailureError)) throw err;
137514
+ this.dropSession(sid);
137515
+ const fresh = await this.ensureSession();
137516
+ return this.client.post(method, params, { sessionId: fresh });
137517
+ }
137518
+ } };
137519
+ }
137520
+ async runEnsure() {
135308
137521
  if (this.currentSessionId === void 0) return this.login();
135309
137522
  await this.renew();
135310
137523
  if (this.currentSessionId === void 0) return this.login();
135311
137524
  return this.currentSessionId;
135312
137525
  }
137526
+ async sendLogin() {
137527
+ try {
137528
+ const result = await this.client.post(JsonRpcMethod.SESSION_LOGIN, {
137529
+ username: this.username,
137530
+ password: this.password
137531
+ });
137532
+ const id = String(result);
137533
+ this.currentSessionId = id;
137534
+ this.lastRefresh = this.now();
137535
+ this.resetBackoff();
137536
+ return id;
137537
+ } catch (err) {
137538
+ this.consecutiveFailures += 1;
137539
+ this.nextAttemptAt = this.now() + this.backoffDelayMs();
137540
+ throw err;
137541
+ }
137542
+ }
137543
+ /** Forget `id` if it is still the current session (a newer one stays). */
137544
+ dropSession(id) {
137545
+ if (this.currentSessionId === id) this.currentSessionId = void 0;
137546
+ }
135313
137547
  backoffDelayMs() {
135314
137548
  const exp = INITIAL_BACKOFF_MS * BACKOFF_FACTOR ** (this.consecutiveFailures - 1);
135315
137549
  return Math.min(exp, MAX_BACKOFF_MS);
@@ -137785,7 +140019,7 @@ var HubFetcher = class {
137785
140019
  this.client = options.client;
137786
140020
  this.getSessionId = options.getSessionId;
137787
140021
  }
137788
- sid() {
140022
+ async sid() {
137789
140023
  return this.getSessionId();
137790
140024
  }
137791
140025
  /**
@@ -137794,14 +140028,14 @@ var HubFetcher = class {
137794
140028
  * tolerated (such a variable is treated as read-only).
137795
140029
  */
137796
140030
  async fetchSystemVariables() {
137797
- const sid = this.sid();
140031
+ const sid = await this.sid();
137798
140032
  const entries = asRecordArray2(await this.client.post(JsonRpcMethod.SYSVAR_GET_ALL, void 0, sidOpts(sid)));
137799
140033
  const descriptions = await this.fetchSysVarDescriptions();
137800
140034
  return entries.map((entry) => this.toSystemVariable(entry, descriptions));
137801
140035
  }
137802
140036
  /** Read a single system variable's raw value by name. */
137803
140037
  async getSystemVariable(name2) {
137804
- const sid = this.sid();
140038
+ const sid = await this.sid();
137805
140039
  const raw = await this.client.post(JsonRpcMethod.SYSVAR_GET_VALUE_BY_NAME, { name: name2 }, sidOpts(sid));
137806
140040
  if (typeof raw === "string" || typeof raw === "number" || typeof raw === "boolean") return raw;
137807
140041
  if (raw === null || raw === void 0) return null;
@@ -137813,7 +140047,7 @@ var HubFetcher = class {
137813
140047
  * `SET_SYSTEM_VARIABLE`. A null value is rejected.
137814
140048
  */
137815
140049
  async setSystemVariable(name2, value) {
137816
- const sid = this.sid();
140050
+ const sid = await this.sid();
137817
140051
  if (value === null) throw new ValidationError(`Cannot set system variable "${name2}" to null`);
137818
140052
  if (typeof value === "boolean") {
137819
140053
  await this.client.post(JsonRpcMethod.SYSVAR_SET_BOOL, {
@@ -137836,7 +140070,7 @@ var HubFetcher = class {
137836
140070
  }
137837
140071
  /** Fetch all programs, coercing flags to booleans. */
137838
140072
  async fetchPrograms() {
137839
- const sid = this.sid();
140073
+ const sid = await this.sid();
137840
140074
  return asRecordArray2(await this.client.post(JsonRpcMethod.PROGRAM_GET_ALL, void 0, sidOpts(sid))).map((entry) => {
137841
140075
  const lastExecuteTime = entry.lastExecuteTime;
137842
140076
  return {
@@ -137850,12 +140084,12 @@ var HubFetcher = class {
137850
140084
  }
137851
140085
  /** Execute a program by id. */
137852
140086
  async runProgram(id) {
137853
- const sid = this.sid();
140087
+ const sid = await this.sid();
137854
140088
  await this.client.post(JsonRpcMethod.PROGRAM_EXECUTE, { id }, sidOpts(sid));
137855
140089
  }
137856
140090
  /** Enable/disable a program via the ReGa `SET_PROGRAM_STATE` script. */
137857
140091
  async setProgramActive(id, active) {
137858
- const sid = this.sid();
140092
+ const sid = await this.sid();
137859
140093
  await runScript(this.client, sid, SET_PROGRAM_STATE, {
137860
140094
  id,
137861
140095
  state: active ? 1 : 0
@@ -137866,7 +140100,7 @@ var HubFetcher = class {
137866
140100
  * channel address, decoding the latin1 `UriEncode`d names. Tolerates empty.
137867
140101
  */
137868
140102
  async fetchRoomsFunctions() {
137869
- const sid = this.sid();
140103
+ const sid = await this.sid();
137870
140104
  const parsed = await runScript(this.client, sid, GET_ROOMS_FUNCTIONS);
137871
140105
  return {
137872
140106
  rooms: toDecodedMap(isRecord5(parsed) ? parsed.rooms : void 0),
@@ -137875,7 +140109,7 @@ var HubFetcher = class {
137875
140109
  }
137876
140110
  /** Build the `SYSVAR_DESCRIPTIONS` map: sysvar id → description text. */
137877
140111
  async fetchSysVarDescriptions() {
137878
- const sid = this.sid();
140112
+ const sid = await this.sid();
137879
140113
  const out = /* @__PURE__ */ new Map();
137880
140114
  try {
137881
140115
  const parsed = await runScript(this.client, sid, SYSVAR_DESCRIPTIONS);
@@ -138511,10 +140745,14 @@ var CentralUnit = class {
138511
140745
  */
138512
140746
  getHubFetcher() {
138513
140747
  if (this.jsonClient === void 0) return void 0;
138514
- const client = this.jsonClient;
140748
+ const session = this.session;
140749
+ if (session === void 0) return new HubFetcher({
140750
+ client: this.jsonClient,
140751
+ getSessionId: () => void 0
140752
+ });
138515
140753
  return new HubFetcher({
138516
- client,
138517
- getSessionId: () => this.session?.sessionId
140754
+ client: session.boundClient(),
140755
+ getSessionId: () => session.ensureSession()
138518
140756
  });
138519
140757
  }
138520
140758
  /**
@@ -138525,7 +140763,7 @@ var CentralUnit = class {
138525
140763
  */
138526
140764
  getManagement() {
138527
140765
  return new CcuManagement({
138528
- json: this.jsonClient,
140766
+ json: this.session !== void 0 ? this.session.boundClient() : this.jsonClient,
138529
140767
  webUi: this.webUi,
138530
140768
  getSessionId: () => this.session !== void 0 ? this.session.ensureSession() : Promise.resolve(void 0),
138531
140769
  interfaceClient: (iface) => {
@@ -138715,13 +140953,14 @@ var CentralUnit = class {
138715
140953
  this.webUi = this.options.webUiClient;
138716
140954
  } else {
138717
140955
  const scheme = this.tls ? "https" : "http";
138718
- const client = new JsonRpcClient({ url: `${scheme}://${this.host}` });
140956
+ const client = new JsonRpcClient({ url: this.options.jsonRpcUrl ?? `${scheme}://${this.host}` });
138719
140957
  this.jsonClient = client;
138720
140958
  this.webUi = this.options.webUiClient ?? new WebUiHttpClient({ url: `${scheme}://${this.host}` });
138721
140959
  this.session = new SessionManager({
138722
140960
  client,
138723
140961
  username: this.credentials.username,
138724
- password: this.credentials.password
140962
+ password: this.credentials.password,
140963
+ now: this.now
138725
140964
  });
138726
140965
  }
138727
140966
  }
@@ -138871,8 +141110,9 @@ var CentralUnit = class {
138871
141110
  async fetchDetails() {
138872
141111
  if (this.jsonClient === void 0) return void 0;
138873
141112
  try {
138874
- const sessionId = this.session !== void 0 ? await this.session.ensureSession() : void 0;
138875
- return await mergeDetails(this.jsonClient, sessionId);
141113
+ if (this.session === void 0) return await mergeDetails(this.jsonClient);
141114
+ const sessionId = await this.session.ensureSession();
141115
+ return await mergeDetails(this.session.boundClient(), sessionId);
138876
141116
  } catch {
138877
141117
  return;
138878
141118
  }
@@ -139010,6 +141250,8 @@ var CentralUnit = class {
139010
141250
  } catch {}
139011
141251
  await runtime.client.initProxy();
139012
141252
  runtime.pingPong.reset();
141253
+ this.session?.resetBackoff();
141254
+ this.session?.markStale();
139013
141255
  }
139014
141256
  async reloadData(interfaceId2) {
139015
141257
  const runtime = this.runtimes.get(interfaceId2);
@@ -145109,6 +147351,7 @@ var HomematicGatewayDevice = class extends BaseDevice {
145109
147351
  const patch = gatewayMetadataPatch({ host: session.getConnection().host });
145110
147352
  const key = JSON.stringify(patch);
145111
147353
  if (key === this.lastMetadataKey) return;
147354
+ await this.declareIdentifiers({ host: session.getConnection().host });
145112
147355
  const action = this.ctx.api.deviceManager?.setMetadata;
145113
147356
  if (action === void 0) return;
145114
147357
  try {