@camstack/addon-provider-reolink 1.2.235 → 1.2.236

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/addon.mjs CHANGED
@@ -101490,7 +101490,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
101490
101490
  return EventCategory;
101491
101491
  }({});
101492
101492
  //#endregion
101493
- //#region ../types/dist/device-type-CbDhVwFP.mjs
101493
+ //#region ../types/dist/composed-stable-id-jnvhwGoH.mjs
101494
101494
  /**
101495
101495
  import { errMsg } from '@camstack/types'
101496
101496
  * Extract a human-readable message from an unknown error value.
@@ -101616,6 +101616,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
101616
101616
  * (`reboot`, `device-admin-link`). Products are NOT its children — they are
101617
101617
  * adopted beside it — and its connection settings stay on the integration. */
101618
101618
  DeviceType["Gateway"] = "gateway";
101619
+ /** A heat pump (any vendor): the compressor unit with its circuits (heating, hot
101620
+ * water, cooling, solar), its system modes and its power. One main read-only
101621
+ * `heat-pump-status` cap carries all of it; `heat-pump-control` sets it (D1026). */
101622
+ DeviceType["HeatPump"] = "heat-pump";
101619
101623
  return DeviceType;
101620
101624
  }({});
101621
101625
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -101774,6 +101778,10 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
101774
101778
  /** Robot mower exposes targeted mowing (all-area / zones / edges /
101775
101779
  * spots) — gates the Mow action + map selectors. */
101776
101780
  DeviceFeature["MowerHasTargetedMowing"] = "mower-has-targeted-mowing";
101781
+ /** The device has a drive/navigation surface (`navigation` cap): a robot camera. */
101782
+ DeviceFeature["Navigation"] = "navigation";
101783
+ /** The device has a network-link reading (`network-link` cap). */
101784
+ DeviceFeature["NetworkLink"] = "network-link";
101777
101785
  return DeviceFeature;
101778
101786
  }({});
101779
101787
  /**
@@ -101888,6 +101896,12 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
101888
101896
  DeviceRole["IrTransmitter"] = "ir-transmitter";
101889
101897
  return DeviceRole;
101890
101898
  }({});
101899
+ /**
101900
+ * A composed device's stableId is this prefix plus the block id. Its own module,
101901
+ * free of zod, so the addon runner can read it through `@camstack/types/addon`
101902
+ * without loading the schema barrel (D28).
101903
+ */
101904
+ var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
101891
101905
  //#endregion
101892
101906
  //#region ../../node_modules/zod/v4/core/core.js
101893
101907
  var _a$1;
@@ -106700,7 +106714,7 @@ var ZodIssueCode = {
106700
106714
  var ZodFirstPartyTypeKind;
106701
106715
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
106702
106716
  //#endregion
106703
- //#region ../types/dist/sleep-CS5Xp1iQ.mjs
106717
+ //#region ../types/dist/sleep-Dz1P6--1.mjs
106704
106718
  /**
106705
106719
  * The audio chunk plane's byte format, and the ONE expansion from a coded
106706
106720
  * window to float samples (D455).
@@ -109394,16 +109408,6 @@ var BaseAddon = class {
109394
109408
  return null;
109395
109409
  }
109396
109410
  /**
109397
- * The form schema of ONE integration instance, or `null` to use the scoped form.
109398
- *
109399
- * Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
109400
- * needs its connection fields, the default integration the addon's own sections. It is the
109401
- * SHAPE of the form only — the values live on the instance record.
109402
- */
109403
- async integrationFormSchema(_instance) {
109404
- return null;
109405
- }
109406
- /**
109407
109411
  * D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
109408
109412
  * provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
109409
109413
  * declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
@@ -109431,8 +109435,7 @@ var BaseAddon = class {
109431
109435
  }
109432
109436
  /**
109433
109437
  * The host's read of the scoped declarations: the schema one capability declares for `scope`,
109434
- * or `null`. Beside {@link getIntegrationFormSchema}, the same shape: the hook is protected, the
109435
- * host asks this method.
109438
+ * or `null`. The hook is protected, the host asks this method.
109436
109439
  */
109437
109440
  async getScopedSettingsSchema(scope, cap) {
109438
109441
  switch (scope) {
@@ -109600,22 +109603,6 @@ var BaseAddon = class {
109600
109603
  return Object.fromEntries([...collectHydratedFieldValues(form)].filter(([, value]) => value !== void 0));
109601
109604
  }
109602
109605
  /**
109603
- * What the create wizard and the integration edit page render for one instance: the addon's
109604
- * per-instance schema when it declares one, else its global schema (what they always showed).
109605
- */
109606
- async getIntegrationFormSchema(instance, nodeId) {
109607
- const scoped = await this.integrationFormSchema(instance);
109608
- if (scoped === null) return this.scopedForm(nodeId);
109609
- return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
109610
- }
109611
- /** The form of the scoped schemas this addon declared, hydrated from its store. */
109612
- async scopedForm(nodeId) {
109613
- await this.loadScopedSchemas();
109614
- const schema = this.scopedFormSchema();
109615
- if (!schema) return { sections: [] };
109616
- return hydrateSchema(schema, await this.readRawProjectedStore(nodeId), { inlineSecretsAsViews: true });
109617
- }
109618
- /**
109619
109606
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
109620
109607
  * every `perNode: true` field carries THAT node's scoped value on its bare
109621
109608
  * key (absent scoped key ⇒ key absent, so the schema `default` wins — no
@@ -109802,12 +109789,6 @@ var BaseAddon = class {
109802
109789
  this._nodeKeysByCap = /* @__PURE__ */ new Map();
109803
109790
  this._addonSecretTree = null;
109804
109791
  }
109805
- /** The form of an addon's scoped schemas: their sections, each shown once. */
109806
- scopedFormSchema(cap) {
109807
- const byId = /* @__PURE__ */ new Map();
109808
- for (const entry of this.loadedScopedSchemas(cap)) for (const section of entry.schema.sections) if (!byId.has(section.id)) byId.set(section.id, section);
109809
- return byId.size === 0 ? null : { sections: [...byId.values()] };
109810
- }
109811
109792
  /** Every loaded scoped schema of `cap`, or of every loaded capability. */
109812
109793
  loadedScopedSchemas(cap) {
109813
109794
  if (cap !== void 0) return this._scopedByCap.get(cap) ?? [];
@@ -110397,6 +110378,24 @@ function normalizeAddonInitResult(result) {
110397
110378
  if (Array.isArray(result)) return { providers: result };
110398
110379
  return result;
110399
110380
  }
110381
+ object({
110382
+ code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
110383
+ params: record(string(), union([string(), number$1()])).optional()
110384
+ });
110385
+ var CamstackError = class extends Error {
110386
+ i18nCode;
110387
+ i18nParams;
110388
+ constructor(code, params, englishMessage) {
110389
+ super(englishMessage);
110390
+ this.name = "CamstackError";
110391
+ this.i18nCode = code;
110392
+ this.i18nParams = params;
110393
+ }
110394
+ };
110395
+ /** `throw userError('device.not-found', { id }, 'Device 12 not found')` */
110396
+ function userError(code, params, englishFallback) {
110397
+ return new CamstackError(code, params, englishFallback);
110398
+ }
110400
110399
  object({
110401
110400
  field: string().min(1),
110402
110401
  on: literal("advance")
@@ -110473,12 +110472,6 @@ function systemMethod(input, output, options) {
110473
110472
  systemOnly: true
110474
110473
  };
110475
110474
  }
110476
- /**
110477
- * A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
110478
- * on `InferProvider`. The `providerOptional: true` literal is what
110479
- * `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
110480
- * for when this is the honest answer and when it is a soft stub.
110481
- */
110482
110475
  function optionalMethod(input, output, options) {
110483
110476
  return {
110484
110477
  ...method(input, output, options),
@@ -110769,15 +110762,52 @@ var PeerBytesTicketSchema = object({
110769
110762
  */
110770
110763
  declaredBytes: number$1().int().nonnegative().nullable()
110771
110764
  });
110772
- discriminatedUnion("kind", [object({
110773
- kind: literal("action"),
110774
- actionId: string(),
110775
- runId: string(),
110776
- automationId: string().optional()
110777
- }), object({
110778
- kind: literal("scheduler"),
110779
- schedulerId: string()
110780
- })]);
110765
+ /**
110766
+ * The match a notification rule fired on (D705). Carried as a command origin so an
110767
+ * Action the rule starts can press `alarm-panel.trigger` as that match, not as an
110768
+ * anonymous press (D735). The same fields a rule fire ref freezes.
110769
+ */
110770
+ var RuleFireOriginSchema = object({
110771
+ ruleId: string(),
110772
+ ruleName: string(),
110773
+ deviceId: number$1().int(),
110774
+ sourceDeviceId: number$1().int().optional(),
110775
+ recordId: string(),
110776
+ timestamp: number$1(),
110777
+ trackId: string().optional(),
110778
+ eventId: string().optional(),
110779
+ className: string().optional(),
110780
+ label: string().optional(),
110781
+ zones: array(string()).optional(),
110782
+ confidence: number$1().optional(),
110783
+ sensorChange: object({
110784
+ name: string(),
110785
+ kind: string(),
110786
+ state: string()
110787
+ }).optional(),
110788
+ extraStills: array(object({
110789
+ ownerId: string(),
110790
+ cameraId: number$1().int()
110791
+ })).optional()
110792
+ });
110793
+ discriminatedUnion("kind", [
110794
+ object({
110795
+ kind: literal("action"),
110796
+ actionId: string(),
110797
+ runId: string(),
110798
+ automationId: string().optional(),
110799
+ /** The rule fire that started this run, when one did (D705). */
110800
+ ruleFire: RuleFireOriginSchema.optional()
110801
+ }),
110802
+ object({
110803
+ kind: literal("scheduler"),
110804
+ schedulerId: string()
110805
+ }),
110806
+ object({
110807
+ kind: literal("rule"),
110808
+ fire: RuleFireOriginSchema
110809
+ })
110810
+ ]);
110781
110811
  /**
110782
110812
  * One recorded device transition (D1022): a status field of a device went from
110783
110813
  * one value to another, with who or what asked for it.
@@ -111363,7 +111393,7 @@ function t(en, it) {
111363
111393
  * Things an operator switches, opens, sets or arms: lights, plugs, sirens,
111364
111394
  * covers, valves, locks, climate, fans, alarm panels.
111365
111395
  */
111366
- var ON = t("On", "Acceso");
111396
+ var ON$1 = t("On", "Acceso");
111367
111397
  var PERCENT = t("Percentage", "Percentuale");
111368
111398
  var OPEN_CLOSE_STATES = [
111369
111399
  {
@@ -111423,7 +111453,7 @@ var ACTUATOR_CAP_VOCABULARY = {
111423
111453
  state: [{
111424
111454
  kind: "boolean",
111425
111455
  field: "on",
111426
- label: ON,
111456
+ label: ON$1,
111427
111457
  whenTrue: t("When {device} turns on", "Quando {device} si accende"),
111428
111458
  whenFalse: t("When {device} turns off", "Quando {device} si spegne"),
111429
111459
  icon: "power"
@@ -112589,7 +112619,7 @@ var ACTUATOR_CAP_VOCABULARY = {
112589
112619
  state: [{
112590
112620
  kind: "boolean",
112591
112621
  field: "on",
112592
- label: ON,
112622
+ label: ON$1,
112593
112623
  whenTrue: t("When {device} turns on", "Quando {device} si accende"),
112594
112624
  whenFalse: t("When {device} turns off", "Quando {device} si spegne"),
112595
112625
  icon: "power"
@@ -115001,6 +115031,133 @@ var CAMERA_CAP_VOCABULARY = {
115001
115031
  }
115002
115032
  };
115003
115033
  /**
115034
+ * The heat pump (D1026): its system modes are phrased for automations, each with the
115035
+ * values the gateway really accepts; the per-circuit parameters need a circuit and are
115036
+ * set from the device page.
115037
+ */
115038
+ var OFF = {
115039
+ value: "off",
115040
+ label: t("Off", "Off")
115041
+ };
115042
+ var AUTO = {
115043
+ value: "auto",
115044
+ label: t("Auto", "Auto")
115045
+ };
115046
+ var ON = {
115047
+ value: "on",
115048
+ label: t("On", "On")
115049
+ };
115050
+ var MANUAL = {
115051
+ value: "manual",
115052
+ label: t("Manual", "Manuale")
115053
+ };
115054
+ var HOLIDAY_PROGRAMMES = [OFF, ...[
115055
+ 1,
115056
+ 2,
115057
+ 3,
115058
+ 4,
115059
+ 5,
115060
+ 6,
115061
+ 7,
115062
+ 8
115063
+ ].map((n) => ({
115064
+ value: `hm${n}`,
115065
+ label: t(`Programme ${n}`, `Programma ${n}`)
115066
+ }))];
115067
+ var PER_CIRCUIT = "Needs a circuit: set from the device page, not offered to automations";
115068
+ var HEAT_PUMP_CAP_VOCABULARY = {
115069
+ "heat-pump-status": {
115070
+ scope: "device",
115071
+ noun: t("Heat pump", "Pompa di calore")
115072
+ },
115073
+ "heat-pump-control": {
115074
+ scope: "device",
115075
+ noun: t("Heat pump settings", "Impostazioni pompa di calore"),
115076
+ actions: [
115077
+ {
115078
+ id: "heatPump.silent",
115079
+ method: "setSilentMode",
115080
+ label: t("Set silent mode", "Imposta la modalità silenziosa"),
115081
+ phrase: t("Set silent mode of {device} to {mode}", "Imposta la modalità silenziosa di {device} su {mode}"),
115082
+ icon: "volume-x",
115083
+ openArgs: [{
115084
+ key: "mode",
115085
+ label: t("Silent mode", "Modalità silenziosa"),
115086
+ offer: {
115087
+ kind: "enum",
115088
+ values: [
115089
+ OFF,
115090
+ AUTO,
115091
+ ON
115092
+ ]
115093
+ }
115094
+ }]
115095
+ },
115096
+ {
115097
+ id: "heatPump.away",
115098
+ method: "setAwayMode",
115099
+ label: t("Set away mode", "Imposta la modalità assente"),
115100
+ phrase: t("Set away mode of {device} to {mode}", "Imposta la modalità assente di {device} su {mode}"),
115101
+ icon: "plane",
115102
+ openArgs: [{
115103
+ key: "mode",
115104
+ label: t("Away mode", "Modalità assente"),
115105
+ offer: {
115106
+ kind: "enum",
115107
+ values: [OFF, ON]
115108
+ }
115109
+ }]
115110
+ },
115111
+ {
115112
+ id: "heatPump.additionalHeater",
115113
+ method: "setAdditionalHeaterMode",
115114
+ label: t("Set additional heater", "Imposta il riscaldatore aggiuntivo"),
115115
+ phrase: t("Set the additional heater of {device} to {mode}", "Imposta il riscaldatore aggiuntivo di {device} su {mode}"),
115116
+ icon: "flame",
115117
+ openArgs: [{
115118
+ key: "mode",
115119
+ label: t("Additional heater", "Riscaldatore aggiuntivo"),
115120
+ offer: {
115121
+ kind: "enum",
115122
+ values: [
115123
+ OFF,
115124
+ MANUAL,
115125
+ AUTO
115126
+ ]
115127
+ }
115128
+ }]
115129
+ },
115130
+ {
115131
+ id: "heatPump.holiday",
115132
+ method: "setHolidayMode",
115133
+ label: t("Set holiday mode", "Imposta la modalità vacanza"),
115134
+ phrase: t("Set holiday mode of {device} to {mode}", "Imposta la modalità vacanza di {device} su {mode}"),
115135
+ icon: "tree-palm",
115136
+ openArgs: [{
115137
+ key: "mode",
115138
+ label: t("Holiday programme", "Programma vacanza"),
115139
+ offer: {
115140
+ kind: "enum",
115141
+ values: HOLIDAY_PROGRAMMES
115142
+ }
115143
+ }]
115144
+ }
115145
+ ],
115146
+ notOperatorFacing: {
115147
+ setCircuitOperationMode: PER_CIRCUIT,
115148
+ setCircuitHeatCoolMode: PER_CIRCUIT,
115149
+ setCircuitSummerWinter: PER_CIRCUIT,
115150
+ setCircuitComfortSetpoint: PER_CIRCUIT,
115151
+ setCircuitEcoSetpoint: PER_CIRCUIT,
115152
+ setCircuitMaxFlowTemp: PER_CIRCUIT,
115153
+ setDhwOperationMode: PER_CIRCUIT,
115154
+ setDhwTemperatureLevel: PER_CIRCUIT,
115155
+ setDhwChargeDuration: PER_CIRCUIT,
115156
+ startExtraHotWater: PER_CIRCUIT
115157
+ }
115158
+ }
115159
+ };
115160
+ /**
115004
115161
  * Things an operator WATCHES: contacts, motion, leaks, smoke, measurements,
115005
115162
  * presence, reachability, batteries, doorbells and event sources.
115006
115163
  */
@@ -115722,6 +115879,7 @@ var CAP_VOCABULARY_BY_NAME = {
115722
115879
  ...ACTUATOR_CAP_VOCABULARY,
115723
115880
  ...APPLIANCE_CAP_VOCABULARY,
115724
115881
  ...CAMERA_CAP_VOCABULARY,
115882
+ ...HEAT_PUMP_CAP_VOCABULARY,
115725
115883
  ...SENSOR_CAP_VOCABULARY,
115726
115884
  ...SYSTEM_CAP_VOCABULARY
115727
115885
  };
@@ -115981,6 +116139,8 @@ var CAP_NAMES = Object.freeze([
115981
116139
  "group-active",
115982
116140
  "group-commands",
115983
116141
  "group-status",
116142
+ "heat-pump-control",
116143
+ "heat-pump-status",
115984
116144
  "heating-valve",
115985
116145
  "hero-layout",
115986
116146
  "humidifier",
@@ -116846,6 +117006,48 @@ Object.freeze({
116846
117006
  "valueType": "number"
116847
117007
  }
116848
117008
  ],
117009
+ "heat-pump-status": [
117010
+ {
117011
+ "path": "power.thermalW",
117012
+ "valueType": "number"
117013
+ },
117014
+ {
117015
+ "path": "power.electricalW",
117016
+ "valueType": "number"
117017
+ },
117018
+ {
117019
+ "path": "power.compressorPct",
117020
+ "valueType": "number"
117021
+ },
117022
+ {
117023
+ "path": "temperatures.supply",
117024
+ "valueType": "number"
117025
+ },
117026
+ {
117027
+ "path": "temperatures.return",
117028
+ "valueType": "number"
117029
+ },
117030
+ {
117031
+ "path": "temperatures.outdoor",
117032
+ "valueType": "number"
117033
+ },
117034
+ {
117035
+ "path": "energy.thermalKwh",
117036
+ "valueType": "number"
117037
+ },
117038
+ {
117039
+ "path": "energy.electricalKwh",
117040
+ "valueType": "number"
117041
+ },
117042
+ {
117043
+ "path": "waterPressureBar",
117044
+ "valueType": "number"
117045
+ },
117046
+ {
117047
+ "path": "starts",
117048
+ "valueType": "number"
117049
+ }
117050
+ ],
116849
117051
  "heating-valve": [{
116850
117052
  "path": "position",
116851
117053
  "valueType": "number"
@@ -117986,24 +118188,6 @@ Object.freeze({
117986
118188
  "uploadDataset": 72e5
117987
118189
  }
117988
118190
  });
117989
- object({
117990
- code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
117991
- params: record(string(), union([string(), number$1()])).optional()
117992
- });
117993
- var CamstackError = class extends Error {
117994
- i18nCode;
117995
- i18nParams;
117996
- constructor(code, params, englishMessage) {
117997
- super(englishMessage);
117998
- this.name = "CamstackError";
117999
- this.i18nCode = code;
118000
- this.i18nParams = params;
118001
- }
118002
- };
118003
- /** `throw userError('device.not-found', { id }, 'Device 12 not found')` */
118004
- function userError(code, params, englishFallback) {
118005
- return new CamstackError(code, params, englishFallback);
118006
- }
118007
118191
  /**
118008
118192
  * Promise-based timer helpers — used everywhere the codebase needs to
118009
118193
  * wait, back off, or schedule a retry. Before these helpers landed, each
@@ -118029,7 +118213,7 @@ function sleep(ms) {
118029
118213
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
118030
118214
  }
118031
118215
  //#endregion
118032
- //#region ../types/dist/composition-CXCX78IR.mjs
118216
+ //#region ../types/dist/implemented-methods-OitwyO1Y.mjs
118033
118217
  /**
118034
118218
  * The ffmpeg build every CamStack node downloads, per platform and arch.
118035
118219
  *
@@ -118984,8 +119168,6 @@ var HelperSpecSchema = discriminatedUnion("kind", [
118984
119168
  source: HelperMemberSchema
118985
119169
  })
118986
119170
  ]);
118987
- /** A composed device's stableId is this prefix plus the block id. */
118988
- var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
118989
119171
  /** Longest snippet a `code` source may carry (slice 4). */
118990
119172
  var MAX_COMPOSITION_CODE_LENGTH = 2e4;
118991
119173
  /** One field of one capability of one source device. */
@@ -119760,25 +119942,6 @@ var RequiredAddonUpdateSchema = object({
119760
119942
  installed: string().nullable()
119761
119943
  });
119762
119944
  /**
119763
- * Which integration instance a settings form is for. An addon that serves several instances
119764
- * (`instanceMode: multiple`) can show a different form per instance — an NVR integration
119765
- * needs its connection, the default integration needs the addon's own sections.
119766
- *
119767
- * - `integrationId` is `null` in the create wizard: nothing exists yet, the operator is
119768
- * setting up a NEW instance.
119769
- * - `mode` is the wizard mode of the integration type (`getAvailableTypes`).
119770
- * - `candidateStableId` is the discovery candidate a wizard was seeded from, if any.
119771
- */
119772
- var IntegrationInstanceRefSchema = object({
119773
- integrationId: string().nullable(),
119774
- mode: _enum([
119775
- "standalone",
119776
- "account",
119777
- "broker"
119778
- ]),
119779
- candidateStableId: string().optional()
119780
- });
119781
- /**
119782
119945
  * notification-output — canonical, capability-gated notification delivery.
119783
119946
  *
119784
119947
  * Apprise-derived model (see
@@ -120007,18 +120170,43 @@ var TargetKindLevelSchema = object({
120007
120170
  requires: array(string()).optional(),
120008
120171
  description: string().optional()
120009
120172
  });
120173
+ /** Attachment capabilities for a kind (drives the degrade engine + test panel). */
120174
+ var TargetKindAttachmentsCapsSchema = object({
120175
+ mediaTypes: array(AttachmentMediaTypeSchema),
120176
+ mode: _enum([
120177
+ "url",
120178
+ "bytes",
120179
+ "both"
120180
+ ]),
120181
+ max: number$1().int().nonnegative(),
120182
+ maxBytes: number$1().int().positive().optional()
120183
+ });
120184
+ /**
120185
+ * Which TEXT fields a kind delivers (#483). Alexa speaks a title and nothing
120186
+ * else; a push service shows both.
120187
+ *
120188
+ * `.optional()` on the caps block, never defaulted: absent = both, which is
120189
+ * what every kind declared before this field meant (D938's rule for a Zod
120190
+ * default on the addon cap path).
120191
+ */
120192
+ var TargetKindTextCapsSchema = object({
120193
+ title: boolean(),
120194
+ body: boolean()
120195
+ });
120196
+ _enum([
120197
+ "title",
120198
+ "body",
120199
+ "attachments",
120200
+ "actions",
120201
+ "priority",
120202
+ "sound",
120203
+ "clickUrl"
120204
+ ]);
120010
120205
  /** The full capability block consulted before dispatch. */
120011
120206
  var TargetKindCapsSchema = object({
120012
- attachments: object({
120013
- mediaTypes: array(AttachmentMediaTypeSchema),
120014
- mode: _enum([
120015
- "url",
120016
- "bytes",
120017
- "both"
120018
- ]),
120019
- max: number$1().int().nonnegative(),
120020
- maxBytes: number$1().int().positive().optional()
120021
- }),
120207
+ /** Text fields this kind delivers (#483). Absent = title AND body. */
120208
+ text: TargetKindTextCapsSchema.optional(),
120209
+ attachments: TargetKindAttachmentsCapsSchema,
120022
120210
  /** Max action buttons (0 = none). */
120023
120211
  actions: number$1().int().nonnegative(),
120024
120212
  /**
@@ -145823,30 +146011,21 @@ function convertLegacyWhen(half) {
145823
146011
  * (instants) and state leaves (durations). It replaces the flat trigger list
145824
146012
  * plus the separate condition tree; the firing rule is in that file and in
145825
146013
  * ADR "one tree".
145826
- * - **Actions** — `NcRuleActionSchema`'s two steps, plus the `{kind:'code'}`
145827
- * fragment of §3.2.2. See {@link AutomationActionSchema} for the ONE place
145828
- * this had to diverge from "verbatim", and why.
146014
+ * - **Actions** — the `wait` and `cap` steps, plus the `{kind:'code'}`
146015
+ * fragment of §3.2.2. See {@link AutomationActionSchema}.
145829
146016
  *
145830
146017
  * A recipe stored in the old shape (`triggers` + `conditions`) still LOADS:
145831
146018
  * {@link AutomationRecipeSchema} (the parse-anywhere schema) converts it on parse. Nothing writes it.
145832
146019
  */
145833
146020
  /**
145834
- * One action step.
145835
- *
145836
- * `wait` and `cap` are `NcRuleActionSchema`'s two members, kept structurally
145837
- * identical so `NcRuleActionRunner` runs them unchanged — its device-scope
145838
- * check, stop-at-first-failure and per-sequence throttle are the whole reason
145839
- * to reuse it, and none of them are re-implemented here.
146021
+ * One action step: `wait`, or a `cap` call.
145840
146022
  *
145841
- * **The one divergence, and it is forced.** `NcRuleActionSchema.cap.deviceId` is
145842
- * a literal `z.number().int()`, and the NC runner's own `RunSequencesInput`
145843
- * documents its subject device as *"for the log tag, never for routing"*. So an
145844
- * NC action can never target the device that triggered it — which is fine for
145845
- * the NC (its rules already scope to a device) and fatal for an automation
145846
- * ("sound the siren of the camera that saw the person"). `deviceId` therefore
145847
- * also accepts `{ $var }`, resolved from the run's `vars` bag BEFORE the runner
145848
- * is called. The runner still receives a number and is untouched; the
145849
- * resolution is the recipe's job, not the runner's.
146023
+ * A cap step's target is who it acts on (D983: `devices`, a `domain`, or a
146024
+ * `{ $var }` resolved from the run's variables); the legacy `deviceId` is still
146025
+ * READ, never written. The step runner (`runSteps`) owns the device-scope
146026
+ * check, the stop-at-first-failure and the variable substitution, once, for
146027
+ * every caller — automations, Actions, and the notification centre, which runs
146028
+ * only Actions (planning#473).
145850
146029
  */
145851
146030
  var AutomationWaitStepSchema = object({
145852
146031
  kind: literal("wait"),
@@ -145893,21 +146072,44 @@ var AutomationCapStepBaseSchema = object({
145893
146072
  */
145894
146073
  argUnits: record(string(), string().min(1)).optional()
145895
146074
  });
145896
- var AutomationCapStepSchema = AutomationCapStepBaseSchema.refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
146075
+ /**
146076
+ * The steps an internal Action may contain: cap and wait, and nothing that can
146077
+ * call back into an Action — so an Action can never reach itself (no cycles).
146078
+ * This is the LEAF shape: no condition of its own.
146079
+ */
146080
+ var LeafActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepBaseSchema.refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
145897
146081
  message: "a cap step needs a target",
145898
146082
  path: ["target"]
145899
146083
  }).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
145900
146084
  message: "a domain target needs the vocabulary action it applies to (actionId)",
145901
146085
  path: ["actionId"]
145902
- });
146086
+ })]);
145903
146087
  /**
145904
- * The steps an internal Action may contain: cap and wait, and nothing that can
145905
- * call back into an Action — so an Action can never reach itself (no cycles).
146088
+ * The optional guard of a step (#472): `if` is the ONE `when` tree (D980), read
146089
+ * on the state mirror when the step is reached; `else` runs when it is false.
146090
+ * An `else` holds leaf steps only — the nesting is bounded at ONE level, so a
146091
+ * branch can never grow a tree the trace has to draw.
145906
146092
  */
145907
- var ActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
146093
+ var stepGuardShape = {
146094
+ if: AutomationWhenSchema.optional(),
146095
+ else: array(LeafActionStepSchema).max(10).optional()
146096
+ };
146097
+ var elseNeedsIf = {
146098
+ message: "an else list needs the condition it is the other side of (if)",
146099
+ path: ["else"]
146100
+ };
146101
+ var GuardedWaitStepSchema = AutomationWaitStepSchema.extend(stepGuardShape).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
146102
+ var GuardedCapStepSchema = AutomationCapStepBaseSchema.extend(stepGuardShape).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
146103
+ message: "a cap step needs a target",
146104
+ path: ["target"]
146105
+ }).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
146106
+ message: "a domain target needs the vocabulary action it applies to (actionId)",
146107
+ path: ["actionId"]
146108
+ }).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
146109
+ var ActionStepSchema = discriminatedUnion("kind", [GuardedWaitStepSchema, GuardedCapStepSchema]);
145908
146110
  var AutomationActionSchema = discriminatedUnion("kind", [
145909
- AutomationWaitStepSchema,
145910
- AutomationCapStepSchema,
146111
+ GuardedWaitStepSchema,
146112
+ GuardedCapStepSchema,
145911
146113
  object({
145912
146114
  kind: literal("action"),
145913
146115
  /** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
@@ -146287,7 +146489,7 @@ var StepDeviceTraceSchema = object({
146287
146489
  outcome: _enum(["ok", "error"]),
146288
146490
  message: string().optional()
146289
146491
  });
146290
- var AutomationStepTraceSchema = object({
146492
+ var StepTraceBaseSchema = object({
146291
146493
  /** `actions.<i>` */
146292
146494
  path: string().min(1),
146293
146495
  kind: string().min(1),
@@ -146306,15 +146508,35 @@ var AutomationStepTraceSchema = object({
146306
146508
  * is shown as {@link REDACTED_ARG}. Absent on traces written before it existed.
146307
146509
  */
146308
146510
  args: record(string(), TraceValueSchema).optional(),
146309
- /** `empty`: the target resolved to no device, so nothing was done — never silently `ok`. */
146511
+ /**
146512
+ * The device values a templated arg printed as `—`, one `ref: reason` each
146513
+ * (D1021): why a sentence says "—" where a number was expected. Bounded.
146514
+ */
146515
+ templates: array(string()).max(20).optional(),
146516
+ /**
146517
+ * What the step's own `if` read when the step was reached (#472): `true` the
146518
+ * step ran, `false` its `else` ran (or nothing did), `unknown` a state leaf
146519
+ * could not be read, so NEITHER side ran. Absent on an unguarded step.
146520
+ */
146521
+ condition: _enum([
146522
+ "true",
146523
+ "false",
146524
+ "unknown"
146525
+ ]).optional(),
146526
+ /** Why the condition read what it read, in the evaluator's own words. */
146527
+ conditionReason: string().optional(),
146528
+ /** `empty`: the target resolved to no device, so nothing was done — never silently `ok`. `skipped`: its `if` was false (or unknown) and nothing ran in its place. */
146310
146529
  outcome: _enum([
146311
146530
  "ok",
146312
146531
  "error",
146313
146532
  "not-run",
146314
- "empty"
146533
+ "empty",
146534
+ "skipped"
146315
146535
  ]),
146316
146536
  message: string().optional()
146317
146537
  });
146538
+ /** A step trace; the `else` steps that ran are one level of the same shape (the nesting is bounded at one). */
146539
+ var AutomationStepTraceSchema = StepTraceBaseSchema.extend({ else: array(StepTraceBaseSchema).optional() });
146318
146540
  var AutomationRunTraceSchema = object({
146319
146541
  runId: string().min(1),
146320
146542
  startedAt: number$1(),
@@ -146421,6 +146643,8 @@ var ActionStatusSchema = object({
146421
146643
  /** The latest run's failure; null on success or when it never ran. */
146422
146644
  lastError: string().nullable()
146423
146645
  });
146646
+ /** The throttle window of an action, in seconds; absent or 0 = no throttle. */
146647
+ var ActionMinDelaySecSchema = number$1().int().min(0).max(86400);
146424
146648
  var ActionEntrySchema = object({
146425
146649
  /** `internal:<uuid>` or `<addonId>:<localId>`. */
146426
146650
  id: string().min(3),
@@ -146433,6 +146657,14 @@ var ActionEntrySchema = object({
146433
146657
  /** Internal only: cap and wait steps. No action-in-action, so no cycles. */
146434
146658
  steps: array(ActionStepSchema).min(1).max(50).optional(),
146435
146659
  variables: array(ActionVariableSchema).max(20).optional(),
146660
+ /**
146661
+ * Internal only: the least time between two run STARTS. A run that begins
146662
+ * inside the window is skipped (`skipped-cooldown`), traced and logged. It
146663
+ * is an actuator's budget — "how often may this gate physically open" —
146664
+ * not a notification cooldown, and it is shared by every caller of the
146665
+ * action (two rules, a button, an automation).
146666
+ */
146667
+ minDelaySec: ActionMinDelaySecSchema.optional(),
146436
146668
  status: ActionStatusSchema
146437
146669
  }).superRefine((entry, ctx) => {
146438
146670
  if (entry.source === "internal") {
@@ -146463,7 +146695,8 @@ var ActionEntrySchema = object({
146463
146695
  var ActionInputSchema = object({
146464
146696
  name: string().min(1).max(120),
146465
146697
  steps: array(ActionStepSchema).min(1).max(50),
146466
- variables: array(ActionVariableSchema).max(20).optional()
146698
+ variables: array(ActionVariableSchema).max(20).optional(),
146699
+ minDelaySec: ActionMinDelaySecSchema.optional()
146467
146700
  });
146468
146701
  /** Who started a run. Absent = the operator pressed it. */
146469
146702
  var ActionRunOriginSchema = object({
@@ -146490,6 +146723,7 @@ _enum([
146490
146723
  "invalid-variables",
146491
146724
  "invalid-steps",
146492
146725
  "not-linked",
146726
+ "template-scope",
146493
146727
  "busy"
146494
146728
  ]);
146495
146729
  object({
@@ -146814,10 +147048,6 @@ method(object({
146814
147048
  scope: ScopedSettingsScopeSchema,
146815
147049
  nodeId: string().optional()
146816
147050
  }), record(string(), unknown()).nullable()), method(object({
146817
- addonId: string(),
146818
- nodeId: string().optional(),
146819
- instance: IntegrationInstanceRefSchema
146820
- }), SettingsSchemaWithValuesSchema.nullable()), method(object({
146821
147051
  addonId: string(),
146822
147052
  nodeId: string().optional()
146823
147053
  }), object({ keys: array(string()) }).nullable(), { auth: "admin" }), method(object({
@@ -149234,7 +149464,14 @@ var CalendarInfoSchema = object({
149234
149464
  id: string().min(1),
149235
149465
  name: string().min(1),
149236
149466
  source: CalendarSourceKindSchema,
149237
- enabled: boolean()
149467
+ enabled: boolean(),
149468
+ /**
149469
+ * The `integration-instances` record that owns this calendar (the record the switch writes).
149470
+ * Every source stamps it from the record it read the calendar from, so a consumer joins on
149471
+ * it instead of rebuilding an id from form values. Optional on the wire so a source addon
149472
+ * that predates the field still lists its calendars: such a row simply has no switch.
149473
+ */
149474
+ instanceId: string().min(1).optional()
149238
149475
  });
149239
149476
  /**
149240
149477
  * Time contract of {@link CalendarEvent}.
@@ -150619,14 +150856,14 @@ var climateControlCapability = {
150619
150856
  kind: "mutation",
150620
150857
  auth: "protected"
150621
150858
  }),
150622
- setFanMode: method(object({
150859
+ setFanMode: optionalMethod(object({
150623
150860
  deviceId: number$1().int().nonnegative(),
150624
150861
  fanMode: string().min(1)
150625
150862
  }), _void(), {
150626
150863
  kind: "mutation",
150627
150864
  auth: "protected"
150628
150865
  }),
150629
- setPreset: method(object({
150866
+ setPreset: optionalMethod(object({
150630
150867
  deviceId: number$1().int().nonnegative(),
150631
150868
  preset: string().min(1)
150632
150869
  }), _void(), {
@@ -150640,7 +150877,7 @@ var climateControlCapability = {
150640
150877
  kind: "mutation",
150641
150878
  auth: "protected"
150642
150879
  }),
150643
- setTargetRange: method(object({
150880
+ setTargetRange: optionalMethod(object({
150644
150881
  deviceId: number$1().int().nonnegative(),
150645
150882
  targetLow: number$1(),
150646
150883
  targetHigh: number$1()
@@ -150648,21 +150885,21 @@ var climateControlCapability = {
150648
150885
  kind: "mutation",
150649
150886
  auth: "protected"
150650
150887
  }),
150651
- setTargetHumidity: method(object({
150888
+ setTargetHumidity: optionalMethod(object({
150652
150889
  deviceId: number$1().int().nonnegative(),
150653
150890
  targetHumidity: number$1().min(0).max(100)
150654
150891
  }), _void(), {
150655
150892
  kind: "mutation",
150656
150893
  auth: "protected"
150657
150894
  }),
150658
- setSwingVertical: method(object({
150895
+ setSwingVertical: optionalMethod(object({
150659
150896
  deviceId: number$1().int().nonnegative(),
150660
150897
  on: boolean()
150661
150898
  }), _void(), {
150662
150899
  kind: "mutation",
150663
150900
  auth: "protected"
150664
150901
  }),
150665
- setSwingHorizontal: method(object({
150902
+ setSwingHorizontal: optionalMethod(object({
150666
150903
  deviceId: number$1().int().nonnegative(),
150667
150904
  on: boolean()
150668
150905
  }), _void(), {
@@ -151762,8 +151999,12 @@ var RemoteSourceSchema = discriminatedUnion("kind", [
151762
151999
  object({
151763
152000
  ...sourceBase,
151764
152001
  kind: literal("ir"),
151765
- /** The `ir-transmitter` device the code is sent through. */
151766
- transmitterId: number$1().int().nonnegative(),
152002
+ /**
152003
+ * The `ir-transmitter` device the code is sent through. Absent = the remote's
152004
+ * `defaultTransmitterId` at run time (a source stored before this field was
152005
+ * optional keeps the emitter it names).
152006
+ */
152007
+ transmitterId: number$1().int().nonnegative().optional(),
151767
152008
  /** The code itself; whether a transmitter could send it is `irSourceProblem`. */
151768
152009
  payload: IrPayloadSchema
151769
152010
  })
@@ -151917,27 +152158,27 @@ var mediaPlayerCapability = {
151917
152158
  mode: "singleton",
151918
152159
  deviceTypes: [DeviceType.MediaPlayer],
151919
152160
  methods: {
151920
- turnOn: method(deviceOnly, _void(), {
152161
+ turnOn: optionalMethod(deviceOnly, _void(), {
151921
152162
  kind: "mutation",
151922
152163
  auth: "protected"
151923
152164
  }),
151924
- turnOff: method(deviceOnly, _void(), {
152165
+ turnOff: optionalMethod(deviceOnly, _void(), {
151925
152166
  kind: "mutation",
151926
152167
  auth: "protected"
151927
152168
  }),
151928
- volumeUp: method(stepInput, _void(), {
152169
+ volumeUp: optionalMethod(stepInput, _void(), {
151929
152170
  kind: "mutation",
151930
152171
  auth: "protected"
151931
152172
  }),
151932
- volumeDown: method(stepInput, _void(), {
152173
+ volumeDown: optionalMethod(stepInput, _void(), {
151933
152174
  kind: "mutation",
151934
152175
  auth: "protected"
151935
152176
  }),
151936
- channelUp: method(stepInput, _void(), {
152177
+ channelUp: optionalMethod(stepInput, _void(), {
151937
152178
  kind: "mutation",
151938
152179
  auth: "protected"
151939
152180
  }),
151940
- channelDown: method(stepInput, _void(), {
152181
+ channelDown: optionalMethod(stepInput, _void(), {
151941
152182
  kind: "mutation",
151942
152183
  auth: "protected"
151943
152184
  }),
@@ -151949,61 +152190,61 @@ var mediaPlayerCapability = {
151949
152190
  kind: "mutation",
151950
152191
  auth: "protected"
151951
152192
  }),
151952
- stop: method(object({ deviceId: number$1().int().nonnegative() }), _void(), {
152193
+ stop: optionalMethod(object({ deviceId: number$1().int().nonnegative() }), _void(), {
151953
152194
  kind: "mutation",
151954
152195
  auth: "protected"
151955
152196
  }),
151956
- next: method(object({ deviceId: number$1().int().nonnegative() }), _void(), {
152197
+ next: optionalMethod(object({ deviceId: number$1().int().nonnegative() }), _void(), {
151957
152198
  kind: "mutation",
151958
152199
  auth: "protected"
151959
152200
  }),
151960
- previous: method(object({ deviceId: number$1().int().nonnegative() }), _void(), {
152201
+ previous: optionalMethod(object({ deviceId: number$1().int().nonnegative() }), _void(), {
151961
152202
  kind: "mutation",
151962
152203
  auth: "protected"
151963
152204
  }),
151964
- seek: method(object({
152205
+ seek: optionalMethod(object({
151965
152206
  deviceId: number$1().int().nonnegative(),
151966
152207
  position: number$1().int().nonnegative()
151967
152208
  }), _void(), {
151968
152209
  kind: "mutation",
151969
152210
  auth: "protected"
151970
152211
  }),
151971
- setVolume: method(object({
152212
+ setVolume: optionalMethod(object({
151972
152213
  deviceId: number$1().int().nonnegative(),
151973
152214
  volumeLevel: number$1().min(0).max(100)
151974
152215
  }), _void(), {
151975
152216
  kind: "mutation",
151976
152217
  auth: "protected"
151977
152218
  }),
151978
- setMute: method(object({
152219
+ setMute: optionalMethod(object({
151979
152220
  deviceId: number$1().int().nonnegative(),
151980
152221
  muted: boolean()
151981
152222
  }), _void(), {
151982
152223
  kind: "mutation",
151983
152224
  auth: "protected"
151984
152225
  }),
151985
- setShuffle: method(object({
152226
+ setShuffle: optionalMethod(object({
151986
152227
  deviceId: number$1().int().nonnegative(),
151987
152228
  shuffle: boolean()
151988
152229
  }), _void(), {
151989
152230
  kind: "mutation",
151990
152231
  auth: "protected"
151991
152232
  }),
151992
- setRepeat: method(object({
152233
+ setRepeat: optionalMethod(object({
151993
152234
  deviceId: number$1().int().nonnegative(),
151994
152235
  repeat: MediaPlayerRepeatSchema
151995
152236
  }), _void(), {
151996
152237
  kind: "mutation",
151997
152238
  auth: "protected"
151998
152239
  }),
151999
- selectSource: method(object({
152240
+ selectSource: optionalMethod(object({
152000
152241
  deviceId: number$1().int().nonnegative(),
152001
152242
  source: string().min(1)
152002
152243
  }), _void(), {
152003
152244
  kind: "mutation",
152004
152245
  auth: "protected"
152005
152246
  }),
152006
- playMedia: method(object({
152247
+ playMedia: optionalMethod(object({
152007
152248
  deviceId: number$1().int().nonnegative(),
152008
152249
  /** Media identifier / URL. */
152009
152250
  mediaId: string().min(1),
@@ -152046,7 +152287,7 @@ var mediaPlayerCapability = {
152046
152287
  isMuted: { kind: "boolean" }
152047
152288
  } }
152048
152289
  };
152049
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.MediaPlayer;
152290
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.MediaPlayer;
152050
152291
  var NUMBER = {
152051
152292
  kind: "fixed",
152052
152293
  result: ["number"]
@@ -153025,18 +153266,18 @@ var coverCapability = {
153025
153266
  kind: "mutation",
153026
153267
  auth: "protected"
153027
153268
  }),
153028
- stop: method(object({ deviceId: number$1().int().nonnegative() }), _void(), {
153269
+ stop: optionalMethod(object({ deviceId: number$1().int().nonnegative() }), _void(), {
153029
153270
  kind: "mutation",
153030
153271
  auth: "protected"
153031
153272
  }),
153032
- setPosition: method(object({
153273
+ setPosition: optionalMethod(object({
153033
153274
  deviceId: number$1().int().nonnegative(),
153034
153275
  position: number$1().min(0).max(100)
153035
153276
  }), _void(), {
153036
153277
  kind: "mutation",
153037
153278
  auth: "protected"
153038
153279
  }),
153039
- setTiltPosition: method(object({
153280
+ setTiltPosition: optionalMethod(object({
153040
153281
  deviceId: number$1().int().nonnegative(),
153041
153282
  tiltPosition: number$1().min(0).max(100)
153042
153283
  }), _void(), {
@@ -154086,6 +154327,59 @@ method(InstancePinSchema, DeviceExportStatusSchema), method(_void(), array(Expor
154086
154327
  auth: "admin"
154087
154328
  });
154088
154329
  var DeviceAliasSchema = string().max(64).regex(/^[a-z][a-z0-9_]*$/);
154330
+ var DeviceTemplateSchema = string().min(1).max(4096);
154331
+ /** One value a caller hands the renderer for `thisDevice`. */
154332
+ var DeviceTemplateValueSchema = union([
154333
+ string(),
154334
+ number$1(),
154335
+ boolean()
154336
+ ]);
154337
+ /**
154338
+ * The device a render is FOR (`camera` in the text) and the values the caller
154339
+ * knows about it that no capability carries, for example `lastPerson` and
154340
+ * `lastPlate`. `values` read as `camera.<name>`; a name a capability also carries
154341
+ * is `ambiguous` and is written `camera.values.<name>`.
154342
+ */
154343
+ var DeviceTemplateThisDeviceSchema = object({
154344
+ deviceId: number$1().int(),
154345
+ values: record(string().min(1).max(64), DeviceTemplateValueSchema).optional()
154346
+ });
154347
+ var DeviceTemplateRefusalSchema = object({
154348
+ reason: _enum([
154349
+ "too-long",
154350
+ "syntax",
154351
+ "forbidden-syntax",
154352
+ "forbidden-member",
154353
+ "unknown-filter",
154354
+ "ambiguous-field",
154355
+ "busy",
154356
+ "budget-exceeded",
154357
+ "timeout",
154358
+ "output-too-large",
154359
+ "render-failed",
154360
+ "out-of-scope",
154361
+ "unavailable"
154362
+ ]),
154363
+ message: string()
154364
+ });
154365
+ var DeviceTemplateTraceEntrySchema = object({
154366
+ ref: string(),
154367
+ reason: _enum([
154368
+ "unknown-alias",
154369
+ "unknown-field",
154370
+ "no-field",
154371
+ "unavailable"
154372
+ ])
154373
+ });
154374
+ var DeviceTemplateRenderSchema = discriminatedUnion("ok", [object({
154375
+ ok: literal(true),
154376
+ text: string(),
154377
+ trace: array(DeviceTemplateTraceEntrySchema)
154378
+ }), object({
154379
+ ok: literal(false),
154380
+ refusal: DeviceTemplateRefusalSchema,
154381
+ trace: array(DeviceTemplateTraceEntrySchema)
154382
+ })]);
154089
154383
  /**
154090
154384
  * A SITE ZONE — a named part of the property that several locations belong to.
154091
154385
  *
@@ -154681,7 +154975,9 @@ var DeviceBindingsForDeviceSchema = object({
154681
154975
  kind: _enum(["native", "wrapped"]),
154682
154976
  providerAddonId: string(),
154683
154977
  providerNodeId: string(),
154684
- nativeAddonId: string()
154978
+ nativeAddonId: string(),
154979
+ /** The cap's methods the native provider implements; absent = all. */
154980
+ implementedMethods: array(string()).optional()
154685
154981
  }))
154686
154982
  });
154687
154983
  /**
@@ -154893,7 +155189,13 @@ method(object({
154893
155189
  auth: "admin"
154894
155190
  }), method(object({ deviceId: number$1() }), record(string(), unknown()), { auth: "admin" }), method(object({ deviceId: number$1() }), record(string(), unknown()), { auth: "admin" }), method(object({ deviceId: number$1() }), DeviceMetaSchema.nullable()), method(object({
154895
155191
  deviceId: number$1(),
154896
- name: string()
155192
+ name: string(),
155193
+ /**
155194
+ * Absent or true: an operator rename, which stamps `userNamed`.
155195
+ * False: the system copying a block name onto the device. That write
155196
+ * must not look like the operator's, or the next reconcile freezes it.
155197
+ */
155198
+ stampUserNamed: boolean().optional()
154897
155199
  }), _void(), {
154898
155200
  kind: "mutation",
154899
155201
  auth: "admin"
@@ -154917,6 +155219,29 @@ method(object({
154917
155219
  kind: "mutation",
154918
155220
  auth: "admin"
154919
155221
  }), method(object({
155222
+ templates: array(DeviceTemplateSchema).max(64),
155223
+ allowedDeviceIds: array(number$1().int()).optional(),
155224
+ /** The device `camera` names in the texts, and the values the caller knows of it. */
155225
+ thisDevice: DeviceTemplateThisDeviceSchema.optional()
155226
+ }), object({ results: array(DeviceTemplateRenderSchema) }), { auth: "admin" }), method(object({
155227
+ templates: array(string()).max(64),
155228
+ allowedDeviceIds: array(number$1().int()).optional(),
155229
+ thisDevice: DeviceTemplateThisDeviceSchema.optional()
155230
+ }), object({ results: array(discriminatedUnion("ok", [object({
155231
+ ok: literal(true),
155232
+ aliases: array(object({
155233
+ alias: string(),
155234
+ deviceId: number$1().int().nullable(),
155235
+ allowed: boolean(),
155236
+ /** The fields the text reads on this alias, as written (`temperature`, `cap.field`). */
155237
+ reads: array(string())
155238
+ })),
155239
+ /** Whether the text reads the clock (`now`): it changes every minute. */
155240
+ readsClock: boolean()
155241
+ }), object({
155242
+ ok: literal(false),
155243
+ refusal: DeviceTemplateRefusalSchema
155244
+ })])) }), { auth: "admin" }), method(object({
154920
155245
  deviceId: number$1(),
154921
155246
  location: string().nullable()
154922
155247
  }), _void(), {
@@ -157666,28 +157991,28 @@ var fanControlCapability = {
157666
157991
  mode: "singleton",
157667
157992
  deviceTypes: [DeviceType.Fan],
157668
157993
  methods: {
157669
- setPercentage: method(object({
157994
+ setPercentage: optionalMethod(object({
157670
157995
  deviceId: number$1().int().nonnegative(),
157671
157996
  speed: number$1().min(0).max(100)
157672
157997
  }), _void(), {
157673
157998
  kind: "mutation",
157674
157999
  auth: "protected"
157675
158000
  }),
157676
- setPreset: method(object({
158001
+ setPreset: optionalMethod(object({
157677
158002
  deviceId: number$1().int().nonnegative(),
157678
158003
  preset: string().min(1)
157679
158004
  }), _void(), {
157680
158005
  kind: "mutation",
157681
158006
  auth: "protected"
157682
158007
  }),
157683
- setDirection: method(object({
158008
+ setDirection: optionalMethod(object({
157684
158009
  deviceId: number$1().int().nonnegative(),
157685
158010
  direction: FanDirectionSchema
157686
158011
  }), _void(), {
157687
158012
  kind: "mutation",
157688
158013
  auth: "protected"
157689
158014
  }),
157690
- setOscillating: method(object({
158015
+ setOscillating: optionalMethod(object({
157691
158016
  deviceId: number$1().int().nonnegative(),
157692
158017
  oscillating: boolean()
157693
158018
  }), _void(), {
@@ -158139,6 +158464,305 @@ var groupStatusCapability = {
158139
158464
  durability: "session",
158140
158465
  history: "none"
158141
158466
  };
158467
+ /**
158468
+ * Heat pump settable surface (D1026): one typed method per parameter, never a
158469
+ * generic `set(key, value)`. The values a mode takes and the limits of a number
158470
+ * are the ones `heat-pump-status` carries (`allowed`, `min`, `max`, `step`),
158471
+ * read from the gateway; a provider refuses a value outside them. The state is
158472
+ * `heat-pump-status` — this cap has none.
158473
+ */
158474
+ var deviceId = number$1().int().nonnegative();
158475
+ var circuitId = string().min(1);
158476
+ var mode = string().min(1);
158477
+ var temp = number$1().finite();
158478
+ DeviceType.HeatPump, method(object({
158479
+ deviceId,
158480
+ mode
158481
+ }), _void(), {
158482
+ kind: "mutation",
158483
+ auth: "protected"
158484
+ }), method(object({
158485
+ deviceId,
158486
+ mode
158487
+ }), _void(), {
158488
+ kind: "mutation",
158489
+ auth: "protected"
158490
+ }), method(object({
158491
+ deviceId,
158492
+ mode
158493
+ }), _void(), {
158494
+ kind: "mutation",
158495
+ auth: "protected"
158496
+ }), method(object({
158497
+ deviceId,
158498
+ mode
158499
+ }), _void(), {
158500
+ kind: "mutation",
158501
+ auth: "protected"
158502
+ }), method(object({
158503
+ deviceId,
158504
+ circuitId,
158505
+ mode
158506
+ }), _void(), {
158507
+ kind: "mutation",
158508
+ auth: "protected"
158509
+ }), method(object({
158510
+ deviceId,
158511
+ circuitId,
158512
+ mode
158513
+ }), _void(), {
158514
+ kind: "mutation",
158515
+ auth: "protected"
158516
+ }), method(object({
158517
+ deviceId,
158518
+ circuitId,
158519
+ mode
158520
+ }), _void(), {
158521
+ kind: "mutation",
158522
+ auth: "protected"
158523
+ }), method(object({
158524
+ deviceId,
158525
+ circuitId,
158526
+ temp
158527
+ }), _void(), {
158528
+ kind: "mutation",
158529
+ auth: "protected"
158530
+ }), method(object({
158531
+ deviceId,
158532
+ circuitId,
158533
+ temp
158534
+ }), _void(), {
158535
+ kind: "mutation",
158536
+ auth: "protected"
158537
+ }), method(object({
158538
+ deviceId,
158539
+ circuitId,
158540
+ temp
158541
+ }), _void(), {
158542
+ kind: "mutation",
158543
+ auth: "protected"
158544
+ }), method(object({
158545
+ deviceId,
158546
+ circuitId,
158547
+ mode
158548
+ }), _void(), {
158549
+ kind: "mutation",
158550
+ auth: "protected"
158551
+ }), method(object({
158552
+ deviceId,
158553
+ circuitId,
158554
+ level: mode
158555
+ }), _void(), {
158556
+ kind: "mutation",
158557
+ auth: "protected"
158558
+ }), method(object({
158559
+ deviceId,
158560
+ circuitId,
158561
+ minutes: number$1().int().positive()
158562
+ }), _void(), {
158563
+ kind: "mutation",
158564
+ auth: "protected"
158565
+ }), method(object({
158566
+ deviceId,
158567
+ circuitId
158568
+ }), _void(), {
158569
+ kind: "mutation",
158570
+ auth: "protected"
158571
+ });
158572
+ var HeatPumpCircuitKindSchema = _enum([
158573
+ "heating",
158574
+ "dhw",
158575
+ "cooling",
158576
+ "solar"
158577
+ ]);
158578
+ /** A setting that takes one of a list of values the gateway named. */
158579
+ var HeatPumpOptionSettingSchema = object({
158580
+ /** The active value. Null when the gateway did not answer. */
158581
+ value: string().nullable(),
158582
+ /** Values the gateway accepts, in its order. Empty = read-only here. */
158583
+ allowed: array(string())
158584
+ });
158585
+ /** A numeric setting with the limits the gateway named. */
158586
+ var HeatPumpRangeSettingSchema = object({
158587
+ value: number$1().nullable(),
158588
+ min: number$1().nullable(),
158589
+ max: number$1().nullable(),
158590
+ step: number$1().nullable()
158591
+ });
158592
+ var HeatPumpCircuitSchema = object({
158593
+ /** Gateway id of the circuit (`hc1`, `dhw1`): the key of the series. */
158594
+ id: string().min(1),
158595
+ kind: HeatPumpCircuitKindSchema,
158596
+ label: string(),
158597
+ icon: IconKeySchema,
158598
+ /** Measured temperature of the circuit (room, tank, collector). */
158599
+ currentTemp: number$1().nullable().meta(readingMeta("temperature")),
158600
+ /** The setpoint in force now. */
158601
+ targetTemp: number$1().nullable().meta(readingMeta("temperature")),
158602
+ /** The operation mode in force (mirror of `operationMode.value`, for the series). */
158603
+ mode: string().nullable(),
158604
+ /** Whether the circuit is calling for heat right now. Null = unknown. */
158605
+ active: boolean().nullable(),
158606
+ operationMode: HeatPumpOptionSettingSchema.nullable(),
158607
+ /** Heating circuits: heat / cool / heatCool. */
158608
+ heatCoolMode: HeatPumpOptionSettingSchema.nullable(),
158609
+ /** Heating circuits: summer / winter changeover. */
158610
+ summerWinter: HeatPumpOptionSettingSchema.nullable(),
158611
+ comfortSetpoint: HeatPumpRangeSettingSchema.nullable(),
158612
+ ecoSetpoint: HeatPumpRangeSettingSchema.nullable(),
158613
+ maxFlowTemp: HeatPumpRangeSettingSchema.nullable(),
158614
+ /** Hot water: the temperature level (off / low / high / eco). */
158615
+ temperatureLevel: HeatPumpOptionSettingSchema.nullable(),
158616
+ /** Hot water: how long a charge lasts, minutes. */
158617
+ chargeDuration: HeatPumpRangeSettingSchema.nullable(),
158618
+ /** Hot water: whether an extra-hot-water charge is running. Null = no such surface. */
158619
+ extraHotWater: boolean().nullable()
158620
+ });
158621
+ /** The independent system modes, each with its real values. A null mode = the gateway has none. */
158622
+ var HeatPumpSystemSchema = object({
158623
+ silent: HeatPumpOptionSettingSchema.nullable(),
158624
+ away: HeatPumpOptionSettingSchema.nullable(),
158625
+ additionalHeater: HeatPumpOptionSettingSchema.nullable(),
158626
+ holiday: HeatPumpOptionSettingSchema.nullable()
158627
+ });
158628
+ var HeatPumpPowerSchema = object({
158629
+ thermalW: number$1().nullable().meta(readingMeta("power")),
158630
+ electricalW: number$1().nullable().meta(readingMeta("power")),
158631
+ /** Compressor modulation, percent. */
158632
+ compressorPct: number$1().nullable().meta(readingMeta("percentage"))
158633
+ });
158634
+ var HeatPumpTemperaturesSchema = object({
158635
+ supply: number$1().nullable().meta(readingMeta("temperature")),
158636
+ return: number$1().nullable().meta(readingMeta("temperature")),
158637
+ outdoor: number$1().nullable().meta(readingMeta("temperature"))
158638
+ });
158639
+ /** Lifetime meters, kWh: the energy of a period is computed at read time from their difference (D944). */
158640
+ var HeatPumpEnergySchema = object({
158641
+ thermalKwh: number$1().nullable().meta(readingMeta("energy")),
158642
+ electricalKwh: number$1().nullable().meta(readingMeta("energy"))
158643
+ });
158644
+ var HeatPumpStatusSchema = object({
158645
+ circuits: array(HeatPumpCircuitSchema),
158646
+ system: HeatPumpSystemSchema,
158647
+ power: HeatPumpPowerSchema,
158648
+ temperatures: HeatPumpTemperaturesSchema,
158649
+ energy: HeatPumpEnergySchema,
158650
+ /** Water pressure of the heating loop, bar. */
158651
+ waterPressureBar: number$1().nullable(),
158652
+ /** Compressor starts since commissioning. */
158653
+ starts: number$1().nullable(),
158654
+ /** Ms epoch when the slice was last read from the gateway. */
158655
+ lastFetchedAt: number$1()
158656
+ });
158657
+ /**
158658
+ * The instantaneous COP: thermal over electrical power. Null unless BOTH powers
158659
+ * are known and the unit draws power — a missing reading is never a 0 or a
158660
+ * division by it (D393). Computed on every read; there is no stored value.
158661
+ */
158662
+ function heatPumpInstantCop(power) {
158663
+ const { thermalW, electricalW } = power;
158664
+ if (thermalW === null || electricalW === null || electricalW <= 0) return null;
158665
+ return thermalW / electricalW;
158666
+ }
158667
+ var heatPumpStatusCapability = {
158668
+ name: "heat-pump-status",
158669
+ scope: "device",
158670
+ deviceNative: true,
158671
+ mode: "singleton",
158672
+ deviceTypes: [DeviceType.HeatPump],
158673
+ methods: {},
158674
+ status: {
158675
+ schema: HeatPumpStatusSchema,
158676
+ kind: "push"
158677
+ },
158678
+ runtimeState: HeatPumpStatusSchema,
158679
+ /**
158680
+ * Runtime-state durability: **session** — a heat pump's gateway answers on the
158681
+ * next poll, so a restart that clears the slice loses nothing a reader needs
158682
+ * (the series are recorded). See `RuntimeStateDurability`.
158683
+ */
158684
+ durability: "session",
158685
+ /**
158686
+ * History (D850, D917): `circuits[]` is a keyed array — one series per circuit and
158687
+ * field, named by the circuit's label. The mode is a state (D896); the energy
158688
+ * totals are lifetime counters, the kWh of a period is computed at read time (D944).
158689
+ * The COP is never recorded: it derives from the two powers.
158690
+ */
158691
+ history: {
158692
+ fields: {
158693
+ "power.thermalW": {
158694
+ kind: "gauge",
158695
+ unit: "W",
158696
+ deadband: 50,
158697
+ displayName: "Thermal power"
158698
+ },
158699
+ "power.electricalW": {
158700
+ kind: "gauge",
158701
+ unit: "W",
158702
+ deadband: 50,
158703
+ displayName: "Electrical power"
158704
+ },
158705
+ "power.compressorPct": {
158706
+ kind: "gauge",
158707
+ unit: "%",
158708
+ deadband: 2,
158709
+ displayName: "Compressor"
158710
+ },
158711
+ "temperatures.supply": {
158712
+ kind: "gauge",
158713
+ unit: "°C",
158714
+ deadband: .5,
158715
+ displayName: "Supply"
158716
+ },
158717
+ "temperatures.return": {
158718
+ kind: "gauge",
158719
+ unit: "°C",
158720
+ deadband: .5,
158721
+ displayName: "Return"
158722
+ },
158723
+ "temperatures.outdoor": {
158724
+ kind: "gauge",
158725
+ unit: "°C",
158726
+ deadband: .5,
158727
+ displayName: "Outdoor"
158728
+ },
158729
+ "energy.thermalKwh": {
158730
+ kind: "counter",
158731
+ unit: "kWh",
158732
+ displayName: "Thermal energy"
158733
+ },
158734
+ "energy.electricalKwh": {
158735
+ kind: "counter",
158736
+ unit: "kWh",
158737
+ displayName: "Electrical energy"
158738
+ }
158739
+ },
158740
+ items: {
158741
+ path: "circuits",
158742
+ key: "id",
158743
+ label: "label",
158744
+ fields: {
158745
+ currentTemp: {
158746
+ kind: "gauge",
158747
+ unit: "°C",
158748
+ deadband: .5,
158749
+ displayName: "Temperature"
158750
+ },
158751
+ targetTemp: {
158752
+ kind: "gauge",
158753
+ unit: "°C",
158754
+ minIntervalMs: 0,
158755
+ displayName: "Setpoint"
158756
+ },
158757
+ mode: {
158758
+ kind: "enum",
158759
+ displayName: "Mode"
158760
+ }
158761
+ }
158762
+ }
158763
+ },
158764
+ volatileStateFields: ["lastFetchedAt"]
158765
+ };
158142
158766
  var HeatingValveStatusSchema = object({
158143
158767
  /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
158144
158768
  position: number$1().min(0).max(100).nullable().meta(readingMeta("percentage")),
@@ -158353,6 +158977,7 @@ var HeroSceneSchema = object({
158353
158977
  "ac",
158354
158978
  "thermostat",
158355
158979
  "heater",
158980
+ "heat-pump",
158356
158981
  "fan",
158357
158982
  "washer",
158358
158983
  "dryer",
@@ -158395,7 +159020,7 @@ var HeroSceneSchema = object({
158395
159020
  /** 0..1: volume, cover position, cycle progress. */
158396
159021
  level: number$1().min(0).max(1).nullable()
158397
159022
  });
158398
- DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway;
159023
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway;
158399
159024
  DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
158400
159025
  /** A string in both languages, as the cap vocabulary writes it (D920): no `t()` in the model. */
158401
159026
  var HeroTextSchema = object({
@@ -158403,6 +159028,7 @@ var HeroTextSchema = object({
158403
159028
  it: string()
158404
159029
  });
158405
159030
  var HeroRowIdSchema = _enum([
159031
+ "progress",
158406
159032
  "run-for",
158407
159033
  "cycle",
158408
159034
  "program",
@@ -158417,6 +159043,7 @@ var HeroRowIdSchema = _enum([
158417
159043
  "alarm",
158418
159044
  "fan",
158419
159045
  "vacuum",
159046
+ "vacuum-suction",
158420
159047
  "mower",
158421
159048
  "feeder",
158422
159049
  "fountain",
@@ -158435,7 +159062,10 @@ var HeroRowIdSchema = _enum([
158435
159062
  "climate-fan",
158436
159063
  "setpoint",
158437
159064
  "channel",
158438
- "control"
159065
+ "control",
159066
+ "circuit",
159067
+ "heat-pump-power",
159068
+ "system-mode"
158439
159069
  ]);
158440
159070
  var HeroArgValueSchema = lazy(() => union([
158441
159071
  string(),
@@ -158500,16 +159130,32 @@ var HeroControlSchema = discriminatedUnion("kind", [
158500
159130
  label: HeroTextSchema,
158501
159131
  current: string().nullable(),
158502
159132
  options: array(string()),
159133
+ /** A readable label per option value; an option without one is drawn as its raw value. */
159134
+ optionLabels: record(string(), HeroTextSchema).optional(),
158503
159135
  call: HeroCallSchema,
158504
159136
  valueArg: string()
158505
159137
  })
158506
159138
  ]);
159139
+ /** Declared by its interface: a `z.infer` of one more icon union pushes the cap's inferred type past what the compiler can print. */
159140
+ var HeroPillSchema = object({
159141
+ icon: IconKeySchema.nullable(),
159142
+ text: HeroTextSchema,
159143
+ tone: HeroToneSchema
159144
+ });
158507
159145
  var HeroRowSchema = object({
158508
159146
  id: HeroRowIdSchema,
159147
+ /** The row's own name when the kind's label would not tell rows of one kind apart (a circuit's label). */
159148
+ label: HeroTextSchema.optional(),
159149
+ /** A group header drawn above the row when it differs from the previous row's ("System"). */
159150
+ group: HeroTextSchema.optional(),
159151
+ /** Values drawn as pills across the row (a heat pump's powers). */
159152
+ pills: array(HeroPillSchema).optional(),
158509
159153
  icon: IconKeySchema,
158510
159154
  /** The row's status, in words. `null` = nothing to say. */
158511
159155
  status: HeroTextSchema.nullable(),
158512
- controls: array(HeroControlSchema)
159156
+ controls: array(HeroControlSchema),
159157
+ /** A bar under the row's label, 0..1; `null` / absent = no bar. */
159158
+ progress: number$1().min(0).max(1).nullable().optional()
158513
159159
  });
158514
159160
  var HeroDetailSchema = object({
158515
159161
  label: HeroTextSchema,
@@ -158517,7 +159163,11 @@ var HeroDetailSchema = object({
158517
159163
  unit: string().nullable()
158518
159164
  });
158519
159165
  var HeroBadgeSchema = object({
158520
- id: _enum(["battery", "network-link"]),
159166
+ id: _enum([
159167
+ "battery",
159168
+ "network-link",
159169
+ "integration"
159170
+ ]),
158521
159171
  icon: IconKeySchema,
158522
159172
  tone: HeroToneSchema,
158523
159173
  /** Percent for a battery, link quality for a link; `null` = not known. */
@@ -158565,7 +159215,13 @@ var HeroTimedRunSlotSchema = object({
158565
159215
  activeUntil: number$1().nullable(),
158566
159216
  quickRun: TimedRunQuickRunSchema,
158567
159217
  run: HeroActionSchema,
158568
- cancel: HeroActionSchema
159218
+ cancel: HeroActionSchema,
159219
+ /**
159220
+ * Whole units left (the limit's unit, ceil). `null` while nothing is armed.
159221
+ * A number, not words: the row formats it, and a text here would not fit the
159222
+ * hero-layout declaration.
159223
+ */
159224
+ remaining: number$1().nullable()
158569
159225
  });
158570
159226
  var HeroPowerSupplySlotSchema = object({
158571
159227
  /** The plug's state; `null` = unknown, never off. */
@@ -158617,7 +159273,12 @@ var HeroFactSchema = object({
158617
159273
  var HeroSideTileSchema = object({
158618
159274
  label: HeroTextSchema,
158619
159275
  value: HeroTextSchema,
158620
- tone: HeroToneSchema.optional()
159276
+ tone: HeroToneSchema.optional(),
159277
+ /**
159278
+ * Epoch ms when the tile reads a clock time (an appliance's end): a client prints it in
159279
+ * the viewer's own time zone; `value` is the fallback for one that cannot.
159280
+ */
159281
+ at: number$1().optional()
158621
159282
  });
158622
159283
  var HeroSideTilesSchema = object({
158623
159284
  left: array(HeroSideTileSchema).max(2),
@@ -158653,8 +159314,12 @@ var HeroModelSchema = object({
158653
159314
  sideTiles: HeroSideTilesSchema,
158654
159315
  /** The status line under the main icon. */
158655
159316
  title: HeroTextSchema,
159317
+ /** The scene's top line when it says more than `title`; absent = draw the title. */
159318
+ caption: HeroTextSchema.optional(),
158656
159319
  badges: array(HeroBadgeSchema),
158657
159320
  remote: HeroRemoteSlotSchema.nullable(),
159321
+ /** The foot button that opens the device's history: "History", "Cycles", "Meals", "Access". */
159322
+ historyLabel: HeroTextSchema,
158658
159323
  consumables: HeroConsumablesSlotSchema.nullable(),
158659
159324
  consumption: HeroConsumptionSlotSchema.nullable(),
158660
159325
  ownPower: HeroOwnPowerSlotSchema.nullable(),
@@ -158675,18 +159340,31 @@ var HeroModelSchema = object({
158675
159340
  * 4. a trailing fact (power, else battery, else consumables).
158676
159341
  *
158677
159342
  * Selection rules, all taken from the model:
158678
- * - ONE control is ever shown: the device's own power; else the FIRST control of
159343
+ * - the primary control is the device's own power; else the FIRST control of
158679
159344
  * the FIRST row that has any (a later row's control is never promoted). When
158680
159345
  * the model lists that part in `gated`, the row has no inline control: the
158681
159346
  * projection never falls through to another control the caller could use.
159347
+ * - a timed run, when the model carries the slot, sits beside that primary:
159348
+ * Run while idle, Stop while armed. Gating the slot hides the control.
158682
159349
  * - the status line is the head (what plays, else the state) plus at most
158683
- * {@link ROW_STATUS_FACTS_MAX} facts, the trailing fact excluded;
159350
+ * {@link ROW_STATUS_FACTS_MAX} facts, the trailing fact excluded, then the
159351
+ * time left on an armed timed run;
158684
159352
  * - the trailing fact is the first of power, battery, consumables.
158685
159353
  *
158686
159354
  * `projectDeviceRow` is pure and computes nothing: it selects from a
158687
159355
  * {@link HeroModel}. A row that needed a value the hero lacks would mean the
158688
159356
  * model is missing it, so the fix goes in the model.
158689
159357
  */
159358
+ /**
159359
+ * The row's timed-run control. `id` is `timed-run.run` while idle and
159360
+ * `timed-run.cancel` while armed; `duration` and `unit` are the one-tap run
159361
+ * a Run press starts.
159362
+ */
159363
+ var HeroRowTimedRunSchema = object({
159364
+ id: _enum(["timed-run.run", "timed-run.cancel"]),
159365
+ duration: number$1(),
159366
+ unit: _enum(["min", "s"])
159367
+ });
158690
159368
  var HeroRowModelSchema = object({
158691
159369
  deviceId: number$1().int(),
158692
159370
  name: string(),
@@ -158699,6 +159377,11 @@ var HeroRowModelSchema = object({
158699
159377
  statusLine: array(HeroTextSchema),
158700
159378
  /** `null` = the type has no inline control, or the caller may not act on it. */
158701
159379
  primary: HeroControlSchema.nullable(),
159380
+ /**
159381
+ * Beside `primary` when the device offers a timed run: Run while idle, Stop
159382
+ * while armed. `null` when there is no slot, or the caller may not act.
159383
+ */
159384
+ timedRun: HeroRowTimedRunSchema.nullable(),
158702
159385
  trailing: HeroFactSchema.nullable()
158703
159386
  });
158704
159387
  /**
@@ -159112,6 +159795,12 @@ var IntegrationWithStateSchema = object({
159112
159795
  name: string(),
159113
159796
  /** A projection of the instance body's switch (`setInstanceEnabled` is the only writer). */
159114
159797
  enabled: boolean(),
159798
+ /**
159799
+ * True when the addon that holds the switch did not answer (down, failed, or keeps no record for
159800
+ * this row): `enabled` is then the stored registry flag, a stale value, not the state. A reader
159801
+ * must not draw it as on or off (D315).
159802
+ */
159803
+ switchUnknown: literal(true).optional(),
159115
159804
  info: record(string(), unknown()).readonly(),
159116
159805
  /** The discovery candidate this integration was set up from (D984). */
159117
159806
  originStableId: string().optional(),
@@ -159125,6 +159814,12 @@ var IntegrationLiteSchema = object({
159125
159814
  name: string(),
159126
159815
  /** A projection of the instance body's switch (`setInstanceEnabled` is the only writer). */
159127
159816
  enabled: boolean(),
159817
+ /**
159818
+ * True when the addon that holds the switch did not answer (down, failed, or keeps no record for
159819
+ * this row): `enabled` is then the stored registry flag, a stale value, not the state. A reader
159820
+ * must not draw it as on or off (D315).
159821
+ */
159822
+ switchUnknown: literal(true).optional(),
159128
159823
  info: record(string(), unknown()).readonly(),
159129
159824
  /** The discovery candidate this integration was set up from (D984). */
159130
159825
  originStableId: string().optional(),
@@ -159223,9 +159918,9 @@ var UpdateIntegrationInputSchema = object({
159223
159918
  id: string(),
159224
159919
  name: string().optional(),
159225
159920
  /**
159226
- * Accepted for a FIXED builtin only (`info.fixed`: alarm panel, camera grid, core blocks,
159227
- * terminal), which keeps no instance record: the registry flag is its one store. Any other
159228
- * integration is switched through `integration-instances.setInstanceEnabled`.
159921
+ * Honoured ONLY for a fixed builtin (`info.fixed`), whose switch is the hub's own registry flag
159922
+ * and works while its addon is down. Any other row is refused (a typed `BAD_REQUEST`): its
159923
+ * switch is `integration-instances.setInstanceEnabled`.
159229
159924
  */
159230
159925
  enabled: boolean().optional(),
159231
159926
  info: record(string(), unknown()).optional()
@@ -159259,6 +159954,12 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
159259
159954
  * the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
159260
159955
  * or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
159261
159956
  * clears it.
159957
+ *
159958
+ * Who may call (epic #440): every method but `describe` and `instanceFormSchema` is open to any
159959
+ * session (`caller: 'scoped'`) and default-denies. An admin passes everywhere. A non-admin passes
159960
+ * only on a call pinned to one addon whose `describe().userScoped` is true, and that provider
159961
+ * filters every row on the `caller` the router injected (a notification target is somebody's
159962
+ * phone: a user sees and changes only their own). An addon that says nothing keeps the admin door.
159262
159963
  */
159263
159964
  var ConfigSchemaPassthrough$2 = custom();
159264
159965
  var IntegrationInstanceIdSchema = string().min(1);
@@ -159372,7 +160073,15 @@ var IntegrationInstanceDescriptionSchema = object({
159372
160073
  */
159373
160074
  mintsId: boolean().optional(),
159374
160075
  /** The links to other instances the provider's kinds declare; absent means none. */
159375
- links: array(IntegrationInstanceLinkSchema).optional()
160076
+ links: array(IntegrationInstanceLinkSchema).optional(),
160077
+ /**
160078
+ * The rows belong to individual users (a notification target is somebody's phone). The router
160079
+ * then opens `listInstances`, `getInstance`, `createInstance`, `updateInstance`,
160080
+ * `setInstanceEnabled`, `deleteInstance` and `testInstance` to a NON-admin session on a call
160081
+ * pinned to this addon, and hands the provider the `caller` so it keeps a user to their own rows.
160082
+ * Absent means admin only, as it always was.
160083
+ */
160084
+ userScoped: boolean().optional()
159376
160085
  });
159377
160086
  var IntegrationInstanceStatusSchema = object({
159378
160087
  state: _enum([
@@ -159430,8 +160139,14 @@ var integrationInstancesCapability = {
159430
160139
  /** The discovery candidate the wizard was seeded from (`stableId`), if any. */
159431
160140
  candidateStableId: string().min(1).optional()
159432
160141
  }), ConfigSchemaPassthrough$2, { auth: "admin" }),
159433
- listInstances: method(_void(), array(IntegrationInstanceSchema).readonly(), { auth: "admin" }),
159434
- getInstance: method(object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }),
160142
+ listInstances: method(looseObject({}), array(IntegrationInstanceSchema).readonly(), {
160143
+ auth: "protected",
160144
+ caller: "scoped"
160145
+ }),
160146
+ getInstance: method(object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), {
160147
+ auth: "protected",
160148
+ caller: "scoped"
160149
+ }),
159435
160150
  /**
159436
160151
  * Insert the typed record. With `id` it is stored under that id (a duplicate id is refused);
159437
160152
  * without one the PROVIDER mints it and answers it. `kind` picks one of `describe().kinds`.
@@ -159464,11 +160179,13 @@ var integrationInstancesCapability = {
159464
160179
  seed: object({ info: record(string(), unknown()) }).optional()
159465
160180
  }), object({ id: string() }), {
159466
160181
  kind: "mutation",
159467
- auth: "admin"
160182
+ auth: "protected",
160183
+ caller: "scoped"
159468
160184
  }),
159469
160185
  updateInstance: method(IntegrationInstancePatchSchema, object({ ok: literal(true) }), {
159470
160186
  kind: "mutation",
159471
- auth: "admin"
160187
+ auth: "protected",
160188
+ caller: "scoped"
159472
160189
  }),
159473
160190
  /**
159474
160191
  * Switch ONE instance on or off, for every role; a missing record is created from the addon's
@@ -159480,7 +160197,8 @@ var integrationInstancesCapability = {
159480
160197
  enabled: boolean()
159481
160198
  }), object({ ok: literal(true) }), {
159482
160199
  kind: "mutation",
159483
- auth: "admin"
160200
+ auth: "protected",
160201
+ caller: "scoped"
159484
160202
  }),
159485
160203
  /**
159486
160204
  * Delete the record and its keychain refs together. For an instance that brings devices the hub
@@ -159489,7 +160207,8 @@ var integrationInstancesCapability = {
159489
160207
  */
159490
160208
  deleteInstance: method(object({ id: IntegrationInstanceIdSchema }), object({ ok: literal(true) }), {
159491
160209
  kind: "mutation",
159492
- auth: "admin"
160210
+ auth: "protected",
160211
+ caller: "scoped"
159493
160212
  }),
159494
160213
  testInstance: optionalMethod(object({
159495
160214
  id: IntegrationInstanceIdSchema.nullable(),
@@ -159498,7 +160217,8 @@ var integrationInstancesCapability = {
159498
160217
  kind: string().min(1).optional()
159499
160218
  }), TestConnectionResultSchema, {
159500
160219
  kind: "mutation",
159501
- auth: "admin"
160220
+ auth: "protected",
160221
+ caller: "scoped"
159502
160222
  })
159503
160223
  }
159504
160224
  };
@@ -161370,7 +162090,7 @@ var lockControlCapability = {
161370
162090
  kind: "mutation",
161371
162091
  auth: "protected"
161372
162092
  }),
161373
- open: method(object({ deviceId: number$1().int().nonnegative() }), _void(), {
162093
+ open: optionalMethod(object({ deviceId: number$1().int().nonnegative() }), _void(), {
161374
162094
  kind: "mutation",
161375
162095
  auth: "protected"
161376
162096
  })
@@ -162588,7 +163308,7 @@ object({
162588
163308
  deviceId: number$1().int().optional(),
162589
163309
  atBefore: number$1().optional(),
162590
163310
  where: RecordWhereSchema.optional()
162591
- }), object({ count: number$1().int().nonnegative() }), object({}), object({ store: Rows }), object({ patch: Rows }), object({}), object({ keys: array(string().min(1)) }), object({ removed: array(string()) }), object({ refs: array(string()) }), object({ values: record(string(), string().nullable()) }), object({
163311
+ }), object({ count: number$1().int().nonnegative() }), object({}), object({ store: Rows }), object({ patch: Rows }), object({}), object({ keys: array(string().min(1)) }), object({ removed: array(string()) }), object({}), object({ deviceIds: array(number$1().int()) }), object({ deviceIds: array(number$1().int()) }), object({ blobs: record(string(), Rows) }), object({ refs: array(string()) }), object({ values: record(string(), string().nullable()) }), object({
162592
163312
  ref: string().min(1),
162593
163313
  value: string()
162594
163314
  }), object({}), object({ refs: array(string()) }), object({ deleted: number$1().int().nonnegative() }), object({}), object({ integrations: array(MigrationIntegrationSchema) }), object({ id: string().min(1) }), MigrationIntegrationSchema.nullable(), object({
@@ -162599,7 +163319,7 @@ object({
162599
163319
  integrationId: string().nullable(),
162600
163320
  /** Whether the device carries any stored config; its content is not offered. */
162601
163321
  hasConfig: boolean()
162602
- }).nullable(), object({
163322
+ }).nullable(), object({ deviceIds: array(number$1().int()) }), object({ aliases: record(string(), string()) }), object({
162603
163323
  deviceId: number$1().int(),
162604
163324
  integrationId: string().min(1)
162605
163325
  }), object({}), object({}), object({ nodeId: string() }), object({}), object({});
@@ -169897,92 +170617,21 @@ var NcZoneConditionSchema = object({
169897
170617
  * membership lists are OR within the list (spec §2.3).
169898
170618
  */
169899
170619
  /**
169900
- * What a rule may actuate.
169901
- *
169902
- * **No hand-maintained allowlist** (operator decision, and the right one — a
169903
- * written list of methods is a third parallel map to keep aligned, and this
169904
- * repo has paid for those). The boundary instead comes from a property the
169905
- * capabilities already carry: an action may target only a **device-scoped**
169906
- * capability method.
170620
+ * What a rule or a button runs: an **Action** of the `actions` surface
170621
+ * (`internal:<uuid>` or an addon's), by id, and nothing else (planning#473).
169907
170622
  *
169908
- * That is not decoration. A rule can be authored by a NON-ADMIN — personal
169909
- * rules are a supported flow — and the executor runs with the addon's
169910
- * privileges, so an unbounded action is an arbitrary RPC channel with a
169911
- * privilege escalation attached. Restricting to device scope excludes the
169912
- * system caps (`device-manager.removeDevice` and friends) by construction,
169913
- * costs nothing to maintain, and cannot rot: a cap that stops being
169914
- * device-scoped stops being actuatable in the same change.
169915
- *
169916
- * The executor enforces it; {@link NcRuleActionSchema} carries the intent.
170623
+ * The notification centre has no step vocabulary of its own. The steps, the
170624
+ * device-scope boundary, the stop-at-first-failure, the throttle
170625
+ * (`minDelaySec`), the variables and the runs ledger all belong to the Action;
170626
+ * an operator edits them in ONE place (the Actions page) and a rule points at
170627
+ * the result. A rule can be authored by a non-admin (personal rules), which is
170628
+ * safe for the same reason: it can only name an Action an admin already wrote.
169917
170629
  */
170630
+ var NcActionIdSchema = string().min(1);
170631
+ /** Action ids one hook edge runs, in order. Capped so a slot never becomes a second editor. */
170632
+ var NcHookActionIdsSchema = array(NcActionIdSchema).max(4);
169918
170633
  /**
169919
- * One step of a sequence.
169920
- *
169921
- * `wait` is a first-class step rather than a property of the next action: it is
169922
- * what makes a sequence a SEQUENCE and not a list — "unlock, wait 5s, open"
169923
- * cannot be expressed otherwise.
169924
- */
169925
- var NcRuleActionSchema = discriminatedUnion("kind", [object({
169926
- kind: literal("wait"),
169927
- seconds: number$1().min(0).max(300)
169928
- }), object({
169929
- kind: literal("cap"),
169930
- /**
169931
- * WHO the step acts on (D983) — the only shape that is written. A sequence
169932
- * stored before D983 carries `deviceId`; the sequence store reads it as a
169933
- * `devices` target.
169934
- */
169935
- target: ActionTargetSchema.optional(),
169936
- /** The vocabulary action the step performs; required for a `domain` target. */
169937
- actionId: string().min(1).optional(),
169938
- /** @deprecated The pre-D983 single device. Read, never written. */
169939
- deviceId: number$1().int().optional(),
169940
- /** Capability name, e.g. `alarm-panel`. */
169941
- cap: string().min(1),
169942
- /** Method on it. The executor refuses a non-device-scoped cap. */
169943
- method: string().min(1),
169944
- /** Method arguments, minus `deviceId` (the executor injects it). */
169945
- args: record(string(), unknown()).optional()
169946
- }).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
169947
- message: "a cap step needs a target",
169948
- path: ["target"]
169949
- }).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
169950
- message: "a domain target needs the vocabulary action it applies to (actionId)",
169951
- path: ["actionId"]
169952
- })]);
169953
- /**
169954
- * A named, ordered run of steps shared across rules, with its own throttle.
169955
- *
169956
- * Sequences live in the notification centre's sequence store — never inline on
169957
- * a rule. A rule binds to one by id ({@link NcActionBindingSchema}), and a
169958
- * button names one the same way. `minDelaySec` exists because a noisy rule
169959
- * otherwise hammers a physical actuator — the rule's own cooldown governs
169960
- * NOTIFICATIONS, which is a different budget from "how often may this gate
169961
- * actually open". The throttle key is the sequence id, so two rules sharing
169962
- * one sequence share its budget.
169963
- */
169964
- var NcSharedSequenceSchema = object({
169965
- id: string().min(1),
169966
- name: string().min(1).max(120),
169967
- minDelaySec: number$1().int().min(0).max(86400).optional(),
169968
- actions: array(NcRuleActionSchema).min(1)
169969
- });
169970
- /** Create / update body — the id is minted by the provider. */
169971
- var NcSharedSequenceInputSchema = object({
169972
- name: string().min(1).max(120),
169973
- minDelaySec: number$1().int().min(0).max(86400).optional(),
169974
- actions: array(NcRuleActionSchema).min(1)
169975
- });
169976
- /** Bindings on one hook edge. Cap keeps a slot from becoming a second sequence editor. */
169977
- var NcHookBindingsSchema = array(discriminatedUnion("kind", [object({
169978
- kind: literal("sequence"),
169979
- sequenceId: string().min(1)
169980
- }), object({
169981
- kind: literal("do"),
169982
- action: NcRuleActionSchema
169983
- })])).max(4);
169984
- /**
169985
- * One button carried by the notification, running a shared sequence on tap.
170634
+ * One button carried by the notification, running an Action on tap.
169986
170635
  *
169987
170636
  * **Read this before adding a button that does something physical.** The tap
169988
170637
  * arrives over a link that travelled through third-party infrastructure — ntfy,
@@ -169997,9 +170646,9 @@ var NcRuleNotificationButtonSchema = object({
169997
170646
  /** Stable id — travels in the callback and identifies the button in logs. */
169998
170647
  id: string().min(1).max(64),
169999
170648
  label: string().min(1).max(40),
170000
- /** Id of a shared sequence. The dispatcher drops a button whose sequence
170001
- * does not exist rather than minting a token for nothing. */
170002
- sequenceId: string().min(1),
170649
+ /** The Action the tap runs. The dispatcher drops a button whose Action does
170650
+ * not exist rather than minting a token for nothing. */
170651
+ actionId: NcActionIdSchema,
170003
170652
  icon: NotificationActionIconSchema.optional(),
170004
170653
  destructive: boolean().optional()
170005
170654
  });
@@ -170014,25 +170663,19 @@ var NcRuleNotificationButtonSchema = object({
170014
170663
  * leave). A delivery with no clear edge never produces this hook.
170015
170664
  */
170016
170665
  var NcRuleActionsSchema = object({
170017
- onActivation: NcHookBindingsSchema.optional(),
170018
- onDeactivation: NcHookBindingsSchema.optional(),
170666
+ onActivation: NcHookActionIdsSchema.optional(),
170667
+ onDeactivation: NcHookActionIdsSchema.optional(),
170019
170668
  /** Runs on a positive / raised match. */
170020
- onTrigger: NcHookBindingsSchema.optional(),
170669
+ onTrigger: NcHookActionIdsSchema.optional(),
170021
170670
  /** Runs on a clear / leave match, when the subject carries one. */
170022
- onTriggerOff: NcHookBindingsSchema.optional(),
170671
+ onTriggerOff: NcHookActionIdsSchema.optional(),
170023
170672
  /**
170024
- * Buttons the NOTIFICATION carries, each running one shared sequence when
170025
- * tapped. Deliberately a REFERENCE — a button that could define its own
170026
- * actions would be a parallel actuation vocabulary.
170673
+ * Buttons the NOTIFICATION carries, each running one Action when tapped.
170674
+ * Deliberately a REFERENCE — a button that could define its own steps would
170675
+ * be a parallel actuation vocabulary.
170027
170676
  */
170028
170677
  buttons: array(NcRuleNotificationButtonSchema).max(8).optional()
170029
170678
  });
170030
- object({
170031
- name: string().min(1).max(120),
170032
- enabled: boolean(),
170033
- minDelaySec: number$1().int().min(0).max(86400).optional(),
170034
- actions: array(NcRuleActionSchema).min(1)
170035
- });
170036
170679
  /**
170037
170680
  * "This rule applies only while `deviceId` is in one of `states`."
170038
170681
  *
@@ -170331,6 +170974,16 @@ var NcRuleTargetSchema = object({
170331
170974
  */
170332
170975
  params: record(string(), unknown()).optional()
170333
170976
  });
170977
+ var NcTargetOverrideSchema = object({
170978
+ template: object({
170979
+ title: string().max(500).optional(),
170980
+ body: string().max(2e3).optional()
170981
+ }).optional(),
170982
+ schedule: NcScheduleSchema.optional(),
170983
+ priority: number$1().int().min(1).max(5).optional()
170984
+ });
170985
+ /** Per-target settings keyed by target id (#487). */
170986
+ var NcTargetOverridesSchema = record(string(), NcTargetOverrideSchema);
170334
170987
  /**
170335
170988
  * WHAT THE NOTIFICATION'S PICTURE IS (D897) — the ONE media choice of a rule.
170336
170989
  *
@@ -170612,6 +171265,13 @@ var NcRuleInputSchema = object({
170612
171265
  * targets.
170613
171266
  */
170614
171267
  targetUsers: array(string()).optional(),
171268
+ /**
171269
+ * Per-target settings keyed by target id (#487): texts, schedule, priority.
171270
+ * Absent (and an absent entry) = the rule's own values. A patch that omits
171271
+ * the key keeps the stored map; a patch that names it REPLACES it whole —
171272
+ * `{}` empties it.
171273
+ */
171274
+ targetOverrides: NcTargetOverridesSchema.optional(),
170615
171275
  /** Absent = the kind's default picture (`resolveNcMediaImage`): the subject crop for a
170616
171276
  * detection, the clean scene for a sensor or a sound. Set explicitly on save (D897). */
170617
171277
  media: NcMediaPolicySchema.default({}),
@@ -171713,18 +172373,6 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
171713
172373
  }), object({ success: literal(true) }), {
171714
172374
  kind: "mutation",
171715
172375
  auth: "admin"
171716
- }), method(object({}), object({ sequences: array(NcSharedSequenceSchema) }), { auth: "admin" }), method(object({ sequenceId: string().min(1) }), object({ sequence: NcSharedSequenceSchema.nullable() }), { auth: "admin" }), method(object({ sequence: NcSharedSequenceInputSchema }), object({ sequence: NcSharedSequenceSchema }), {
171717
- kind: "mutation",
171718
- auth: "admin"
171719
- }), method(object({
171720
- sequenceId: string().min(1),
171721
- sequence: NcSharedSequenceInputSchema
171722
- }), object({ sequence: NcSharedSequenceSchema }), {
171723
- kind: "mutation",
171724
- auth: "admin"
171725
- }), method(object({ sequenceId: string().min(1) }), object({ success: literal(true) }), {
171726
- kind: "mutation",
171727
- auth: "admin"
171728
172376
  }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number$1().int()).readonly() }), { auth: "admin" }), method(object({
171729
172377
  deviceId: number$1().int(),
171730
172378
  muted: boolean()
@@ -172209,53 +172857,41 @@ setOverlay: method(object({
172209
172857
  }
172210
172858
  }] }
172211
172859
  };
172212
- _enum([
172213
- "value",
172214
- "unit",
172215
- "full"
172216
- ]);
172217
- _enum([
172218
- "value+unit",
172219
- "value",
172220
- "unit"
172221
- ]);
172222
172860
  /**
172223
- * How the operator reached the leaf device. `deviceId` is ALWAYS the
172224
- * OSD-supported leaf that is read; `containerId` is set when the pick
172225
- * went through a container (gateway) first.
172861
+ * `osd-manager` — the ORCHESTRATOR over the device-scope `osd` cap.
172862
+ *
172863
+ * The `osd` cap is the firmware contract: it probes a camera's overlay
172864
+ * SLOTS and writes literal text into one. It has no idea WHERE that text
172865
+ * comes from, and it must not — a driver that grew a "show the temperature
172866
+ * here" feature would grow it once per vendor.
172867
+ *
172868
+ * This cap owns the other half: a per-(camera, slot) BINDING that says
172869
+ * which value feeds the slot, how it is formatted, and under which
172870
+ * conditions it is shown at all. Named TEMPLATES combine many device
172871
+ * fields into one overlay string (plugin catalog OSD Manager parity).
172226
172872
  */
172227
- var OsdTemplatePickSchema = object({
172228
- containerId: number$1().int().optional(),
172229
- deviceId: number$1().int()
172230
- });
172231
172873
  /**
172232
- * One named binding inside a multi-device template: device path + unit
172233
- * selection + precision. The parser expands `{alias}`, `{alias.value}`,
172234
- * `{alias.unit}`, or `{alias.full}` from the same binding — there is no
172235
- * per-binding format lock.
172874
+ * The text of a named template: a device template (D1021) —
172875
+ * `{{ camera.temperature | round(1) }}`, `{{ now | time('HH:mm') }}`,
172876
+ * `{% if camera.motion %}MOTION{% endif %}` — rendered by the ONE hub renderer
172877
+ * (`device-manager.renderDeviceTemplates`), never by this addon.
172878
+ *
172879
+ * Two names belong to the render rather than to a device:
172880
+ * - `now` is the clock; `time('HH:mm')` prints it in the server's zone.
172881
+ * - `camera` is the camera the overlay is on, so one template serves every
172882
+ * camera. `camera.lastPerson` and `camera.lastPlate` are the most recent
172883
+ * recognition persisted for it (empty text until there is one, with
172884
+ * `| default('')`).
172236
172885
  */
172237
- var OsdTemplateBindingSchema = object({
172238
- /** Token stem in the parser, e.g. `t` → `{t}` / `{t.value}`. Unique within the template. */
172239
- alias: string().min(1).max(32).regex(/^[A-Za-z][A-Za-z0-9_-]*$/, "alias must start with a letter"),
172240
- pick: OsdTemplatePickSchema,
172241
- capName: string().min(1).max(64),
172242
- valuePath: string().min(1).max(64),
172243
- /** Convert TO this unit at render (`tryConvertUnit`). Absent = source unit. */
172244
- displayUnit: string().max(16).optional(),
172245
- maxDecimals: number$1().int().min(0).max(4).default(1),
172246
- /** Raw value → display text (same shape as slot binding). Empty string hides. */
172247
- valueMap: record(string(), string()).optional()
172248
- });
172886
+ var OSD_TEMPLATE_TEXT_MAX = 1024;
172249
172887
  /**
172250
- * A named template: bindings (alias → leaf field) + a parser that
172251
- * references `{alias}` / `{alias.value}` / `{alias.unit}` / `{alias.full}`.
172888
+ * A named template: the unit of reuse. A slot points at one by id; editing it
172889
+ * changes every slot that points at it, on every camera.
172252
172890
  */
172253
172891
  var OsdNamedTemplateSchema = object({
172254
172892
  id: string().min(1).max(64),
172255
172893
  name: string().min(1).max(64),
172256
- bindings: array(OsdTemplateBindingSchema).max(32).default([]),
172257
- /** Parser with alias placeholders, e.g. `{t.value} {t.unit} / {h}`. */
172258
- parser: string().max(256).default("")
172894
+ text: string().max(OSD_TEMPLATE_TEXT_MAX).default("")
172259
172895
  });
172260
172896
  /** Where a slot's value comes from. */
172261
172897
  var OsdSourceSchema = discriminatedUnion("kind", [
@@ -172264,26 +172900,6 @@ var OsdSourceSchema = discriminatedUnion("kind", [
172264
172900
  kind: literal("static"),
172265
172901
  text: string().max(64)
172266
172902
  }),
172267
- object({
172268
- kind: literal("clock"),
172269
- /** Token pattern: `YYYY MM DD HH mm ss`. Everything else is literal. */
172270
- pattern: string().min(1).max(32).default("HH:mm"),
172271
- /** IANA zone. Omitted = the server's zone. */
172272
- timezone: string().min(1).max(64).optional()
172273
- }),
172274
- object({
172275
- kind: literal("device-state"),
172276
- deviceId: number$1().int().optional(),
172277
- capName: string().min(1).max(64),
172278
- /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
172279
- valuePath: string().min(1).max(64),
172280
- /** Convert TO this unit at render. Absent = no conversion. */
172281
- displayUnit: string().max(16).optional()
172282
- }),
172283
- object({
172284
- kind: literal("latest-recognition"),
172285
- recognition: _enum(["person", "plate"])
172286
- }),
172287
172903
  object({
172288
172904
  kind: literal("template"),
172289
172905
  templateId: string().min(1).max(64)
@@ -172293,15 +172909,6 @@ var OsdSlotBindingSchema = object({
172293
172909
  /** Off = the manager stops driving this slot. It does NOT clear it. */
172294
172910
  enabled: boolean().default(true),
172295
172911
  source: OsdSourceSchema,
172296
- /** `${value}` and `${unit}` are substituted; every occurrence. */
172297
- template: string().max(96).default("${value}"),
172298
- /**
172299
- * Decimal places for a numeric value. `0` yields an integer — the
172300
- * documented workaround for firmwares that reject `.` in overlay text.
172301
- */
172302
- maxDecimals: number$1().int().min(0).max(4).default(1),
172303
- /** Raw value → display text, e.g. `{"true":"MOTION","false":""}`. */
172304
- valueMap: record(string(), string()).optional(),
172305
172912
  /** Time windows in which the slot is shown. Absent = always. */
172306
172913
  schedule: NcScheduleSchema.optional(),
172307
172914
  /**
@@ -172343,31 +172950,21 @@ var OsdRenderResultSchema = object({
172343
172950
  /** Why, whenever the outcome is not a plain write. Never silent. */
172344
172951
  reason: string().optional()
172345
172952
  });
172346
- var OsdSourceValueTypeEnum = _enum([
172347
- "number",
172348
- "boolean",
172349
- "string",
172350
- "enum"
172351
- ]);
172352
172953
  /**
172353
- * One bindable value, derived from a cap's `runtimeState` schema — never
172354
- * hand-listed. The editor renders from this, so a cap that ships a new
172355
- * state field becomes bindable with no UI change.
172954
+ * A template rendered for one camera without being saved: what the editor
172955
+ * previews. `text` is what the overlay would carry; a refused render has a
172956
+ * `reason` and an empty text.
172356
172957
  */
172357
- var OsdSourceOptionSchema = object({
172358
- deviceId: number$1().int(),
172359
- deviceName: string(),
172360
- capName: string(),
172361
- valuePath: string(),
172362
- label: string(),
172363
- valueType: OsdSourceValueTypeEnum,
172364
- /** Present for `enum`; the editor offers these as `valueMap` keys. */
172365
- enumValues: array(string()).readonly().optional()
172958
+ var OsdTemplatePreviewSchema = object({
172959
+ ok: boolean(),
172960
+ text: string(),
172961
+ /** The refusal, or `ref: reason` per value that printed `—`. */
172962
+ notes: array(string())
172366
172963
  });
172367
172964
  method(object({ deviceId: number$1().int() }), object({
172368
172965
  supported: boolean(),
172369
172966
  slots: array(OsdSlotViewSchema)
172370
- }), { auth: "admin" }), method(object({ deviceId: number$1().int() }), object({ sources: array(OsdSourceOptionSchema) }), { auth: "admin" }), method(object({}), object({
172967
+ }), { auth: "admin" }), method(object({}), object({
172371
172968
  supported: array(string()),
172372
172969
  catalog: array(NcConditionDescriptorSchema)
172373
172970
  }), { auth: "admin" }), method(object({
@@ -172409,6 +173006,12 @@ method(object({ deviceId: number$1().int() }), object({
172409
173006
  }), OsdRenderResultSchema, {
172410
173007
  kind: "mutation",
172411
173008
  auth: "admin"
173009
+ }), method(object({
173010
+ deviceId: number$1().int(),
173011
+ text: string().max(OSD_TEMPLATE_TEXT_MAX)
173012
+ }), OsdTemplatePreviewSchema, {
173013
+ kind: "mutation",
173014
+ auth: "admin"
172412
173015
  }), method(object({ deviceId: number$1().int() }), object({ results: array(OsdRenderResultSchema) }), {
172413
173016
  kind: "mutation",
172414
173017
  auth: "admin"
@@ -177973,7 +178576,6 @@ var RemoteCustomButtonSchema = object({
177973
178576
  /** What the operator calls it, and what a voice command may name. */
177974
178577
  name: string().min(1).max(60)
177975
178578
  });
177976
- var RemotePowerModeSchema = _enum(["toggle", "discrete"]);
177977
178579
  /**
177978
178580
  * The source rules: every step role is bound, ids and names are unique, a
177979
178581
  * channel number belongs to one `digits` source, and no name or id is another
@@ -178054,7 +178656,6 @@ var RemoteConfigSchema = object({
178054
178656
  sources: array(RemoteSourceSchema).max(200).default([]),
178055
178657
  /** The pause between two steps of a source: the television's receiver, not a repeat. */
178056
178658
  stepDelayMs: number$1().int().min(100).max(REMOTE_STEP_DELAY_MAX_MS).default(500),
178057
- power: object({ mode: RemotePowerModeSchema }),
178058
178659
  /**
178059
178660
  * READ-ONLY: sources a stored configuration carries that no longer parse,
178060
178661
  * left out of `sources` with the reason (`readStoredRemoteConfig`). Never
@@ -178158,6 +178759,11 @@ var RemoteLayoutButtonSchema = object({
178158
178759
  /** Absent = the plain rendering every layout had before shapes existed. */
178159
178760
  shape: RemoteButtonShapeSchema.optional(),
178160
178761
  tone: RemoteButtonToneSchema.optional(),
178762
+ /**
178763
+ * Draw the label on a colour-toned key. A colour key shows only its colour
178764
+ * by default; a remote whose plastic prints letters on them (A B C D) sets it.
178765
+ */
178766
+ showLegend: boolean().optional(),
178161
178767
  /** The group this button belongs to; it must lie inside that group's rectangle. */
178162
178768
  groupId: string().min(1).max(40).optional()
178163
178769
  });
@@ -178295,7 +178901,6 @@ var RemoteBoundCommandSchema = object({
178295
178901
  });
178296
178902
  var RemoteCommandListSchema = object({
178297
178903
  layoutTemplateId: string().nullable(),
178298
- power: object({ mode: RemotePowerModeSchema }),
178299
178904
  /** Only the roles that are BOUND — the ones a press can reach. */
178300
178905
  commands: array(RemoteBoundCommandSchema),
178301
178906
  /** The sources the operator declared; empty when none (planning#460). */
@@ -178308,7 +178913,8 @@ var RemoteRefusalReasonSchema = _enum([
178308
178913
  "unknown-source",
178309
178914
  "unbound-step",
178310
178915
  "undeclared-channel",
178311
- "press-timeout"
178916
+ "press-timeout",
178917
+ "no-transmitter"
178312
178918
  ]);
178313
178919
  var RemoteSendResultSchema = discriminatedUnion("status", [
178314
178920
  object({
@@ -178401,7 +179007,8 @@ var RemoteComponentButtonSchema = object({
178401
179007
  icon: string().min(1).max(60).optional(),
178402
179008
  label: string().min(1).max(40).optional(),
178403
179009
  shape: RemoteButtonShapeSchema.optional(),
178404
- tone: RemoteButtonToneSchema.optional()
179010
+ tone: RemoteButtonToneSchema.optional(),
179011
+ showLegend: boolean().optional()
178405
179012
  });
178406
179013
  var RemoteLayoutComponentSchema = object({
178407
179014
  id: string().max(80).regex(COMPONENT_ID_RE, { message: "<namespace>:<name>, lowercase" }),
@@ -179600,6 +180207,11 @@ var SendEmailResultSchema = object({
179600
180207
  var SmtpStatusSchema = object({
179601
180208
  /** True iff the addon has successfully verified the relay. */
179602
180209
  ready: boolean(),
180210
+ /**
180211
+ * The tri-state behind `ready` (D315): true when the last send worked, false when it failed,
180212
+ * ABSENT when the relay has not sent yet (unknown, never "not verified").
180213
+ */
180214
+ verified: boolean().optional(),
179603
180215
  /** Operator-visible host string (no credentials). */
179604
180216
  host: string(),
179605
180217
  /** Last error message reported by the relay, when not ready. */
@@ -179611,10 +180223,6 @@ method(SendEmailInputSchema, SendEmailResultSchema, {
179611
180223
  kind: "mutation",
179612
180224
  auth: "admin",
179613
180225
  access: "create"
179614
- }), method(RelayPinSchema, SmtpStatusSchema, {
179615
- kind: "mutation",
179616
- auth: "admin",
179617
- access: "view"
179618
180226
  }), method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" });
179619
180227
  /**
179620
180228
  * A single device snapshot returned as base64 JPEG/PNG.
@@ -182659,7 +183267,7 @@ var valveCapability = {
182659
183267
  kind: "mutation",
182660
183268
  auth: "protected"
182661
183269
  }),
182662
- setPosition: method(object({
183270
+ setPosition: optionalMethod(object({
182663
183271
  deviceId: number$1().int().nonnegative(),
182664
183272
  position: number$1().min(0).max(100)
182665
183273
  }), _void(), {
@@ -185228,6 +185836,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
185228
185836
  groupCommands: groupCommandsCapability,
185229
185837
  groupStatus: groupStatusCapability,
185230
185838
  heatingValve: heatingValveCapability,
185839
+ heatPumpStatus: heatPumpStatusCapability,
185231
185840
  humidifier: humidifierCapability,
185232
185841
  humiditySensor: humiditySensorCapability,
185233
185842
  image: imageCapability,
@@ -186511,7 +187120,8 @@ var BaseDeviceProvider = class extends BaseAddon {
186511
187120
  return toDeviceSummary(device, this.addonId);
186512
187121
  }
186513
187122
  };
186514
- 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;
187123
+ DeviceType.HeatPump;
187124
+ 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;
186515
187125
  new Set(Object.values(DeviceType));
186516
187126
  /** Parses the raw slice with the cap's own schema; `undefined` when it does not parse. */
186517
187127
  function contribution(cap, schema, build) {
@@ -186647,6 +187257,13 @@ var lockContribution = contribution("lock-control", LockControlStatusSchema, (sl
186647
187257
  reading: reading("lock-control", words?.state ?? "unknown", false, words?.title),
186648
187258
  rows: [row$1("lock", state === "locked" || state === "locking" ? "lock" : "lock-open", joinText([title, since]), lockControls(state, ctx.features.includes(DeviceFeature.LockOpen)))],
186649
187259
  ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, "muted")] },
187260
+ ...words === null ? {} : { tiles: { left: [{
187261
+ label: t("Door", "Porta"),
187262
+ value: title
187263
+ }, ...since === null ? [] : [{
187264
+ label: t("Since", "Da"),
187265
+ value: since
187266
+ }]] } },
186650
187267
  ...words?.door == null ? {} : { scene: { mode: words.door } }
186651
187268
  };
186652
187269
  });
@@ -186728,7 +187345,17 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
186728
187345
  return {
186729
187346
  reading: reading("alarm-panel", words?.state ?? "unknown", false, words?.title),
186730
187347
  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))],
186731
- ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] }
187348
+ ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] },
187349
+ ...words === null ? {} : { tiles: {
187350
+ left: [{
187351
+ label: t("Mode", "Modalità"),
187352
+ value: words.title
187353
+ }],
187354
+ ...since === null ? {} : { right: [{
187355
+ label: t("Since", "Da"),
187356
+ value: since
187357
+ }] }
187358
+ } }
186732
187359
  };
186733
187360
  }),
186734
187361
  "automation-control": contribution("automation-control", AutomationControlStatusSchema, (slice, ctx) => {
@@ -186792,7 +187419,7 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
186792
187419
  */
186793
187420
  var has$3 = (ctx, f) => ctx.features.includes(f);
186794
187421
  var unknownText = t("Unknown", "Sconosciuto");
186795
- var pct$1 = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
187422
+ var pct$2 = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
186796
187423
  var unit = (n) => Math.min(1, Math.max(0, n / 100));
186797
187424
  /** Battery as a fact, unless the device is also bound to the `battery` cap (it already says so). */
186798
187425
  function ownBattery(level, ctx) {
@@ -186854,7 +187481,7 @@ var fanContribution = contribution("fan-control", FanControlStatusSchema, (slice
186854
187481
  },
186855
187482
  valueArg: "direction"
186856
187483
  });
186857
- const speedText = speed === null ? null : pct$1(speed);
187484
+ const speedText = speed === null ? null : pct$2(speed);
186858
187485
  const preset = slice?.preset ?? "";
186859
187486
  const status = speed === null ? unknownText : joinText([speed === 0 ? t("Off", "Spento") : t(`Speed ${speed}%`, `Velocità ${speed}%`), preset === "" ? null : t(preset, preset)]);
186860
187487
  return {
@@ -186867,10 +187494,16 @@ var fanContribution = contribution("fan-control", FanControlStatusSchema, (slice
186867
187494
  }],
186868
187495
  ...speedText === null ? {} : {
186869
187496
  facts: [fact("speed", "fan", speedText, speed === 0 ? "muted" : "primary")],
186870
- tiles: { right: [{
186871
- label: t("Speed", "Velocità"),
186872
- value: speedText
186873
- }] },
187497
+ tiles: {
187498
+ ...slice?.oscillating == null ? {} : { left: [{
187499
+ label: t("Oscillation", "Oscilla"),
187500
+ value: slice.oscillating ? t("Yes", "Sì") : t("No", "No")
187501
+ }] },
187502
+ ...preset === "" ? {} : { right: [{
187503
+ label: t("Mode", "Modalità"),
187504
+ value: t(preset, preset)
187505
+ }] }
187506
+ },
186874
187507
  scene: { level: unit(speed ?? 0) }
186875
187508
  }
186876
187509
  };
@@ -186934,7 +187567,8 @@ var vacuumContribution = contribution("vacuum-control", VacuumControlStatusSchem
186934
187567
  const words = state === null ? null : VACUUM_WORDS[state];
186935
187568
  const title = state === "error" && slice?.errorLabel ? t(slice.errorLabel, slice.errorLabel) : words?.title;
186936
187569
  const controls = vacuumControls(state);
186937
- if (slice !== void 0 && slice.availableFanSpeeds.length > 0) controls.push({
187570
+ const suctionControls = [];
187571
+ if (slice !== void 0 && slice.availableFanSpeeds.length > 0) suctionControls.push({
186938
187572
  kind: "picker",
186939
187573
  id: "vacuum.suction",
186940
187574
  label: t("Suction", "Aspirazione"),
@@ -186949,22 +187583,31 @@ var vacuumContribution = contribution("vacuum-control", VacuumControlStatusSchem
186949
187583
  });
186950
187584
  if (state !== null) controls.push(vac("locate", "Locate", "Trova", "map-pin", "locate"));
186951
187585
  const progress = state === "cleaning" ? slice?.progress ?? null : null;
187586
+ const suction = slice?.fanSpeed == null || slice.fanSpeed === "" ? [] : [{
187587
+ label: t("Suction", "Aspirazione"),
187588
+ value: t(slice.fanSpeed, slice.fanSpeed)
187589
+ }];
187590
+ const suctionRows = suctionControls.length === 0 ? [] : [{
187591
+ id: "vacuum-suction",
187592
+ icon: "bot",
187593
+ status: null,
187594
+ controls: suctionControls
187595
+ }];
187596
+ const vacuumRows = [{
187597
+ id: "vacuum",
187598
+ icon: "bot",
187599
+ status: title ?? unknownText,
187600
+ controls
187601
+ }, ...suctionRows];
186952
187602
  return {
186953
187603
  reading: reading("vacuum-control", words?.state ?? "unknown", false, title),
186954
- rows: [{
186955
- id: "vacuum",
186956
- icon: "bot",
186957
- status: title ?? unknownText,
186958
- controls
186959
- }],
186960
- facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$1(progress), "primary")]],
186961
- ...progress === null ? {} : {
186962
- tiles: { right: [{
186963
- label: t("Progress", "Avanzamento"),
186964
- value: pct$1(progress)
186965
- }] },
186966
- scene: { level: unit(progress) }
186967
- }
187604
+ rows: vacuumRows,
187605
+ facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$2(progress), "primary")]],
187606
+ ...suction.length === 0 && progress === null ? {} : { tiles: { right: [...suction, ...progress === null ? [] : [{
187607
+ label: t("Progress", "Avanzamento"),
187608
+ value: pct$2(progress)
187609
+ }]] } },
187610
+ ...progress === null ? {} : { scene: { level: unit(progress) } }
186968
187611
  };
186969
187612
  });
186970
187613
  var MOWER_WORDS = {
@@ -187020,11 +187663,11 @@ var mowerContribution = contribution("lawn-mower-control", LawnMowerControlStatu
187020
187663
  status: title ?? unknownText,
187021
187664
  controls: mowerControls(activity)
187022
187665
  }],
187023
- facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$1(progress), "primary")]],
187666
+ facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$2(progress), "primary")]],
187024
187667
  ...progress === null ? {} : {
187025
187668
  tiles: { right: [{
187026
187669
  label: t("Progress", "Avanzamento"),
187027
- value: pct$1(progress)
187670
+ value: pct$2(progress)
187028
187671
  }] },
187029
187672
  scene: { level: unit(progress) }
187030
187673
  }
@@ -187095,10 +187738,13 @@ var feederContribution = contribution("pet-feeder", PetFeederStatusSchema, (slic
187095
187738
  ...last === null ? [] : [fact("last-run", "clock", t(`Last ${last} g`, `Ultimo ${last} g`))],
187096
187739
  ...ownBattery(slice?.powerSource === "battery" ? slice.batteryPower : null, ctx)
187097
187740
  ],
187098
- ...last === null ? {} : { tiles: { right: [{
187741
+ tiles: { left: [...slice?.foodLevel == null ? [] : [{
187742
+ label: t("Tank", "Serbatoio"),
187743
+ value: pct$2(slice.foodLevel)
187744
+ }], ...last === null ? [] : [{
187099
187745
  label: t("Last portion", "Ultima porzione"),
187100
187746
  value: t(`${last} g`, `${last} g`)
187101
- }] } }
187747
+ }]] }
187102
187748
  };
187103
187749
  });
187104
187750
  var fountainContribution = contribution("pet-fountain", PetFountainStatusSchema, (slice) => {
@@ -187126,10 +187772,13 @@ var fountainContribution = contribution("pet-fountain", PetFountainStatusSchema,
187126
187772
  }],
187127
187773
  ...level === null ? {} : {
187128
187774
  facts: [fact("level", "droplets", t(`Water ${Math.round(level)}%`, `Acqua ${Math.round(level)}%`), level <= 20 ? "warning" : "primary")],
187129
- tiles: { right: [{
187775
+ tiles: { left: [{
187130
187776
  label: t("Water", "Acqua"),
187131
- value: pct$1(level)
187132
- }] },
187777
+ value: pct$2(level)
187778
+ }, ...slice?.waterVolume == null ? [] : [{
187779
+ label: t("Volume", "Volume"),
187780
+ value: t(`${Math.round(slice.waterVolume)} ml`, `${Math.round(slice.waterVolume)} ml`)
187781
+ }]] },
187133
187782
  scene: { level: unit(level) }
187134
187783
  }
187135
187784
  };
@@ -187161,14 +187810,18 @@ var DEVICES_FAMILY_CONTRIBUTIONS = {
187161
187810
  * that does not parse reads `unknown`, never closed or off (D315/D393).
187162
187811
  */
187163
187812
  var has$2 = (ctx, f) => ctx.features.includes(f);
187164
- var pct = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
187813
+ var pct$1 = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
187165
187814
  var brightnessContribution = contribution("brightness", BrightnessStatusSchema, (slice) => {
187166
187815
  const level = slice?.level ?? null;
187167
187816
  return {
187168
187817
  ...level === null ? {} : { reading: reading("brightness", level > 0 ? "on" : "off") },
187169
187818
  ...level === null ? {} : {
187170
- facts: [fact("level", "sun-dim", pct(level), level > 0 ? "primary" : "muted")],
187171
- scene: { level: level / 100 }
187819
+ facts: [fact("level", "sun-dim", pct$1(level), level > 0 ? "primary" : "muted")],
187820
+ scene: { level: level / 100 },
187821
+ tiles: { left: [{
187822
+ label: t("Brightness", "Luminosità"),
187823
+ value: pct$1(level)
187824
+ }] }
187172
187825
  },
187173
187826
  rows: [row$1("brightness", "sun-dim", level === null ? null : t(`Brightness ${Math.round(level)}%`, `Luminosità ${Math.round(level)}%`), [{
187174
187827
  kind: "slider",
@@ -187377,12 +188030,16 @@ function travelFragment(s, state, position, tilt, ctx) {
187377
188030
  });
187378
188031
  return {
187379
188032
  reading: reading(s.source, words.state, false, words.title),
187380
- ...position === null ? {} : { facts: [fact("level", "arrow-up-down", pct(position))] },
188033
+ ...position === null ? {} : { facts: [fact("level", "arrow-up-down", pct$1(position))] },
188034
+ ...position === null ? {} : { tiles: { left: [{
188035
+ label: t("Opening", "Apertura"),
188036
+ value: pct$1(position)
188037
+ }] } },
187381
188038
  scene: {
187382
188039
  ...words.mode === null ? {} : { mode: words.mode },
187383
188040
  ...position === null ? {} : { level: position / 100 }
187384
188041
  },
187385
- rows: [row$1(s.rowId, "arrow-up-down", joinText([words.title, position !== null && state !== "open" ? pct(position) : null]), controls)]
188042
+ rows: [row$1(s.rowId, "arrow-up-down", joinText([words.title, position !== null && state !== "open" ? pct$1(position) : null]), controls)]
187386
188043
  };
187387
188044
  }
187388
188045
  var ACTUATORS_FAMILY_CONTRIBUTIONS = {
@@ -187460,10 +188117,10 @@ var ACTUATORS_FAMILY_CONTRIBUTIONS = {
187460
188117
  const now = slice.currentHumidity;
187461
188118
  return {
187462
188119
  reading: reading("humidifier", state, false, title),
187463
- ...now === null ? {} : { facts: [fact("level", "droplets", pct(now), "info")] },
188120
+ ...now === null ? {} : { facts: [fact("level", "droplets", pct$1(now), "info")] },
187464
188121
  ...slice.targetHumidity === null ? {} : { tiles: { right: [{
187465
188122
  label: t("Target", "Obiettivo"),
187466
- value: pct(slice.targetHumidity)
188123
+ value: pct$1(slice.targetHumidity)
187467
188124
  }] } },
187468
188125
  ...now === null ? {} : { scene: { level: now / 100 } },
187469
188126
  rows: [row$1("humidifier", "droplets", joinText([title, slice.mode === null ? null : t(slice.mode, slice.mode)]), controls)]
@@ -187711,17 +188368,16 @@ var weatherContribution = contribution("weather", WeatherStatusSchema, (slice, c
187711
188368
  });
187712
188369
  var updateContribution = contribution("update", UpdateStatusSchema, (slice) => {
187713
188370
  if (slice === void 0) return { reading: reading("update", "unknown") };
187714
- const { currentVersion, availableVersion, inProgress, updatable } = slice;
188371
+ const { currentVersion, availableVersion, inProgress } = slice;
187715
188372
  const pending = availableVersion !== null && availableVersion !== "" && availableVersion !== currentVersion;
187716
188373
  if (!pending && currentVersion === null && !inProgress) return { reading: reading("update", "unknown") };
187717
188374
  const state = inProgress ? "running" : pending ? "standby" : "idle";
187718
188375
  const title = inProgress ? t("Updating", "Aggiornamento in corso") : pending ? t("Update available", "Aggiornamento disponibile") : t("Up to date", "Aggiornato");
187719
188376
  const versions = currentVersion === null ? pending ? t(`${availableVersion}`, `${availableVersion}`) : null : pending ? t(`${currentVersion} → ${availableVersion}`, `${currentVersion} → ${availableVersion}`) : t(`Version ${currentVersion}`, `Versione ${currentVersion}`);
187720
- const install = pending && updatable && !inProgress ? [asAction(action("update.install", t("Install", "Installa"), "download", "update", "installUpdate", {}, "primary", "install"))] : [];
187721
188377
  return {
187722
188378
  reading: reading("update", state, false, title),
187723
188379
  facts: versions === null ? [] : [fact("reading", "download", versions, pending ? "warning" : "muted")],
187724
- rows: [row$1("update", "download", versions, install)]
188380
+ rows: [row$1("update", "download", versions, [])]
187725
188381
  };
187726
188382
  });
187727
188383
  var imageContribution = contribution("image", ImageStatusSchema, (slice, ctx) => {
@@ -187829,6 +188485,33 @@ var ON_MODE_PREFERENCE = [
187829
188485
  "heat",
187830
188486
  "cool"
187831
188487
  ];
188488
+ var FAN_LABEL = {
188489
+ auto: t("Auto", "Auto"),
188490
+ quiet: t("Quiet", "Silenziosa"),
188491
+ low: t("Low", "Bassa"),
188492
+ medium: t("Medium", "Media"),
188493
+ high: t("High", "Alta"),
188494
+ turbo: t("Turbo", "Turbo"),
188495
+ off: t("Off", "Spenta")
188496
+ };
188497
+ /** A readable label for a fan speed name; an unknown one is shown as the device reported it. */
188498
+ function fanLabelOf(fan) {
188499
+ return FAN_LABEL[fan] ?? t(fan, fan);
188500
+ }
188501
+ /** Short labels for a segmented control: one word each, so the segments stay on a line. */
188502
+ var MODE_SEGMENT_LABEL = {
188503
+ off: t("Off", "Spento"),
188504
+ heat: t("Heat", "Caldo"),
188505
+ cool: t("Cool", "Freddo"),
188506
+ auto: t("Auto", "Auto"),
188507
+ heat_cool: t("Heat/Cool", "Caldo/Freddo"),
188508
+ fan_only: t("Fan", "Vent."),
188509
+ dry: t("Dry", "Deum.")
188510
+ };
188511
+ /** The segment label of every available HVAC mode, keyed by the mode value. */
188512
+ function modeLabelsOf(modes) {
188513
+ return Object.fromEntries(modes.map((m) => [m, MODE_SEGMENT_LABEL[m]]));
188514
+ }
187832
188515
  /** 22 -> "22", 22.3 -> "22.3": a trailing zero is noise on a thermostat. */
187833
188516
  function formatDegrees(value) {
187834
188517
  return `${Number(value.toFixed(1))}°`;
@@ -187893,11 +188576,11 @@ function rangeFrom(min, max, step) {
187893
188576
  * contribute, types never do (D14). A slice that is absent or does not parse is
187894
188577
  * "not answered": the state reads unknown, no row is drawn (D315, D393).
187895
188578
  */
187896
- var same = (text) => t(text, text);
187897
- function tile(en, it, value) {
188579
+ var same$1 = (text) => t(text, text);
188580
+ function tile$1(en, it, value) {
187898
188581
  return {
187899
188582
  label: t(en, it),
187900
- value: same(value)
188583
+ value: same$1(value)
187901
188584
  };
187902
188585
  }
187903
188586
  function setpointSlider(id, cap, method, valueArg, value, range) {
@@ -187932,18 +188615,19 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
187932
188615
  const status = climateStatusText(view);
187933
188616
  const facts = [];
187934
188617
  if (status !== null) facts.push(fact("climate", "thermometer", status));
187935
- if (view.humidity !== null) facts.push(fact("humidity", "droplets", same(`${Math.round(view.humidity)}%`)));
187936
- if (view.targetHumidity !== null) facts.push(fact("humidity", "droplets", same(`→ ${Math.round(view.targetHumidity)}%`)));
188618
+ if (view.humidity !== null) facts.push(fact("humidity", "droplets", same$1(`${Math.round(view.humidity)}%`)));
188619
+ if (view.targetHumidity !== null) facts.push(fact("humidity", "droplets", same$1(`→ ${Math.round(view.targetHumidity)}%`)));
187937
188620
  const left = [];
187938
188621
  const right = [];
187939
- if (view.measured !== null) left.push(tile("Indoor", "In casa", formatDegrees(view.measured)));
187940
- if (view.humidity !== null) left.push(tile("Humidity", "Umidità", `${Math.round(view.humidity)}%`));
188622
+ if (view.measured !== null) left.push(tile$1("Indoor", "In casa", formatDegrees(view.measured)));
188623
+ if (view.humidity !== null) left.push(tile$1("Humidity", "Umidità", `${Math.round(view.humidity)}%`));
187941
188624
  const modeControls = [{
187942
188625
  kind: "picker",
187943
188626
  id: "climate.mode",
187944
188627
  label: t("Mode", "Modalità"),
187945
188628
  current: view.mode,
187946
- options: [...view.availableModes],
188629
+ options: [...view.availableModes.filter((m) => m !== "off"), ...view.availableModes.filter((m) => m === "off")],
188630
+ optionLabels: modeLabelsOf(view.availableModes),
187947
188631
  call: {
187948
188632
  cap: "climate-control",
187949
188633
  method: "setMode",
@@ -187971,6 +188655,7 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
187971
188655
  label: t("Fan", "Ventola"),
187972
188656
  current: slice.fanMode === "" ? null : slice.fanMode,
187973
188657
  options: [...slice.availableFanModes],
188658
+ optionLabels: Object.fromEntries(slice.availableFanModes.map((m) => [m, fanLabelOf(m)])),
187974
188659
  call: {
187975
188660
  cap: "climate-control",
187976
188661
  method: "setFanMode",
@@ -187996,14 +188681,15 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
187996
188681
  if (fanControls.length > 0) rows.push({
187997
188682
  id: "climate-fan",
187998
188683
  icon: "fan",
187999
- status: slice.fanMode === "" ? null : same(slice.fanMode),
188684
+ status: slice.fanMode === "" ? null : same$1(slice.fanMode),
188000
188685
  controls: fanControls
188001
188686
  });
188002
- 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)));
188687
+ 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)));
188003
188688
  const sceneMode = view.sceneMode;
188004
188689
  return {
188005
188690
  reading: reading("climate-control", view.isOff ? "off" : "on"),
188006
188691
  title: view.modeLabel,
188692
+ ...view.isOff || slice.fanMode === "" ? {} : { caption: t(`${view.modeLabel.en} · fan ${fanLabelOf(slice.fanMode).en}`, `${view.modeLabel.it} · ventola ${fanLabelOf(slice.fanMode).it}`) },
188007
188693
  facts,
188008
188694
  ...left.length === 0 && right.length === 0 ? {} : { tiles: {
188009
188695
  left,
@@ -188030,7 +188716,7 @@ var WATER_ON_PREFERENCE = [
188030
188716
  "performance"
188031
188717
  ];
188032
188718
  function capitalised(word) {
188033
- return same(word.charAt(0).toUpperCase() + word.slice(1).replace(/_/g, " "));
188719
+ return same$1(word.charAt(0).toUpperCase() + word.slice(1).replace(/_/g, " "));
188034
188720
  }
188035
188721
  var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSchema, (slice) => {
188036
188722
  if (slice === void 0 || slice.operationMode === null) return { reading: reading("climate-control", "unknown") };
@@ -188067,13 +188753,13 @@ var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSche
188067
188753
  icon: "flame",
188068
188754
  status: label,
188069
188755
  controls: modeControls
188070
- }, ...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))];
188756
+ }, ...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))];
188071
188757
  const level = levelWithin(slice.targetTemp, range);
188072
188758
  return {
188073
188759
  reading: reading("climate-control", isOff ? "off" : "on"),
188074
188760
  title: label,
188075
188761
  facts: status === null ? [] : [fact("climate", "flame", status)],
188076
- ...slice.currentTemp === null ? {} : { tiles: { left: [tile("Water", "Acqua", formatDegrees(slice.currentTemp))] } },
188762
+ ...slice.currentTemp === null ? {} : { tiles: { left: [tile$1("Water", "Acqua", formatDegrees(slice.currentTemp))] } },
188077
188763
  scene: {
188078
188764
  ...isOff ? {} : { mode: "heat" },
188079
188765
  ...level === null ? {} : { level }
@@ -188091,11 +188777,12 @@ var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSche
188091
188777
  var heatingValveContribution = contribution("heating-valve", HeatingValveStatusSchema, (slice) => {
188092
188778
  const position = slice?.position ?? null;
188093
188779
  if (position === null) return { reading: reading("sensor", "unknown") };
188094
- const text = same(`${Math.round(position)}%`);
188780
+ const text = same$1(`${Math.round(position)}%`);
188095
188781
  return {
188096
188782
  reading: reading("sensor", position > 0 ? "running" : "idle"),
188097
188783
  facts: [fact("valve", "gauge", t(`Valve ${text.en}`, `Valvola ${text.it}`))],
188098
- tiles: { right: [tile("Valve", "Valvola", text.en)] },
188784
+ tiles: { right: [tile$1("Valve", "Valvola", text.en)] },
188785
+ ...position > 0 ? { caption: t(`Heating · valve ${text.en}`, `Riscalda · valvola ${text.it}`) } : {},
188099
188786
  scene: { level: position / 100 }
188100
188787
  };
188101
188788
  });
@@ -188104,9 +188791,9 @@ function sensorFragment(value, id, icon, en, it, text) {
188104
188791
  if (value === null) return { reading: reading("sensor", "unknown") };
188105
188792
  return {
188106
188793
  reading: reading("sensor", "on"),
188107
- title: same(text),
188108
- facts: [fact(id, icon, same(text))],
188109
- tiles: { right: [tile(en, it, text)] }
188794
+ title: same$1(text),
188795
+ facts: [fact(id, icon, same$1(text))],
188796
+ tiles: { right: [tile$1(en, it, text)] }
188110
188797
  };
188111
188798
  }
188112
188799
  var temperatureContribution = contribution("temperature-sensor", TemperatureSensorStatusSchema, (slice) => sensorFragment(slice?.temperature ?? null, "temperature", "thermometer", "Temperature", "Temperatura", formatDegrees(slice?.temperature ?? 0)));
@@ -188161,8 +188848,8 @@ var CLIMATE_FAMILY_CONTRIBUTIONS = {
188161
188848
  return {
188162
188849
  reading: reading("sensor", "on"),
188163
188850
  ...slice.aqi === void 0 ? {} : { title: airQualityWord(slice.aqi) },
188164
- facts: parts.map((p) => fact("air-quality", "wind", same(`${p.label} ${p.value}`))),
188165
- tiles: { right: parts.slice(0, 2).map((p) => tile(p.label, p.label, p.value)) }
188851
+ facts: parts.map((p) => fact("air-quality", "wind", same$1(`${p.label} ${p.value}`))),
188852
+ tiles: { right: parts.slice(0, 2).map((p) => tile$1(p.label, p.label, p.value)) }
188166
188853
  };
188167
188854
  }),
188168
188855
  "carbon-monoxide": contribution("carbon-monoxide", CarbonMonoxideStatusSchema, (slice) => {
@@ -188177,15 +188864,270 @@ var CLIMATE_FAMILY_CONTRIBUTIONS = {
188177
188864
  "numeric-sensor": numericContribution,
188178
188865
  "enum-sensor": enumContribution
188179
188866
  };
188867
+ /**
188868
+ * The heat pump's contribution to a hero (D1026): the compressor scene, every
188869
+ * circuit as a row with its own label and icon, the powers as pills (the
188870
+ * instantaneous COP is "—" when it cannot be computed) and a "System" group with
188871
+ * one selector per mode. Values and their limits come from the slice, which the
188872
+ * gateway filled: a selector with no allowed value is not drawn, a missing
188873
+ * reading is never a 0 (D393).
188874
+ */
188875
+ var CAP = "heat-pump-control";
188876
+ var same = (text) => t(text, text);
188877
+ /** The words of the values the gateway names; a value not listed is drawn as the gateway wrote it. */
188878
+ var VALUE_LABELS = {
188879
+ off: t("Off", "Off"),
188880
+ on: t("On", "On"),
188881
+ auto: t("Auto", "Auto"),
188882
+ manual: t("Manual", "Manuale"),
188883
+ low: t("Low", "Bassa"),
188884
+ high: t("High", "Alta"),
188885
+ eco: t("Eco", "Eco"),
188886
+ heat: t("Heat", "Caldo"),
188887
+ cool: t("Cool", "Freddo"),
188888
+ heatCool: t("Heat/cool", "Caldo/freddo"),
188889
+ ownprogram: t("Programme", "Programma")
188890
+ };
188891
+ function valueLabel(value) {
188892
+ const known = VALUE_LABELS[value];
188893
+ if (known !== void 0) return known;
188894
+ const holiday = /^hm(\d+)$/.exec(value);
188895
+ if (holiday?.[1] !== void 0) return t(`Programme ${holiday[1]}`, `Programma ${holiday[1]}`);
188896
+ return same(value);
188897
+ }
188898
+ function optionLabels(allowed) {
188899
+ return Object.fromEntries(allowed.map((value) => [value, valueLabel(value)]));
188900
+ }
188901
+ function picker(id, label, setting, method, args, valueArg = "mode") {
188902
+ return {
188903
+ kind: "picker",
188904
+ id,
188905
+ label,
188906
+ current: setting.value,
188907
+ options: [...setting.allowed],
188908
+ optionLabels: optionLabels(setting.allowed),
188909
+ call: {
188910
+ cap: CAP,
188911
+ method,
188912
+ args: { ...args }
188913
+ },
188914
+ valueArg
188915
+ };
188916
+ }
188917
+ /** A selector exists only where the gateway named values to choose from. */
188918
+ function choosable(setting) {
188919
+ return setting !== null && setting.allowed.length > 0;
188920
+ }
188921
+ function circuitControl(circuit) {
188922
+ const args = { circuitId: circuit.id };
188923
+ if (circuit.kind === "dhw" && choosable(circuit.temperatureLevel)) return picker(`heat-pump.${circuit.id}.level`, t("Level", "Livello"), circuit.temperatureLevel, "setDhwTemperatureLevel", args, "level");
188924
+ if (!choosable(circuit.operationMode)) return null;
188925
+ const method = circuit.kind === "dhw" ? "setDhwOperationMode" : "setCircuitOperationMode";
188926
+ return picker(`heat-pump.${circuit.id}.mode`, t("Mode", "Modalità"), circuit.operationMode, method, args);
188927
+ }
188928
+ /** A circuit with no reading is still a row: it shows that nothing is known, not nothing. */
188929
+ var UNKNOWN_STATUS = same("—");
188930
+ function circuitRow(circuit) {
188931
+ const control = circuitControl(circuit);
188932
+ const status = thermalStatusText(circuit.targetTemp, circuit.currentTemp) ?? UNKNOWN_STATUS;
188933
+ return {
188934
+ id: "circuit",
188935
+ label: same(circuit.label),
188936
+ icon: circuit.icon,
188937
+ status,
188938
+ controls: control === null ? [] : [control]
188939
+ };
188940
+ }
188941
+ var kilowatts = (watts) => `${Number((watts / 1e3).toFixed(2))} kW`;
188942
+ /** A COP that cannot be computed is still the pill: "—", never an absent reading (D393). */
188943
+ function copPill(cop) {
188944
+ if (cop === null) return {
188945
+ icon: "gauge",
188946
+ text: t("Instantaneous COP —", "COP istantaneo —"),
188947
+ tone: "muted"
188948
+ };
188949
+ const text = String(Number(cop.toFixed(1)));
188950
+ return {
188951
+ icon: "gauge",
188952
+ text: t(`Instantaneous COP ${text}`, `COP istantaneo ${text}`),
188953
+ tone: "success"
188954
+ };
188955
+ }
188956
+ function powerPills(status) {
188957
+ const { thermalW, electricalW } = status.power;
188958
+ const pills = [];
188959
+ if (thermalW !== null) pills.push({
188960
+ icon: "flame",
188961
+ text: t(`Thermal ${kilowatts(thermalW)}`, `Termica ${kilowatts(thermalW)}`),
188962
+ tone: "muted"
188963
+ });
188964
+ if (electricalW !== null) pills.push({
188965
+ icon: "zap",
188966
+ text: t(`Electrical ${kilowatts(electricalW)}`, `Elettrica ${kilowatts(electricalW)}`),
188967
+ tone: "muted"
188968
+ });
188969
+ pills.push(copPill(heatPumpInstantCop(status.power)));
188970
+ return pills;
188971
+ }
188972
+ /** The independent system modes, in the order the card draws them. */
188973
+ var SYSTEM_MODES = [
188974
+ {
188975
+ key: "silent",
188976
+ label: t("Silent", "Silenzioso"),
188977
+ icon: "volume-x",
188978
+ method: "setSilentMode"
188979
+ },
188980
+ {
188981
+ key: "away",
188982
+ label: t("Away", "Assente"),
188983
+ icon: "plane",
188984
+ method: "setAwayMode"
188985
+ },
188986
+ {
188987
+ key: "additionalHeater",
188988
+ label: t("Additional heater", "Riscaldatore aggiuntivo"),
188989
+ icon: "flame",
188990
+ method: "setAdditionalHeaterMode"
188991
+ },
188992
+ {
188993
+ key: "holiday",
188994
+ label: t("Holiday", "Vacanza"),
188995
+ icon: "tree-palm",
188996
+ method: "setHolidayMode"
188997
+ }
188998
+ ];
188999
+ var SYSTEM_GROUP = t("System", "Sistema");
189000
+ var PROGRAMME = /^hm\d+$/;
189001
+ /**
189002
+ * Holiday is two segments, off / programme. Choosing "programme" keeps the programme
189003
+ * that is set, else the first one the gateway allowed, so a write never leaves
189004
+ * `allowed`. The full hm1..hm8 pick is not in the hero (D1026). A holiday whose values
189005
+ * are not programmes keeps the plain selector.
189006
+ */
189007
+ function holidayRow(def, setting) {
189008
+ if (!setting.allowed.includes("off")) return null;
189009
+ const current = setting.value !== null && PROGRAMME.test(setting.value) ? setting.value : null;
189010
+ const programme = current ?? setting.allowed.find((v) => PROGRAMME.test(v));
189011
+ if (programme === void 0) return null;
189012
+ const control = picker("heat-pump.system.holiday", def.label, {
189013
+ value: setting.value,
189014
+ allowed: ["off", programme]
189015
+ }, def.method, {});
189016
+ const number = programme.slice(2);
189017
+ return {
189018
+ id: "system-mode",
189019
+ label: def.label,
189020
+ group: SYSTEM_GROUP,
189021
+ icon: def.icon,
189022
+ status: current === null ? null : t(`Programme ${number}`, `Programma ${number}`),
189023
+ controls: [control.kind === "picker" ? {
189024
+ ...control,
189025
+ optionLabels: {
189026
+ off: t("Off", "Off"),
189027
+ [programme]: t("Programme", "Programma")
189028
+ }
189029
+ } : control]
189030
+ };
189031
+ }
189032
+ function systemRows(status) {
189033
+ const rows = [];
189034
+ for (const def of SYSTEM_MODES) {
189035
+ const setting = status.system[def.key];
189036
+ if (!choosable(setting)) continue;
189037
+ if (def.key === "holiday") {
189038
+ const holiday = holidayRow(def, setting);
189039
+ if (holiday !== null) {
189040
+ rows.push(holiday);
189041
+ continue;
189042
+ }
189043
+ }
189044
+ rows.push({
189045
+ id: "system-mode",
189046
+ label: def.label,
189047
+ group: SYSTEM_GROUP,
189048
+ icon: def.icon,
189049
+ status: null,
189050
+ controls: [picker(`heat-pump.system.${def.key}`, def.label, setting, def.method, {})]
189051
+ });
189052
+ }
189053
+ return rows;
189054
+ }
189055
+ function tile(en, it, value) {
189056
+ return {
189057
+ label: t(en, it),
189058
+ value: same(value)
189059
+ };
189060
+ }
189061
+ function tilesOf$1(status) {
189062
+ const { supply, return: back, outdoor } = status.temperatures;
189063
+ const left = [];
189064
+ const right = [];
189065
+ if (supply !== null) left.push(tile("Supply", "Mandata", formatDegrees(supply)));
189066
+ if (back !== null) left.push(tile("Return", "Ritorno", formatDegrees(back)));
189067
+ if (outdoor !== null) right.push(tile("Outdoor", "Esterna", formatDegrees(outdoor)));
189068
+ if (status.waterPressureBar !== null) right.push(tile("Pressure", "Pressione", `${Number(status.waterPressureBar.toFixed(1))} bar`));
189069
+ return {
189070
+ left,
189071
+ right
189072
+ };
189073
+ }
189074
+ function isRunning(status) {
189075
+ const { compressorPct, electricalW } = status.power;
189076
+ if (compressorPct !== null) return compressorPct > 0;
189077
+ if (electricalW !== null) return electricalW > 0;
189078
+ return null;
189079
+ }
189080
+ var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pump-status", HeatPumpStatusSchema, (slice) => {
189081
+ if (slice === void 0) return { reading: reading("climate-control", "unknown") };
189082
+ const running = isRunning(slice);
189083
+ const facts = [];
189084
+ if (slice.power.electricalW !== null) facts.push(fact("power", "zap", same(`${Math.round(slice.power.electricalW)} W`)));
189085
+ if (slice.power.compressorPct !== null) facts.push(fact("level", "gauge", t(`Compressor ${Math.round(slice.power.compressorPct)} %`, `Compressore ${Math.round(slice.power.compressorPct)} %`)));
189086
+ const charging = slice.circuits.find((c) => c.active === true);
189087
+ const tiles = tilesOf$1(slice);
189088
+ const pills = powerPills(slice);
189089
+ const rows = [
189090
+ ...slice.circuits.map(circuitRow),
189091
+ ...pills.length === 0 ? [] : [{
189092
+ id: "heat-pump-power",
189093
+ icon: "zap",
189094
+ status: null,
189095
+ controls: [],
189096
+ pills: [...pills]
189097
+ }],
189098
+ ...systemRows(slice)
189099
+ ];
189100
+ return {
189101
+ reading: reading("climate-control", running === true ? "running" : running === false ? "idle" : "on"),
189102
+ title: t("Heat pump", "Pompa di calore"),
189103
+ ...charging === void 0 ? {} : { caption: t(`${charging.label} · heating`.toUpperCase(), `${charging.label} · in riscaldamento`.toUpperCase()) },
189104
+ facts,
189105
+ ...tiles.left.length === 0 && tiles.right.length === 0 ? {} : { tiles },
189106
+ ...slice.power.electricalW === null ? {} : { consumption: {
189107
+ priority: 1,
189108
+ slot: {
189109
+ kind: "power",
189110
+ watts: slice.power.electricalW,
189111
+ detail: slice.power.thermalW === null ? [] : [{
189112
+ label: t("Thermal", "Termica"),
189113
+ value: Math.round(slice.power.thermalW),
189114
+ unit: "W"
189115
+ }]
189116
+ }
189117
+ } },
189118
+ rows
189119
+ };
189120
+ }) };
188180
189121
  [
188181
189122
  ...Object.values(ACCESS_FAMILY_CONTRIBUTIONS),
188182
189123
  ...Object.values(DEVICES_FAMILY_CONTRIBUTIONS),
188183
189124
  ...Object.values(GROUPS_FAMILY_CONTRIBUTIONS),
188184
189125
  ...Object.values(ACTUATORS_FAMILY_CONTRIBUTIONS),
188185
189126
  ...Object.values(SENSORS_FAMILY_CONTRIBUTIONS),
188186
- ...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS)
189127
+ ...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
189128
+ ...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
188187
189129
  ];
188188
- DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway;
189130
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway;
188189
189131
  /**
188190
189132
  * Who looks like what (D1023). One look per {@link DeviceType}, refined by a
188191
189133
  * {@link DeviceRole} where the role changes how the device reads (a leak
@@ -188575,7 +189517,7 @@ lookOf({
188575
189517
  ({ ...lookOf({
188576
189518
  icon: "shield-check",
188577
189519
  on: [
188578
- "success",
189520
+ "danger",
188579
189521
  "glow",
188580
189522
  "halo"
188581
189523
  ],
@@ -188813,8 +189755,24 @@ lookOf({
188813
189755
  idle: INFO,
188814
189756
  standby: MUTED
188815
189757
  });
189758
+ lookOf({
189759
+ icon: "thermometer-sun",
189760
+ on: [
189761
+ "warning",
189762
+ "heat-rise",
189763
+ "rise"
189764
+ ],
189765
+ off: MUTED,
189766
+ running: [
189767
+ "warning",
189768
+ "heat-rise",
189769
+ "rise"
189770
+ ],
189771
+ idle: INFO,
189772
+ standby: MUTED
189773
+ });
188816
189774
  DeviceType.Climate, DeviceType.Thermostat;
188817
- DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway;
189775
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway;
188818
189776
  DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
188819
189777
  Object.freeze({
188820
189778
  "accessories.getStatus": {
@@ -189195,13 +190153,6 @@ Object.freeze({
189195
190153
  access: "view",
189196
190154
  role: "admin"
189197
190155
  },
189198
- "addonSettings.getIntegrationFormSchema": {
189199
- capName: "addon-settings",
189200
- capScope: "system",
189201
- addonId: null,
189202
- access: "view",
189203
- role: "admin"
189204
- },
189205
190156
  "addonSettings.getScopedSettings": {
189206
190157
  capName: "addon-settings",
189207
190158
  capScope: "system",
@@ -190987,6 +191938,13 @@ Object.freeze({
190987
191938
  access: "create",
190988
191939
  role: "admin"
190989
191940
  },
191941
+ "deviceManager.checkDeviceTemplates": {
191942
+ capName: "device-manager",
191943
+ capScope: "system",
191944
+ addonId: null,
191945
+ access: "view",
191946
+ role: "admin"
191947
+ },
190990
191948
  "deviceManager.cleanupDeletedDevicesData": {
190991
191949
  capName: "device-manager",
190992
191950
  capScope: "system",
@@ -191386,6 +192344,13 @@ Object.freeze({
191386
192344
  access: "create",
191387
192345
  role: "admin"
191388
192346
  },
192347
+ "deviceManager.renderDeviceTemplates": {
192348
+ capName: "device-manager",
192349
+ capScope: "system",
192350
+ addonId: null,
192351
+ access: "view",
192352
+ role: "admin"
192353
+ },
191389
192354
  "deviceManager.reportDiscoveryObservations": {
191390
192355
  capName: "device-manager",
191391
192356
  capScope: "system",
@@ -192317,6 +193282,111 @@ Object.freeze({
192317
193282
  access: "view",
192318
193283
  role: "viewer"
192319
193284
  },
193285
+ "heatPumpControl.setAdditionalHeaterMode": {
193286
+ capName: "heat-pump-control",
193287
+ capScope: "device",
193288
+ addonId: null,
193289
+ access: "create",
193290
+ role: "viewer"
193291
+ },
193292
+ "heatPumpControl.setAwayMode": {
193293
+ capName: "heat-pump-control",
193294
+ capScope: "device",
193295
+ addonId: null,
193296
+ access: "create",
193297
+ role: "viewer"
193298
+ },
193299
+ "heatPumpControl.setCircuitComfortSetpoint": {
193300
+ capName: "heat-pump-control",
193301
+ capScope: "device",
193302
+ addonId: null,
193303
+ access: "create",
193304
+ role: "viewer"
193305
+ },
193306
+ "heatPumpControl.setCircuitEcoSetpoint": {
193307
+ capName: "heat-pump-control",
193308
+ capScope: "device",
193309
+ addonId: null,
193310
+ access: "create",
193311
+ role: "viewer"
193312
+ },
193313
+ "heatPumpControl.setCircuitHeatCoolMode": {
193314
+ capName: "heat-pump-control",
193315
+ capScope: "device",
193316
+ addonId: null,
193317
+ access: "create",
193318
+ role: "viewer"
193319
+ },
193320
+ "heatPumpControl.setCircuitMaxFlowTemp": {
193321
+ capName: "heat-pump-control",
193322
+ capScope: "device",
193323
+ addonId: null,
193324
+ access: "create",
193325
+ role: "viewer"
193326
+ },
193327
+ "heatPumpControl.setCircuitOperationMode": {
193328
+ capName: "heat-pump-control",
193329
+ capScope: "device",
193330
+ addonId: null,
193331
+ access: "create",
193332
+ role: "viewer"
193333
+ },
193334
+ "heatPumpControl.setCircuitSummerWinter": {
193335
+ capName: "heat-pump-control",
193336
+ capScope: "device",
193337
+ addonId: null,
193338
+ access: "create",
193339
+ role: "viewer"
193340
+ },
193341
+ "heatPumpControl.setDhwChargeDuration": {
193342
+ capName: "heat-pump-control",
193343
+ capScope: "device",
193344
+ addonId: null,
193345
+ access: "create",
193346
+ role: "viewer"
193347
+ },
193348
+ "heatPumpControl.setDhwOperationMode": {
193349
+ capName: "heat-pump-control",
193350
+ capScope: "device",
193351
+ addonId: null,
193352
+ access: "create",
193353
+ role: "viewer"
193354
+ },
193355
+ "heatPumpControl.setDhwTemperatureLevel": {
193356
+ capName: "heat-pump-control",
193357
+ capScope: "device",
193358
+ addonId: null,
193359
+ access: "create",
193360
+ role: "viewer"
193361
+ },
193362
+ "heatPumpControl.setHolidayMode": {
193363
+ capName: "heat-pump-control",
193364
+ capScope: "device",
193365
+ addonId: null,
193366
+ access: "create",
193367
+ role: "viewer"
193368
+ },
193369
+ "heatPumpControl.setSilentMode": {
193370
+ capName: "heat-pump-control",
193371
+ capScope: "device",
193372
+ addonId: null,
193373
+ access: "create",
193374
+ role: "viewer"
193375
+ },
193376
+ "heatPumpControl.startExtraHotWater": {
193377
+ capName: "heat-pump-control",
193378
+ capScope: "device",
193379
+ addonId: null,
193380
+ access: "create",
193381
+ role: "viewer"
193382
+ },
193383
+ "heatPumpStatus.getStatus": {
193384
+ capName: "heat-pump-status",
193385
+ capScope: "device",
193386
+ addonId: null,
193387
+ access: "view",
193388
+ role: "viewer"
193389
+ },
192320
193390
  "heroLayout.getHeroModel": {
192321
193391
  capName: "hero-layout",
192322
193392
  capScope: "system",
@@ -194074,13 +195144,6 @@ Object.freeze({
194074
195144
  access: "create",
194075
195145
  role: "admin"
194076
195146
  },
194077
- "notificationRules.createSequence": {
194078
- capName: "notification-rules",
194079
- capScope: "system",
194080
- addonId: null,
194081
- access: "create",
194082
- role: "admin"
194083
- },
194084
195147
  "notificationRules.createSnooze": {
194085
195148
  capName: "notification-rules",
194086
195149
  capScope: "system",
@@ -194102,13 +195165,6 @@ Object.freeze({
194102
195165
  access: "delete",
194103
195166
  role: "admin"
194104
195167
  },
194105
- "notificationRules.deleteSequence": {
194106
- capName: "notification-rules",
194107
- capScope: "system",
194108
- addonId: null,
194109
- access: "delete",
194110
- role: "admin"
194111
- },
194112
195168
  "notificationRules.getAlarmConfig": {
194113
195169
  capName: "notification-rules",
194114
195170
  capScope: "system",
@@ -194158,13 +195214,6 @@ Object.freeze({
194158
195214
  access: "view",
194159
195215
  role: "admin"
194160
195216
  },
194161
- "notificationRules.getSequence": {
194162
- capName: "notification-rules",
194163
- capScope: "system",
194164
- addonId: null,
194165
- access: "view",
194166
- role: "admin"
194167
- },
194168
195217
  "notificationRules.getTemplateCatalog": {
194169
195218
  capName: "notification-rules",
194170
195219
  capScope: "system",
@@ -194186,13 +195235,6 @@ Object.freeze({
194186
195235
  access: "view",
194187
195236
  role: "admin"
194188
195237
  },
194189
- "notificationRules.listSequences": {
194190
- capName: "notification-rules",
194191
- capScope: "system",
194192
- addonId: null,
194193
- access: "view",
194194
- role: "admin"
194195
- },
194196
195238
  "notificationRules.listSnoozes": {
194197
195239
  capName: "notification-rules",
194198
195240
  capScope: "system",
@@ -194263,13 +195305,6 @@ Object.freeze({
194263
195305
  access: "create",
194264
195306
  role: "admin"
194265
195307
  },
194266
- "notificationRules.updateSequence": {
194267
- capName: "notification-rules",
194268
- capScope: "system",
194269
- addonId: null,
194270
- access: "create",
194271
- role: "admin"
194272
- },
194273
195308
  "notifier.cancel": {
194274
195309
  capName: "notifier",
194275
195310
  capScope: "device",
@@ -194354,21 +195389,21 @@ Object.freeze({
194354
195389
  access: "view",
194355
195390
  role: "admin"
194356
195391
  },
194357
- "osdManager.getSourceCatalog": {
195392
+ "osdManager.listTemplates": {
194358
195393
  capName: "osd-manager",
194359
195394
  capScope: "system",
194360
195395
  addonId: null,
194361
195396
  access: "view",
194362
195397
  role: "admin"
194363
195398
  },
194364
- "osdManager.listTemplates": {
195399
+ "osdManager.previewSlot": {
194365
195400
  capName: "osd-manager",
194366
195401
  capScope: "system",
194367
195402
  addonId: null,
194368
- access: "view",
195403
+ access: "create",
194369
195404
  role: "admin"
194370
195405
  },
194371
- "osdManager.previewSlot": {
195406
+ "osdManager.previewTemplate": {
194372
195407
  capName: "osd-manager",
194373
195408
  capScope: "system",
194374
195409
  addonId: null,
@@ -197224,13 +198259,6 @@ Object.freeze({
197224
198259
  access: "create",
197225
198260
  role: "admin"
197226
198261
  },
197227
- "smtpProvider.verify": {
197228
- capName: "smtp-provider",
197229
- capScope: "system",
197230
- addonId: null,
197231
- access: "view",
197232
- role: "admin"
197233
- },
197234
198262
  "snapshot.applyDeviceSettingsPatch": {
197235
198263
  capName: "snapshot",
197236
198264
  capScope: "device",
@@ -199163,8 +200191,26 @@ function projectAction(cap, action) {
199163
200191
  };
199164
200192
  }
199165
200193
  Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
199166
- 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;
200194
+ 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;
199167
200195
  DeviceFeature.BatteryOperated;
200196
+ function bound(cap, methods = [], authority = "reported") {
200197
+ return {
200198
+ kind: "cap",
200199
+ cap,
200200
+ methods,
200201
+ authority
200202
+ };
200203
+ }
200204
+ function derived(cap, methods = []) {
200205
+ return bound(cap, methods, "derived");
200206
+ }
200207
+ DeviceFeature.BatteryOperated, DeviceFeature.Rebootable, derived("reboot", ["reboot"]), DeviceFeature.Resyncable, DeviceFeature.NativeSnapshot, DeviceFeature.DoorbellButton, derived("doorbell"), DeviceFeature.TwoWayAudio, derived("intercom", [
200208
+ "startTalkSession",
200209
+ "pushTalkAudio",
200210
+ "endTalkSession"
200211
+ ]), DeviceFeature.PanTiltZoom, derived("ptz"), DeviceFeature.PtzAutotrack, derived("ptz-autotrack"), DeviceFeature.MotionTrigger, derived("motion-trigger", ["setMotionTrigger"]), DeviceFeature.TimedRun, derived("timed-run", ["runFor"]), DeviceFeature.Switch, DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired, DeviceFeature.ClimateDualSetpoint, DeviceFeature.ClimateHumidity, DeviceFeature.ClimateFanMode, DeviceFeature.ClimatePreset, DeviceFeature.ClimateSwingVertical, DeviceFeature.ClimateSwingHorizontal, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.CoverStoppable, DeviceFeature.ValvePositionable, DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.LockPinRequired, DeviceFeature.LockOpen, DeviceFeature.MediaPlayerSeek, DeviceFeature.MediaPlayerVolume, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerShuffle, DeviceFeature.MediaPlayerRepeat, DeviceFeature.MediaPlayerSelectSource, DeviceFeature.MediaPlayerPlayMedia, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerPower, DeviceFeature.AlarmPinRequired, DeviceFeature.PresenceGps, DeviceFeature.NotifierImage, DeviceFeature.NotifierPriority, DeviceFeature.NotifierData, DeviceFeature.NotifierActions, DeviceFeature.NotifierRecipients, DeviceFeature.ScriptVariables, DeviceFeature.AutomationSkipCondition, DeviceFeature.VacuumHasMap, DeviceFeature.VacuumHasAi, DeviceFeature.MowerHasMap, DeviceFeature.MowerHasTargetedMowing, DeviceFeature.Navigation, derived("navigation"), DeviceFeature.NetworkLink, derived("network-link");
200212
+ var ALL_FEATURES = Object.values(DeviceFeature);
200213
+ new Set(ALL_FEATURES);
199168
200214
  DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
199169
200215
  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.";
199170
200216
  var HOMEKIT_REASON = "HomeKit has no laundry-appliance service. The export tab would pair an accessory with nothing on it: running-state is withheld until a null reading can be unavailable, and power is not a HomeKit service this export honours.";
@@ -199356,7 +200402,6 @@ function createRuntimeStateBridge(params) {
199356
200402
  getStatus
199357
200403
  };
199358
200404
  }
199359
- string().min(1).max(4096);
199360
200405
  Object.freeze({
199361
200406
  "accessories.getStatus": [{
199362
200407
  name: "deviceId",
@@ -200439,6 +201484,81 @@ Object.freeze({
200439
201484
  form: "single",
200440
201485
  optional: false
200441
201486
  }],
201487
+ "heatPumpControl.setAdditionalHeaterMode": [{
201488
+ name: "deviceId",
201489
+ form: "single",
201490
+ optional: false
201491
+ }],
201492
+ "heatPumpControl.setAwayMode": [{
201493
+ name: "deviceId",
201494
+ form: "single",
201495
+ optional: false
201496
+ }],
201497
+ "heatPumpControl.setCircuitComfortSetpoint": [{
201498
+ name: "deviceId",
201499
+ form: "single",
201500
+ optional: false
201501
+ }],
201502
+ "heatPumpControl.setCircuitEcoSetpoint": [{
201503
+ name: "deviceId",
201504
+ form: "single",
201505
+ optional: false
201506
+ }],
201507
+ "heatPumpControl.setCircuitHeatCoolMode": [{
201508
+ name: "deviceId",
201509
+ form: "single",
201510
+ optional: false
201511
+ }],
201512
+ "heatPumpControl.setCircuitMaxFlowTemp": [{
201513
+ name: "deviceId",
201514
+ form: "single",
201515
+ optional: false
201516
+ }],
201517
+ "heatPumpControl.setCircuitOperationMode": [{
201518
+ name: "deviceId",
201519
+ form: "single",
201520
+ optional: false
201521
+ }],
201522
+ "heatPumpControl.setCircuitSummerWinter": [{
201523
+ name: "deviceId",
201524
+ form: "single",
201525
+ optional: false
201526
+ }],
201527
+ "heatPumpControl.setDhwChargeDuration": [{
201528
+ name: "deviceId",
201529
+ form: "single",
201530
+ optional: false
201531
+ }],
201532
+ "heatPumpControl.setDhwOperationMode": [{
201533
+ name: "deviceId",
201534
+ form: "single",
201535
+ optional: false
201536
+ }],
201537
+ "heatPumpControl.setDhwTemperatureLevel": [{
201538
+ name: "deviceId",
201539
+ form: "single",
201540
+ optional: false
201541
+ }],
201542
+ "heatPumpControl.setHolidayMode": [{
201543
+ name: "deviceId",
201544
+ form: "single",
201545
+ optional: false
201546
+ }],
201547
+ "heatPumpControl.setSilentMode": [{
201548
+ name: "deviceId",
201549
+ form: "single",
201550
+ optional: false
201551
+ }],
201552
+ "heatPumpControl.startExtraHotWater": [{
201553
+ name: "deviceId",
201554
+ form: "single",
201555
+ optional: false
201556
+ }],
201557
+ "heatPumpStatus.getStatus": [{
201558
+ name: "deviceId",
201559
+ form: "single",
201560
+ optional: false
201561
+ }],
200442
201562
  "heroLayout.getHeroModel": [{
200443
201563
  name: "deviceId",
200444
201564
  form: "single",
@@ -200898,12 +202018,12 @@ Object.freeze({
200898
202018
  form: "single",
200899
202019
  optional: false
200900
202020
  }],
200901
- "osdManager.getSourceCatalog": [{
202021
+ "osdManager.previewSlot": [{
200902
202022
  name: "deviceId",
200903
202023
  form: "single",
200904
202024
  optional: false
200905
202025
  }],
200906
- "osdManager.previewSlot": [{
202026
+ "osdManager.previewTemplate": [{
200907
202027
  name: "deviceId",
200908
202028
  form: "single",
200909
202029
  optional: false