@camstack/server 1.2.819 → 1.2.821

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 (102) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/api/core/cap-providers.js +32 -40
  3. package/dist/api/trpc/cap-route-error-formatter.js +19 -1
  4. package/dist/api/trpc/cap-router-runtime.js +23 -0
  5. package/dist/api/trpc/device-config-secret-redaction.js +1 -2
  6. package/dist/api/trpc/generated-cap-mounts.js +3 -1
  7. package/dist/api/trpc/generated-cap-routers.js +1855 -1723
  8. package/dist/api/trpc/localized-schema-paths.js +1 -1
  9. package/dist/api/trpc/trpc.router.js +1 -1
  10. package/dist/core/addon/addon-registry.service.js +2 -2
  11. package/dist/core/addon/addon-settings-provider.js +0 -23
  12. package/dist/core/addon/instance-lifecycle.js +44 -7
  13. package/package.json +13 -12
  14. package/system/dist/addon-runner.js +0 -1
  15. package/system/dist/addon-runner.mjs +0 -1
  16. package/system/dist/{agent-https-ChriyNA8.js → agent-https-Bp5yzi8b.js} +1 -1
  17. package/system/dist/{agent-https-rhOY61af.mjs → agent-https-N6Or6UAu.mjs} +1 -1
  18. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  19. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  20. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  21. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  22. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  23. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  24. package/system/dist/builtins/autotrack/index.js +1 -1
  25. package/system/dist/builtins/autotrack/index.mjs +1 -1
  26. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  27. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  28. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  29. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  30. package/system/dist/builtins/camera-grid/index.js +1 -1
  31. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  32. package/system/dist/builtins/composer/composer.addon.js +3 -3
  33. package/system/dist/builtins/composer/composer.addon.mjs +3 -3
  34. package/system/dist/builtins/console-logging/index.js +1 -1
  35. package/system/dist/builtins/console-logging/index.mjs +1 -1
  36. package/system/dist/builtins/core-blocks/blocks-instances.d.ts +2 -2
  37. package/system/dist/builtins/core-blocks/core-blocks.addon.js +14 -7
  38. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +12 -5
  39. package/system/dist/builtins/core-blocks/hero-layout-service.d.ts +2 -0
  40. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  41. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  42. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  43. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  44. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  45. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  46. package/system/dist/builtins/keychain/index.js +4 -4
  47. package/system/dist/builtins/keychain/index.mjs +4 -4
  48. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  49. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  50. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  51. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  52. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  53. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  54. package/system/dist/builtins/loki-logging/index.js +1 -1
  55. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  56. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  57. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  58. package/system/dist/builtins/platform-probe/index.js +1 -1
  59. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  60. package/system/dist/builtins/record-entries/index.js +1 -1
  61. package/system/dist/builtins/record-entries/index.mjs +1 -1
  62. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  63. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  64. package/system/dist/builtins/snapshot/index.js +1 -1
  65. package/system/dist/builtins/snapshot/index.mjs +1 -1
  66. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  67. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  68. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  69. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  70. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  71. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  72. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  73. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  74. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  75. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  76. package/system/dist/builtins/winston-logging/index.js +1 -1
  77. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  78. package/system/dist/{capture-engine-Cgt1r0h5.js → capture-engine-4lB0sLCf.js} +1 -1
  79. package/system/dist/{capture-engine-CoK1n1F1.mjs → capture-engine-Cz7z5d36.mjs} +1 -1
  80. package/system/dist/{composition-sources-DSU28FFP.mjs → composition-sources-C0e2g_VP.mjs} +1 -1
  81. package/system/dist/{composition-sources-TkHq8DdF.js → composition-sources-C9gEj25e.js} +1 -1
  82. package/system/dist/{constants-CCezBXPq.mjs → constants-CZMy7dor.mjs} +1 -1
  83. package/system/dist/{constants-D3mNibfv.js → constants-Cq3B9yzj.js} +1 -1
  84. package/system/dist/{device-ca-CEzeY_zI.js → device-ca-BenyQXJV.js} +1 -1
  85. package/system/dist/{device-ca-CjX1tQP7.mjs → device-ca-BmQ6N-A-.mjs} +1 -1
  86. package/system/dist/{dist-BNBgsEk0.mjs → dist-DuKMbGBM.mjs} +1534 -268
  87. package/system/dist/{dist-DX1gyM8o.js → dist-M5VX8Hqf.js} +1534 -268
  88. package/system/dist/file-host-worker.js +1 -1
  89. package/system/dist/file-host-worker.mjs +1 -1
  90. package/system/dist/{hub-mdns-ciao-BCfG7mv3.mjs → hub-mdns-ciao-CXBfBwAy.mjs} +2 -2
  91. package/system/dist/{hub-mdns-ciao-DBHvpWvv.js → hub-mdns-ciao-k3pOKWyZ.js} +2 -2
  92. package/system/dist/index.js +40 -11
  93. package/system/dist/index.mjs +40 -11
  94. package/system/dist/kernel/cap-router-builder.d.ts +9 -0
  95. package/system/dist/kernel/transport/child-cap-protocol.d.ts +1 -1
  96. package/system/dist/{legacy-integration-rows-door-C0X4Ijcr.mjs → legacy-integration-rows-door-C13OeuW9.mjs} +1 -1
  97. package/system/dist/{legacy-integration-rows-door-7K4_MoAP.js → legacy-integration-rows-door-mIpR3e6X.js} +1 -1
  98. package/system/dist/{restore-archive-DXlN0NYx.js → restore-archive-CCgt7SZ8.js} +1 -1
  99. package/system/dist/{restore-archive-WBDJlios.mjs → restore-archive-DDeQFJN5.mjs} +82 -82
  100. package/system/dist/{wal-maintenance-BJ0vDek1.mjs → wal-maintenance-Cj7xe4wN.mjs} +0 -0
  101. package/system/dist/{wal-maintenance-BPmo2JzY.js → wal-maintenance-D5M6hl53.js} +0 -0
  102. package/system/package.json +1 -1
@@ -803,7 +803,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
803
803
  return EventCategory;
804
804
  }({});
805
805
  //#endregion
806
- //#region ../types/dist/device-type-CbDhVwFP.mjs
806
+ //#region ../types/dist/device-type-DTTZKB2I.mjs
807
807
  /**
808
808
  import { errMsg } from '@camstack/types'
809
809
  * Extract a human-readable message from an unknown error value.
@@ -929,6 +929,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
929
929
  * (`reboot`, `device-admin-link`). Products are NOT its children — they are
930
930
  * adopted beside it — and its connection settings stay on the integration. */
931
931
  DeviceType["Gateway"] = "gateway";
932
+ /** A heat pump (any vendor): the compressor unit with its circuits (heating, hot
933
+ * water, cooling, solar), its system modes and its power. One main read-only
934
+ * `heat-pump-status` cap carries all of it; `heat-pump-control` sets it (D1026). */
935
+ DeviceType["HeatPump"] = "heat-pump";
932
936
  return DeviceType;
933
937
  }({});
934
938
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -1211,7 +1215,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1211
1215
  return DeviceRole;
1212
1216
  }({});
1213
1217
  //#endregion
1214
- //#region ../types/dist/sleep-CS5Xp1iQ.mjs
1218
+ //#region ../types/dist/sleep-DnVqHJc4.mjs
1215
1219
  /**
1216
1220
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1217
1221
  * window to float samples (D455).
@@ -4080,16 +4084,6 @@ var BaseAddon = class {
4080
4084
  return null;
4081
4085
  }
4082
4086
  /**
4083
- * The form schema of ONE integration instance, or `null` to use the scoped form.
4084
- *
4085
- * Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
4086
- * needs its connection fields, the default integration the addon's own sections. It is the
4087
- * SHAPE of the form only — the values live on the instance record.
4088
- */
4089
- async integrationFormSchema(_instance) {
4090
- return null;
4091
- }
4092
- /**
4093
4087
  * D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
4094
4088
  * provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
4095
4089
  * declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
@@ -4117,8 +4111,7 @@ var BaseAddon = class {
4117
4111
  }
4118
4112
  /**
4119
4113
  * The host's read of the scoped declarations: the schema one capability declares for `scope`,
4120
- * or `null`. Beside {@link getIntegrationFormSchema}, the same shape: the hook is protected, the
4121
- * host asks this method.
4114
+ * or `null`. The hook is protected, the host asks this method.
4122
4115
  */
4123
4116
  async getScopedSettingsSchema(scope, cap) {
4124
4117
  switch (scope) {
@@ -4286,22 +4279,6 @@ var BaseAddon = class {
4286
4279
  return Object.fromEntries([...collectHydratedFieldValues(form)].filter(([, value]) => value !== void 0));
4287
4280
  }
4288
4281
  /**
4289
- * What the create wizard and the integration edit page render for one instance: the addon's
4290
- * per-instance schema when it declares one, else its global schema (what they always showed).
4291
- */
4292
- async getIntegrationFormSchema(instance, nodeId) {
4293
- const scoped = await this.integrationFormSchema(instance);
4294
- if (scoped === null) return this.scopedForm(nodeId);
4295
- return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
4296
- }
4297
- /** The form of the scoped schemas this addon declared, hydrated from its store. */
4298
- async scopedForm(nodeId) {
4299
- await this.loadScopedSchemas();
4300
- const schema = this.scopedFormSchema();
4301
- if (!schema) return { sections: [] };
4302
- return hydrateSchema(schema, await this.readRawProjectedStore(nodeId), { inlineSecretsAsViews: true });
4303
- }
4304
- /**
4305
4282
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
4306
4283
  * every `perNode: true` field carries THAT node's scoped value on its bare
4307
4284
  * key (absent scoped key ⇒ key absent, so the schema `default` wins — no
@@ -4488,12 +4465,6 @@ var BaseAddon = class {
4488
4465
  this._nodeKeysByCap = /* @__PURE__ */ new Map();
4489
4466
  this._addonSecretTree = null;
4490
4467
  }
4491
- /** The form of an addon's scoped schemas: their sections, each shown once. */
4492
- scopedFormSchema(cap) {
4493
- const byId = /* @__PURE__ */ new Map();
4494
- for (const entry of this.loadedScopedSchemas(cap)) for (const section of entry.schema.sections) if (!byId.has(section.id)) byId.set(section.id, section);
4495
- return byId.size === 0 ? null : { sections: [...byId.values()] };
4496
- }
4497
4468
  /** Every loaded scoped schema of `cap`, or of every loaded capability. */
4498
4469
  loadedScopedSchemas(cap) {
4499
4470
  if (cap !== void 0) return this._scopedByCap.get(cap) ?? [];
@@ -5083,6 +5054,35 @@ function normalizeAddonInitResult(result) {
5083
5054
  if (Array.isArray(result)) return { providers: result };
5084
5055
  return result;
5085
5056
  }
5057
+ /**
5058
+ * A user-facing error with a STABLE code (D863).
5059
+ *
5060
+ * `message` is always the English text, so every consumer that knows nothing
5061
+ * of codes (old clients, logs, the mesh) behaves exactly as before. The hub's
5062
+ * tRPC error formatter reads `code` + `params` and, when the request language
5063
+ * has a text for `server:<code>`, replaces the response `message`; the code
5064
+ * stays in the payload (`data.i18n`).
5065
+ */
5066
+ /** Dotted lower-case code, e.g. `auth.invalid-credentials`. It is the key in the `server` catalog. */
5067
+ var ErrorCodeSchema = z.string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/);
5068
+ z.object({
5069
+ code: ErrorCodeSchema,
5070
+ params: z.record(z.string(), z.union([z.string(), z.number()])).optional()
5071
+ });
5072
+ var CamstackError = class extends Error {
5073
+ i18nCode;
5074
+ i18nParams;
5075
+ constructor(code, params, englishMessage) {
5076
+ super(englishMessage);
5077
+ this.name = "CamstackError";
5078
+ this.i18nCode = code;
5079
+ this.i18nParams = params;
5080
+ }
5081
+ };
5082
+ /** `throw userError('device.not-found', { id }, 'Device 12 not found')` */
5083
+ function userError(code, params, englishFallback) {
5084
+ return new CamstackError(code, params, englishFallback);
5085
+ }
5086
5086
  z.object({
5087
5087
  field: z.string().min(1),
5088
5088
  on: z.literal("advance")
@@ -5236,12 +5236,6 @@ function systemMethod(input, output, options) {
5236
5236
  systemOnly: true
5237
5237
  };
5238
5238
  }
5239
- /**
5240
- * A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
5241
- * on `InferProvider`. The `providerOptional: true` literal is what
5242
- * `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
5243
- * for when this is the honest answer and when it is a soft stub.
5244
- */
5245
5239
  function optionalMethod(input, output, options) {
5246
5240
  return {
5247
5241
  ...method(input, output, options),
@@ -6590,7 +6584,7 @@ function t(en, it) {
6590
6584
  * Things an operator switches, opens, sets or arms: lights, plugs, sirens,
6591
6585
  * covers, valves, locks, climate, fans, alarm panels.
6592
6586
  */
6593
- var ON = t("On", "Acceso");
6587
+ var ON$1 = t("On", "Acceso");
6594
6588
  var PERCENT = t("Percentage", "Percentuale");
6595
6589
  var OPEN_CLOSE_STATES = [
6596
6590
  {
@@ -6650,7 +6644,7 @@ var ACTUATOR_CAP_VOCABULARY = {
6650
6644
  state: [{
6651
6645
  kind: "boolean",
6652
6646
  field: "on",
6653
- label: ON,
6647
+ label: ON$1,
6654
6648
  whenTrue: t("When {device} turns on", "Quando {device} si accende"),
6655
6649
  whenFalse: t("When {device} turns off", "Quando {device} si spegne"),
6656
6650
  icon: "power"
@@ -7816,7 +7810,7 @@ var ACTUATOR_CAP_VOCABULARY = {
7816
7810
  state: [{
7817
7811
  kind: "boolean",
7818
7812
  field: "on",
7819
- label: ON,
7813
+ label: ON$1,
7820
7814
  whenTrue: t("When {device} turns on", "Quando {device} si accende"),
7821
7815
  whenFalse: t("When {device} turns off", "Quando {device} si spegne"),
7822
7816
  icon: "power"
@@ -10228,6 +10222,133 @@ var CAMERA_CAP_VOCABULARY = {
10228
10222
  }
10229
10223
  };
10230
10224
  /**
10225
+ * The heat pump (D1026): its system modes are phrased for automations, each with the
10226
+ * values the gateway really accepts; the per-circuit parameters need a circuit and are
10227
+ * set from the device page.
10228
+ */
10229
+ var OFF = {
10230
+ value: "off",
10231
+ label: t("Off", "Off")
10232
+ };
10233
+ var AUTO$1 = {
10234
+ value: "auto",
10235
+ label: t("Auto", "Auto")
10236
+ };
10237
+ var ON = {
10238
+ value: "on",
10239
+ label: t("On", "On")
10240
+ };
10241
+ var MANUAL = {
10242
+ value: "manual",
10243
+ label: t("Manual", "Manuale")
10244
+ };
10245
+ var HOLIDAY_PROGRAMMES = [OFF, ...[
10246
+ 1,
10247
+ 2,
10248
+ 3,
10249
+ 4,
10250
+ 5,
10251
+ 6,
10252
+ 7,
10253
+ 8
10254
+ ].map((n) => ({
10255
+ value: `hm${n}`,
10256
+ label: t(`Programme ${n}`, `Programma ${n}`)
10257
+ }))];
10258
+ var PER_CIRCUIT = "Needs a circuit: set from the device page, not offered to automations";
10259
+ var HEAT_PUMP_CAP_VOCABULARY = {
10260
+ "heat-pump-status": {
10261
+ scope: "device",
10262
+ noun: t("Heat pump", "Pompa di calore")
10263
+ },
10264
+ "heat-pump-control": {
10265
+ scope: "device",
10266
+ noun: t("Heat pump settings", "Impostazioni pompa di calore"),
10267
+ actions: [
10268
+ {
10269
+ id: "heatPump.silent",
10270
+ method: "setSilentMode",
10271
+ label: t("Set silent mode", "Imposta la modalità silenziosa"),
10272
+ phrase: t("Set silent mode of {device} to {mode}", "Imposta la modalità silenziosa di {device} su {mode}"),
10273
+ icon: "volume-x",
10274
+ openArgs: [{
10275
+ key: "mode",
10276
+ label: t("Silent mode", "Modalità silenziosa"),
10277
+ offer: {
10278
+ kind: "enum",
10279
+ values: [
10280
+ OFF,
10281
+ AUTO$1,
10282
+ ON
10283
+ ]
10284
+ }
10285
+ }]
10286
+ },
10287
+ {
10288
+ id: "heatPump.away",
10289
+ method: "setAwayMode",
10290
+ label: t("Set away mode", "Imposta la modalità assente"),
10291
+ phrase: t("Set away mode of {device} to {mode}", "Imposta la modalità assente di {device} su {mode}"),
10292
+ icon: "plane",
10293
+ openArgs: [{
10294
+ key: "mode",
10295
+ label: t("Away mode", "Modalità assente"),
10296
+ offer: {
10297
+ kind: "enum",
10298
+ values: [OFF, ON]
10299
+ }
10300
+ }]
10301
+ },
10302
+ {
10303
+ id: "heatPump.additionalHeater",
10304
+ method: "setAdditionalHeaterMode",
10305
+ label: t("Set additional heater", "Imposta il riscaldatore aggiuntivo"),
10306
+ phrase: t("Set the additional heater of {device} to {mode}", "Imposta il riscaldatore aggiuntivo di {device} su {mode}"),
10307
+ icon: "flame",
10308
+ openArgs: [{
10309
+ key: "mode",
10310
+ label: t("Additional heater", "Riscaldatore aggiuntivo"),
10311
+ offer: {
10312
+ kind: "enum",
10313
+ values: [
10314
+ OFF,
10315
+ MANUAL,
10316
+ AUTO$1
10317
+ ]
10318
+ }
10319
+ }]
10320
+ },
10321
+ {
10322
+ id: "heatPump.holiday",
10323
+ method: "setHolidayMode",
10324
+ label: t("Set holiday mode", "Imposta la modalità vacanza"),
10325
+ phrase: t("Set holiday mode of {device} to {mode}", "Imposta la modalità vacanza di {device} su {mode}"),
10326
+ icon: "tree-palm",
10327
+ openArgs: [{
10328
+ key: "mode",
10329
+ label: t("Holiday programme", "Programma vacanza"),
10330
+ offer: {
10331
+ kind: "enum",
10332
+ values: HOLIDAY_PROGRAMMES
10333
+ }
10334
+ }]
10335
+ }
10336
+ ],
10337
+ notOperatorFacing: {
10338
+ setCircuitOperationMode: PER_CIRCUIT,
10339
+ setCircuitHeatCoolMode: PER_CIRCUIT,
10340
+ setCircuitSummerWinter: PER_CIRCUIT,
10341
+ setCircuitComfortSetpoint: PER_CIRCUIT,
10342
+ setCircuitEcoSetpoint: PER_CIRCUIT,
10343
+ setCircuitMaxFlowTemp: PER_CIRCUIT,
10344
+ setDhwOperationMode: PER_CIRCUIT,
10345
+ setDhwTemperatureLevel: PER_CIRCUIT,
10346
+ setDhwChargeDuration: PER_CIRCUIT,
10347
+ startExtraHotWater: PER_CIRCUIT
10348
+ }
10349
+ }
10350
+ };
10351
+ /**
10231
10352
  * Things an operator WATCHES: contacts, motion, leaks, smoke, measurements,
10232
10353
  * presence, reachability, batteries, doorbells and event sources.
10233
10354
  */
@@ -10949,6 +11070,7 @@ var CAP_VOCABULARY_BY_NAME = {
10949
11070
  ...ACTUATOR_CAP_VOCABULARY,
10950
11071
  ...APPLIANCE_CAP_VOCABULARY,
10951
11072
  ...CAMERA_CAP_VOCABULARY,
11073
+ ...HEAT_PUMP_CAP_VOCABULARY,
10952
11074
  ...SENSOR_CAP_VOCABULARY,
10953
11075
  ...SYSTEM_CAP_VOCABULARY
10954
11076
  };
@@ -11494,6 +11616,8 @@ var CAP_NAMES = Object.freeze([
11494
11616
  "group-active",
11495
11617
  "group-commands",
11496
11618
  "group-status",
11619
+ "heat-pump-control",
11620
+ "heat-pump-status",
11497
11621
  "heating-valve",
11498
11622
  "hero-layout",
11499
11623
  "humidifier",
@@ -12359,6 +12483,48 @@ Object.freeze({
12359
12483
  "valueType": "number"
12360
12484
  }
12361
12485
  ],
12486
+ "heat-pump-status": [
12487
+ {
12488
+ "path": "power.thermalW",
12489
+ "valueType": "number"
12490
+ },
12491
+ {
12492
+ "path": "power.electricalW",
12493
+ "valueType": "number"
12494
+ },
12495
+ {
12496
+ "path": "power.compressorPct",
12497
+ "valueType": "number"
12498
+ },
12499
+ {
12500
+ "path": "temperatures.supply",
12501
+ "valueType": "number"
12502
+ },
12503
+ {
12504
+ "path": "temperatures.return",
12505
+ "valueType": "number"
12506
+ },
12507
+ {
12508
+ "path": "temperatures.outdoor",
12509
+ "valueType": "number"
12510
+ },
12511
+ {
12512
+ "path": "energy.thermalKwh",
12513
+ "valueType": "number"
12514
+ },
12515
+ {
12516
+ "path": "energy.electricalKwh",
12517
+ "valueType": "number"
12518
+ },
12519
+ {
12520
+ "path": "waterPressureBar",
12521
+ "valueType": "number"
12522
+ },
12523
+ {
12524
+ "path": "starts",
12525
+ "valueType": "number"
12526
+ }
12527
+ ],
12362
12528
  "heating-valve": [{
12363
12529
  "path": "position",
12364
12530
  "valueType": "number"
@@ -13574,35 +13740,6 @@ function auditedFields(cap) {
13574
13740
  return fieldsByCap.get(cap) ?? NO_FIELDS;
13575
13741
  }
13576
13742
  /**
13577
- * A user-facing error with a STABLE code (D863).
13578
- *
13579
- * `message` is always the English text, so every consumer that knows nothing
13580
- * of codes (old clients, logs, the mesh) behaves exactly as before. The hub's
13581
- * tRPC error formatter reads `code` + `params` and, when the request language
13582
- * has a text for `server:<code>`, replaces the response `message`; the code
13583
- * stays in the payload (`data.i18n`).
13584
- */
13585
- /** Dotted lower-case code, e.g. `auth.invalid-credentials`. It is the key in the `server` catalog. */
13586
- var ErrorCodeSchema = z.string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/);
13587
- z.object({
13588
- code: ErrorCodeSchema,
13589
- params: z.record(z.string(), z.union([z.string(), z.number()])).optional()
13590
- });
13591
- var CamstackError = class extends Error {
13592
- i18nCode;
13593
- i18nParams;
13594
- constructor(code, params, englishMessage) {
13595
- super(englishMessage);
13596
- this.name = "CamstackError";
13597
- this.i18nCode = code;
13598
- this.i18nParams = params;
13599
- }
13600
- };
13601
- /** `throw userError('device.not-found', { id }, 'Device 12 not found')` */
13602
- function userError(code, params, englishFallback) {
13603
- return new CamstackError(code, params, englishFallback);
13604
- }
13605
- /**
13606
13743
  * Type-safe JSON parsing helpers.
13607
13744
  *
13608
13745
  * `JSON.parse` is typed as `any` in lib.es5.d.ts, which triggers
@@ -13668,7 +13805,7 @@ function sleep(ms) {
13668
13805
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
13669
13806
  }
13670
13807
  //#endregion
13671
- //#region ../types/dist/composition-CXCX78IR.mjs
13808
+ //#region ../types/dist/composition-C6TZGqUb.mjs
13672
13809
  var AUDIO_ENCODER_BY_CODEC = {
13673
13810
  opus: "libopus",
13674
13811
  aac: "aac",
@@ -17011,25 +17148,6 @@ function describeUnmet(unmet) {
17011
17148
  }
17012
17149
  }
17013
17150
  /**
17014
- * Which integration instance a settings form is for. An addon that serves several instances
17015
- * (`instanceMode: multiple`) can show a different form per instance — an NVR integration
17016
- * needs its connection, the default integration needs the addon's own sections.
17017
- *
17018
- * - `integrationId` is `null` in the create wizard: nothing exists yet, the operator is
17019
- * setting up a NEW instance.
17020
- * - `mode` is the wizard mode of the integration type (`getAvailableTypes`).
17021
- * - `candidateStableId` is the discovery candidate a wizard was seeded from, if any.
17022
- */
17023
- var IntegrationInstanceRefSchema = z.object({
17024
- integrationId: z.string().nullable(),
17025
- mode: z.enum([
17026
- "standalone",
17027
- "account",
17028
- "broker"
17029
- ]),
17030
- candidateStableId: z.string().optional()
17031
- });
17032
- /**
17033
17151
  * notification-output — canonical, capability-gated notification delivery.
17034
17152
  *
17035
17153
  * Apprise-derived model (see
@@ -45919,11 +46037,6 @@ var addonSettingsCapability = {
45919
46037
  scope: ScopedSettingsScopeSchema,
45920
46038
  nodeId: z.string().optional()
45921
46039
  }), z.record(z.string(), z.unknown()).nullable()),
45922
- getIntegrationFormSchema: method(z.object({
45923
- addonId: z.string(),
45924
- nodeId: z.string().optional(),
45925
- instance: IntegrationInstanceRefSchema
45926
- }), SettingsSchemaWithValuesSchema.nullable()),
45927
46040
  getDeclaredSettingsKeys: method(z.object({
45928
46041
  addonId: z.string(),
45929
46042
  nodeId: z.string().optional()
@@ -52073,7 +52186,7 @@ function irSourceProblem(source) {
52073
52186
  throw err;
52074
52187
  }
52075
52188
  }
52076
- function same$1(a, b) {
52189
+ function same$2(a, b) {
52077
52190
  return a.trim().toLowerCase() === b.trim().toLowerCase();
52078
52191
  }
52079
52192
  /** The `digits` source that declares this channel number, or null. */
@@ -52087,7 +52200,7 @@ function findChannelSource(sources, number) {
52087
52200
  * the number reach the same source; nothing else is guessed.
52088
52201
  */
52089
52202
  function resolveRemoteSource(sources, query) {
52090
- const byName = sources.find((source) => same$1(source.name, query));
52203
+ const byName = sources.find((source) => same$2(source.name, query));
52091
52204
  if (byName !== void 0) return byName;
52092
52205
  const byId = sources.find((source) => source.id === query.trim());
52093
52206
  if (byId !== void 0) return byId;
@@ -52449,7 +52562,8 @@ var CAP_CUSTOMIZE_CATALOG = {
52449
52562
  DeviceType.Washer,
52450
52563
  DeviceType.Heater,
52451
52564
  DeviceType.Dryer,
52452
- DeviceType.Gateway
52565
+ DeviceType.Gateway,
52566
+ DeviceType.HeatPump
52453
52567
  ],
52454
52568
  apply: "add",
52455
52569
  vocabularyCap: "consumables",
@@ -54033,7 +54147,7 @@ async function runFanOut(calls, invoke) {
54033
54147
  }
54034
54148
  /**
54035
54149
  * Cap history catalog, projected from every `*.cap.ts` `history` block.
54036
- * 43 caps with series (79 series), 37 caps answered `'none'`.
54150
+ * 44 caps with series (87 series), 37 caps answered `'none'`.
54037
54151
  * Field keys are `runtimeState` paths (`a.b` into fixed objects only).
54038
54152
  */
54039
54153
  var HISTORY_CATALOG = {
@@ -54191,6 +54305,54 @@ var HISTORY_CATALOG = {
54191
54305
  },
54192
54306
  "flood": { "flooded": { kind: "boolean" } },
54193
54307
  "gas": { "detected": { kind: "boolean" } },
54308
+ "heat-pump-status": {
54309
+ "power.thermalW": {
54310
+ kind: "gauge",
54311
+ unit: "W",
54312
+ deadband: 50,
54313
+ displayName: "Thermal power"
54314
+ },
54315
+ "power.electricalW": {
54316
+ kind: "gauge",
54317
+ unit: "W",
54318
+ deadband: 50,
54319
+ displayName: "Electrical power"
54320
+ },
54321
+ "power.compressorPct": {
54322
+ kind: "gauge",
54323
+ unit: "%",
54324
+ deadband: 2,
54325
+ displayName: "Compressor"
54326
+ },
54327
+ "temperatures.supply": {
54328
+ kind: "gauge",
54329
+ unit: "°C",
54330
+ deadband: .5,
54331
+ displayName: "Supply"
54332
+ },
54333
+ "temperatures.return": {
54334
+ kind: "gauge",
54335
+ unit: "°C",
54336
+ deadband: .5,
54337
+ displayName: "Return"
54338
+ },
54339
+ "temperatures.outdoor": {
54340
+ kind: "gauge",
54341
+ unit: "°C",
54342
+ deadband: .5,
54343
+ displayName: "Outdoor"
54344
+ },
54345
+ "energy.thermalKwh": {
54346
+ kind: "counter",
54347
+ unit: "kWh",
54348
+ displayName: "Thermal energy"
54349
+ },
54350
+ "energy.electricalKwh": {
54351
+ kind: "counter",
54352
+ unit: "kWh",
54353
+ displayName: "Electrical energy"
54354
+ }
54355
+ },
54194
54356
  "heating-valve": { "position": {
54195
54357
  kind: "gauge",
54196
54358
  unit: "%",
@@ -54404,38 +54566,63 @@ var HISTORY_CATALOG = {
54404
54566
  };
54405
54567
  /**
54406
54568
  * Keyed-array series (D917), projected from every `history.items` block:
54407
- * 1 caps (3 item fields). The item key is the series SCOPE;
54569
+ * 2 caps (6 item fields). The item key is the series SCOPE;
54408
54570
  * the series key is `cap:<capName>.<path>[].<field>`.
54409
54571
  */
54410
- var HISTORY_ITEM_CATALOG = { "consumables": {
54411
- path: "items",
54412
- key: "key",
54413
- label: "label",
54414
- fields: {
54415
- "level": {
54416
- kind: "gauge",
54417
- unit: "%",
54418
- deadband: 2,
54419
- displayName: "Level"
54420
- },
54421
- "status": {
54422
- kind: "enum",
54423
- displayName: "Status",
54424
- values: [
54425
- "ok",
54426
- "low",
54427
- "empty",
54428
- "full",
54429
- "replace"
54430
- ]
54431
- },
54432
- "remaining.value": {
54433
- kind: "gauge",
54434
- deadband: 1,
54435
- displayName: "Remaining"
54572
+ var HISTORY_ITEM_CATALOG = {
54573
+ "consumables": {
54574
+ path: "items",
54575
+ key: "key",
54576
+ label: "label",
54577
+ fields: {
54578
+ "level": {
54579
+ kind: "gauge",
54580
+ unit: "%",
54581
+ deadband: 2,
54582
+ displayName: "Level"
54583
+ },
54584
+ "status": {
54585
+ kind: "enum",
54586
+ displayName: "Status",
54587
+ values: [
54588
+ "ok",
54589
+ "low",
54590
+ "empty",
54591
+ "full",
54592
+ "replace"
54593
+ ]
54594
+ },
54595
+ "remaining.value": {
54596
+ kind: "gauge",
54597
+ deadband: 1,
54598
+ displayName: "Remaining"
54599
+ }
54600
+ }
54601
+ },
54602
+ "heat-pump-status": {
54603
+ path: "circuits",
54604
+ key: "id",
54605
+ label: "label",
54606
+ fields: {
54607
+ "currentTemp": {
54608
+ kind: "gauge",
54609
+ unit: "°C",
54610
+ deadband: .5,
54611
+ displayName: "Temperature"
54612
+ },
54613
+ "targetTemp": {
54614
+ kind: "gauge",
54615
+ unit: "°C",
54616
+ minIntervalMs: 0,
54617
+ displayName: "Setpoint"
54618
+ },
54619
+ "mode": {
54620
+ kind: "enum",
54621
+ displayName: "Mode"
54622
+ }
54436
54623
  }
54437
54624
  }
54438
- } };
54625
+ };
54439
54626
  /** The series specs of `capName`; empty for a `'none'` cap or an unknown one. */
54440
54627
  function historyFieldsFor(capName) {
54441
54628
  return HISTORY_CATALOG[capName] ?? {};
@@ -62901,6 +63088,332 @@ var groupStatusCapability = {
62901
63088
  durability: "session",
62902
63089
  history: "none"
62903
63090
  };
63091
+ /**
63092
+ * Heat pump settable surface (D1026): one typed method per parameter, never a
63093
+ * generic `set(key, value)`. The values a mode takes and the limits of a number
63094
+ * are the ones `heat-pump-status` carries (`allowed`, `min`, `max`, `step`),
63095
+ * read from the gateway; a provider refuses a value outside them. The state is
63096
+ * `heat-pump-status` — this cap has none.
63097
+ */
63098
+ var deviceId = z.number().int().nonnegative();
63099
+ var circuitId = z.string().min(1);
63100
+ var mode = z.string().min(1);
63101
+ var temp = z.number().finite();
63102
+ var heatPumpControlCapability = {
63103
+ name: "heat-pump-control",
63104
+ scope: "device",
63105
+ deviceNative: true,
63106
+ mode: "singleton",
63107
+ deviceTypes: [DeviceType.HeatPump],
63108
+ methods: {
63109
+ /** off / auto / on. */
63110
+ setSilentMode: method(z.object({
63111
+ deviceId,
63112
+ mode
63113
+ }), z.void(), {
63114
+ kind: "mutation",
63115
+ auth: "protected"
63116
+ }),
63117
+ /** off / on. */
63118
+ setAwayMode: method(z.object({
63119
+ deviceId,
63120
+ mode
63121
+ }), z.void(), {
63122
+ kind: "mutation",
63123
+ auth: "protected"
63124
+ }),
63125
+ /** off / manual / auto. */
63126
+ setAdditionalHeaterMode: method(z.object({
63127
+ deviceId,
63128
+ mode
63129
+ }), z.void(), {
63130
+ kind: "mutation",
63131
+ auth: "protected"
63132
+ }),
63133
+ /** off / hm1 .. hm8 (the programmes the gateway lists). */
63134
+ setHolidayMode: method(z.object({
63135
+ deviceId,
63136
+ mode
63137
+ }), z.void(), {
63138
+ kind: "mutation",
63139
+ auth: "protected"
63140
+ }),
63141
+ setCircuitOperationMode: method(z.object({
63142
+ deviceId,
63143
+ circuitId,
63144
+ mode
63145
+ }), z.void(), {
63146
+ kind: "mutation",
63147
+ auth: "protected"
63148
+ }),
63149
+ setCircuitHeatCoolMode: method(z.object({
63150
+ deviceId,
63151
+ circuitId,
63152
+ mode
63153
+ }), z.void(), {
63154
+ kind: "mutation",
63155
+ auth: "protected"
63156
+ }),
63157
+ setCircuitSummerWinter: method(z.object({
63158
+ deviceId,
63159
+ circuitId,
63160
+ mode
63161
+ }), z.void(), {
63162
+ kind: "mutation",
63163
+ auth: "protected"
63164
+ }),
63165
+ setCircuitComfortSetpoint: method(z.object({
63166
+ deviceId,
63167
+ circuitId,
63168
+ temp
63169
+ }), z.void(), {
63170
+ kind: "mutation",
63171
+ auth: "protected"
63172
+ }),
63173
+ setCircuitEcoSetpoint: method(z.object({
63174
+ deviceId,
63175
+ circuitId,
63176
+ temp
63177
+ }), z.void(), {
63178
+ kind: "mutation",
63179
+ auth: "protected"
63180
+ }),
63181
+ setCircuitMaxFlowTemp: method(z.object({
63182
+ deviceId,
63183
+ circuitId,
63184
+ temp
63185
+ }), z.void(), {
63186
+ kind: "mutation",
63187
+ auth: "protected"
63188
+ }),
63189
+ setDhwOperationMode: method(z.object({
63190
+ deviceId,
63191
+ circuitId,
63192
+ mode
63193
+ }), z.void(), {
63194
+ kind: "mutation",
63195
+ auth: "protected"
63196
+ }),
63197
+ setDhwTemperatureLevel: method(z.object({
63198
+ deviceId,
63199
+ circuitId,
63200
+ level: mode
63201
+ }), z.void(), {
63202
+ kind: "mutation",
63203
+ auth: "protected"
63204
+ }),
63205
+ setDhwChargeDuration: method(z.object({
63206
+ deviceId,
63207
+ circuitId,
63208
+ minutes: z.number().int().positive()
63209
+ }), z.void(), {
63210
+ kind: "mutation",
63211
+ auth: "protected"
63212
+ }),
63213
+ /** Start an extra-hot-water charge now: an action, not a stored mode. */
63214
+ startExtraHotWater: method(z.object({
63215
+ deviceId,
63216
+ circuitId
63217
+ }), z.void(), {
63218
+ kind: "mutation",
63219
+ auth: "protected"
63220
+ })
63221
+ }
63222
+ };
63223
+ var HeatPumpCircuitKindSchema = z.enum([
63224
+ "heating",
63225
+ "dhw",
63226
+ "cooling",
63227
+ "solar"
63228
+ ]);
63229
+ /** A setting that takes one of a list of values the gateway named. */
63230
+ var HeatPumpOptionSettingSchema = z.object({
63231
+ /** The active value. Null when the gateway did not answer. */
63232
+ value: z.string().nullable(),
63233
+ /** Values the gateway accepts, in its order. Empty = read-only here. */
63234
+ allowed: z.array(z.string())
63235
+ });
63236
+ /** A numeric setting with the limits the gateway named. */
63237
+ var HeatPumpRangeSettingSchema = z.object({
63238
+ value: z.number().nullable(),
63239
+ min: z.number().nullable(),
63240
+ max: z.number().nullable(),
63241
+ step: z.number().nullable()
63242
+ });
63243
+ var HeatPumpCircuitSchema = z.object({
63244
+ /** Gateway id of the circuit (`hc1`, `dhw1`): the key of the series. */
63245
+ id: z.string().min(1),
63246
+ kind: HeatPumpCircuitKindSchema,
63247
+ label: z.string(),
63248
+ icon: IconKeySchema,
63249
+ /** Measured temperature of the circuit (room, tank, collector). */
63250
+ currentTemp: z.number().nullable().meta(readingMeta("temperature")),
63251
+ /** The setpoint in force now. */
63252
+ targetTemp: z.number().nullable().meta(readingMeta("temperature")),
63253
+ /** The operation mode in force (mirror of `operationMode.value`, for the series). */
63254
+ mode: z.string().nullable(),
63255
+ /** Whether the circuit is calling for heat right now. Null = unknown. */
63256
+ active: z.boolean().nullable(),
63257
+ operationMode: HeatPumpOptionSettingSchema.nullable(),
63258
+ /** Heating circuits: heat / cool / heatCool. */
63259
+ heatCoolMode: HeatPumpOptionSettingSchema.nullable(),
63260
+ /** Heating circuits: summer / winter changeover. */
63261
+ summerWinter: HeatPumpOptionSettingSchema.nullable(),
63262
+ comfortSetpoint: HeatPumpRangeSettingSchema.nullable(),
63263
+ ecoSetpoint: HeatPumpRangeSettingSchema.nullable(),
63264
+ maxFlowTemp: HeatPumpRangeSettingSchema.nullable(),
63265
+ /** Hot water: the temperature level (off / low / high / eco). */
63266
+ temperatureLevel: HeatPumpOptionSettingSchema.nullable(),
63267
+ /** Hot water: how long a charge lasts, minutes. */
63268
+ chargeDuration: HeatPumpRangeSettingSchema.nullable(),
63269
+ /** Hot water: whether an extra-hot-water charge is running. Null = no such surface. */
63270
+ extraHotWater: z.boolean().nullable()
63271
+ });
63272
+ /** The independent system modes, each with its real values. A null mode = the gateway has none. */
63273
+ var HeatPumpSystemSchema = z.object({
63274
+ silent: HeatPumpOptionSettingSchema.nullable(),
63275
+ away: HeatPumpOptionSettingSchema.nullable(),
63276
+ additionalHeater: HeatPumpOptionSettingSchema.nullable(),
63277
+ holiday: HeatPumpOptionSettingSchema.nullable()
63278
+ });
63279
+ var HeatPumpPowerSchema = z.object({
63280
+ thermalW: z.number().nullable().meta(readingMeta("power")),
63281
+ electricalW: z.number().nullable().meta(readingMeta("power")),
63282
+ /** Compressor modulation, percent. */
63283
+ compressorPct: z.number().nullable().meta(readingMeta("percentage"))
63284
+ });
63285
+ var HeatPumpTemperaturesSchema = z.object({
63286
+ supply: z.number().nullable().meta(readingMeta("temperature")),
63287
+ return: z.number().nullable().meta(readingMeta("temperature")),
63288
+ outdoor: z.number().nullable().meta(readingMeta("temperature"))
63289
+ });
63290
+ /** Lifetime meters, kWh: the energy of a period is computed at read time from their difference (D944). */
63291
+ var HeatPumpEnergySchema = z.object({
63292
+ thermalKwh: z.number().nullable().meta(readingMeta("energy")),
63293
+ electricalKwh: z.number().nullable().meta(readingMeta("energy"))
63294
+ });
63295
+ var HeatPumpStatusSchema = z.object({
63296
+ circuits: z.array(HeatPumpCircuitSchema),
63297
+ system: HeatPumpSystemSchema,
63298
+ power: HeatPumpPowerSchema,
63299
+ temperatures: HeatPumpTemperaturesSchema,
63300
+ energy: HeatPumpEnergySchema,
63301
+ /** Water pressure of the heating loop, bar. */
63302
+ waterPressureBar: z.number().nullable(),
63303
+ /** Compressor starts since commissioning. */
63304
+ starts: z.number().nullable(),
63305
+ /** Ms epoch when the slice was last read from the gateway. */
63306
+ lastFetchedAt: z.number()
63307
+ });
63308
+ /**
63309
+ * The instantaneous COP: thermal over electrical power. Null unless BOTH powers
63310
+ * are known and the unit draws power — a missing reading is never a 0 or a
63311
+ * division by it (D393). Computed on every read; there is no stored value.
63312
+ */
63313
+ function heatPumpInstantCop(power) {
63314
+ const { thermalW, electricalW } = power;
63315
+ if (thermalW === null || electricalW === null || electricalW <= 0) return null;
63316
+ return thermalW / electricalW;
63317
+ }
63318
+ var heatPumpStatusCapability = {
63319
+ name: "heat-pump-status",
63320
+ scope: "device",
63321
+ deviceNative: true,
63322
+ mode: "singleton",
63323
+ deviceTypes: [DeviceType.HeatPump],
63324
+ methods: {},
63325
+ status: {
63326
+ schema: HeatPumpStatusSchema,
63327
+ kind: "push"
63328
+ },
63329
+ runtimeState: HeatPumpStatusSchema,
63330
+ /**
63331
+ * Runtime-state durability: **session** — a heat pump's gateway answers on the
63332
+ * next poll, so a restart that clears the slice loses nothing a reader needs
63333
+ * (the series are recorded). See `RuntimeStateDurability`.
63334
+ */
63335
+ durability: "session",
63336
+ /**
63337
+ * History (D850, D917): `circuits[]` is a keyed array — one series per circuit and
63338
+ * field, named by the circuit's label. The mode is a state (D896); the energy
63339
+ * totals are lifetime counters, the kWh of a period is computed at read time (D944).
63340
+ * The COP is never recorded: it derives from the two powers.
63341
+ */
63342
+ history: {
63343
+ fields: {
63344
+ "power.thermalW": {
63345
+ kind: "gauge",
63346
+ unit: "W",
63347
+ deadband: 50,
63348
+ displayName: "Thermal power"
63349
+ },
63350
+ "power.electricalW": {
63351
+ kind: "gauge",
63352
+ unit: "W",
63353
+ deadband: 50,
63354
+ displayName: "Electrical power"
63355
+ },
63356
+ "power.compressorPct": {
63357
+ kind: "gauge",
63358
+ unit: "%",
63359
+ deadband: 2,
63360
+ displayName: "Compressor"
63361
+ },
63362
+ "temperatures.supply": {
63363
+ kind: "gauge",
63364
+ unit: "°C",
63365
+ deadband: .5,
63366
+ displayName: "Supply"
63367
+ },
63368
+ "temperatures.return": {
63369
+ kind: "gauge",
63370
+ unit: "°C",
63371
+ deadband: .5,
63372
+ displayName: "Return"
63373
+ },
63374
+ "temperatures.outdoor": {
63375
+ kind: "gauge",
63376
+ unit: "°C",
63377
+ deadband: .5,
63378
+ displayName: "Outdoor"
63379
+ },
63380
+ "energy.thermalKwh": {
63381
+ kind: "counter",
63382
+ unit: "kWh",
63383
+ displayName: "Thermal energy"
63384
+ },
63385
+ "energy.electricalKwh": {
63386
+ kind: "counter",
63387
+ unit: "kWh",
63388
+ displayName: "Electrical energy"
63389
+ }
63390
+ },
63391
+ items: {
63392
+ path: "circuits",
63393
+ key: "id",
63394
+ label: "label",
63395
+ fields: {
63396
+ currentTemp: {
63397
+ kind: "gauge",
63398
+ unit: "°C",
63399
+ deadband: .5,
63400
+ displayName: "Temperature"
63401
+ },
63402
+ targetTemp: {
63403
+ kind: "gauge",
63404
+ unit: "°C",
63405
+ minIntervalMs: 0,
63406
+ displayName: "Setpoint"
63407
+ },
63408
+ mode: {
63409
+ kind: "enum",
63410
+ displayName: "Mode"
63411
+ }
63412
+ }
63413
+ }
63414
+ },
63415
+ volatileStateFields: ["lastFetchedAt"]
63416
+ };
62904
63417
  var HeatingValveStatusSchema = z.object({
62905
63418
  /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
62906
63419
  position: z.number().min(0).max(100).nullable().meta(readingMeta("percentage")),
@@ -63151,6 +63664,7 @@ var HeroSceneIdSchema = z.enum([
63151
63664
  "ac",
63152
63665
  "thermostat",
63153
63666
  "heater",
63667
+ "heat-pump",
63154
63668
  "fan",
63155
63669
  "washer",
63156
63670
  "dryer",
@@ -63218,6 +63732,7 @@ var HERO_SCENE_BY_TYPE = {
63218
63732
  [DeviceType.Valve]: "control-dial",
63219
63733
  [DeviceType.Humidifier]: "control-dial",
63220
63734
  [DeviceType.WaterHeater]: "heater",
63735
+ [DeviceType.HeatPump]: "heat-pump",
63221
63736
  [DeviceType.Fan]: "fan",
63222
63737
  [DeviceType.MediaPlayer]: "tv",
63223
63738
  [DeviceType.AlarmPanel]: "alarm",
@@ -63315,6 +63830,7 @@ var HeroTextSchema = z.object({
63315
63830
  it: z.string()
63316
63831
  });
63317
63832
  var HeroRowIdSchema = z.enum([
63833
+ "progress",
63318
63834
  "run-for",
63319
63835
  "cycle",
63320
63836
  "program",
@@ -63329,6 +63845,7 @@ var HeroRowIdSchema = z.enum([
63329
63845
  "alarm",
63330
63846
  "fan",
63331
63847
  "vacuum",
63848
+ "vacuum-suction",
63332
63849
  "mower",
63333
63850
  "feeder",
63334
63851
  "fountain",
@@ -63347,7 +63864,10 @@ var HeroRowIdSchema = z.enum([
63347
63864
  "climate-fan",
63348
63865
  "setpoint",
63349
63866
  "channel",
63350
- "control"
63867
+ "control",
63868
+ "circuit",
63869
+ "heat-pump-power",
63870
+ "system-mode"
63351
63871
  ]);
63352
63872
  var HeroArgValueSchema = z.lazy(() => z.union([
63353
63873
  z.string(),
@@ -63412,16 +63932,32 @@ var HeroControlSchema = z.discriminatedUnion("kind", [
63412
63932
  label: HeroTextSchema,
63413
63933
  current: z.string().nullable(),
63414
63934
  options: z.array(z.string()),
63935
+ /** A readable label per option value; an option without one is drawn as its raw value. */
63936
+ optionLabels: z.record(z.string(), HeroTextSchema).optional(),
63415
63937
  call: HeroCallSchema,
63416
63938
  valueArg: z.string()
63417
63939
  })
63418
63940
  ]);
63941
+ /** Declared by its interface: a `z.infer` of one more icon union pushes the cap's inferred type past what the compiler can print. */
63942
+ var HeroPillSchema = z.object({
63943
+ icon: IconKeySchema.nullable(),
63944
+ text: HeroTextSchema,
63945
+ tone: HeroToneSchema
63946
+ });
63419
63947
  var HeroRowSchema = z.object({
63420
63948
  id: HeroRowIdSchema,
63949
+ /** The row's own name when the kind's label would not tell rows of one kind apart (a circuit's label). */
63950
+ label: HeroTextSchema.optional(),
63951
+ /** A group header drawn above the row when it differs from the previous row's ("System"). */
63952
+ group: HeroTextSchema.optional(),
63953
+ /** Values drawn as pills across the row (a heat pump's powers). */
63954
+ pills: z.array(HeroPillSchema).optional(),
63421
63955
  icon: IconKeySchema,
63422
63956
  /** The row's status, in words. `null` = nothing to say. */
63423
63957
  status: HeroTextSchema.nullable(),
63424
- controls: z.array(HeroControlSchema)
63958
+ controls: z.array(HeroControlSchema),
63959
+ /** A bar under the row's label, 0..1; `null` / absent = no bar. */
63960
+ progress: z.number().min(0).max(1).nullable().optional()
63425
63961
  });
63426
63962
  var HeroDetailSchema = z.object({
63427
63963
  label: HeroTextSchema,
@@ -63429,7 +63965,11 @@ var HeroDetailSchema = z.object({
63429
63965
  unit: z.string().nullable()
63430
63966
  });
63431
63967
  var HeroBadgeSchema = z.object({
63432
- id: z.enum(["battery", "network-link"]),
63968
+ id: z.enum([
63969
+ "battery",
63970
+ "network-link",
63971
+ "integration"
63972
+ ]),
63433
63973
  icon: IconKeySchema,
63434
63974
  tone: HeroToneSchema,
63435
63975
  /** Percent for a battery, link quality for a link; `null` = not known. */
@@ -63530,7 +64070,12 @@ var HeroFactSchema = z.object({
63530
64070
  var HeroSideTileSchema = z.object({
63531
64071
  label: HeroTextSchema,
63532
64072
  value: HeroTextSchema,
63533
- tone: HeroToneSchema.optional()
64073
+ tone: HeroToneSchema.optional(),
64074
+ /**
64075
+ * Epoch ms when the tile reads a clock time (an appliance's end): a client prints it in
64076
+ * the viewer's own time zone; `value` is the fallback for one that cannot.
64077
+ */
64078
+ at: z.number().optional()
63534
64079
  });
63535
64080
  var HeroSideTilesSchema = z.object({
63536
64081
  left: z.array(HeroSideTileSchema).max(2),
@@ -63566,8 +64111,12 @@ var HeroModelSchema = z.object({
63566
64111
  sideTiles: HeroSideTilesSchema,
63567
64112
  /** The status line under the main icon. */
63568
64113
  title: HeroTextSchema,
64114
+ /** The scene's top line when it says more than `title`; absent = draw the title. */
64115
+ caption: HeroTextSchema.optional(),
63569
64116
  badges: z.array(HeroBadgeSchema),
63570
64117
  remote: HeroRemoteSlotSchema.nullable(),
64118
+ /** The foot button that opens the device's history: "History", "Cycles", "Meals", "Access". */
64119
+ historyLabel: HeroTextSchema,
63571
64120
  consumables: HeroConsumablesSlotSchema.nullable(),
63572
64121
  consumption: HeroConsumptionSlotSchema.nullable(),
63573
64122
  ownPower: HeroOwnPowerSlotSchema.nullable(),
@@ -64092,6 +64641,12 @@ var IntegrationWithStateSchema = z.object({
64092
64641
  name: z.string(),
64093
64642
  /** A projection of the instance body's switch (`setInstanceEnabled` is the only writer). */
64094
64643
  enabled: z.boolean(),
64644
+ /**
64645
+ * True when the addon that holds the switch did not answer (down, failed, or keeps no record for
64646
+ * this row): `enabled` is then the stored registry flag, a stale value, not the state. A reader
64647
+ * must not draw it as on or off (D315).
64648
+ */
64649
+ switchUnknown: z.literal(true).optional(),
64095
64650
  info: z.record(z.string(), z.unknown()).readonly(),
64096
64651
  /** The discovery candidate this integration was set up from (D984). */
64097
64652
  originStableId: z.string().optional(),
@@ -64105,6 +64660,12 @@ var IntegrationLiteSchema = z.object({
64105
64660
  name: z.string(),
64106
64661
  /** A projection of the instance body's switch (`setInstanceEnabled` is the only writer). */
64107
64662
  enabled: z.boolean(),
64663
+ /**
64664
+ * True when the addon that holds the switch did not answer (down, failed, or keeps no record for
64665
+ * this row): `enabled` is then the stored registry flag, a stale value, not the state. A reader
64666
+ * must not draw it as on or off (D315).
64667
+ */
64668
+ switchUnknown: z.literal(true).optional(),
64108
64669
  info: z.record(z.string(), z.unknown()).readonly(),
64109
64670
  /** The discovery candidate this integration was set up from (D984). */
64110
64671
  originStableId: z.string().optional(),
@@ -64203,9 +64764,9 @@ var UpdateIntegrationInputSchema = z.object({
64203
64764
  id: z.string(),
64204
64765
  name: z.string().optional(),
64205
64766
  /**
64206
- * Accepted for a FIXED builtin only (`info.fixed`: alarm panel, camera grid, core blocks,
64207
- * terminal), which keeps no instance record: the registry flag is its one store. Any other
64208
- * integration is switched through `integration-instances.setInstanceEnabled`.
64767
+ * Honoured ONLY for a fixed builtin (`info.fixed`), whose switch is the hub's own registry flag
64768
+ * and works while its addon is down. Any other row is refused (a typed `BAD_REQUEST`): its
64769
+ * switch is `integration-instances.setInstanceEnabled`.
64209
64770
  */
64210
64771
  enabled: z.boolean().optional(),
64211
64772
  info: z.record(z.string(), z.unknown()).optional()
@@ -64226,6 +64787,13 @@ var integrationsCapability = {
64226
64787
  kind: "mutation",
64227
64788
  auth: "admin"
64228
64789
  }),
64790
+ /**
64791
+ * Delete an integration from the hub side: its devices, its registry row and its record, and
64792
+ * announce it. It works while the addon that owns the instance is down (installed but
64793
+ * crashed), where `integration-instances.deleteInstance` has no provider to route to; with the
64794
+ * provider up the record is removed through it as well. A fixed builtin and an instance a link
64795
+ * names are refused first.
64796
+ */
64229
64797
  delete: method(z.object({ id: z.string() }), DeleteIntegrationResultSchema, {
64230
64798
  kind: "mutation",
64231
64799
  auth: "admin"
@@ -64253,6 +64821,12 @@ var integrationsCapability = {
64253
64821
  * the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
64254
64822
  * or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
64255
64823
  * clears it.
64824
+ *
64825
+ * Who may call (epic #440): every method but `describe` and `instanceFormSchema` is open to any
64826
+ * session (`caller: 'scoped'`) and default-denies. An admin passes everywhere. A non-admin passes
64827
+ * only on a call pinned to one addon whose `describe().userScoped` is true, and that provider
64828
+ * filters every row on the `caller` the router injected (a notification target is somebody's
64829
+ * phone: a user sees and changes only their own). An addon that says nothing keeps the admin door.
64256
64830
  */
64257
64831
  var ConfigSchemaPassthrough$2 = z.custom();
64258
64832
  var IntegrationInstanceIdSchema = z.string().min(1);
@@ -64366,7 +64940,15 @@ var IntegrationInstanceDescriptionSchema = z.object({
64366
64940
  */
64367
64941
  mintsId: z.boolean().optional(),
64368
64942
  /** The links to other instances the provider's kinds declare; absent means none. */
64369
- links: z.array(IntegrationInstanceLinkSchema).optional()
64943
+ links: z.array(IntegrationInstanceLinkSchema).optional(),
64944
+ /**
64945
+ * The rows belong to individual users (a notification target is somebody's phone). The router
64946
+ * then opens `listInstances`, `getInstance`, `createInstance`, `updateInstance`,
64947
+ * `setInstanceEnabled`, `deleteInstance` and `testInstance` to a NON-admin session on a call
64948
+ * pinned to this addon, and hands the provider the `caller` so it keeps a user to their own rows.
64949
+ * Absent means admin only, as it always was.
64950
+ */
64951
+ userScoped: z.boolean().optional()
64370
64952
  });
64371
64953
  var IntegrationInstanceStatusSchema = z.object({
64372
64954
  state: z.enum([
@@ -64424,8 +65006,14 @@ var integrationInstancesCapability = {
64424
65006
  /** The discovery candidate the wizard was seeded from (`stableId`), if any. */
64425
65007
  candidateStableId: z.string().min(1).optional()
64426
65008
  }), ConfigSchemaPassthrough$2, { auth: "admin" }),
64427
- listInstances: method(z.void(), z.array(IntegrationInstanceSchema).readonly(), { auth: "admin" }),
64428
- getInstance: method(z.object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }),
65009
+ listInstances: method(z.looseObject({}), z.array(IntegrationInstanceSchema).readonly(), {
65010
+ auth: "protected",
65011
+ caller: "scoped"
65012
+ }),
65013
+ getInstance: method(z.object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), {
65014
+ auth: "protected",
65015
+ caller: "scoped"
65016
+ }),
64429
65017
  /**
64430
65018
  * Insert the typed record. With `id` it is stored under that id (a duplicate id is refused);
64431
65019
  * without one the PROVIDER mints it and answers it. `kind` picks one of `describe().kinds`.
@@ -64458,11 +65046,13 @@ var integrationInstancesCapability = {
64458
65046
  seed: z.object({ info: z.record(z.string(), z.unknown()) }).optional()
64459
65047
  }), z.object({ id: z.string() }), {
64460
65048
  kind: "mutation",
64461
- auth: "admin"
65049
+ auth: "protected",
65050
+ caller: "scoped"
64462
65051
  }),
64463
65052
  updateInstance: method(IntegrationInstancePatchSchema, z.object({ ok: z.literal(true) }), {
64464
65053
  kind: "mutation",
64465
- auth: "admin"
65054
+ auth: "protected",
65055
+ caller: "scoped"
64466
65056
  }),
64467
65057
  /**
64468
65058
  * Switch ONE instance on or off, for every role; a missing record is created from the addon's
@@ -64474,7 +65064,8 @@ var integrationInstancesCapability = {
64474
65064
  enabled: z.boolean()
64475
65065
  }), z.object({ ok: z.literal(true) }), {
64476
65066
  kind: "mutation",
64477
- auth: "admin"
65067
+ auth: "protected",
65068
+ caller: "scoped"
64478
65069
  }),
64479
65070
  /**
64480
65071
  * Delete the record and its keychain refs together. For an instance that brings devices the hub
@@ -64483,7 +65074,8 @@ var integrationInstancesCapability = {
64483
65074
  */
64484
65075
  deleteInstance: method(z.object({ id: IntegrationInstanceIdSchema }), z.object({ ok: z.literal(true) }), {
64485
65076
  kind: "mutation",
64486
- auth: "admin"
65077
+ auth: "protected",
65078
+ caller: "scoped"
64487
65079
  }),
64488
65080
  testInstance: optionalMethod(z.object({
64489
65081
  id: IntegrationInstanceIdSchema.nullable(),
@@ -64492,7 +65084,8 @@ var integrationInstancesCapability = {
64492
65084
  kind: z.string().min(1).optional()
64493
65085
  }), TestConnectionResultSchema, {
64494
65086
  kind: "mutation",
64495
- auth: "admin"
65087
+ auth: "protected",
65088
+ caller: "scoped"
64496
65089
  })
64497
65090
  }
64498
65091
  };
@@ -88484,6 +89077,11 @@ var SendEmailResultSchema = z.object({
88484
89077
  var SmtpStatusSchema = z.object({
88485
89078
  /** True iff the addon has successfully verified the relay. */
88486
89079
  ready: z.boolean(),
89080
+ /**
89081
+ * The tri-state behind `ready` (D315): true when the last send worked, false when it failed,
89082
+ * ABSENT when the relay has not sent yet (unknown, never "not verified").
89083
+ */
89084
+ verified: z.boolean().optional(),
88487
89085
  /** Operator-visible host string (no credentials). */
88488
89086
  host: z.string(),
88489
89087
  /** Last error message reported by the relay, when not ready. */
@@ -88503,13 +89101,6 @@ var smtpProviderCapability = {
88503
89101
  auth: "admin",
88504
89102
  access: "create"
88505
89103
  }),
88506
- /** Round-trip ping against the SMTP relay (EHLO + AUTH if configured).
88507
- * Used by the operator's "Test connection" button. */
88508
- verify: method(RelayPinSchema, SmtpStatusSchema, {
88509
- kind: "mutation",
88510
- auth: "admin",
88511
- access: "view"
88512
- }),
88513
89104
  getStatus: method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" })
88514
89105
  }
88515
89106
  };
@@ -93898,6 +94489,8 @@ var ALL_CAPABILITY_DEFINITIONS = [
93898
94489
  groupActiveCapability,
93899
94490
  groupCommandsCapability,
93900
94491
  groupStatusCapability,
94492
+ heatPumpControlCapability,
94493
+ heatPumpStatusCapability,
93901
94494
  heatingValveCapability,
93902
94495
  heroLayoutCapability,
93903
94496
  humidifierCapability,
@@ -96450,6 +97043,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
96450
97043
  groupCommands: groupCommandsCapability,
96451
97044
  groupStatus: groupStatusCapability,
96452
97045
  heatingValve: heatingValveCapability,
97046
+ heatPumpStatus: heatPumpStatusCapability,
96453
97047
  humidifier: humidifierCapability,
96454
97048
  humiditySensor: humiditySensorCapability,
96455
97049
  image: imageCapability,
@@ -97546,7 +98140,7 @@ var DeclaredDevices = class {
97546
98140
  return removed;
97547
98141
  }
97548
98142
  };
97549
- DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
98143
+ DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
97550
98144
  new Set(Object.values(DeviceType));
97551
98145
  /** True when a value is a navigable node: a plain object OR a tRPC v11 client
97552
98146
  * proxy node (a callable `Proxy(noop)` → `typeof === 'function'`, NOT an
@@ -97699,6 +98293,13 @@ var lockContribution = contribution("lock-control", LockControlStatusSchema, (sl
97699
98293
  reading: reading("lock-control", words?.state ?? "unknown", false, words?.title),
97700
98294
  rows: [row$1("lock", state === "locked" || state === "locking" ? "lock" : "lock-open", joinText([title, since]), lockControls(state, ctx.features.includes(DeviceFeature.LockOpen)))],
97701
98295
  ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, "muted")] },
98296
+ ...words === null ? {} : { tiles: { left: [{
98297
+ label: t("Door", "Porta"),
98298
+ value: title
98299
+ }, ...since === null ? [] : [{
98300
+ label: t("Since", "Da"),
98301
+ value: since
98302
+ }]] } },
97702
98303
  ...words?.door == null ? {} : { scene: { mode: words.door } }
97703
98304
  };
97704
98305
  });
@@ -97780,7 +98381,17 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
97780
98381
  return {
97781
98382
  reading: reading("alarm-panel", words?.state ?? "unknown", false, words?.title),
97782
98383
  rows: [row$1("alarm", state === "triggered" ? "shield-alert" : state === "disarmed" ? "shield-off" : "shield-check", joinText([words?.title ?? t("Unknown", "Sconosciuto"), since]), alarmControls(state, modes, slice?.requiresCode ?? false))],
97783
- ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] }
98384
+ ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] },
98385
+ ...words === null ? {} : { tiles: {
98386
+ left: [{
98387
+ label: t("Mode", "Modalità"),
98388
+ value: words.title
98389
+ }],
98390
+ ...since === null ? {} : { right: [{
98391
+ label: t("Since", "Da"),
98392
+ value: since
98393
+ }] }
98394
+ } }
97784
98395
  };
97785
98396
  }),
97786
98397
  "automation-control": contribution("automation-control", AutomationControlStatusSchema, (slice, ctx) => {
@@ -97844,7 +98455,7 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
97844
98455
  */
97845
98456
  var has$3 = (ctx, f) => ctx.features.includes(f);
97846
98457
  var unknownText = t("Unknown", "Sconosciuto");
97847
- var pct$1 = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
98458
+ var pct$2 = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
97848
98459
  var unit = (n) => Math.min(1, Math.max(0, n / 100));
97849
98460
  /** Battery as a fact, unless the device is also bound to the `battery` cap (it already says so). */
97850
98461
  function ownBattery(level, ctx) {
@@ -97906,7 +98517,7 @@ var fanContribution = contribution("fan-control", FanControlStatusSchema, (slice
97906
98517
  },
97907
98518
  valueArg: "direction"
97908
98519
  });
97909
- const speedText = speed === null ? null : pct$1(speed);
98520
+ const speedText = speed === null ? null : pct$2(speed);
97910
98521
  const preset = slice?.preset ?? "";
97911
98522
  const status = speed === null ? unknownText : joinText([speed === 0 ? t("Off", "Spento") : t(`Speed ${speed}%`, `Velocità ${speed}%`), preset === "" ? null : t(preset, preset)]);
97912
98523
  return {
@@ -97919,10 +98530,16 @@ var fanContribution = contribution("fan-control", FanControlStatusSchema, (slice
97919
98530
  }],
97920
98531
  ...speedText === null ? {} : {
97921
98532
  facts: [fact("speed", "fan", speedText, speed === 0 ? "muted" : "primary")],
97922
- tiles: { right: [{
97923
- label: t("Speed", "Velocità"),
97924
- value: speedText
97925
- }] },
98533
+ tiles: {
98534
+ ...slice?.oscillating == null ? {} : { left: [{
98535
+ label: t("Oscillation", "Oscilla"),
98536
+ value: slice.oscillating ? t("Yes", "Sì") : t("No", "No")
98537
+ }] },
98538
+ ...preset === "" ? {} : { right: [{
98539
+ label: t("Mode", "Modalità"),
98540
+ value: t(preset, preset)
98541
+ }] }
98542
+ },
97926
98543
  scene: { level: unit(speed ?? 0) }
97927
98544
  }
97928
98545
  };
@@ -97986,7 +98603,8 @@ var vacuumContribution = contribution("vacuum-control", VacuumControlStatusSchem
97986
98603
  const words = state === null ? null : VACUUM_WORDS[state];
97987
98604
  const title = state === "error" && slice?.errorLabel ? t(slice.errorLabel, slice.errorLabel) : words?.title;
97988
98605
  const controls = vacuumControls(state);
97989
- if (slice !== void 0 && slice.availableFanSpeeds.length > 0) controls.push({
98606
+ const suctionControls = [];
98607
+ if (slice !== void 0 && slice.availableFanSpeeds.length > 0) suctionControls.push({
97990
98608
  kind: "picker",
97991
98609
  id: "vacuum.suction",
97992
98610
  label: t("Suction", "Aspirazione"),
@@ -98001,22 +98619,31 @@ var vacuumContribution = contribution("vacuum-control", VacuumControlStatusSchem
98001
98619
  });
98002
98620
  if (state !== null) controls.push(vac("locate", "Locate", "Trova", "map-pin", "locate"));
98003
98621
  const progress = state === "cleaning" ? slice?.progress ?? null : null;
98622
+ const suction = slice?.fanSpeed == null || slice.fanSpeed === "" ? [] : [{
98623
+ label: t("Suction", "Aspirazione"),
98624
+ value: t(slice.fanSpeed, slice.fanSpeed)
98625
+ }];
98626
+ const suctionRows = suctionControls.length === 0 ? [] : [{
98627
+ id: "vacuum-suction",
98628
+ icon: "bot",
98629
+ status: null,
98630
+ controls: suctionControls
98631
+ }];
98632
+ const vacuumRows = [{
98633
+ id: "vacuum",
98634
+ icon: "bot",
98635
+ status: title ?? unknownText,
98636
+ controls
98637
+ }, ...suctionRows];
98004
98638
  return {
98005
98639
  reading: reading("vacuum-control", words?.state ?? "unknown", false, title),
98006
- rows: [{
98007
- id: "vacuum",
98008
- icon: "bot",
98009
- status: title ?? unknownText,
98010
- controls
98011
- }],
98012
- facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$1(progress), "primary")]],
98013
- ...progress === null ? {} : {
98014
- tiles: { right: [{
98015
- label: t("Progress", "Avanzamento"),
98016
- value: pct$1(progress)
98017
- }] },
98018
- scene: { level: unit(progress) }
98019
- }
98640
+ rows: vacuumRows,
98641
+ facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$2(progress), "primary")]],
98642
+ ...suction.length === 0 && progress === null ? {} : { tiles: { right: [...suction, ...progress === null ? [] : [{
98643
+ label: t("Progress", "Avanzamento"),
98644
+ value: pct$2(progress)
98645
+ }]] } },
98646
+ ...progress === null ? {} : { scene: { level: unit(progress) } }
98020
98647
  };
98021
98648
  });
98022
98649
  var MOWER_WORDS = {
@@ -98072,11 +98699,11 @@ var mowerContribution = contribution("lawn-mower-control", LawnMowerControlStatu
98072
98699
  status: title ?? unknownText,
98073
98700
  controls: mowerControls(activity)
98074
98701
  }],
98075
- facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$1(progress), "primary")]],
98702
+ facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$2(progress), "primary")]],
98076
98703
  ...progress === null ? {} : {
98077
98704
  tiles: { right: [{
98078
98705
  label: t("Progress", "Avanzamento"),
98079
- value: pct$1(progress)
98706
+ value: pct$2(progress)
98080
98707
  }] },
98081
98708
  scene: { level: unit(progress) }
98082
98709
  }
@@ -98147,10 +98774,13 @@ var feederContribution = contribution("pet-feeder", PetFeederStatusSchema, (slic
98147
98774
  ...last === null ? [] : [fact("last-run", "clock", t(`Last ${last} g`, `Ultimo ${last} g`))],
98148
98775
  ...ownBattery(slice?.powerSource === "battery" ? slice.batteryPower : null, ctx)
98149
98776
  ],
98150
- ...last === null ? {} : { tiles: { right: [{
98777
+ tiles: { left: [...slice?.foodLevel == null ? [] : [{
98778
+ label: t("Tank", "Serbatoio"),
98779
+ value: pct$2(slice.foodLevel)
98780
+ }], ...last === null ? [] : [{
98151
98781
  label: t("Last portion", "Ultima porzione"),
98152
98782
  value: t(`${last} g`, `${last} g`)
98153
- }] } }
98783
+ }]] }
98154
98784
  };
98155
98785
  });
98156
98786
  var fountainContribution = contribution("pet-fountain", PetFountainStatusSchema, (slice) => {
@@ -98178,10 +98808,13 @@ var fountainContribution = contribution("pet-fountain", PetFountainStatusSchema,
98178
98808
  }],
98179
98809
  ...level === null ? {} : {
98180
98810
  facts: [fact("level", "droplets", t(`Water ${Math.round(level)}%`, `Acqua ${Math.round(level)}%`), level <= 20 ? "warning" : "primary")],
98181
- tiles: { right: [{
98811
+ tiles: { left: [{
98182
98812
  label: t("Water", "Acqua"),
98183
- value: pct$1(level)
98184
- }] },
98813
+ value: pct$2(level)
98814
+ }, ...slice?.waterVolume == null ? [] : [{
98815
+ label: t("Volume", "Volume"),
98816
+ value: t(`${Math.round(slice.waterVolume)} ml`, `${Math.round(slice.waterVolume)} ml`)
98817
+ }]] },
98185
98818
  scene: { level: unit(level) }
98186
98819
  }
98187
98820
  };
@@ -98213,14 +98846,18 @@ var DEVICES_FAMILY_CONTRIBUTIONS = {
98213
98846
  * that does not parse reads `unknown`, never closed or off (D315/D393).
98214
98847
  */
98215
98848
  var has$2 = (ctx, f) => ctx.features.includes(f);
98216
- var pct = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
98849
+ var pct$1 = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
98217
98850
  var brightnessContribution = contribution("brightness", BrightnessStatusSchema, (slice) => {
98218
98851
  const level = slice?.level ?? null;
98219
98852
  return {
98220
98853
  ...level === null ? {} : { reading: reading("brightness", level > 0 ? "on" : "off") },
98221
98854
  ...level === null ? {} : {
98222
- facts: [fact("level", "sun-dim", pct(level), level > 0 ? "primary" : "muted")],
98223
- scene: { level: level / 100 }
98855
+ facts: [fact("level", "sun-dim", pct$1(level), level > 0 ? "primary" : "muted")],
98856
+ scene: { level: level / 100 },
98857
+ tiles: { left: [{
98858
+ label: t("Brightness", "Luminosità"),
98859
+ value: pct$1(level)
98860
+ }] }
98224
98861
  },
98225
98862
  rows: [row$1("brightness", "sun-dim", level === null ? null : t(`Brightness ${Math.round(level)}%`, `Luminosità ${Math.round(level)}%`), [{
98226
98863
  kind: "slider",
@@ -98429,12 +99066,16 @@ function travelFragment(s, state, position, tilt, ctx) {
98429
99066
  });
98430
99067
  return {
98431
99068
  reading: reading(s.source, words.state, false, words.title),
98432
- ...position === null ? {} : { facts: [fact("level", "arrow-up-down", pct(position))] },
99069
+ ...position === null ? {} : { facts: [fact("level", "arrow-up-down", pct$1(position))] },
99070
+ ...position === null ? {} : { tiles: { left: [{
99071
+ label: t("Opening", "Apertura"),
99072
+ value: pct$1(position)
99073
+ }] } },
98433
99074
  scene: {
98434
99075
  ...words.mode === null ? {} : { mode: words.mode },
98435
99076
  ...position === null ? {} : { level: position / 100 }
98436
99077
  },
98437
- rows: [row$1(s.rowId, "arrow-up-down", joinText([words.title, position !== null && state !== "open" ? pct(position) : null]), controls)]
99078
+ rows: [row$1(s.rowId, "arrow-up-down", joinText([words.title, position !== null && state !== "open" ? pct$1(position) : null]), controls)]
98438
99079
  };
98439
99080
  }
98440
99081
  var ACTUATORS_FAMILY_CONTRIBUTIONS = {
@@ -98512,10 +99153,10 @@ var ACTUATORS_FAMILY_CONTRIBUTIONS = {
98512
99153
  const now = slice.currentHumidity;
98513
99154
  return {
98514
99155
  reading: reading("humidifier", state, false, title),
98515
- ...now === null ? {} : { facts: [fact("level", "droplets", pct(now), "info")] },
99156
+ ...now === null ? {} : { facts: [fact("level", "droplets", pct$1(now), "info")] },
98516
99157
  ...slice.targetHumidity === null ? {} : { tiles: { right: [{
98517
99158
  label: t("Target", "Obiettivo"),
98518
- value: pct(slice.targetHumidity)
99159
+ value: pct$1(slice.targetHumidity)
98519
99160
  }] } },
98520
99161
  ...now === null ? {} : { scene: { level: now / 100 } },
98521
99162
  rows: [row$1("humidifier", "droplets", joinText([title, slice.mode === null ? null : t(slice.mode, slice.mode)]), controls)]
@@ -98763,17 +99404,16 @@ var weatherContribution = contribution("weather", WeatherStatusSchema, (slice, c
98763
99404
  });
98764
99405
  var updateContribution = contribution("update", UpdateStatusSchema, (slice) => {
98765
99406
  if (slice === void 0) return { reading: reading("update", "unknown") };
98766
- const { currentVersion, availableVersion, inProgress, updatable } = slice;
99407
+ const { currentVersion, availableVersion, inProgress } = slice;
98767
99408
  const pending = availableVersion !== null && availableVersion !== "" && availableVersion !== currentVersion;
98768
99409
  if (!pending && currentVersion === null && !inProgress) return { reading: reading("update", "unknown") };
98769
99410
  const state = inProgress ? "running" : pending ? "standby" : "idle";
98770
99411
  const title = inProgress ? t("Updating", "Aggiornamento in corso") : pending ? t("Update available", "Aggiornamento disponibile") : t("Up to date", "Aggiornato");
98771
99412
  const versions = currentVersion === null ? pending ? t(`${availableVersion}`, `${availableVersion}`) : null : pending ? t(`${currentVersion} → ${availableVersion}`, `${currentVersion} → ${availableVersion}`) : t(`Version ${currentVersion}`, `Versione ${currentVersion}`);
98772
- const install = pending && updatable && !inProgress ? [asAction(action("update.install", t("Install", "Installa"), "download", "update", "installUpdate", {}, "primary", "install"))] : [];
98773
99413
  return {
98774
99414
  reading: reading("update", state, false, title),
98775
99415
  facts: versions === null ? [] : [fact("reading", "download", versions, pending ? "warning" : "muted")],
98776
- rows: [row$1("update", "download", versions, install)]
99416
+ rows: [row$1("update", "download", versions, [])]
98777
99417
  };
98778
99418
  });
98779
99419
  var imageContribution = contribution("image", ImageStatusSchema, (slice, ctx) => {
@@ -98881,6 +99521,33 @@ var ON_MODE_PREFERENCE = [
98881
99521
  "heat",
98882
99522
  "cool"
98883
99523
  ];
99524
+ var FAN_LABEL = {
99525
+ auto: t("Auto", "Auto"),
99526
+ quiet: t("Quiet", "Silenziosa"),
99527
+ low: t("Low", "Bassa"),
99528
+ medium: t("Medium", "Media"),
99529
+ high: t("High", "Alta"),
99530
+ turbo: t("Turbo", "Turbo"),
99531
+ off: t("Off", "Spenta")
99532
+ };
99533
+ /** A readable label for a fan speed name; an unknown one is shown as the device reported it. */
99534
+ function fanLabelOf(fan) {
99535
+ return FAN_LABEL[fan] ?? t(fan, fan);
99536
+ }
99537
+ /** Short labels for a segmented control: one word each, so the segments stay on a line. */
99538
+ var MODE_SEGMENT_LABEL = {
99539
+ off: t("Off", "Spento"),
99540
+ heat: t("Heat", "Caldo"),
99541
+ cool: t("Cool", "Freddo"),
99542
+ auto: t("Auto", "Auto"),
99543
+ heat_cool: t("Heat/Cool", "Caldo/Freddo"),
99544
+ fan_only: t("Fan", "Vent."),
99545
+ dry: t("Dry", "Deum.")
99546
+ };
99547
+ /** The segment label of every available HVAC mode, keyed by the mode value. */
99548
+ function modeLabelsOf(modes) {
99549
+ return Object.fromEntries(modes.map((m) => [m, MODE_SEGMENT_LABEL[m]]));
99550
+ }
98884
99551
  /** 22 -> "22", 22.3 -> "22.3": a trailing zero is noise on a thermostat. */
98885
99552
  function formatDegrees(value) {
98886
99553
  return `${Number(value.toFixed(1))}°`;
@@ -98945,11 +99612,11 @@ function rangeFrom(min, max, step) {
98945
99612
  * contribute, types never do (D14). A slice that is absent or does not parse is
98946
99613
  * "not answered": the state reads unknown, no row is drawn (D315, D393).
98947
99614
  */
98948
- var same = (text) => t(text, text);
98949
- function tile(en, it, value) {
99615
+ var same$1 = (text) => t(text, text);
99616
+ function tile$1(en, it, value) {
98950
99617
  return {
98951
99618
  label: t(en, it),
98952
- value: same(value)
99619
+ value: same$1(value)
98953
99620
  };
98954
99621
  }
98955
99622
  function setpointSlider(id, cap, method, valueArg, value, range) {
@@ -98984,18 +99651,19 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
98984
99651
  const status = climateStatusText(view);
98985
99652
  const facts = [];
98986
99653
  if (status !== null) facts.push(fact("climate", "thermometer", status));
98987
- if (view.humidity !== null) facts.push(fact("humidity", "droplets", same(`${Math.round(view.humidity)}%`)));
98988
- if (view.targetHumidity !== null) facts.push(fact("humidity", "droplets", same(`→ ${Math.round(view.targetHumidity)}%`)));
99654
+ if (view.humidity !== null) facts.push(fact("humidity", "droplets", same$1(`${Math.round(view.humidity)}%`)));
99655
+ if (view.targetHumidity !== null) facts.push(fact("humidity", "droplets", same$1(`→ ${Math.round(view.targetHumidity)}%`)));
98989
99656
  const left = [];
98990
99657
  const right = [];
98991
- if (view.measured !== null) left.push(tile("Indoor", "In casa", formatDegrees(view.measured)));
98992
- if (view.humidity !== null) left.push(tile("Humidity", "Umidità", `${Math.round(view.humidity)}%`));
99658
+ if (view.measured !== null) left.push(tile$1("Indoor", "In casa", formatDegrees(view.measured)));
99659
+ if (view.humidity !== null) left.push(tile$1("Humidity", "Umidità", `${Math.round(view.humidity)}%`));
98993
99660
  const modeControls = [{
98994
99661
  kind: "picker",
98995
99662
  id: "climate.mode",
98996
99663
  label: t("Mode", "Modalità"),
98997
99664
  current: view.mode,
98998
- options: [...view.availableModes],
99665
+ options: [...view.availableModes.filter((m) => m !== "off"), ...view.availableModes.filter((m) => m === "off")],
99666
+ optionLabels: modeLabelsOf(view.availableModes),
98999
99667
  call: {
99000
99668
  cap: "climate-control",
99001
99669
  method: "setMode",
@@ -99023,6 +99691,7 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
99023
99691
  label: t("Fan", "Ventola"),
99024
99692
  current: slice.fanMode === "" ? null : slice.fanMode,
99025
99693
  options: [...slice.availableFanModes],
99694
+ optionLabels: Object.fromEntries(slice.availableFanModes.map((m) => [m, fanLabelOf(m)])),
99026
99695
  call: {
99027
99696
  cap: "climate-control",
99028
99697
  method: "setFanMode",
@@ -99048,14 +99717,15 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
99048
99717
  if (fanControls.length > 0) rows.push({
99049
99718
  id: "climate-fan",
99050
99719
  icon: "fan",
99051
- status: slice.fanMode === "" ? null : same(slice.fanMode),
99720
+ status: slice.fanMode === "" ? null : same$1(slice.fanMode),
99052
99721
  controls: fanControls
99053
99722
  });
99054
- rows.push(...setpointRow(view.target === null ? null : same(formatDegrees(view.target)), view.range === null || view.target === null ? null : setpointSlider("climate.target", "climate-control", "setTarget", "target", view.target, view.range)));
99723
+ rows.push(...setpointRow(view.target === null ? null : same$1(formatDegrees(view.target)), view.range === null || view.target === null ? null : setpointSlider("climate.target", "climate-control", "setTarget", "target", view.target, view.range)));
99055
99724
  const sceneMode = view.sceneMode;
99056
99725
  return {
99057
99726
  reading: reading("climate-control", view.isOff ? "off" : "on"),
99058
99727
  title: view.modeLabel,
99728
+ ...view.isOff || slice.fanMode === "" ? {} : { caption: t(`${view.modeLabel.en} · fan ${fanLabelOf(slice.fanMode).en}`, `${view.modeLabel.it} · ventola ${fanLabelOf(slice.fanMode).it}`) },
99059
99729
  facts,
99060
99730
  ...left.length === 0 && right.length === 0 ? {} : { tiles: {
99061
99731
  left,
@@ -99082,7 +99752,7 @@ var WATER_ON_PREFERENCE = [
99082
99752
  "performance"
99083
99753
  ];
99084
99754
  function capitalised(word) {
99085
- return same(word.charAt(0).toUpperCase() + word.slice(1).replace(/_/g, " "));
99755
+ return same$1(word.charAt(0).toUpperCase() + word.slice(1).replace(/_/g, " "));
99086
99756
  }
99087
99757
  var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSchema, (slice) => {
99088
99758
  if (slice === void 0 || slice.operationMode === null) return { reading: reading("climate-control", "unknown") };
@@ -99119,13 +99789,13 @@ var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSche
99119
99789
  icon: "flame",
99120
99790
  status: label,
99121
99791
  controls: modeControls
99122
- }, ...setpointRow(slice.targetTemp === null ? null : same(formatDegrees(slice.targetTemp)), range === null || slice.targetTemp === null ? null : setpointSlider("water-heater.target", "water-heater", "setTargetTemp", "temp", slice.targetTemp, range))];
99792
+ }, ...setpointRow(slice.targetTemp === null ? null : same$1(formatDegrees(slice.targetTemp)), range === null || slice.targetTemp === null ? null : setpointSlider("water-heater.target", "water-heater", "setTargetTemp", "temp", slice.targetTemp, range))];
99123
99793
  const level = levelWithin(slice.targetTemp, range);
99124
99794
  return {
99125
99795
  reading: reading("climate-control", isOff ? "off" : "on"),
99126
99796
  title: label,
99127
99797
  facts: status === null ? [] : [fact("climate", "flame", status)],
99128
- ...slice.currentTemp === null ? {} : { tiles: { left: [tile("Water", "Acqua", formatDegrees(slice.currentTemp))] } },
99798
+ ...slice.currentTemp === null ? {} : { tiles: { left: [tile$1("Water", "Acqua", formatDegrees(slice.currentTemp))] } },
99129
99799
  scene: {
99130
99800
  ...isOff ? {} : { mode: "heat" },
99131
99801
  ...level === null ? {} : { level }
@@ -99143,11 +99813,12 @@ var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSche
99143
99813
  var heatingValveContribution = contribution("heating-valve", HeatingValveStatusSchema, (slice) => {
99144
99814
  const position = slice?.position ?? null;
99145
99815
  if (position === null) return { reading: reading("sensor", "unknown") };
99146
- const text = same(`${Math.round(position)}%`);
99816
+ const text = same$1(`${Math.round(position)}%`);
99147
99817
  return {
99148
99818
  reading: reading("sensor", position > 0 ? "running" : "idle"),
99149
99819
  facts: [fact("valve", "gauge", t(`Valve ${text.en}`, `Valvola ${text.it}`))],
99150
- tiles: { right: [tile("Valve", "Valvola", text.en)] },
99820
+ tiles: { right: [tile$1("Valve", "Valvola", text.en)] },
99821
+ ...position > 0 ? { caption: t(`Heating · valve ${text.en}`, `Riscalda · valvola ${text.it}`) } : {},
99151
99822
  scene: { level: position / 100 }
99152
99823
  };
99153
99824
  });
@@ -99156,9 +99827,9 @@ function sensorFragment(value, id, icon, en, it, text) {
99156
99827
  if (value === null) return { reading: reading("sensor", "unknown") };
99157
99828
  return {
99158
99829
  reading: reading("sensor", "on"),
99159
- title: same(text),
99160
- facts: [fact(id, icon, same(text))],
99161
- tiles: { right: [tile(en, it, text)] }
99830
+ title: same$1(text),
99831
+ facts: [fact(id, icon, same$1(text))],
99832
+ tiles: { right: [tile$1(en, it, text)] }
99162
99833
  };
99163
99834
  }
99164
99835
  var temperatureContribution = contribution("temperature-sensor", TemperatureSensorStatusSchema, (slice) => sensorFragment(slice?.temperature ?? null, "temperature", "thermometer", "Temperature", "Temperatura", formatDegrees(slice?.temperature ?? 0)));
@@ -99213,8 +99884,8 @@ var CLIMATE_FAMILY_CONTRIBUTIONS = {
99213
99884
  return {
99214
99885
  reading: reading("sensor", "on"),
99215
99886
  ...slice.aqi === void 0 ? {} : { title: airQualityWord(slice.aqi) },
99216
- facts: parts.map((p) => fact("air-quality", "wind", same(`${p.label} ${p.value}`))),
99217
- tiles: { right: parts.slice(0, 2).map((p) => tile(p.label, p.label, p.value)) }
99887
+ facts: parts.map((p) => fact("air-quality", "wind", same$1(`${p.label} ${p.value}`))),
99888
+ tiles: { right: parts.slice(0, 2).map((p) => tile$1(p.label, p.label, p.value)) }
99218
99889
  };
99219
99890
  }),
99220
99891
  "carbon-monoxide": contribution("carbon-monoxide", CarbonMonoxideStatusSchema, (slice) => {
@@ -99229,6 +99900,262 @@ var CLIMATE_FAMILY_CONTRIBUTIONS = {
99229
99900
  "numeric-sensor": numericContribution,
99230
99901
  "enum-sensor": enumContribution
99231
99902
  };
99903
+ /**
99904
+ * The heat pump's contribution to a hero (D1026): the compressor scene, every
99905
+ * circuit as a row with its own label and icon, the powers as pills (the
99906
+ * instantaneous COP only when both powers are known) and a "System" group with
99907
+ * one selector per mode. Values and their limits come from the slice, which the
99908
+ * gateway filled: a selector with no allowed value is not drawn, a missing
99909
+ * reading is never a 0 (D393).
99910
+ */
99911
+ var CAP = "heat-pump-control";
99912
+ var same = (text) => t(text, text);
99913
+ /** The words of the values the gateway names; a value not listed is drawn as the gateway wrote it. */
99914
+ var VALUE_LABELS = {
99915
+ off: t("Off", "Off"),
99916
+ on: t("On", "On"),
99917
+ auto: t("Auto", "Auto"),
99918
+ manual: t("Manual", "Manuale"),
99919
+ low: t("Low", "Bassa"),
99920
+ high: t("High", "Alta"),
99921
+ eco: t("Eco", "Eco"),
99922
+ heat: t("Heat", "Caldo"),
99923
+ cool: t("Cool", "Freddo"),
99924
+ heatCool: t("Heat/cool", "Caldo/freddo"),
99925
+ ownprogram: t("Programme", "Programma")
99926
+ };
99927
+ function valueLabel(value) {
99928
+ const known = VALUE_LABELS[value];
99929
+ if (known !== void 0) return known;
99930
+ const holiday = /^hm(\d+)$/.exec(value);
99931
+ if (holiday?.[1] !== void 0) return t(`Programme ${holiday[1]}`, `Programma ${holiday[1]}`);
99932
+ return same(value);
99933
+ }
99934
+ function optionLabels(allowed) {
99935
+ return Object.fromEntries(allowed.map((value) => [value, valueLabel(value)]));
99936
+ }
99937
+ function picker(id, label, setting, method, args, valueArg = "mode") {
99938
+ return {
99939
+ kind: "picker",
99940
+ id,
99941
+ label,
99942
+ current: setting.value,
99943
+ options: [...setting.allowed],
99944
+ optionLabels: optionLabels(setting.allowed),
99945
+ call: {
99946
+ cap: CAP,
99947
+ method,
99948
+ args: { ...args }
99949
+ },
99950
+ valueArg
99951
+ };
99952
+ }
99953
+ /** A selector exists only where the gateway named values to choose from. */
99954
+ function choosable(setting) {
99955
+ return setting !== null && setting.allowed.length > 0;
99956
+ }
99957
+ function circuitControl(circuit) {
99958
+ const args = { circuitId: circuit.id };
99959
+ if (circuit.kind === "dhw" && choosable(circuit.temperatureLevel)) return picker(`heat-pump.${circuit.id}.level`, t("Level", "Livello"), circuit.temperatureLevel, "setDhwTemperatureLevel", args, "level");
99960
+ if (!choosable(circuit.operationMode)) return null;
99961
+ const method = circuit.kind === "dhw" ? "setDhwOperationMode" : "setCircuitOperationMode";
99962
+ return picker(`heat-pump.${circuit.id}.mode`, t("Mode", "Modalità"), circuit.operationMode, method, args);
99963
+ }
99964
+ /** A circuit with no reading is still a row: it shows that nothing is known, not nothing. */
99965
+ var UNKNOWN_STATUS = same("—");
99966
+ function circuitRow(circuit) {
99967
+ const control = circuitControl(circuit);
99968
+ const status = thermalStatusText(circuit.targetTemp, circuit.currentTemp) ?? UNKNOWN_STATUS;
99969
+ return {
99970
+ id: "circuit",
99971
+ label: same(circuit.label),
99972
+ icon: circuit.icon,
99973
+ status,
99974
+ controls: control === null ? [] : [control]
99975
+ };
99976
+ }
99977
+ var kilowatts = (watts) => `${Number((watts / 1e3).toFixed(2))} kW`;
99978
+ function powerPills(status) {
99979
+ const { thermalW, electricalW } = status.power;
99980
+ const cop = heatPumpInstantCop(status.power);
99981
+ const pills = [];
99982
+ if (thermalW !== null) pills.push({
99983
+ icon: "flame",
99984
+ text: t(`Thermal ${kilowatts(thermalW)}`, `Termica ${kilowatts(thermalW)}`),
99985
+ tone: "muted"
99986
+ });
99987
+ if (electricalW !== null) pills.push({
99988
+ icon: "zap",
99989
+ text: t(`Electrical ${kilowatts(electricalW)}`, `Elettrica ${kilowatts(electricalW)}`),
99990
+ tone: "muted"
99991
+ });
99992
+ if (cop !== null) {
99993
+ const text = String(Number(cop.toFixed(1)));
99994
+ pills.push({
99995
+ icon: "gauge",
99996
+ text: t(`Instantaneous COP ${text}`, `COP istantaneo ${text}`),
99997
+ tone: "success"
99998
+ });
99999
+ }
100000
+ return pills;
100001
+ }
100002
+ /** The independent system modes, in the order the card draws them. */
100003
+ var SYSTEM_MODES = [
100004
+ {
100005
+ key: "silent",
100006
+ label: t("Silent", "Silenzioso"),
100007
+ icon: "volume-x",
100008
+ method: "setSilentMode"
100009
+ },
100010
+ {
100011
+ key: "away",
100012
+ label: t("Away", "Assente"),
100013
+ icon: "plane",
100014
+ method: "setAwayMode"
100015
+ },
100016
+ {
100017
+ key: "additionalHeater",
100018
+ label: t("Additional heater", "Riscaldatore aggiuntivo"),
100019
+ icon: "flame",
100020
+ method: "setAdditionalHeaterMode"
100021
+ },
100022
+ {
100023
+ key: "holiday",
100024
+ label: t("Holiday", "Vacanza"),
100025
+ icon: "tree-palm",
100026
+ method: "setHolidayMode"
100027
+ }
100028
+ ];
100029
+ var SYSTEM_GROUP = t("System", "Sistema");
100030
+ var PROGRAMME = /^hm\d+$/;
100031
+ /**
100032
+ * Holiday is two segments, off / programme. Choosing "programme" keeps the programme
100033
+ * that is set, else the first one the gateway allowed, so a write never leaves
100034
+ * `allowed`. The full hm1..hm8 pick is not in the hero (D1026). A holiday whose values
100035
+ * are not programmes keeps the plain selector.
100036
+ */
100037
+ function holidayRow(def, setting) {
100038
+ if (!setting.allowed.includes("off")) return null;
100039
+ const current = setting.value !== null && PROGRAMME.test(setting.value) ? setting.value : null;
100040
+ const programme = current ?? setting.allowed.find((v) => PROGRAMME.test(v));
100041
+ if (programme === void 0) return null;
100042
+ const control = picker("heat-pump.system.holiday", def.label, {
100043
+ value: setting.value,
100044
+ allowed: ["off", programme]
100045
+ }, def.method, {});
100046
+ const number = programme.slice(2);
100047
+ return {
100048
+ id: "system-mode",
100049
+ label: def.label,
100050
+ group: SYSTEM_GROUP,
100051
+ icon: def.icon,
100052
+ status: current === null ? null : t(`Programme ${number}`, `Programma ${number}`),
100053
+ controls: [control.kind === "picker" ? {
100054
+ ...control,
100055
+ optionLabels: {
100056
+ off: t("Off", "Off"),
100057
+ [programme]: t("Programme", "Programma")
100058
+ }
100059
+ } : control]
100060
+ };
100061
+ }
100062
+ function systemRows(status) {
100063
+ const rows = [];
100064
+ for (const def of SYSTEM_MODES) {
100065
+ const setting = status.system[def.key];
100066
+ if (!choosable(setting)) continue;
100067
+ if (def.key === "holiday") {
100068
+ const holiday = holidayRow(def, setting);
100069
+ if (holiday !== null) {
100070
+ rows.push(holiday);
100071
+ continue;
100072
+ }
100073
+ }
100074
+ rows.push({
100075
+ id: "system-mode",
100076
+ label: def.label,
100077
+ group: SYSTEM_GROUP,
100078
+ icon: def.icon,
100079
+ status: null,
100080
+ controls: [picker(`heat-pump.system.${def.key}`, def.label, setting, def.method, {})]
100081
+ });
100082
+ }
100083
+ return rows;
100084
+ }
100085
+ function tile(en, it, value) {
100086
+ return {
100087
+ label: t(en, it),
100088
+ value: same(value)
100089
+ };
100090
+ }
100091
+ function tilesOf$1(status) {
100092
+ const { supply, return: back, outdoor } = status.temperatures;
100093
+ const left = [];
100094
+ const right = [];
100095
+ if (supply !== null) left.push(tile("Supply", "Mandata", formatDegrees(supply)));
100096
+ if (back !== null) left.push(tile("Return", "Ritorno", formatDegrees(back)));
100097
+ if (outdoor !== null) right.push(tile("Outdoor", "Esterna", formatDegrees(outdoor)));
100098
+ if (status.waterPressureBar !== null) right.push(tile("Pressure", "Pressione", `${Number(status.waterPressureBar.toFixed(1))} bar`));
100099
+ return {
100100
+ left,
100101
+ right
100102
+ };
100103
+ }
100104
+ function isRunning(status) {
100105
+ const { compressorPct, electricalW } = status.power;
100106
+ if (compressorPct !== null) return compressorPct > 0;
100107
+ if (electricalW !== null) return electricalW > 0;
100108
+ return null;
100109
+ }
100110
+ var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pump-status", HeatPumpStatusSchema, (slice) => {
100111
+ if (slice === void 0) return { reading: reading("climate-control", "unknown") };
100112
+ const running = isRunning(slice);
100113
+ const facts = [];
100114
+ if (slice.power.electricalW !== null) facts.push(fact("power", "zap", same(`${Math.round(slice.power.electricalW)} W`)));
100115
+ if (slice.power.compressorPct !== null) facts.push(fact("level", "gauge", t(`Compressor ${Math.round(slice.power.compressorPct)} %`, `Compressore ${Math.round(slice.power.compressorPct)} %`)));
100116
+ const charging = slice.circuits.find((c) => c.active === true);
100117
+ const tiles = tilesOf$1(slice);
100118
+ const pills = powerPills(slice);
100119
+ const rows = [
100120
+ ...slice.circuits.map(circuitRow),
100121
+ ...pills.length === 0 ? [] : [{
100122
+ id: "heat-pump-power",
100123
+ icon: "zap",
100124
+ status: null,
100125
+ controls: [],
100126
+ pills: [...pills]
100127
+ }],
100128
+ ...systemRows(slice)
100129
+ ];
100130
+ return {
100131
+ reading: reading("climate-control", running === true ? "running" : running === false ? "idle" : "on"),
100132
+ title: t("Heat pump", "Pompa di calore"),
100133
+ ...charging === void 0 ? {} : { caption: t(`${charging.label} · heating`.toUpperCase(), `${charging.label} · in riscaldamento`.toUpperCase()) },
100134
+ facts,
100135
+ ...tiles.left.length === 0 && tiles.right.length === 0 ? {} : { tiles },
100136
+ ...slice.power.electricalW === null ? {} : { consumption: {
100137
+ priority: 1,
100138
+ slot: {
100139
+ kind: "power",
100140
+ watts: slice.power.electricalW,
100141
+ detail: slice.power.thermalW === null ? [] : [{
100142
+ label: t("Thermal", "Termica"),
100143
+ value: Math.round(slice.power.thermalW),
100144
+ unit: "W"
100145
+ }]
100146
+ }
100147
+ } },
100148
+ rows
100149
+ };
100150
+ }) };
100151
+ /** The position to show at `nowMs`: the reported one, advanced while playing when it is stamped. */
100152
+ function projectedPositionMs(status, nowMs) {
100153
+ if (status.position === null) return null;
100154
+ const stamp = status.positionUpdatedAt;
100155
+ if (status.state !== "playing" || typeof stamp !== "number") return status.position;
100156
+ const advanced = status.position + Math.max(0, nowMs - stamp);
100157
+ return status.duration !== null && status.duration > 0 ? Math.min(advanced, status.duration) : advanced;
100158
+ }
99232
100159
  var NO_TRANSPORT = {
99233
100160
  playPause: false,
99234
100161
  previous: false,
@@ -99412,6 +100339,13 @@ function minutesLeft(seconds) {
99412
100339
  const m = Math.ceil(seconds / 60);
99413
100340
  return t(`${m} min left`, `${m} min rimanenti`);
99414
100341
  }
100342
+ /** A time left as a tile reads it: "38 min", "1 h 12". */
100343
+ function durationText(seconds) {
100344
+ const m = Math.ceil(seconds / 60);
100345
+ if (m < 60) return t(`${m} min`, `${m} min`);
100346
+ const text = `${Math.floor(m / 60)} h ${String(m % 60).padStart(2, "0")}`;
100347
+ return t(text, text);
100348
+ }
99415
100349
  function deviceTypeOf(type) {
99416
100350
  return Object.values(DeviceType).find((t) => t === type);
99417
100351
  }
@@ -99428,7 +100362,7 @@ var switchContribution = contribution("switch", SwitchStatusSchema, (slice) => {
99428
100362
  }
99429
100363
  };
99430
100364
  });
99431
- var runningStateContribution = contribution("running-state", RunningStateStatusSchema, (slice) => {
100365
+ var runningStateContribution = contribution("running-state", RunningStateStatusSchema, (slice, ctx) => {
99432
100366
  const running = slice?.running ?? null;
99433
100367
  const phase = slice?.phase ?? null;
99434
100368
  const detail = [];
@@ -99442,13 +100376,6 @@ var runningStateContribution = contribution("running-state", RunningStateStatusS
99442
100376
  value: phase,
99443
100377
  unit: null
99444
100378
  });
99445
- const head = running === null ? t("Unknown", "Sconosciuto") : running ? t("Running", "In funzione") : t("Idle", "Inattivo");
99446
- const row = {
99447
- id: "cycle",
99448
- icon: "activity",
99449
- status: phase === null || running !== true ? head : t(`${head.en} · ${phase}`, `${head.it} · ${phase}`),
99450
- controls: []
99451
- };
99452
100379
  return {
99453
100380
  reading: reading("running-state", running === null ? "unknown" : running ? "running" : "idle"),
99454
100381
  consumption: {
@@ -99461,8 +100388,17 @@ var runningStateContribution = contribution("running-state", RunningStateStatusS
99461
100388
  detail
99462
100389
  }
99463
100390
  },
99464
- rows: [row],
99465
- ...phase !== null && running === true ? { facts: [fact("phase", "activity", t(phase, phase), "primary")] } : {}
100391
+ ...phase !== null && running === true ? { facts: [fact("phase", "activity", t(phase, phase), "primary")] } : {},
100392
+ ...running === true && (phase !== null || slice?.since != null) ? { tiles: {
100393
+ ...phase === null ? {} : { left: [{
100394
+ label: t("Phase", "Fase"),
100395
+ value: t(phase, phase)
100396
+ }] },
100397
+ ...slice?.since == null || elapsedText(slice.since, ctx.now) === null ? {} : { right: [{
100398
+ label: t("Started", "Avviata"),
100399
+ value: elapsedText(slice.since, ctx.now) ?? t("", "")
100400
+ }] }
100401
+ } } : {}
99466
100402
  };
99467
100403
  });
99468
100404
  var powerMeterContribution = contribution("power-meter", PowerMeterStatusSchema, (slice) => {
@@ -99495,6 +100431,7 @@ var powerMeterContribution = contribution("power-meter", PowerMeterStatusSchema,
99495
100431
  }
99496
100432
  },
99497
100433
  facts: [fact("power", "zap", text, watts > 0 ? "primary" : "muted")],
100434
+ tilesFallback: true,
99498
100435
  tiles: {
99499
100436
  right: [{
99500
100437
  label: t("Power", "Potenza"),
@@ -99525,6 +100462,7 @@ var batteryContribution = contribution("battery", BatteryStatusSchema, (slice) =
99525
100462
  badges: [badge],
99526
100463
  ...level === null ? {} : {
99527
100464
  facts: [fact("battery", "battery", badge.label, badge.tone)],
100465
+ tilesFallback: true,
99528
100466
  tiles: { left: [{
99529
100467
  label: t("Battery", "Batteria"),
99530
100468
  value: t(`${level}%`, `${level}%`),
@@ -99578,6 +100516,14 @@ var motionTriggerContribution = contribution("motion-trigger", MotionTriggerStat
99578
100516
  controls: [toggle]
99579
100517
  }] };
99580
100518
  });
100519
+ /** The armed run's length: "Timer 25 min". */
100520
+ function timerTile(quickRun) {
100521
+ const text = `${quickRun.duration} ${quickRun.unit}`;
100522
+ return {
100523
+ label: t("Timer", "Timer"),
100524
+ value: t(text, text)
100525
+ };
100526
+ }
99581
100527
  var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slice, ctx) => {
99582
100528
  const type = deviceTypeOf(ctx.type);
99583
100529
  const limit = type === void 0 ? void 0 : TIMED_RUN_LIMITS[type];
@@ -99598,6 +100544,7 @@ var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slic
99598
100544
  status: activeUntil === null ? t(`Run for ${quickRun.duration} ${quickRun.unit}`, `Avvia per ${quickRun.duration} ${quickRun.unit}`) : t(`Stops in ${left} min`, `Si ferma tra ${left} min`),
99599
100545
  controls: activeUntil === null ? [asAction(run)] : [asAction(cancel), asAction(restart)]
99600
100546
  };
100547
+ const armed = activeUntil === null ? {} : { right: [timerTile(quickRun)] };
99601
100548
  return {
99602
100549
  timedRun: {
99603
100550
  activeUntil,
@@ -99605,7 +100552,9 @@ var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slic
99605
100552
  run,
99606
100553
  cancel
99607
100554
  },
99608
- rows: [row]
100555
+ rows: [row],
100556
+ tilesFallback: true,
100557
+ tiles: armed
99609
100558
  };
99610
100559
  });
99611
100560
  var powerSourceContribution = contribution("power-source", PowerSourceStateSchema, (slice, ctx) => ({ powerSupply: {
@@ -99646,15 +100595,43 @@ var consumablesContribution = contribution("consumables", ConsumablesStatusSchem
99646
100595
  ...attention === 0 ? {} : { facts: [fact("consumables", null, t(`${attention} to check`, `${attention} da controllare`), "warning")] }
99647
100596
  };
99648
100597
  });
99649
- var dishwasherContribution = contribution("dishwasher", DishwasherStatusSchema, (slice) => {
100598
+ var pct = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
100599
+ var dishCycle = (id, en, it, icon, method, emphasis = "normal") => asAction(action(`cycle.${id}`, t(en, it), icon, "dishwasher", method, {}, emphasis));
100600
+ /** Pause / resume / stop, per what the appliance is doing; nothing while it is not running. */
100601
+ function dishwasherCycleControls(state) {
100602
+ if (state === "running") return [dishCycle("pause", "Pause", "Pausa", "pause", "pause"), dishCycle("stop", "Stop", "Stop", "square", "stop")];
100603
+ if (state === "paused") return [dishCycle("resume", "Resume", "Riprendi", "play", "resume", "primary"), dishCycle("stop", "Stop", "Stop", "square", "stop")];
100604
+ return [];
100605
+ }
100606
+ var OPERATION_WORDS = {
100607
+ Run: t("Running", "In corso"),
100608
+ Pause: t("Paused", "In pausa"),
100609
+ Finished: t("Finished", "Finito"),
100610
+ Ready: t("Ready", "Pronta"),
100611
+ Inactive: t("Idle", "Inattiva"),
100612
+ DelayedStart: t("Delayed start", "Avvio ritardato"),
100613
+ ActionRequired: t("Action needed", "Serve un intervento"),
100614
+ Error: t("Error", "Errore"),
100615
+ Aborting: t("Stopping", "Arresto")
100616
+ };
100617
+ var dishwasherContribution = contribution("dishwasher", DishwasherStatusSchema, (slice, ctx) => {
99650
100618
  const state = slice === void 0 || slice.state === "unavailable" ? "unknown" : slice.state === "running" ? "running" : slice.state === "error" ? "alert" : "idle";
99651
- const stop = action("program.stop", t("Stop", "Ferma"), "square", "dishwasher", "stop");
99652
- const rows = [{
99653
- id: "program",
99654
- icon: "utensils",
99655
- status: slice?.remaining == null ? null : t(`${Math.ceil(slice.remaining / 60)} min left`, `${Math.ceil(slice.remaining / 60)} min rimanenti`),
99656
- controls: slice?.state === "running" ? [asAction(stop)] : []
99657
- }];
100619
+ const rows = [];
100620
+ const progress = slice?.progress ?? null;
100621
+ if (progress !== null) rows.push({
100622
+ id: "progress",
100623
+ icon: "activity",
100624
+ status: pct(progress),
100625
+ controls: [],
100626
+ progress: progress / 100
100627
+ });
100628
+ const cycle = dishwasherCycleControls(slice?.state);
100629
+ if (cycle.length > 0) rows.push({
100630
+ id: "cycle",
100631
+ icon: "activity",
100632
+ status: null,
100633
+ controls: cycle
100634
+ });
99658
100635
  if (slice?.powerOn != null) rows.push({
99659
100636
  id: "appliance-power",
99660
100637
  icon: "power",
@@ -99669,16 +100646,32 @@ var dishwasherContribution = contribution("dishwasher", DishwasherStatusSchema,
99669
100646
  }]
99670
100647
  });
99671
100648
  const remaining = slice?.remaining ?? null;
100649
+ const phase = slice?.operationState == null ? null : OPERATION_WORDS[slice.operationState] ?? null;
100650
+ const program = slice?.program ?? slice?.selectedProgram ?? null;
100651
+ const left = [...phase === null ? [] : [{
100652
+ label: t("Phase", "Fase"),
100653
+ value: phase
100654
+ }], ...program === null ? [] : [{
100655
+ label: t("Program", "Programma"),
100656
+ value: t(program, program)
100657
+ }]];
99672
100658
  return {
99673
100659
  reading: reading("dishwasher", state),
99674
100660
  rows,
99675
- ...remaining === null ? {} : {
99676
- facts: [fact("remaining", "timer", minutesLeft(remaining), "primary")],
99677
- tiles: { right: [{
99678
- label: t("Left", "Rimane"),
99679
- value: minutesLeft(remaining)
100661
+ ...remaining === null ? {} : { facts: [fact("remaining", "timer", minutesLeft(remaining), "primary")] },
100662
+ tiles: {
100663
+ left,
100664
+ ...remaining === null ? {} : { right: [{
100665
+ label: t("Ends", "Fine"),
100666
+ value: minutesLeft(remaining),
100667
+ tone: "warning",
100668
+ at: ctx.now + remaining * 1e3
100669
+ }, {
100670
+ label: t("Left", "Restano"),
100671
+ value: durationText(remaining)
99680
100672
  }] }
99681
- }
100673
+ },
100674
+ ...progress === null ? {} : { scene: { level: progress / 100 } }
99682
100675
  };
99683
100676
  });
99684
100677
  var has$1 = (ctx, f) => ctx.features.includes(f);
@@ -99736,6 +100729,44 @@ function volumeControls(view, volumeLevel, muted) {
99736
100729
  });
99737
100730
  return controls;
99738
100731
  }
100732
+ var clock = (ms) => {
100733
+ const total = Math.max(0, Math.floor(ms / 1e3));
100734
+ const h = Math.floor(total / 3600);
100735
+ const m = Math.floor(total % 3600 / 60);
100736
+ const sec = String(total % 60).padStart(2, "0");
100737
+ return h > 0 ? `${h}:${String(m).padStart(2, "0")}:${sec}` : `${m}:${sec}`;
100738
+ };
100739
+ var REPEAT_MODES = [
100740
+ "off",
100741
+ "all",
100742
+ "one"
100743
+ ];
100744
+ /** Shuffle and repeat, drawn only when the player declares them and reports a value. */
100745
+ function modeControls(view, shuffle, repeat) {
100746
+ const controls = [];
100747
+ if (view.shuffle) controls.push({
100748
+ kind: "toggle",
100749
+ id: "playback.shuffle",
100750
+ label: t("Shuffle", "Casuale"),
100751
+ on: shuffle,
100752
+ turnOn: action("playback.shuffle.on", t("Shuffle on", "Casuale attivo"), "shuffle", "media-player", "setShuffle", { shuffle: true }),
100753
+ turnOff: action("playback.shuffle.off", t("Shuffle off", "Casuale disattivo"), "shuffle", "media-player", "setShuffle", { shuffle: false })
100754
+ });
100755
+ if (view.repeat) controls.push({
100756
+ kind: "picker",
100757
+ id: "playback.repeat",
100758
+ label: t("Repeat", "Ripeti"),
100759
+ current: repeat,
100760
+ options: [...REPEAT_MODES],
100761
+ call: {
100762
+ cap: "media-player",
100763
+ method: "setRepeat",
100764
+ args: {}
100765
+ },
100766
+ valueArg: "repeat"
100767
+ });
100768
+ return controls;
100769
+ }
99739
100770
  /** Every contributing cap, in the order their fragments are merged. */
99740
100771
  var HERO_CAP_CONTRIBUTIONS = [
99741
100772
  contribution("media-player", MediaPlayerStatusSchema, (slice, ctx) => {
@@ -99751,7 +100782,7 @@ var HERO_CAP_CONTRIBUTIONS = [
99751
100782
  controls: []
99752
100783
  });
99753
100784
  }
99754
- const playback = playbackControls(view, ctx);
100785
+ const playback = [...playbackControls(view, ctx), ...modeControls(view, slice?.shuffle ?? null, slice?.repeat ?? null)];
99755
100786
  if (playback.length > 0) rows.push({
99756
100787
  id: "playback",
99757
100788
  icon: "play",
@@ -99801,13 +100832,30 @@ var HERO_CAP_CONTRIBUTIONS = [
99801
100832
  const facts = [];
99802
100833
  if (sourceNow !== null) facts.push(fact("source", "radio", t(sourceNow, sourceNow)));
99803
100834
  if (volumeNow !== null) facts.push(fact("volume", "volume-2", t(`${volumeNow}%`, `${volumeNow}%`)));
100835
+ const duration = slice?.duration ?? null;
100836
+ const position = slice === void 0 ? null : projectedPositionMs(slice, ctx.now);
100837
+ if (position !== null && duration !== null && duration > 0) {
100838
+ const line = `${clock(position)} / ${clock(duration)}`;
100839
+ facts.push(fact("progress", "activity", t(line, line)));
100840
+ }
100841
+ const trackNow = slice?.currentMedia?.title ?? null;
100842
+ const mediaTiles = {
100843
+ left: [...trackNow === null ? [] : [{
100844
+ label: t("Track", "Brano"),
100845
+ value: t(trackNow, trackNow)
100846
+ }], ...sourceNow === null ? [] : [{
100847
+ label: t("Source", "Sorgente"),
100848
+ value: t(sourceNow, sourceNow)
100849
+ }]],
100850
+ right: volumeNow === null ? [] : [{
100851
+ label: t("Volume", "Volume"),
100852
+ value: t(`${volumeNow}%`, `${volumeNow}%`)
100853
+ }]
100854
+ };
99804
100855
  return {
99805
100856
  reading: mediaReading(view),
99806
100857
  facts,
99807
- ...volumeNow === null ? {} : { tiles: { right: [{
99808
- label: t("Volume", "Volume"),
99809
- value: t(`${volumeNow}%`, `${volumeNow}%`)
99810
- }] } },
100858
+ ...mediaTiles.left.length === 0 && mediaTiles.right.length === 0 ? {} : { tiles: mediaTiles },
99811
100859
  scene: {
99812
100860
  ...mode === null ? {} : { mode },
99813
100861
  ...volumeNow === null ? {} : { level: volumeNow / 100 }
@@ -99840,7 +100888,8 @@ var HERO_CAP_CONTRIBUTIONS = [
99840
100888
  ...Object.values(GROUPS_FAMILY_CONTRIBUTIONS),
99841
100889
  ...Object.values(ACTUATORS_FAMILY_CONTRIBUTIONS),
99842
100890
  ...Object.values(SENSORS_FAMILY_CONTRIBUTIONS),
99843
- ...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS)
100891
+ ...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
100892
+ ...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
99844
100893
  ];
99845
100894
  /**
99846
100895
  * The FIXED layout of each device type's hero (D1023). A layout lives in this
@@ -99863,9 +100912,10 @@ var MEDIA_PLAYER_LAYOUT = { rows: [
99863
100912
  "source",
99864
100913
  "do-not-disturb"
99865
100914
  ] };
99866
- var APPLIANCE_LAYOUT = { rows: ["cycle"] };
100915
+ var APPLIANCE_LAYOUT = { rows: ["progress", "cycle"] };
99867
100916
  /** Its Home Connect PowerState is a secondary row action, never the own-power slot. */
99868
100917
  var DISHWASHER_LAYOUT = { rows: [
100918
+ "progress",
99869
100919
  "cycle",
99870
100920
  "program",
99871
100921
  "appliance-power"
@@ -99875,11 +100925,17 @@ var CLIMATE_LAYOUT = { rows: [
99875
100925
  "climate-fan",
99876
100926
  "setpoint"
99877
100927
  ] };
100928
+ /** The circuits, then the power pills, then the System group, one row per mode (D1026). */
100929
+ var HEAT_PUMP_LAYOUT = { rows: [
100930
+ "circuit",
100931
+ "heat-pump-power",
100932
+ "system-mode"
100933
+ ] };
99878
100934
  var SWITCH_LAYOUT = { rows: ["motion-trigger"] };
99879
100935
  var LOCK_LAYOUT = { rows: ["lock"] };
99880
100936
  var ALARM_LAYOUT = { rows: ["alarm"] };
99881
100937
  var FAN_LAYOUT = { rows: ["fan"] };
99882
- var VACUUM_LAYOUT = { rows: ["vacuum"] };
100938
+ var VACUUM_LAYOUT = { rows: ["vacuum", "vacuum-suction"] };
99883
100939
  var MOWER_LAYOUT = { rows: ["mower"] };
99884
100940
  var FEEDER_LAYOUT = { rows: ["feeder"] };
99885
100941
  var FOUNTAIN_LAYOUT = { rows: ["fountain", "pump-cycle"] };
@@ -99918,6 +100974,7 @@ var HERO_LAYOUT_BY_TYPE = {
99918
100974
  [DeviceType.Valve]: VALVE_LAYOUT,
99919
100975
  [DeviceType.Humidifier]: HUMIDIFIER_LAYOUT,
99920
100976
  [DeviceType.WaterHeater]: CLIMATE_LAYOUT,
100977
+ [DeviceType.HeatPump]: HEAT_PUMP_LAYOUT,
99921
100978
  [DeviceType.Fan]: FAN_LAYOUT,
99922
100979
  [DeviceType.MediaPlayer]: MEDIA_PLAYER_LAYOUT,
99923
100980
  [DeviceType.AlarmPanel]: ALARM_LAYOUT,
@@ -100341,12 +101398,12 @@ var LOCK_LOOK = {
100341
101398
  standby: look("lock-open", "warning", "plain", "none"),
100342
101399
  off: look("lock-open", "muted", "plain", "none")
100343
101400
  };
100344
- /** The shield glows while armed, blinks red in alarm and goes quiet when disarmed. */
101401
+ /** The shield glows red while armed, blinks red in alarm and goes quiet when disarmed. */
100345
101402
  var ALARM_LOOK = {
100346
101403
  ...lookOf({
100347
101404
  icon: "shield-check",
100348
101405
  on: [
100349
- "success",
101406
+ "danger",
100350
101407
  "glow",
100351
101408
  "halo"
100352
101409
  ],
@@ -100591,6 +101648,22 @@ var WATER_HEATER_LOOK = lookOf({
100591
101648
  idle: INFO,
100592
101649
  standby: MUTED
100593
101650
  });
101651
+ var HEAT_PUMP_LOOK = lookOf({
101652
+ icon: "thermometer-sun",
101653
+ on: [
101654
+ "warning",
101655
+ "heat-rise",
101656
+ "rise"
101657
+ ],
101658
+ off: MUTED,
101659
+ running: [
101660
+ "warning",
101661
+ "heat-rise",
101662
+ "rise"
101663
+ ],
101664
+ idle: INFO,
101665
+ standby: MUTED
101666
+ });
100594
101667
  /** What a climate device draws while it is on, by mode: warm air rises, cold falls, drops dry, the fan spins. */
100595
101668
  var HERO_MODE_LOOK = {
100596
101669
  heat: look("flame", "warning", "heat-rise", "rise"),
@@ -100625,6 +101698,7 @@ var HERO_LOOK_BY_TYPE = {
100625
101698
  [DeviceType.Valve]: VALVE_LOOK,
100626
101699
  [DeviceType.Humidifier]: HUMIDIFIER_LOOK,
100627
101700
  [DeviceType.WaterHeater]: WATER_HEATER_LOOK,
101701
+ [DeviceType.HeatPump]: HEAT_PUMP_LOOK,
100628
101702
  [DeviceType.Fan]: FAN_LOOK,
100629
101703
  [DeviceType.MediaPlayer]: MEDIA_PLAYER_LOOK,
100630
101704
  [DeviceType.AlarmPanel]: ALARM_LOOK,
@@ -100864,7 +101938,19 @@ function consumptionOf(fragments) {
100864
101938
  return best === null ? null : best.slot;
100865
101939
  }
100866
101940
  function tilesOf(fragments, side) {
100867
- return fragments.flatMap((f) => f.tiles?.[side] ?? []).slice(0, 2);
101941
+ const own = fragments.filter((f) => f.tilesFallback !== true).flatMap((f) => f.tiles?.[side] ?? []);
101942
+ return (own.length > 0 ? own : fragments.filter((f) => f.tilesFallback === true).flatMap((f) => f.tiles?.[side] ?? [])).slice(0, 2);
101943
+ }
101944
+ /** The foot button that opens the history, named for what the device keeps. */
101945
+ function historyLabelOf(type) {
101946
+ switch (type) {
101947
+ case DeviceType.Washer:
101948
+ case DeviceType.Dryer:
101949
+ case DeviceType.Dishwasher: return t("Cycles", "Cicli");
101950
+ case DeviceType.PetFeeder: return t("Meals", "Pasti");
101951
+ case DeviceType.Lock: return t("Access", "Accessi");
101952
+ default: return t("History", "Storico");
101953
+ }
100868
101954
  }
100869
101955
  function sceneOf(role, type, fragments) {
100870
101956
  const parts = fragments.flatMap((f) => f.scene === void 0 ? [] : [f.scene]);
@@ -100908,20 +101994,27 @@ function buildHeroModel(input) {
100908
101994
  };
100909
101995
  const allRows = fragments.flatMap((f) => f.rows ?? []);
100910
101996
  const rows = resolveHeroLayout(device.type).rows.flatMap((id) => {
100911
- const row = allRows.find((r) => r.id === id);
100912
- return row === void 0 ? [] : [row];
101997
+ return allRows.filter((r) => r.id === id);
100913
101998
  });
100914
101999
  const ownPower = resolveOwnPower(fragments.flatMap((f) => f.ownPower === void 0 ? [] : [f.ownPower]));
100915
102000
  const timedRun = fragments.find((f) => f.timedRun !== void 0)?.timedRun ?? null;
100916
102001
  const powerSupply = fragments.find((f) => f.powerSupply !== void 0)?.powerSupply ?? null;
100917
102002
  const remote = fragments.find((f) => f.remote !== void 0)?.remote ?? null;
100918
- const badges = fragments.flatMap((f) => f.badges ?? []);
102003
+ const integration = device.integration?.trim() ?? "";
102004
+ const badges = [...integration === "" ? [] : [{
102005
+ id: "integration",
102006
+ icon: "plug",
102007
+ tone: "muted",
102008
+ value: null,
102009
+ label: t(integration, integration)
102010
+ }], ...fragments.flatMap((f) => f.badges ?? [])];
100919
102011
  const headline = state === "offline" || state === "unknown" ? void 0 : fragments.find((f) => f.title !== void 0)?.title;
100920
102012
  const facts = fragments.flatMap((f) => f.facts ?? []).filter((f) => headline === void 0 || f.text.en !== headline.en);
100921
102013
  const sideTiles = {
100922
102014
  left: tilesOf(fragments, "left"),
100923
102015
  right: tilesOf(fragments, "right")
100924
102016
  };
102017
+ const caption = state === "offline" || state === "unknown" ? void 0 : fragments.find((f) => f.caption !== void 0)?.caption;
100925
102018
  const gated = [];
100926
102019
  if (!input.access.canActuate) {
100927
102020
  if (ownPower !== null) gated.push("own-power");
@@ -100943,8 +102036,10 @@ function buildHeroModel(input) {
100943
102036
  facts,
100944
102037
  sideTiles,
100945
102038
  title: headline ?? title,
102039
+ ...caption === void 0 ? {} : { caption },
100946
102040
  badges,
100947
102041
  remote,
102042
+ historyLabel: historyLabelOf(device.type),
100948
102043
  consumables: fragments.find((f) => f.consumables !== void 0)?.consumables ?? null,
100949
102044
  consumption: consumptionOf(fragments),
100950
102045
  ownPower,
@@ -101334,13 +102429,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
101334
102429
  access: "view",
101335
102430
  role: "admin"
101336
102431
  },
101337
- "addonSettings.getIntegrationFormSchema": {
101338
- capName: "addon-settings",
101339
- capScope: "system",
101340
- addonId: null,
101341
- access: "view",
101342
- role: "admin"
101343
- },
101344
102432
  "addonSettings.getScopedSettings": {
101345
102433
  capName: "addon-settings",
101346
102434
  capScope: "system",
@@ -104456,6 +105544,111 @@ var METHOD_ACCESS_MAP = Object.freeze({
104456
105544
  access: "view",
104457
105545
  role: "viewer"
104458
105546
  },
105547
+ "heatPumpControl.setAdditionalHeaterMode": {
105548
+ capName: "heat-pump-control",
105549
+ capScope: "device",
105550
+ addonId: null,
105551
+ access: "create",
105552
+ role: "viewer"
105553
+ },
105554
+ "heatPumpControl.setAwayMode": {
105555
+ capName: "heat-pump-control",
105556
+ capScope: "device",
105557
+ addonId: null,
105558
+ access: "create",
105559
+ role: "viewer"
105560
+ },
105561
+ "heatPumpControl.setCircuitComfortSetpoint": {
105562
+ capName: "heat-pump-control",
105563
+ capScope: "device",
105564
+ addonId: null,
105565
+ access: "create",
105566
+ role: "viewer"
105567
+ },
105568
+ "heatPumpControl.setCircuitEcoSetpoint": {
105569
+ capName: "heat-pump-control",
105570
+ capScope: "device",
105571
+ addonId: null,
105572
+ access: "create",
105573
+ role: "viewer"
105574
+ },
105575
+ "heatPumpControl.setCircuitHeatCoolMode": {
105576
+ capName: "heat-pump-control",
105577
+ capScope: "device",
105578
+ addonId: null,
105579
+ access: "create",
105580
+ role: "viewer"
105581
+ },
105582
+ "heatPumpControl.setCircuitMaxFlowTemp": {
105583
+ capName: "heat-pump-control",
105584
+ capScope: "device",
105585
+ addonId: null,
105586
+ access: "create",
105587
+ role: "viewer"
105588
+ },
105589
+ "heatPumpControl.setCircuitOperationMode": {
105590
+ capName: "heat-pump-control",
105591
+ capScope: "device",
105592
+ addonId: null,
105593
+ access: "create",
105594
+ role: "viewer"
105595
+ },
105596
+ "heatPumpControl.setCircuitSummerWinter": {
105597
+ capName: "heat-pump-control",
105598
+ capScope: "device",
105599
+ addonId: null,
105600
+ access: "create",
105601
+ role: "viewer"
105602
+ },
105603
+ "heatPumpControl.setDhwChargeDuration": {
105604
+ capName: "heat-pump-control",
105605
+ capScope: "device",
105606
+ addonId: null,
105607
+ access: "create",
105608
+ role: "viewer"
105609
+ },
105610
+ "heatPumpControl.setDhwOperationMode": {
105611
+ capName: "heat-pump-control",
105612
+ capScope: "device",
105613
+ addonId: null,
105614
+ access: "create",
105615
+ role: "viewer"
105616
+ },
105617
+ "heatPumpControl.setDhwTemperatureLevel": {
105618
+ capName: "heat-pump-control",
105619
+ capScope: "device",
105620
+ addonId: null,
105621
+ access: "create",
105622
+ role: "viewer"
105623
+ },
105624
+ "heatPumpControl.setHolidayMode": {
105625
+ capName: "heat-pump-control",
105626
+ capScope: "device",
105627
+ addonId: null,
105628
+ access: "create",
105629
+ role: "viewer"
105630
+ },
105631
+ "heatPumpControl.setSilentMode": {
105632
+ capName: "heat-pump-control",
105633
+ capScope: "device",
105634
+ addonId: null,
105635
+ access: "create",
105636
+ role: "viewer"
105637
+ },
105638
+ "heatPumpControl.startExtraHotWater": {
105639
+ capName: "heat-pump-control",
105640
+ capScope: "device",
105641
+ addonId: null,
105642
+ access: "create",
105643
+ role: "viewer"
105644
+ },
105645
+ "heatPumpStatus.getStatus": {
105646
+ capName: "heat-pump-status",
105647
+ capScope: "device",
105648
+ addonId: null,
105649
+ access: "view",
105650
+ role: "viewer"
105651
+ },
104459
105652
  "heroLayout.getHeroModel": {
104460
105653
  capName: "hero-layout",
104461
105654
  capScope: "system",
@@ -109363,13 +110556,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
109363
110556
  access: "create",
109364
110557
  role: "admin"
109365
110558
  },
109366
- "smtpProvider.verify": {
109367
- capName: "smtp-provider",
109368
- capScope: "system",
109369
- addonId: null,
109370
- access: "view",
109371
- role: "admin"
109372
- },
109373
110559
  "snapshot.applyDeviceSettingsPatch": {
109374
110560
  capName: "snapshot",
109375
110561
  capScope: "device",
@@ -111302,7 +112488,7 @@ function projectAction(cap, action) {
111302
112488
  };
111303
112489
  }
111304
112490
  Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
111305
- DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
112491
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
111306
112492
  DeviceFeature.BatteryOperated;
111307
112493
  DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
111308
112494
  var HA_AS = "a power sensor (device_class power). Home Assistant has no laundry domain. running-state stays unexported until a null reading can be published as unavailable.";
@@ -111385,6 +112571,7 @@ var CAP_NAMES_WITH_STATUS = [
111385
112571
  "group-active",
111386
112572
  "group-commands",
111387
112573
  "group-status",
112574
+ "heat-pump-status",
111388
112575
  "heating-valve",
111389
112576
  "humidifier",
111390
112577
  "humidity-sensor",
@@ -112516,6 +113703,81 @@ Object.freeze({
112516
113703
  form: "single",
112517
113704
  optional: false
112518
113705
  }],
113706
+ "heatPumpControl.setAdditionalHeaterMode": [{
113707
+ name: "deviceId",
113708
+ form: "single",
113709
+ optional: false
113710
+ }],
113711
+ "heatPumpControl.setAwayMode": [{
113712
+ name: "deviceId",
113713
+ form: "single",
113714
+ optional: false
113715
+ }],
113716
+ "heatPumpControl.setCircuitComfortSetpoint": [{
113717
+ name: "deviceId",
113718
+ form: "single",
113719
+ optional: false
113720
+ }],
113721
+ "heatPumpControl.setCircuitEcoSetpoint": [{
113722
+ name: "deviceId",
113723
+ form: "single",
113724
+ optional: false
113725
+ }],
113726
+ "heatPumpControl.setCircuitHeatCoolMode": [{
113727
+ name: "deviceId",
113728
+ form: "single",
113729
+ optional: false
113730
+ }],
113731
+ "heatPumpControl.setCircuitMaxFlowTemp": [{
113732
+ name: "deviceId",
113733
+ form: "single",
113734
+ optional: false
113735
+ }],
113736
+ "heatPumpControl.setCircuitOperationMode": [{
113737
+ name: "deviceId",
113738
+ form: "single",
113739
+ optional: false
113740
+ }],
113741
+ "heatPumpControl.setCircuitSummerWinter": [{
113742
+ name: "deviceId",
113743
+ form: "single",
113744
+ optional: false
113745
+ }],
113746
+ "heatPumpControl.setDhwChargeDuration": [{
113747
+ name: "deviceId",
113748
+ form: "single",
113749
+ optional: false
113750
+ }],
113751
+ "heatPumpControl.setDhwOperationMode": [{
113752
+ name: "deviceId",
113753
+ form: "single",
113754
+ optional: false
113755
+ }],
113756
+ "heatPumpControl.setDhwTemperatureLevel": [{
113757
+ name: "deviceId",
113758
+ form: "single",
113759
+ optional: false
113760
+ }],
113761
+ "heatPumpControl.setHolidayMode": [{
113762
+ name: "deviceId",
113763
+ form: "single",
113764
+ optional: false
113765
+ }],
113766
+ "heatPumpControl.setSilentMode": [{
113767
+ name: "deviceId",
113768
+ form: "single",
113769
+ optional: false
113770
+ }],
113771
+ "heatPumpControl.startExtraHotWater": [{
113772
+ name: "deviceId",
113773
+ form: "single",
113774
+ optional: false
113775
+ }],
113776
+ "heatPumpStatus.getStatus": [{
113777
+ name: "deviceId",
113778
+ form: "single",
113779
+ optional: false
113780
+ }],
112519
113781
  "heroLayout.getHeroModel": [{
112520
113782
  name: "deviceId",
112521
113783
  form: "single",
@@ -114485,7 +115747,7 @@ Object.freeze({
114485
115747
  });
114486
115748
  /**
114487
115749
  * Per-cap runtime-state policy, projected from every `*.cap.ts` that declares
114488
- * `runtimeState`. 81 caps: 41 `restored`, 40 `session`.
115750
+ * `runtimeState`. 82 caps: 41 `restored`, 41 `session`.
114489
115751
  *
114490
115752
  * A cap absent from this map has no runtime-state slice at all. A cap PRESENT
114491
115753
  * with `durability: 'session'` has one and has decided not to keep it.
@@ -114620,6 +115882,10 @@ var RUNTIME_STATE_POLICY = {
114620
115882
  durability: "session",
114621
115883
  volatileFields: []
114622
115884
  },
115885
+ "heat-pump-status": {
115886
+ durability: "session",
115887
+ volatileFields: ["lastFetchedAt"]
115888
+ },
114623
115889
  "heating-valve": {
114624
115890
  durability: "session",
114625
115891
  volatileFields: ["lastFetchedAt"]