@camstack/types 1.2.534 → 1.2.535

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/addon.js +2 -2
  3. package/dist/addon.mjs +2 -2
  4. package/dist/capabilities/heat-pump-control.cap.d.ts +83 -0
  5. package/dist/capabilities/heat-pump-status.cap.d.ts +517 -0
  6. package/dist/capabilities/hero-layout.cap.d.ts +46 -0
  7. package/dist/capabilities/index.d.ts +5 -1
  8. package/dist/client.js +24 -0
  9. package/dist/client.mjs +24 -0
  10. package/dist/{composition-BjHGoicU.js → composition-BxalDSTt.js} +1 -1
  11. package/dist/{composition-CXCX78IR.mjs → composition-C6TZGqUb.mjs} +1 -1
  12. package/dist/device/cap-vocabulary/entries/heat-pump.d.ts +4 -0
  13. package/dist/device/device-type.d.ts +5 -1
  14. package/dist/device/hero/build-hero-model.d.ts +2 -0
  15. package/dist/device/hero/climate-view.d.ts +4 -0
  16. package/dist/device/hero/hero-contributions-heat-pump.d.ts +2 -0
  17. package/dist/device/hero/hero-fragment.d.ts +4 -0
  18. package/dist/device/hero/hero-layout.d.ts +1 -0
  19. package/dist/device/hero/hero-look.d.ts +6 -0
  20. package/dist/device/hero/hero-model.d.ts +80 -1
  21. package/dist/device/hero/hero-row.d.ts +5 -0
  22. package/dist/device/hero/hero-scene.d.ts +4 -1
  23. package/dist/device/hero/index.d.ts +1 -1
  24. package/dist/{device-type-BaYa0UGS.js → device-type-BfvqqzRp.js} +4 -0
  25. package/dist/{device-type-CbDhVwFP.mjs → device-type-DTTZKB2I.mjs} +4 -0
  26. package/dist/generated/addon-api.d.ts +120 -0
  27. package/dist/generated/addon-cap-facts.d.ts +1 -1
  28. package/dist/generated/cap-status-types.d.ts +3 -1
  29. package/dist/generated/capability-router-map.d.ts +8 -2
  30. package/dist/generated/customize-catalog.d.ts +1 -1
  31. package/dist/generated/device-local-state.d.ts +3 -0
  32. package/dist/generated/device-proxy.d.ts +5 -0
  33. package/dist/generated/device-scoped-caps.d.ts +1 -1
  34. package/dist/generated/history-catalog.d.ts +2 -2
  35. package/dist/generated/method-access-map.d.ts +1 -1
  36. package/dist/generated/method-device-selectors.d.ts +1 -1
  37. package/dist/generated/runtime-state-durability.d.ts +1 -1
  38. package/dist/index.js +1375 -139
  39. package/dist/index.mjs +1361 -140
  40. package/dist/node.js +2 -2
  41. package/dist/node.mjs +2 -2
  42. package/dist/{sleep-DhZXJtPH.js → sleep-CCAQ_PEp.js} +201 -5
  43. package/dist/{sleep-CkinsFFb.mjs → sleep-DnVqHJc4.mjs} +201 -5
  44. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-DhZXJtPH.js");
2
+ const require_sleep = require("./sleep-CCAQ_PEp.js");
3
3
  const require_event_category = require("./event-category-BC4RRerT.js");
4
- const require_device_type = require("./device-type-BaYa0UGS.js");
5
- const require_composition = require("./composition-BjHGoicU.js");
4
+ const require_device_type = require("./device-type-BfvqqzRp.js");
5
+ const require_composition = require("./composition-BxalDSTt.js");
6
6
  const require_node_color = require("./node-color.js");
7
7
  const require_convert = require("./convert-BmtM6K-5.js");
8
8
  const require_enums = require("./enums.js");
@@ -43197,7 +43197,7 @@ function irSourceProblem(source) {
43197
43197
  throw err;
43198
43198
  }
43199
43199
  }
43200
- function same$1(a, b) {
43200
+ function same$2(a, b) {
43201
43201
  return a.trim().toLowerCase() === b.trim().toLowerCase();
43202
43202
  }
43203
43203
  /** The `digits` source that declares this channel number, or null. */
@@ -43211,7 +43211,7 @@ function findChannelSource(sources, number) {
43211
43211
  * the number reach the same source; nothing else is guessed.
43212
43212
  */
43213
43213
  function resolveRemoteSource(sources, query) {
43214
- const byName = sources.find((source) => same$1(source.name, query));
43214
+ const byName = sources.find((source) => same$2(source.name, query));
43215
43215
  if (byName !== void 0) return byName;
43216
43216
  const byId = sources.find((source) => source.id === query.trim());
43217
43217
  if (byId !== void 0) return byId;
@@ -43579,7 +43579,8 @@ var CAP_CUSTOMIZE_CATALOG = {
43579
43579
  require_device_type.DeviceType.Washer,
43580
43580
  require_device_type.DeviceType.Heater,
43581
43581
  require_device_type.DeviceType.Dryer,
43582
- require_device_type.DeviceType.Gateway
43582
+ require_device_type.DeviceType.Gateway,
43583
+ require_device_type.DeviceType.HeatPump
43583
43584
  ],
43584
43585
  apply: "add",
43585
43586
  vocabularyCap: "consumables",
@@ -45234,7 +45235,7 @@ async function runFanOut(calls, invoke) {
45234
45235
  //#region src/generated/history-catalog.ts
45235
45236
  /**
45236
45237
  * Cap history catalog, projected from every `*.cap.ts` `history` block.
45237
- * 43 caps with series (79 series), 37 caps answered `'none'`.
45238
+ * 44 caps with series (87 series), 37 caps answered `'none'`.
45238
45239
  * Field keys are `runtimeState` paths (`a.b` into fixed objects only).
45239
45240
  */
45240
45241
  var HISTORY_CATALOG = {
@@ -45392,6 +45393,54 @@ var HISTORY_CATALOG = {
45392
45393
  },
45393
45394
  "flood": { "flooded": { kind: "boolean" } },
45394
45395
  "gas": { "detected": { kind: "boolean" } },
45396
+ "heat-pump-status": {
45397
+ "power.thermalW": {
45398
+ kind: "gauge",
45399
+ unit: "W",
45400
+ deadband: 50,
45401
+ displayName: "Thermal power"
45402
+ },
45403
+ "power.electricalW": {
45404
+ kind: "gauge",
45405
+ unit: "W",
45406
+ deadband: 50,
45407
+ displayName: "Electrical power"
45408
+ },
45409
+ "power.compressorPct": {
45410
+ kind: "gauge",
45411
+ unit: "%",
45412
+ deadband: 2,
45413
+ displayName: "Compressor"
45414
+ },
45415
+ "temperatures.supply": {
45416
+ kind: "gauge",
45417
+ unit: "°C",
45418
+ deadband: .5,
45419
+ displayName: "Supply"
45420
+ },
45421
+ "temperatures.return": {
45422
+ kind: "gauge",
45423
+ unit: "°C",
45424
+ deadband: .5,
45425
+ displayName: "Return"
45426
+ },
45427
+ "temperatures.outdoor": {
45428
+ kind: "gauge",
45429
+ unit: "°C",
45430
+ deadband: .5,
45431
+ displayName: "Outdoor"
45432
+ },
45433
+ "energy.thermalKwh": {
45434
+ kind: "counter",
45435
+ unit: "kWh",
45436
+ displayName: "Thermal energy"
45437
+ },
45438
+ "energy.electricalKwh": {
45439
+ kind: "counter",
45440
+ unit: "kWh",
45441
+ displayName: "Electrical energy"
45442
+ }
45443
+ },
45395
45444
  "heating-valve": { "position": {
45396
45445
  kind: "gauge",
45397
45446
  unit: "%",
@@ -45605,38 +45654,63 @@ var HISTORY_CATALOG = {
45605
45654
  };
45606
45655
  /**
45607
45656
  * Keyed-array series (D917), projected from every `history.items` block:
45608
- * 1 caps (3 item fields). The item key is the series SCOPE;
45657
+ * 2 caps (6 item fields). The item key is the series SCOPE;
45609
45658
  * the series key is `cap:<capName>.<path>[].<field>`.
45610
45659
  */
45611
- var HISTORY_ITEM_CATALOG = { "consumables": {
45612
- path: "items",
45613
- key: "key",
45614
- label: "label",
45615
- fields: {
45616
- "level": {
45617
- kind: "gauge",
45618
- unit: "%",
45619
- deadband: 2,
45620
- displayName: "Level"
45621
- },
45622
- "status": {
45623
- kind: "enum",
45624
- displayName: "Status",
45625
- values: [
45626
- "ok",
45627
- "low",
45628
- "empty",
45629
- "full",
45630
- "replace"
45631
- ]
45632
- },
45633
- "remaining.value": {
45634
- kind: "gauge",
45635
- deadband: 1,
45636
- displayName: "Remaining"
45660
+ var HISTORY_ITEM_CATALOG = {
45661
+ "consumables": {
45662
+ path: "items",
45663
+ key: "key",
45664
+ label: "label",
45665
+ fields: {
45666
+ "level": {
45667
+ kind: "gauge",
45668
+ unit: "%",
45669
+ deadband: 2,
45670
+ displayName: "Level"
45671
+ },
45672
+ "status": {
45673
+ kind: "enum",
45674
+ displayName: "Status",
45675
+ values: [
45676
+ "ok",
45677
+ "low",
45678
+ "empty",
45679
+ "full",
45680
+ "replace"
45681
+ ]
45682
+ },
45683
+ "remaining.value": {
45684
+ kind: "gauge",
45685
+ deadband: 1,
45686
+ displayName: "Remaining"
45687
+ }
45688
+ }
45689
+ },
45690
+ "heat-pump-status": {
45691
+ path: "circuits",
45692
+ key: "id",
45693
+ label: "label",
45694
+ fields: {
45695
+ "currentTemp": {
45696
+ kind: "gauge",
45697
+ unit: "°C",
45698
+ deadband: .5,
45699
+ displayName: "Temperature"
45700
+ },
45701
+ "targetTemp": {
45702
+ kind: "gauge",
45703
+ unit: "°C",
45704
+ minIntervalMs: 0,
45705
+ displayName: "Setpoint"
45706
+ },
45707
+ "mode": {
45708
+ kind: "enum",
45709
+ displayName: "Mode"
45710
+ }
45637
45711
  }
45638
45712
  }
45639
- } };
45713
+ };
45640
45714
  /** Caps that declared `history: 'none'`, sorted. */
45641
45715
  var HISTORY_NONE_CAPS = [
45642
45716
  "audio-metrics",
@@ -54910,6 +54984,350 @@ var groupStatusCapability = {
54910
54984
  history: "none"
54911
54985
  };
54912
54986
  //#endregion
54987
+ //#region src/capabilities/heat-pump-control.cap.ts
54988
+ /**
54989
+ * Heat pump settable surface (D1026): one typed method per parameter, never a
54990
+ * generic `set(key, value)`. The values a mode takes and the limits of a number
54991
+ * are the ones `heat-pump-status` carries (`allowed`, `min`, `max`, `step`),
54992
+ * read from the gateway; a provider refuses a value outside them. The state is
54993
+ * `heat-pump-status` — this cap has none.
54994
+ */
54995
+ var deviceId = zod.z.number().int().nonnegative();
54996
+ var circuitId = zod.z.string().min(1);
54997
+ var mode = zod.z.string().min(1);
54998
+ var temp = zod.z.number().finite();
54999
+ var heatPumpControlCapability = {
55000
+ name: "heat-pump-control",
55001
+ scope: "device",
55002
+ deviceNative: true,
55003
+ mode: "singleton",
55004
+ deviceTypes: [require_device_type.DeviceType.HeatPump],
55005
+ methods: {
55006
+ /** off / auto / on. */
55007
+ setSilentMode: require_sleep.method(zod.z.object({
55008
+ deviceId,
55009
+ mode
55010
+ }), zod.z.void(), {
55011
+ kind: "mutation",
55012
+ auth: "protected"
55013
+ }),
55014
+ /** off / on. */
55015
+ setAwayMode: require_sleep.method(zod.z.object({
55016
+ deviceId,
55017
+ mode
55018
+ }), zod.z.void(), {
55019
+ kind: "mutation",
55020
+ auth: "protected"
55021
+ }),
55022
+ /** off / manual / auto. */
55023
+ setAdditionalHeaterMode: require_sleep.method(zod.z.object({
55024
+ deviceId,
55025
+ mode
55026
+ }), zod.z.void(), {
55027
+ kind: "mutation",
55028
+ auth: "protected"
55029
+ }),
55030
+ /** off / hm1 .. hm8 (the programmes the gateway lists). */
55031
+ setHolidayMode: require_sleep.method(zod.z.object({
55032
+ deviceId,
55033
+ mode
55034
+ }), zod.z.void(), {
55035
+ kind: "mutation",
55036
+ auth: "protected"
55037
+ }),
55038
+ setCircuitOperationMode: require_sleep.method(zod.z.object({
55039
+ deviceId,
55040
+ circuitId,
55041
+ mode
55042
+ }), zod.z.void(), {
55043
+ kind: "mutation",
55044
+ auth: "protected"
55045
+ }),
55046
+ setCircuitHeatCoolMode: require_sleep.method(zod.z.object({
55047
+ deviceId,
55048
+ circuitId,
55049
+ mode
55050
+ }), zod.z.void(), {
55051
+ kind: "mutation",
55052
+ auth: "protected"
55053
+ }),
55054
+ setCircuitSummerWinter: require_sleep.method(zod.z.object({
55055
+ deviceId,
55056
+ circuitId,
55057
+ mode
55058
+ }), zod.z.void(), {
55059
+ kind: "mutation",
55060
+ auth: "protected"
55061
+ }),
55062
+ setCircuitComfortSetpoint: require_sleep.method(zod.z.object({
55063
+ deviceId,
55064
+ circuitId,
55065
+ temp
55066
+ }), zod.z.void(), {
55067
+ kind: "mutation",
55068
+ auth: "protected"
55069
+ }),
55070
+ setCircuitEcoSetpoint: require_sleep.method(zod.z.object({
55071
+ deviceId,
55072
+ circuitId,
55073
+ temp
55074
+ }), zod.z.void(), {
55075
+ kind: "mutation",
55076
+ auth: "protected"
55077
+ }),
55078
+ setCircuitMaxFlowTemp: require_sleep.method(zod.z.object({
55079
+ deviceId,
55080
+ circuitId,
55081
+ temp
55082
+ }), zod.z.void(), {
55083
+ kind: "mutation",
55084
+ auth: "protected"
55085
+ }),
55086
+ setDhwOperationMode: require_sleep.method(zod.z.object({
55087
+ deviceId,
55088
+ circuitId,
55089
+ mode
55090
+ }), zod.z.void(), {
55091
+ kind: "mutation",
55092
+ auth: "protected"
55093
+ }),
55094
+ setDhwTemperatureLevel: require_sleep.method(zod.z.object({
55095
+ deviceId,
55096
+ circuitId,
55097
+ level: mode
55098
+ }), zod.z.void(), {
55099
+ kind: "mutation",
55100
+ auth: "protected"
55101
+ }),
55102
+ setDhwChargeDuration: require_sleep.method(zod.z.object({
55103
+ deviceId,
55104
+ circuitId,
55105
+ minutes: zod.z.number().int().positive()
55106
+ }), zod.z.void(), {
55107
+ kind: "mutation",
55108
+ auth: "protected"
55109
+ }),
55110
+ /** Start an extra-hot-water charge now: an action, not a stored mode. */
55111
+ startExtraHotWater: require_sleep.method(zod.z.object({
55112
+ deviceId,
55113
+ circuitId
55114
+ }), zod.z.void(), {
55115
+ kind: "mutation",
55116
+ auth: "protected"
55117
+ })
55118
+ }
55119
+ };
55120
+ //#endregion
55121
+ //#region src/capabilities/heat-pump-status.cap.ts
55122
+ /**
55123
+ * Heat pump status (D1026): the one main, READ-ONLY cap of a heat pump. Every
55124
+ * circuit the gateway reports is an entry of `circuits[]` — heating, hot water,
55125
+ * cooling or solar, any number — so no circuit needs a device of its own to be
55126
+ * seen. The settable parameters are typed methods of `heat-pump-control`; the
55127
+ * values they take and their limits (`allowed`, `min`, `max`, `step`) are read
55128
+ * from the gateway and carried here, never written in code.
55129
+ *
55130
+ * A value the gateway did not report is `null`, never `0` (D393). The COP is not
55131
+ * a field: it is computed from the two powers at read time
55132
+ * ({@link heatPumpInstantCop}).
55133
+ */
55134
+ /** The kinds of circuit a heat pump serves. */
55135
+ var HEAT_PUMP_CIRCUIT_KINDS = [
55136
+ "heating",
55137
+ "dhw",
55138
+ "cooling",
55139
+ "solar"
55140
+ ];
55141
+ var HeatPumpCircuitKindSchema = zod.z.enum(HEAT_PUMP_CIRCUIT_KINDS);
55142
+ /** A setting that takes one of a list of values the gateway named. */
55143
+ var HeatPumpOptionSettingSchema = zod.z.object({
55144
+ /** The active value. Null when the gateway did not answer. */
55145
+ value: zod.z.string().nullable(),
55146
+ /** Values the gateway accepts, in its order. Empty = read-only here. */
55147
+ allowed: zod.z.array(zod.z.string())
55148
+ });
55149
+ /** A numeric setting with the limits the gateway named. */
55150
+ var HeatPumpRangeSettingSchema = zod.z.object({
55151
+ value: zod.z.number().nullable(),
55152
+ min: zod.z.number().nullable(),
55153
+ max: zod.z.number().nullable(),
55154
+ step: zod.z.number().nullable()
55155
+ });
55156
+ var HeatPumpCircuitSchema = zod.z.object({
55157
+ /** Gateway id of the circuit (`hc1`, `dhw1`): the key of the series. */
55158
+ id: zod.z.string().min(1),
55159
+ kind: HeatPumpCircuitKindSchema,
55160
+ label: zod.z.string(),
55161
+ icon: IconKeySchema,
55162
+ /** Measured temperature of the circuit (room, tank, collector). */
55163
+ currentTemp: zod.z.number().nullable().meta(require_sleep.readingMeta("temperature")),
55164
+ /** The setpoint in force now. */
55165
+ targetTemp: zod.z.number().nullable().meta(require_sleep.readingMeta("temperature")),
55166
+ /** The operation mode in force (mirror of `operationMode.value`, for the series). */
55167
+ mode: zod.z.string().nullable(),
55168
+ /** Whether the circuit is calling for heat right now. Null = unknown. */
55169
+ active: zod.z.boolean().nullable(),
55170
+ operationMode: HeatPumpOptionSettingSchema.nullable(),
55171
+ /** Heating circuits: heat / cool / heatCool. */
55172
+ heatCoolMode: HeatPumpOptionSettingSchema.nullable(),
55173
+ /** Heating circuits: summer / winter changeover. */
55174
+ summerWinter: HeatPumpOptionSettingSchema.nullable(),
55175
+ comfortSetpoint: HeatPumpRangeSettingSchema.nullable(),
55176
+ ecoSetpoint: HeatPumpRangeSettingSchema.nullable(),
55177
+ maxFlowTemp: HeatPumpRangeSettingSchema.nullable(),
55178
+ /** Hot water: the temperature level (off / low / high / eco). */
55179
+ temperatureLevel: HeatPumpOptionSettingSchema.nullable(),
55180
+ /** Hot water: how long a charge lasts, minutes. */
55181
+ chargeDuration: HeatPumpRangeSettingSchema.nullable(),
55182
+ /** Hot water: whether an extra-hot-water charge is running. Null = no such surface. */
55183
+ extraHotWater: zod.z.boolean().nullable()
55184
+ });
55185
+ /** The independent system modes, each with its real values. A null mode = the gateway has none. */
55186
+ var HeatPumpSystemSchema = zod.z.object({
55187
+ silent: HeatPumpOptionSettingSchema.nullable(),
55188
+ away: HeatPumpOptionSettingSchema.nullable(),
55189
+ additionalHeater: HeatPumpOptionSettingSchema.nullable(),
55190
+ holiday: HeatPumpOptionSettingSchema.nullable()
55191
+ });
55192
+ var HeatPumpPowerSchema = zod.z.object({
55193
+ thermalW: zod.z.number().nullable().meta(require_sleep.readingMeta("power")),
55194
+ electricalW: zod.z.number().nullable().meta(require_sleep.readingMeta("power")),
55195
+ /** Compressor modulation, percent. */
55196
+ compressorPct: zod.z.number().nullable().meta(require_sleep.readingMeta("percentage"))
55197
+ });
55198
+ var HeatPumpTemperaturesSchema = zod.z.object({
55199
+ supply: zod.z.number().nullable().meta(require_sleep.readingMeta("temperature")),
55200
+ return: zod.z.number().nullable().meta(require_sleep.readingMeta("temperature")),
55201
+ outdoor: zod.z.number().nullable().meta(require_sleep.readingMeta("temperature"))
55202
+ });
55203
+ /** Lifetime meters, kWh: the energy of a period is computed at read time from their difference (D944). */
55204
+ var HeatPumpEnergySchema = zod.z.object({
55205
+ thermalKwh: zod.z.number().nullable().meta(require_sleep.readingMeta("energy")),
55206
+ electricalKwh: zod.z.number().nullable().meta(require_sleep.readingMeta("energy"))
55207
+ });
55208
+ var HeatPumpStatusSchema = zod.z.object({
55209
+ circuits: zod.z.array(HeatPumpCircuitSchema),
55210
+ system: HeatPumpSystemSchema,
55211
+ power: HeatPumpPowerSchema,
55212
+ temperatures: HeatPumpTemperaturesSchema,
55213
+ energy: HeatPumpEnergySchema,
55214
+ /** Water pressure of the heating loop, bar. */
55215
+ waterPressureBar: zod.z.number().nullable(),
55216
+ /** Compressor starts since commissioning. */
55217
+ starts: zod.z.number().nullable(),
55218
+ /** Ms epoch when the slice was last read from the gateway. */
55219
+ lastFetchedAt: zod.z.number()
55220
+ });
55221
+ /**
55222
+ * The instantaneous COP: thermal over electrical power. Null unless BOTH powers
55223
+ * are known and the unit draws power — a missing reading is never a 0 or a
55224
+ * division by it (D393). Computed on every read; there is no stored value.
55225
+ */
55226
+ function heatPumpInstantCop(power) {
55227
+ const { thermalW, electricalW } = power;
55228
+ if (thermalW === null || electricalW === null || electricalW <= 0) return null;
55229
+ return thermalW / electricalW;
55230
+ }
55231
+ var heatPumpStatusCapability = {
55232
+ name: "heat-pump-status",
55233
+ scope: "device",
55234
+ deviceNative: true,
55235
+ mode: "singleton",
55236
+ deviceTypes: [require_device_type.DeviceType.HeatPump],
55237
+ methods: {},
55238
+ status: {
55239
+ schema: HeatPumpStatusSchema,
55240
+ kind: "push"
55241
+ },
55242
+ runtimeState: HeatPumpStatusSchema,
55243
+ /**
55244
+ * Runtime-state durability: **session** — a heat pump's gateway answers on the
55245
+ * next poll, so a restart that clears the slice loses nothing a reader needs
55246
+ * (the series are recorded). See `RuntimeStateDurability`.
55247
+ */
55248
+ durability: "session",
55249
+ /**
55250
+ * History (D850, D917): `circuits[]` is a keyed array — one series per circuit and
55251
+ * field, named by the circuit's label. The mode is a state (D896); the energy
55252
+ * totals are lifetime counters, the kWh of a period is computed at read time (D944).
55253
+ * The COP is never recorded: it derives from the two powers.
55254
+ */
55255
+ history: {
55256
+ fields: {
55257
+ "power.thermalW": {
55258
+ kind: "gauge",
55259
+ unit: "W",
55260
+ deadband: 50,
55261
+ displayName: "Thermal power"
55262
+ },
55263
+ "power.electricalW": {
55264
+ kind: "gauge",
55265
+ unit: "W",
55266
+ deadband: 50,
55267
+ displayName: "Electrical power"
55268
+ },
55269
+ "power.compressorPct": {
55270
+ kind: "gauge",
55271
+ unit: "%",
55272
+ deadband: 2,
55273
+ displayName: "Compressor"
55274
+ },
55275
+ "temperatures.supply": {
55276
+ kind: "gauge",
55277
+ unit: "°C",
55278
+ deadband: .5,
55279
+ displayName: "Supply"
55280
+ },
55281
+ "temperatures.return": {
55282
+ kind: "gauge",
55283
+ unit: "°C",
55284
+ deadband: .5,
55285
+ displayName: "Return"
55286
+ },
55287
+ "temperatures.outdoor": {
55288
+ kind: "gauge",
55289
+ unit: "°C",
55290
+ deadband: .5,
55291
+ displayName: "Outdoor"
55292
+ },
55293
+ "energy.thermalKwh": {
55294
+ kind: "counter",
55295
+ unit: "kWh",
55296
+ displayName: "Thermal energy"
55297
+ },
55298
+ "energy.electricalKwh": {
55299
+ kind: "counter",
55300
+ unit: "kWh",
55301
+ displayName: "Electrical energy"
55302
+ }
55303
+ },
55304
+ items: {
55305
+ path: "circuits",
55306
+ key: "id",
55307
+ label: "label",
55308
+ fields: {
55309
+ currentTemp: {
55310
+ kind: "gauge",
55311
+ unit: "°C",
55312
+ deadband: .5,
55313
+ displayName: "Temperature"
55314
+ },
55315
+ targetTemp: {
55316
+ kind: "gauge",
55317
+ unit: "°C",
55318
+ minIntervalMs: 0,
55319
+ displayName: "Setpoint"
55320
+ },
55321
+ mode: {
55322
+ kind: "enum",
55323
+ displayName: "Mode"
55324
+ }
55325
+ }
55326
+ }
55327
+ },
55328
+ volatileStateFields: ["lastFetchedAt"]
55329
+ };
55330
+ //#endregion
54913
55331
  //#region src/capabilities/heating-valve.cap.ts
54914
55332
  var HeatingValveStatusSchema = zod.z.object({
54915
55333
  /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
@@ -55182,6 +55600,7 @@ var HERO_SCENES = [
55182
55600
  "ac",
55183
55601
  "thermostat",
55184
55602
  "heater",
55603
+ "heat-pump",
55185
55604
  "fan",
55186
55605
  "washer",
55187
55606
  "dryer",
@@ -55252,6 +55671,7 @@ var HERO_SCENE_BY_TYPE = {
55252
55671
  [require_device_type.DeviceType.Valve]: "control-dial",
55253
55672
  [require_device_type.DeviceType.Humidifier]: "control-dial",
55254
55673
  [require_device_type.DeviceType.WaterHeater]: "heater",
55674
+ [require_device_type.DeviceType.HeatPump]: "heat-pump",
55255
55675
  [require_device_type.DeviceType.Fan]: "fan",
55256
55676
  [require_device_type.DeviceType.MediaPlayer]: "tv",
55257
55677
  [require_device_type.DeviceType.AlarmPanel]: "alarm",
@@ -55374,6 +55794,7 @@ var HeroTextSchema = zod.z.object({
55374
55794
  */
55375
55795
  /** The rows a layout may carry. Each is built from the caps the device is bound to. */
55376
55796
  var HERO_ROW_IDS = [
55797
+ "progress",
55377
55798
  "run-for",
55378
55799
  "cycle",
55379
55800
  "program",
@@ -55388,6 +55809,7 @@ var HERO_ROW_IDS = [
55388
55809
  "alarm",
55389
55810
  "fan",
55390
55811
  "vacuum",
55812
+ "vacuum-suction",
55391
55813
  "mower",
55392
55814
  "feeder",
55393
55815
  "fountain",
@@ -55406,9 +55828,56 @@ var HERO_ROW_IDS = [
55406
55828
  "climate-fan",
55407
55829
  "setpoint",
55408
55830
  "channel",
55409
- "control"
55831
+ "control",
55832
+ "circuit",
55833
+ "heat-pump-power",
55834
+ "system-mode"
55410
55835
  ];
55411
55836
  var HeroRowIdSchema = zod.z.enum(HERO_ROW_IDS);
55837
+ /**
55838
+ * The label a row carries at its left ("Phase | value | action"), per row id: the
55839
+ * vocabulary of layout A, so no client names a row itself.
55840
+ */
55841
+ var HERO_ROW_LABELS = {
55842
+ progress: require_sleep.t("Progress", "Avanzamento"),
55843
+ "run-for": require_sleep.t("Run for", "Avvia per"),
55844
+ cycle: require_sleep.t("Cycle", "Ciclo"),
55845
+ program: require_sleep.t("Program", "Programma"),
55846
+ "appliance-power": require_sleep.t("Appliance", "Elettrodomestico"),
55847
+ "now-playing": require_sleep.t("Now playing", "In riproduzione"),
55848
+ playback: require_sleep.t("Playback", "Riproduzione"),
55849
+ volume: require_sleep.t("Volume", "Volume"),
55850
+ source: require_sleep.t("Source", "Sorgente"),
55851
+ contact: require_sleep.t("Door", "Porta"),
55852
+ "motion-trigger": require_sleep.t("Motion", "Movimento"),
55853
+ lock: require_sleep.t("Lock", "Serratura"),
55854
+ alarm: require_sleep.t("Alarm", "Allarme"),
55855
+ fan: require_sleep.t("Fan", "Ventola"),
55856
+ vacuum: require_sleep.t("Cleaning", "Pulizia"),
55857
+ "vacuum-suction": require_sleep.t("Suction", "Aspirazione"),
55858
+ mower: require_sleep.t("Mowing", "Taglio"),
55859
+ feeder: require_sleep.t("Feed now", "Eroga ora"),
55860
+ fountain: require_sleep.t("Pump", "Pompa"),
55861
+ "pump-cycle": require_sleep.t("Pump cycle", "Ciclo pompa"),
55862
+ automation: require_sleep.t("Automation", "Automazione"),
55863
+ script: require_sleep.t("Script", "Script"),
55864
+ "do-not-disturb": require_sleep.t("Do not disturb", "Non disturbare"),
55865
+ brightness: require_sleep.t("Brightness", "Luminosità"),
55866
+ color: require_sleep.t("Colour", "Colore"),
55867
+ cover: require_sleep.t("Position", "Posizione"),
55868
+ valve: require_sleep.t("Valve", "Valvola"),
55869
+ humidifier: require_sleep.t("Humidifier", "Umidificatore"),
55870
+ update: require_sleep.t("Firmware", "Firmware"),
55871
+ button: require_sleep.t("Action", "Azione"),
55872
+ "climate-mode": require_sleep.t("Mode", "Modalità"),
55873
+ "climate-fan": require_sleep.t("Fan", "Ventola"),
55874
+ setpoint: require_sleep.t("Setpoint", "Temperatura"),
55875
+ channel: require_sleep.t("Channel", "Canale"),
55876
+ control: require_sleep.t("Control", "Controllo"),
55877
+ circuit: require_sleep.t("Circuit", "Circuito"),
55878
+ "heat-pump-power": require_sleep.t("Power", "Potenza"),
55879
+ "system-mode": require_sleep.t("Mode", "Modalità")
55880
+ };
55412
55881
  var HeroArgValueSchema = zod.z.lazy(() => zod.z.union([
55413
55882
  zod.z.string(),
55414
55883
  zod.z.number(),
@@ -55416,6 +55885,28 @@ var HeroArgValueSchema = zod.z.lazy(() => zod.z.union([
55416
55885
  zod.z.record(zod.z.string(), HeroArgValueSchema)
55417
55886
  ]));
55418
55887
  var HeroArgsSchema = zod.z.record(zod.z.string(), HeroArgValueSchema);
55888
+ function setArgAt(args, keys, value) {
55889
+ const [head, ...rest] = keys;
55890
+ if (head === void 0) return args;
55891
+ if (rest.length === 0) return {
55892
+ ...args,
55893
+ [head]: value
55894
+ };
55895
+ const child = args[head];
55896
+ const base = typeof child === "object" ? child : {};
55897
+ return {
55898
+ ...args,
55899
+ [head]: setArgAt(base, rest, value)
55900
+ };
55901
+ }
55902
+ /**
55903
+ * `args` with the chosen value set at `path` (`level`, or `control.value` for a value
55904
+ * that lives inside a nested argument). The original is not touched; a renderer builds
55905
+ * the call of a slider or picker with this.
55906
+ */
55907
+ function heroArgsWithValue(args, path, value) {
55908
+ return setArgAt(args, path.split("."), value);
55909
+ }
55419
55910
  /** A cap method called on the hero's device. */
55420
55911
  var HeroCallSchema = zod.z.object({
55421
55912
  cap: zod.z.string(),
@@ -55472,16 +55963,32 @@ var HeroControlSchema = zod.z.discriminatedUnion("kind", [
55472
55963
  label: HeroTextSchema,
55473
55964
  current: zod.z.string().nullable(),
55474
55965
  options: zod.z.array(zod.z.string()),
55966
+ /** A readable label per option value; an option without one is drawn as its raw value. */
55967
+ optionLabels: zod.z.record(zod.z.string(), HeroTextSchema).optional(),
55475
55968
  call: HeroCallSchema,
55476
55969
  valueArg: zod.z.string()
55477
55970
  })
55478
55971
  ]);
55972
+ /** Declared by its interface: a `z.infer` of one more icon union pushes the cap's inferred type past what the compiler can print. */
55973
+ var HeroPillSchema = zod.z.object({
55974
+ icon: IconKeySchema.nullable(),
55975
+ text: HeroTextSchema,
55976
+ tone: HeroToneSchema
55977
+ });
55479
55978
  var HeroRowSchema = zod.z.object({
55480
55979
  id: HeroRowIdSchema,
55980
+ /** The row's own name when the kind's label would not tell rows of one kind apart (a circuit's label). */
55981
+ label: HeroTextSchema.optional(),
55982
+ /** A group header drawn above the row when it differs from the previous row's ("System"). */
55983
+ group: HeroTextSchema.optional(),
55984
+ /** Values drawn as pills across the row (a heat pump's powers). */
55985
+ pills: zod.z.array(HeroPillSchema).optional(),
55481
55986
  icon: IconKeySchema,
55482
55987
  /** The row's status, in words. `null` = nothing to say. */
55483
55988
  status: HeroTextSchema.nullable(),
55484
- controls: zod.z.array(HeroControlSchema)
55989
+ controls: zod.z.array(HeroControlSchema),
55990
+ /** A bar under the row's label, 0..1; `null` / absent = no bar. */
55991
+ progress: zod.z.number().min(0).max(1).nullable().optional()
55485
55992
  });
55486
55993
  var HeroDetailSchema = zod.z.object({
55487
55994
  label: HeroTextSchema,
@@ -55489,7 +55996,11 @@ var HeroDetailSchema = zod.z.object({
55489
55996
  unit: zod.z.string().nullable()
55490
55997
  });
55491
55998
  var HeroBadgeSchema = zod.z.object({
55492
- id: zod.z.enum(["battery", "network-link"]),
55999
+ id: zod.z.enum([
56000
+ "battery",
56001
+ "network-link",
56002
+ "integration"
56003
+ ]),
55493
56004
  icon: IconKeySchema,
55494
56005
  tone: HeroToneSchema,
55495
56006
  /** Percent for a battery, link quality for a link; `null` = not known. */
@@ -55590,7 +56101,12 @@ var HeroFactSchema = zod.z.object({
55590
56101
  var HeroSideTileSchema = zod.z.object({
55591
56102
  label: HeroTextSchema,
55592
56103
  value: HeroTextSchema,
55593
- tone: HeroToneSchema.optional()
56104
+ tone: HeroToneSchema.optional(),
56105
+ /**
56106
+ * Epoch ms when the tile reads a clock time (an appliance's end): a client prints it in
56107
+ * the viewer's own time zone; `value` is the fallback for one that cannot.
56108
+ */
56109
+ at: zod.z.number().optional()
55594
56110
  });
55595
56111
  var HeroSideTilesSchema = zod.z.object({
55596
56112
  left: zod.z.array(HeroSideTileSchema).max(2),
@@ -55626,8 +56142,12 @@ var HeroModelSchema = zod.z.object({
55626
56142
  sideTiles: HeroSideTilesSchema,
55627
56143
  /** The status line under the main icon. */
55628
56144
  title: HeroTextSchema,
56145
+ /** The scene's top line when it says more than `title`; absent = draw the title. */
56146
+ caption: HeroTextSchema.optional(),
55629
56147
  badges: zod.z.array(HeroBadgeSchema),
55630
56148
  remote: HeroRemoteSlotSchema.nullable(),
56149
+ /** The foot button that opens the device's history: "History", "Cycles", "Meals", "Access". */
56150
+ historyLabel: HeroTextSchema,
55631
56151
  consumables: HeroConsumablesSlotSchema.nullable(),
55632
56152
  consumption: HeroConsumptionSlotSchema.nullable(),
55633
56153
  ownPower: HeroOwnPowerSlotSchema.nullable(),
@@ -89537,6 +90057,8 @@ var CAPABILITY_NAMES = {
89537
90057
  groupActive: "group-active",
89538
90058
  groupCommands: "group-commands",
89539
90059
  groupStatus: "group-status",
90060
+ heatPumpControl: "heat-pump-control",
90061
+ heatPumpStatus: "heat-pump-status",
89540
90062
  heatingValve: "heating-valve",
89541
90063
  heroLayout: "hero-layout",
89542
90064
  humidifier: "humidifier",
@@ -89992,6 +90514,14 @@ var CAPABILITY_ROUTER_KEYS = [
89992
90514
  key: "groupStatus",
89993
90515
  name: "group-status"
89994
90516
  },
90517
+ {
90518
+ key: "heatPumpControl",
90519
+ name: "heat-pump-control"
90520
+ },
90521
+ {
90522
+ key: "heatPumpStatus",
90523
+ name: "heat-pump-status"
90524
+ },
89995
90525
  {
89996
90526
  key: "heatingValve",
89997
90527
  name: "heating-valve"
@@ -90566,6 +91096,8 @@ var ALL_CAPABILITY_DEFINITIONS = [
90566
91096
  groupActiveCapability,
90567
91097
  groupCommandsCapability,
90568
91098
  groupStatusCapability,
91099
+ heatPumpControlCapability,
91100
+ heatPumpStatusCapability,
90569
91101
  heatingValveCapability,
90570
91102
  heroLayoutCapability,
90571
91103
  humidifierCapability,
@@ -98127,6 +98659,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
98127
98659
  groupCommands: groupCommandsCapability,
98128
98660
  groupStatus: groupStatusCapability,
98129
98661
  heatingValve: heatingValveCapability,
98662
+ heatPumpStatus: heatPumpStatusCapability,
98130
98663
  humidifier: humidifierCapability,
98131
98664
  humiditySensor: humiditySensorCapability,
98132
98665
  image: imageCapability,
@@ -100179,6 +100712,7 @@ var DEVICE_TYPE_CONTROL_KIND = {
100179
100712
  [require_device_type.DeviceType.Valve]: "valve",
100180
100713
  [require_device_type.DeviceType.Humidifier]: "humidifier",
100181
100714
  [require_device_type.DeviceType.WaterHeater]: "water-heater",
100715
+ [require_device_type.DeviceType.HeatPump]: "dummy",
100182
100716
  [require_device_type.DeviceType.Camera]: "dummy",
100183
100717
  [require_device_type.DeviceType.Hub]: "dummy",
100184
100718
  [require_device_type.DeviceType.Switch]: "switch",
@@ -100454,6 +100988,13 @@ var lockContribution = contribution("lock-control", LockControlStatusSchema, (sl
100454
100988
  reading: reading("lock-control", words?.state ?? "unknown", false, words?.title),
100455
100989
  rows: [row$1("lock", state === "locked" || state === "locking" ? "lock" : "lock-open", joinText([title, since]), lockControls(state, ctx.features.includes(require_device_type.DeviceFeature.LockOpen)))],
100456
100990
  ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, "muted")] },
100991
+ ...words === null ? {} : { tiles: { left: [{
100992
+ label: require_sleep.t("Door", "Porta"),
100993
+ value: title
100994
+ }, ...since === null ? [] : [{
100995
+ label: require_sleep.t("Since", "Da"),
100996
+ value: since
100997
+ }]] } },
100457
100998
  ...words?.door == null ? {} : { scene: { mode: words.door } }
100458
100999
  };
100459
101000
  });
@@ -100535,7 +101076,17 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
100535
101076
  return {
100536
101077
  reading: reading("alarm-panel", words?.state ?? "unknown", false, words?.title),
100537
101078
  rows: [row$1("alarm", state === "triggered" ? "shield-alert" : state === "disarmed" ? "shield-off" : "shield-check", joinText([words?.title ?? require_sleep.t("Unknown", "Sconosciuto"), since]), alarmControls(state, modes, slice?.requiresCode ?? false))],
100538
- ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] }
101079
+ ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] },
101080
+ ...words === null ? {} : { tiles: {
101081
+ left: [{
101082
+ label: require_sleep.t("Mode", "Modalità"),
101083
+ value: words.title
101084
+ }],
101085
+ ...since === null ? {} : { right: [{
101086
+ label: require_sleep.t("Since", "Da"),
101087
+ value: since
101088
+ }] }
101089
+ } }
100539
101090
  };
100540
101091
  }),
100541
101092
  "automation-control": contribution("automation-control", AutomationControlStatusSchema, (slice, ctx) => {
@@ -100601,7 +101152,7 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
100601
101152
  */
100602
101153
  var has$3 = (ctx, f) => ctx.features.includes(f);
100603
101154
  var unknownText = require_sleep.t("Unknown", "Sconosciuto");
100604
- var pct$1 = (n) => require_sleep.t(`${Math.round(n)}%`, `${Math.round(n)}%`);
101155
+ var pct$2 = (n) => require_sleep.t(`${Math.round(n)}%`, `${Math.round(n)}%`);
100605
101156
  var unit = (n) => Math.min(1, Math.max(0, n / 100));
100606
101157
  /** Battery as a fact, unless the device is also bound to the `battery` cap (it already says so). */
100607
101158
  function ownBattery(level, ctx) {
@@ -100663,7 +101214,7 @@ var fanContribution = contribution("fan-control", FanControlStatusSchema, (slice
100663
101214
  },
100664
101215
  valueArg: "direction"
100665
101216
  });
100666
- const speedText = speed === null ? null : pct$1(speed);
101217
+ const speedText = speed === null ? null : pct$2(speed);
100667
101218
  const preset = slice?.preset ?? "";
100668
101219
  const status = speed === null ? unknownText : joinText([speed === 0 ? require_sleep.t("Off", "Spento") : require_sleep.t(`Speed ${speed}%`, `Velocità ${speed}%`), preset === "" ? null : require_sleep.t(preset, preset)]);
100669
101220
  return {
@@ -100676,10 +101227,16 @@ var fanContribution = contribution("fan-control", FanControlStatusSchema, (slice
100676
101227
  }],
100677
101228
  ...speedText === null ? {} : {
100678
101229
  facts: [fact("speed", "fan", speedText, speed === 0 ? "muted" : "primary")],
100679
- tiles: { right: [{
100680
- label: require_sleep.t("Speed", "Velocità"),
100681
- value: speedText
100682
- }] },
101230
+ tiles: {
101231
+ ...slice?.oscillating == null ? {} : { left: [{
101232
+ label: require_sleep.t("Oscillation", "Oscilla"),
101233
+ value: slice.oscillating ? require_sleep.t("Yes", "Sì") : require_sleep.t("No", "No")
101234
+ }] },
101235
+ ...preset === "" ? {} : { right: [{
101236
+ label: require_sleep.t("Mode", "Modalità"),
101237
+ value: require_sleep.t(preset, preset)
101238
+ }] }
101239
+ },
100683
101240
  scene: { level: unit(speed ?? 0) }
100684
101241
  }
100685
101242
  };
@@ -100743,7 +101300,8 @@ var vacuumContribution = contribution("vacuum-control", VacuumControlStatusSchem
100743
101300
  const words = state === null ? null : VACUUM_WORDS[state];
100744
101301
  const title = state === "error" && slice?.errorLabel ? require_sleep.t(slice.errorLabel, slice.errorLabel) : words?.title;
100745
101302
  const controls = vacuumControls(state);
100746
- if (slice !== void 0 && slice.availableFanSpeeds.length > 0) controls.push({
101303
+ const suctionControls = [];
101304
+ if (slice !== void 0 && slice.availableFanSpeeds.length > 0) suctionControls.push({
100747
101305
  kind: "picker",
100748
101306
  id: "vacuum.suction",
100749
101307
  label: require_sleep.t("Suction", "Aspirazione"),
@@ -100758,22 +101316,31 @@ var vacuumContribution = contribution("vacuum-control", VacuumControlStatusSchem
100758
101316
  });
100759
101317
  if (state !== null) controls.push(vac("locate", "Locate", "Trova", "map-pin", "locate"));
100760
101318
  const progress = state === "cleaning" ? slice?.progress ?? null : null;
101319
+ const suction = slice?.fanSpeed == null || slice.fanSpeed === "" ? [] : [{
101320
+ label: require_sleep.t("Suction", "Aspirazione"),
101321
+ value: require_sleep.t(slice.fanSpeed, slice.fanSpeed)
101322
+ }];
101323
+ const suctionRows = suctionControls.length === 0 ? [] : [{
101324
+ id: "vacuum-suction",
101325
+ icon: "bot",
101326
+ status: null,
101327
+ controls: suctionControls
101328
+ }];
101329
+ const vacuumRows = [{
101330
+ id: "vacuum",
101331
+ icon: "bot",
101332
+ status: title ?? unknownText,
101333
+ controls
101334
+ }, ...suctionRows];
100761
101335
  return {
100762
101336
  reading: reading("vacuum-control", words?.state ?? "unknown", false, title),
100763
- rows: [{
100764
- id: "vacuum",
100765
- icon: "bot",
100766
- status: title ?? unknownText,
100767
- controls
100768
- }],
100769
- facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$1(progress), "primary")]],
100770
- ...progress === null ? {} : {
100771
- tiles: { right: [{
100772
- label: require_sleep.t("Progress", "Avanzamento"),
100773
- value: pct$1(progress)
100774
- }] },
100775
- scene: { level: unit(progress) }
100776
- }
101337
+ rows: vacuumRows,
101338
+ facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$2(progress), "primary")]],
101339
+ ...suction.length === 0 && progress === null ? {} : { tiles: { right: [...suction, ...progress === null ? [] : [{
101340
+ label: require_sleep.t("Progress", "Avanzamento"),
101341
+ value: pct$2(progress)
101342
+ }]] } },
101343
+ ...progress === null ? {} : { scene: { level: unit(progress) } }
100777
101344
  };
100778
101345
  });
100779
101346
  var MOWER_WORDS = {
@@ -100829,11 +101396,11 @@ var mowerContribution = contribution("lawn-mower-control", LawnMowerControlStatu
100829
101396
  status: title ?? unknownText,
100830
101397
  controls: mowerControls(activity)
100831
101398
  }],
100832
- facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$1(progress), "primary")]],
101399
+ facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$2(progress), "primary")]],
100833
101400
  ...progress === null ? {} : {
100834
101401
  tiles: { right: [{
100835
101402
  label: require_sleep.t("Progress", "Avanzamento"),
100836
- value: pct$1(progress)
101403
+ value: pct$2(progress)
100837
101404
  }] },
100838
101405
  scene: { level: unit(progress) }
100839
101406
  }
@@ -100904,10 +101471,13 @@ var feederContribution = contribution("pet-feeder", PetFeederStatusSchema, (slic
100904
101471
  ...last === null ? [] : [fact("last-run", "clock", require_sleep.t(`Last ${last} g`, `Ultimo ${last} g`))],
100905
101472
  ...ownBattery(slice?.powerSource === "battery" ? slice.batteryPower : null, ctx)
100906
101473
  ],
100907
- ...last === null ? {} : { tiles: { right: [{
101474
+ tiles: { left: [...slice?.foodLevel == null ? [] : [{
101475
+ label: require_sleep.t("Tank", "Serbatoio"),
101476
+ value: pct$2(slice.foodLevel)
101477
+ }], ...last === null ? [] : [{
100908
101478
  label: require_sleep.t("Last portion", "Ultima porzione"),
100909
101479
  value: require_sleep.t(`${last} g`, `${last} g`)
100910
- }] } }
101480
+ }]] }
100911
101481
  };
100912
101482
  });
100913
101483
  var fountainContribution = contribution("pet-fountain", PetFountainStatusSchema, (slice) => {
@@ -100935,10 +101505,13 @@ var fountainContribution = contribution("pet-fountain", PetFountainStatusSchema,
100935
101505
  }],
100936
101506
  ...level === null ? {} : {
100937
101507
  facts: [fact("level", "droplets", require_sleep.t(`Water ${Math.round(level)}%`, `Acqua ${Math.round(level)}%`), level <= 20 ? "warning" : "primary")],
100938
- tiles: { right: [{
101508
+ tiles: { left: [{
100939
101509
  label: require_sleep.t("Water", "Acqua"),
100940
- value: pct$1(level)
100941
- }] },
101510
+ value: pct$2(level)
101511
+ }, ...slice?.waterVolume == null ? [] : [{
101512
+ label: require_sleep.t("Volume", "Volume"),
101513
+ value: require_sleep.t(`${Math.round(slice.waterVolume)} ml`, `${Math.round(slice.waterVolume)} ml`)
101514
+ }]] },
100942
101515
  scene: { level: unit(level) }
100943
101516
  }
100944
101517
  };
@@ -100972,14 +101545,18 @@ var DEVICES_FAMILY_CONTRIBUTIONS = {
100972
101545
  * that does not parse reads `unknown`, never closed or off (D315/D393).
100973
101546
  */
100974
101547
  var has$2 = (ctx, f) => ctx.features.includes(f);
100975
- var pct = (n) => require_sleep.t(`${Math.round(n)}%`, `${Math.round(n)}%`);
101548
+ var pct$1 = (n) => require_sleep.t(`${Math.round(n)}%`, `${Math.round(n)}%`);
100976
101549
  var brightnessContribution = contribution("brightness", BrightnessStatusSchema, (slice) => {
100977
101550
  const level = slice?.level ?? null;
100978
101551
  return {
100979
101552
  ...level === null ? {} : { reading: reading("brightness", level > 0 ? "on" : "off") },
100980
101553
  ...level === null ? {} : {
100981
- facts: [fact("level", "sun-dim", pct(level), level > 0 ? "primary" : "muted")],
100982
- scene: { level: level / 100 }
101554
+ facts: [fact("level", "sun-dim", pct$1(level), level > 0 ? "primary" : "muted")],
101555
+ scene: { level: level / 100 },
101556
+ tiles: { left: [{
101557
+ label: require_sleep.t("Brightness", "Luminosità"),
101558
+ value: pct$1(level)
101559
+ }] }
100983
101560
  },
100984
101561
  rows: [row$1("brightness", "sun-dim", level === null ? null : require_sleep.t(`Brightness ${Math.round(level)}%`, `Luminosità ${Math.round(level)}%`), [{
100985
101562
  kind: "slider",
@@ -101188,12 +101765,16 @@ function travelFragment(s, state, position, tilt, ctx) {
101188
101765
  });
101189
101766
  return {
101190
101767
  reading: reading(s.source, words.state, false, words.title),
101191
- ...position === null ? {} : { facts: [fact("level", "arrow-up-down", pct(position))] },
101768
+ ...position === null ? {} : { facts: [fact("level", "arrow-up-down", pct$1(position))] },
101769
+ ...position === null ? {} : { tiles: { left: [{
101770
+ label: require_sleep.t("Opening", "Apertura"),
101771
+ value: pct$1(position)
101772
+ }] } },
101192
101773
  scene: {
101193
101774
  ...words.mode === null ? {} : { mode: words.mode },
101194
101775
  ...position === null ? {} : { level: position / 100 }
101195
101776
  },
101196
- rows: [row$1(s.rowId, "arrow-up-down", joinText([words.title, position !== null && state !== "open" ? pct(position) : null]), controls)]
101777
+ rows: [row$1(s.rowId, "arrow-up-down", joinText([words.title, position !== null && state !== "open" ? pct$1(position) : null]), controls)]
101197
101778
  };
101198
101779
  }
101199
101780
  var ACTUATORS_FAMILY_CONTRIBUTIONS = {
@@ -101271,10 +101852,10 @@ var ACTUATORS_FAMILY_CONTRIBUTIONS = {
101271
101852
  const now = slice.currentHumidity;
101272
101853
  return {
101273
101854
  reading: reading("humidifier", state, false, title),
101274
- ...now === null ? {} : { facts: [fact("level", "droplets", pct(now), "info")] },
101855
+ ...now === null ? {} : { facts: [fact("level", "droplets", pct$1(now), "info")] },
101275
101856
  ...slice.targetHumidity === null ? {} : { tiles: { right: [{
101276
101857
  label: require_sleep.t("Target", "Obiettivo"),
101277
- value: pct(slice.targetHumidity)
101858
+ value: pct$1(slice.targetHumidity)
101278
101859
  }] } },
101279
101860
  ...now === null ? {} : { scene: { level: now / 100 } },
101280
101861
  rows: [row$1("humidifier", "droplets", joinText([title, slice.mode === null ? null : require_sleep.t(slice.mode, slice.mode)]), controls)]
@@ -101524,17 +102105,16 @@ var weatherContribution = contribution("weather", WeatherStatusSchema, (slice, c
101524
102105
  });
101525
102106
  var updateContribution = contribution("update", UpdateStatusSchema, (slice) => {
101526
102107
  if (slice === void 0) return { reading: reading("update", "unknown") };
101527
- const { currentVersion, availableVersion, inProgress, updatable } = slice;
102108
+ const { currentVersion, availableVersion, inProgress } = slice;
101528
102109
  const pending = availableVersion !== null && availableVersion !== "" && availableVersion !== currentVersion;
101529
102110
  if (!pending && currentVersion === null && !inProgress) return { reading: reading("update", "unknown") };
101530
102111
  const state = inProgress ? "running" : pending ? "standby" : "idle";
101531
102112
  const title = inProgress ? require_sleep.t("Updating", "Aggiornamento in corso") : pending ? require_sleep.t("Update available", "Aggiornamento disponibile") : require_sleep.t("Up to date", "Aggiornato");
101532
102113
  const versions = currentVersion === null ? pending ? require_sleep.t(`${availableVersion}`, `${availableVersion}`) : null : pending ? require_sleep.t(`${currentVersion} → ${availableVersion}`, `${currentVersion} → ${availableVersion}`) : require_sleep.t(`Version ${currentVersion}`, `Versione ${currentVersion}`);
101533
- const install = pending && updatable && !inProgress ? [asAction(action("update.install", require_sleep.t("Install", "Installa"), "download", "update", "installUpdate", {}, "primary", "install"))] : [];
101534
102114
  return {
101535
102115
  reading: reading("update", state, false, title),
101536
102116
  facts: versions === null ? [] : [fact("reading", "download", versions, pending ? "warning" : "muted")],
101537
- rows: [row$1("update", "download", versions, install)]
102117
+ rows: [row$1("update", "download", versions, [])]
101538
102118
  };
101539
102119
  });
101540
102120
  var imageContribution = contribution("image", ImageStatusSchema, (slice, ctx) => {
@@ -101644,6 +102224,33 @@ var ON_MODE_PREFERENCE = [
101644
102224
  "heat",
101645
102225
  "cool"
101646
102226
  ];
102227
+ var FAN_LABEL = {
102228
+ auto: require_sleep.t("Auto", "Auto"),
102229
+ quiet: require_sleep.t("Quiet", "Silenziosa"),
102230
+ low: require_sleep.t("Low", "Bassa"),
102231
+ medium: require_sleep.t("Medium", "Media"),
102232
+ high: require_sleep.t("High", "Alta"),
102233
+ turbo: require_sleep.t("Turbo", "Turbo"),
102234
+ off: require_sleep.t("Off", "Spenta")
102235
+ };
102236
+ /** A readable label for a fan speed name; an unknown one is shown as the device reported it. */
102237
+ function fanLabelOf(fan) {
102238
+ return FAN_LABEL[fan] ?? require_sleep.t(fan, fan);
102239
+ }
102240
+ /** Short labels for a segmented control: one word each, so the segments stay on a line. */
102241
+ var MODE_SEGMENT_LABEL = {
102242
+ off: require_sleep.t("Off", "Spento"),
102243
+ heat: require_sleep.t("Heat", "Caldo"),
102244
+ cool: require_sleep.t("Cool", "Freddo"),
102245
+ auto: require_sleep.t("Auto", "Auto"),
102246
+ heat_cool: require_sleep.t("Heat/Cool", "Caldo/Freddo"),
102247
+ fan_only: require_sleep.t("Fan", "Vent."),
102248
+ dry: require_sleep.t("Dry", "Deum.")
102249
+ };
102250
+ /** The segment label of every available HVAC mode, keyed by the mode value. */
102251
+ function modeLabelsOf(modes) {
102252
+ return Object.fromEntries(modes.map((m) => [m, MODE_SEGMENT_LABEL[m]]));
102253
+ }
101647
102254
  /** 22 -> "22", 22.3 -> "22.3": a trailing zero is noise on a thermostat. */
101648
102255
  function formatDegrees(value) {
101649
102256
  return `${Number(value.toFixed(1))}°`;
@@ -101710,11 +102317,11 @@ function rangeFrom(min, max, step) {
101710
102317
  * contribute, types never do (D14). A slice that is absent or does not parse is
101711
102318
  * "not answered": the state reads unknown, no row is drawn (D315, D393).
101712
102319
  */
101713
- var same = (text) => require_sleep.t(text, text);
101714
- function tile(en, it, value) {
102320
+ var same$1 = (text) => require_sleep.t(text, text);
102321
+ function tile$1(en, it, value) {
101715
102322
  return {
101716
102323
  label: require_sleep.t(en, it),
101717
- value: same(value)
102324
+ value: same$1(value)
101718
102325
  };
101719
102326
  }
101720
102327
  function setpointSlider(id, cap, method, valueArg, value, range) {
@@ -101749,18 +102356,19 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
101749
102356
  const status = climateStatusText(view);
101750
102357
  const facts = [];
101751
102358
  if (status !== null) facts.push(fact("climate", "thermometer", status));
101752
- if (view.humidity !== null) facts.push(fact("humidity", "droplets", same(`${Math.round(view.humidity)}%`)));
101753
- if (view.targetHumidity !== null) facts.push(fact("humidity", "droplets", same(`→ ${Math.round(view.targetHumidity)}%`)));
102359
+ if (view.humidity !== null) facts.push(fact("humidity", "droplets", same$1(`${Math.round(view.humidity)}%`)));
102360
+ if (view.targetHumidity !== null) facts.push(fact("humidity", "droplets", same$1(`→ ${Math.round(view.targetHumidity)}%`)));
101754
102361
  const left = [];
101755
102362
  const right = [];
101756
- if (view.measured !== null) left.push(tile("Indoor", "In casa", formatDegrees(view.measured)));
101757
- if (view.humidity !== null) left.push(tile("Humidity", "Umidità", `${Math.round(view.humidity)}%`));
102363
+ if (view.measured !== null) left.push(tile$1("Indoor", "In casa", formatDegrees(view.measured)));
102364
+ if (view.humidity !== null) left.push(tile$1("Humidity", "Umidità", `${Math.round(view.humidity)}%`));
101758
102365
  const modeControls = [{
101759
102366
  kind: "picker",
101760
102367
  id: "climate.mode",
101761
102368
  label: require_sleep.t("Mode", "Modalità"),
101762
102369
  current: view.mode,
101763
- options: [...view.availableModes],
102370
+ options: [...view.availableModes.filter((m) => m !== "off"), ...view.availableModes.filter((m) => m === "off")],
102371
+ optionLabels: modeLabelsOf(view.availableModes),
101764
102372
  call: {
101765
102373
  cap: "climate-control",
101766
102374
  method: "setMode",
@@ -101788,6 +102396,7 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
101788
102396
  label: require_sleep.t("Fan", "Ventola"),
101789
102397
  current: slice.fanMode === "" ? null : slice.fanMode,
101790
102398
  options: [...slice.availableFanModes],
102399
+ optionLabels: Object.fromEntries(slice.availableFanModes.map((m) => [m, fanLabelOf(m)])),
101791
102400
  call: {
101792
102401
  cap: "climate-control",
101793
102402
  method: "setFanMode",
@@ -101813,14 +102422,15 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
101813
102422
  if (fanControls.length > 0) rows.push({
101814
102423
  id: "climate-fan",
101815
102424
  icon: "fan",
101816
- status: slice.fanMode === "" ? null : same(slice.fanMode),
102425
+ status: slice.fanMode === "" ? null : same$1(slice.fanMode),
101817
102426
  controls: fanControls
101818
102427
  });
101819
- 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)));
102428
+ 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)));
101820
102429
  const sceneMode = view.sceneMode;
101821
102430
  return {
101822
102431
  reading: reading("climate-control", view.isOff ? "off" : "on"),
101823
102432
  title: view.modeLabel,
102433
+ ...view.isOff || slice.fanMode === "" ? {} : { caption: require_sleep.t(`${view.modeLabel.en} · fan ${fanLabelOf(slice.fanMode).en}`, `${view.modeLabel.it} · ventola ${fanLabelOf(slice.fanMode).it}`) },
101824
102434
  facts,
101825
102435
  ...left.length === 0 && right.length === 0 ? {} : { tiles: {
101826
102436
  left,
@@ -101847,7 +102457,7 @@ var WATER_ON_PREFERENCE = [
101847
102457
  "performance"
101848
102458
  ];
101849
102459
  function capitalised(word) {
101850
- return same(word.charAt(0).toUpperCase() + word.slice(1).replace(/_/g, " "));
102460
+ return same$1(word.charAt(0).toUpperCase() + word.slice(1).replace(/_/g, " "));
101851
102461
  }
101852
102462
  var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSchema, (slice) => {
101853
102463
  if (slice === void 0 || slice.operationMode === null) return { reading: reading("climate-control", "unknown") };
@@ -101884,13 +102494,13 @@ var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSche
101884
102494
  icon: "flame",
101885
102495
  status: label,
101886
102496
  controls: modeControls
101887
- }, ...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))];
102497
+ }, ...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))];
101888
102498
  const level = levelWithin(slice.targetTemp, range);
101889
102499
  return {
101890
102500
  reading: reading("climate-control", isOff ? "off" : "on"),
101891
102501
  title: label,
101892
102502
  facts: status === null ? [] : [fact("climate", "flame", status)],
101893
- ...slice.currentTemp === null ? {} : { tiles: { left: [tile("Water", "Acqua", formatDegrees(slice.currentTemp))] } },
102503
+ ...slice.currentTemp === null ? {} : { tiles: { left: [tile$1("Water", "Acqua", formatDegrees(slice.currentTemp))] } },
101894
102504
  scene: {
101895
102505
  ...isOff ? {} : { mode: "heat" },
101896
102506
  ...level === null ? {} : { level }
@@ -101908,11 +102518,12 @@ var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSche
101908
102518
  var heatingValveContribution = contribution("heating-valve", HeatingValveStatusSchema, (slice) => {
101909
102519
  const position = slice?.position ?? null;
101910
102520
  if (position === null) return { reading: reading("sensor", "unknown") };
101911
- const text = same(`${Math.round(position)}%`);
102521
+ const text = same$1(`${Math.round(position)}%`);
101912
102522
  return {
101913
102523
  reading: reading("sensor", position > 0 ? "running" : "idle"),
101914
102524
  facts: [fact("valve", "gauge", require_sleep.t(`Valve ${text.en}`, `Valvola ${text.it}`))],
101915
- tiles: { right: [tile("Valve", "Valvola", text.en)] },
102525
+ tiles: { right: [tile$1("Valve", "Valvola", text.en)] },
102526
+ ...position > 0 ? { caption: require_sleep.t(`Heating · valve ${text.en}`, `Riscalda · valvola ${text.it}`) } : {},
101916
102527
  scene: { level: position / 100 }
101917
102528
  };
101918
102529
  });
@@ -101921,9 +102532,9 @@ function sensorFragment(value, id, icon, en, it, text) {
101921
102532
  if (value === null) return { reading: reading("sensor", "unknown") };
101922
102533
  return {
101923
102534
  reading: reading("sensor", "on"),
101924
- title: same(text),
101925
- facts: [fact(id, icon, same(text))],
101926
- tiles: { right: [tile(en, it, text)] }
102535
+ title: same$1(text),
102536
+ facts: [fact(id, icon, same$1(text))],
102537
+ tiles: { right: [tile$1(en, it, text)] }
101927
102538
  };
101928
102539
  }
101929
102540
  var temperatureContribution = contribution("temperature-sensor", TemperatureSensorStatusSchema, (slice) => sensorFragment(slice?.temperature ?? null, "temperature", "thermometer", "Temperature", "Temperatura", formatDegrees(slice?.temperature ?? 0)));
@@ -101978,8 +102589,8 @@ var CLIMATE_FAMILY_CONTRIBUTIONS = {
101978
102589
  return {
101979
102590
  reading: reading("sensor", "on"),
101980
102591
  ...slice.aqi === void 0 ? {} : { title: airQualityWord(slice.aqi) },
101981
- facts: parts.map((p) => fact("air-quality", "wind", same(`${p.label} ${p.value}`))),
101982
- tiles: { right: parts.slice(0, 2).map((p) => tile(p.label, p.label, p.value)) }
102592
+ facts: parts.map((p) => fact("air-quality", "wind", same$1(`${p.label} ${p.value}`))),
102593
+ tiles: { right: parts.slice(0, 2).map((p) => tile$1(p.label, p.label, p.value)) }
101983
102594
  };
101984
102595
  }),
101985
102596
  "carbon-monoxide": contribution("carbon-monoxide", CarbonMonoxideStatusSchema, (slice) => {
@@ -101995,6 +102606,256 @@ var CLIMATE_FAMILY_CONTRIBUTIONS = {
101995
102606
  "enum-sensor": enumContribution
101996
102607
  };
101997
102608
  //#endregion
102609
+ //#region src/device/hero/hero-contributions-heat-pump.ts
102610
+ /**
102611
+ * The heat pump's contribution to a hero (D1026): the compressor scene, every
102612
+ * circuit as a row with its own label and icon, the powers as pills (the
102613
+ * instantaneous COP only when both powers are known) and a "System" group with
102614
+ * one selector per mode. Values and their limits come from the slice, which the
102615
+ * gateway filled: a selector with no allowed value is not drawn, a missing
102616
+ * reading is never a 0 (D393).
102617
+ */
102618
+ var CAP = "heat-pump-control";
102619
+ var same = (text) => require_sleep.t(text, text);
102620
+ /** The words of the values the gateway names; a value not listed is drawn as the gateway wrote it. */
102621
+ var VALUE_LABELS = {
102622
+ off: require_sleep.t("Off", "Off"),
102623
+ on: require_sleep.t("On", "On"),
102624
+ auto: require_sleep.t("Auto", "Auto"),
102625
+ manual: require_sleep.t("Manual", "Manuale"),
102626
+ low: require_sleep.t("Low", "Bassa"),
102627
+ high: require_sleep.t("High", "Alta"),
102628
+ eco: require_sleep.t("Eco", "Eco"),
102629
+ heat: require_sleep.t("Heat", "Caldo"),
102630
+ cool: require_sleep.t("Cool", "Freddo"),
102631
+ heatCool: require_sleep.t("Heat/cool", "Caldo/freddo"),
102632
+ ownprogram: require_sleep.t("Programme", "Programma")
102633
+ };
102634
+ function valueLabel(value) {
102635
+ const known = VALUE_LABELS[value];
102636
+ if (known !== void 0) return known;
102637
+ const holiday = /^hm(\d+)$/.exec(value);
102638
+ if (holiday?.[1] !== void 0) return require_sleep.t(`Programme ${holiday[1]}`, `Programma ${holiday[1]}`);
102639
+ return same(value);
102640
+ }
102641
+ function optionLabels(allowed) {
102642
+ return Object.fromEntries(allowed.map((value) => [value, valueLabel(value)]));
102643
+ }
102644
+ function picker(id, label, setting, method, args, valueArg = "mode") {
102645
+ return {
102646
+ kind: "picker",
102647
+ id,
102648
+ label,
102649
+ current: setting.value,
102650
+ options: [...setting.allowed],
102651
+ optionLabels: optionLabels(setting.allowed),
102652
+ call: {
102653
+ cap: CAP,
102654
+ method,
102655
+ args: { ...args }
102656
+ },
102657
+ valueArg
102658
+ };
102659
+ }
102660
+ /** A selector exists only where the gateway named values to choose from. */
102661
+ function choosable(setting) {
102662
+ return setting !== null && setting.allowed.length > 0;
102663
+ }
102664
+ function circuitControl(circuit) {
102665
+ const args = { circuitId: circuit.id };
102666
+ if (circuit.kind === "dhw" && choosable(circuit.temperatureLevel)) return picker(`heat-pump.${circuit.id}.level`, require_sleep.t("Level", "Livello"), circuit.temperatureLevel, "setDhwTemperatureLevel", args, "level");
102667
+ if (!choosable(circuit.operationMode)) return null;
102668
+ const method = circuit.kind === "dhw" ? "setDhwOperationMode" : "setCircuitOperationMode";
102669
+ return picker(`heat-pump.${circuit.id}.mode`, require_sleep.t("Mode", "Modalità"), circuit.operationMode, method, args);
102670
+ }
102671
+ /** A circuit with no reading is still a row: it shows that nothing is known, not nothing. */
102672
+ var UNKNOWN_STATUS = same("—");
102673
+ function circuitRow(circuit) {
102674
+ const control = circuitControl(circuit);
102675
+ const status = thermalStatusText(circuit.targetTemp, circuit.currentTemp) ?? UNKNOWN_STATUS;
102676
+ return {
102677
+ id: "circuit",
102678
+ label: same(circuit.label),
102679
+ icon: circuit.icon,
102680
+ status,
102681
+ controls: control === null ? [] : [control]
102682
+ };
102683
+ }
102684
+ var kilowatts = (watts) => `${Number((watts / 1e3).toFixed(2))} kW`;
102685
+ function powerPills(status) {
102686
+ const { thermalW, electricalW } = status.power;
102687
+ const cop = heatPumpInstantCop(status.power);
102688
+ const pills = [];
102689
+ if (thermalW !== null) pills.push({
102690
+ icon: "flame",
102691
+ text: require_sleep.t(`Thermal ${kilowatts(thermalW)}`, `Termica ${kilowatts(thermalW)}`),
102692
+ tone: "muted"
102693
+ });
102694
+ if (electricalW !== null) pills.push({
102695
+ icon: "zap",
102696
+ text: require_sleep.t(`Electrical ${kilowatts(electricalW)}`, `Elettrica ${kilowatts(electricalW)}`),
102697
+ tone: "muted"
102698
+ });
102699
+ if (cop !== null) {
102700
+ const text = String(Number(cop.toFixed(1)));
102701
+ pills.push({
102702
+ icon: "gauge",
102703
+ text: require_sleep.t(`Instantaneous COP ${text}`, `COP istantaneo ${text}`),
102704
+ tone: "success"
102705
+ });
102706
+ }
102707
+ return pills;
102708
+ }
102709
+ /** The independent system modes, in the order the card draws them. */
102710
+ var SYSTEM_MODES = [
102711
+ {
102712
+ key: "silent",
102713
+ label: require_sleep.t("Silent", "Silenzioso"),
102714
+ icon: "volume-x",
102715
+ method: "setSilentMode"
102716
+ },
102717
+ {
102718
+ key: "away",
102719
+ label: require_sleep.t("Away", "Assente"),
102720
+ icon: "plane",
102721
+ method: "setAwayMode"
102722
+ },
102723
+ {
102724
+ key: "additionalHeater",
102725
+ label: require_sleep.t("Additional heater", "Riscaldatore aggiuntivo"),
102726
+ icon: "flame",
102727
+ method: "setAdditionalHeaterMode"
102728
+ },
102729
+ {
102730
+ key: "holiday",
102731
+ label: require_sleep.t("Holiday", "Vacanza"),
102732
+ icon: "tree-palm",
102733
+ method: "setHolidayMode"
102734
+ }
102735
+ ];
102736
+ var SYSTEM_GROUP = require_sleep.t("System", "Sistema");
102737
+ var PROGRAMME = /^hm\d+$/;
102738
+ /**
102739
+ * Holiday is two segments, off / programme. Choosing "programme" keeps the programme
102740
+ * that is set, else the first one the gateway allowed, so a write never leaves
102741
+ * `allowed`. The full hm1..hm8 pick is not in the hero (D1026). A holiday whose values
102742
+ * are not programmes keeps the plain selector.
102743
+ */
102744
+ function holidayRow(def, setting) {
102745
+ if (!setting.allowed.includes("off")) return null;
102746
+ const current = setting.value !== null && PROGRAMME.test(setting.value) ? setting.value : null;
102747
+ const programme = current ?? setting.allowed.find((v) => PROGRAMME.test(v));
102748
+ if (programme === void 0) return null;
102749
+ const control = picker("heat-pump.system.holiday", def.label, {
102750
+ value: setting.value,
102751
+ allowed: ["off", programme]
102752
+ }, def.method, {});
102753
+ const number = programme.slice(2);
102754
+ return {
102755
+ id: "system-mode",
102756
+ label: def.label,
102757
+ group: SYSTEM_GROUP,
102758
+ icon: def.icon,
102759
+ status: current === null ? null : require_sleep.t(`Programme ${number}`, `Programma ${number}`),
102760
+ controls: [control.kind === "picker" ? {
102761
+ ...control,
102762
+ optionLabels: {
102763
+ off: require_sleep.t("Off", "Off"),
102764
+ [programme]: require_sleep.t("Programme", "Programma")
102765
+ }
102766
+ } : control]
102767
+ };
102768
+ }
102769
+ function systemRows(status) {
102770
+ const rows = [];
102771
+ for (const def of SYSTEM_MODES) {
102772
+ const setting = status.system[def.key];
102773
+ if (!choosable(setting)) continue;
102774
+ if (def.key === "holiday") {
102775
+ const holiday = holidayRow(def, setting);
102776
+ if (holiday !== null) {
102777
+ rows.push(holiday);
102778
+ continue;
102779
+ }
102780
+ }
102781
+ rows.push({
102782
+ id: "system-mode",
102783
+ label: def.label,
102784
+ group: SYSTEM_GROUP,
102785
+ icon: def.icon,
102786
+ status: null,
102787
+ controls: [picker(`heat-pump.system.${def.key}`, def.label, setting, def.method, {})]
102788
+ });
102789
+ }
102790
+ return rows;
102791
+ }
102792
+ function tile(en, it, value) {
102793
+ return {
102794
+ label: require_sleep.t(en, it),
102795
+ value: same(value)
102796
+ };
102797
+ }
102798
+ function tilesOf$1(status) {
102799
+ const { supply, return: back, outdoor } = status.temperatures;
102800
+ const left = [];
102801
+ const right = [];
102802
+ if (supply !== null) left.push(tile("Supply", "Mandata", formatDegrees(supply)));
102803
+ if (back !== null) left.push(tile("Return", "Ritorno", formatDegrees(back)));
102804
+ if (outdoor !== null) right.push(tile("Outdoor", "Esterna", formatDegrees(outdoor)));
102805
+ if (status.waterPressureBar !== null) right.push(tile("Pressure", "Pressione", `${Number(status.waterPressureBar.toFixed(1))} bar`));
102806
+ return {
102807
+ left,
102808
+ right
102809
+ };
102810
+ }
102811
+ function isRunning(status) {
102812
+ const { compressorPct, electricalW } = status.power;
102813
+ if (compressorPct !== null) return compressorPct > 0;
102814
+ if (electricalW !== null) return electricalW > 0;
102815
+ return null;
102816
+ }
102817
+ var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pump-status", HeatPumpStatusSchema, (slice) => {
102818
+ if (slice === void 0) return { reading: reading("climate-control", "unknown") };
102819
+ const running = isRunning(slice);
102820
+ const facts = [];
102821
+ if (slice.power.electricalW !== null) facts.push(fact("power", "zap", same(`${Math.round(slice.power.electricalW)} W`)));
102822
+ if (slice.power.compressorPct !== null) facts.push(fact("level", "gauge", require_sleep.t(`Compressor ${Math.round(slice.power.compressorPct)} %`, `Compressore ${Math.round(slice.power.compressorPct)} %`)));
102823
+ const charging = slice.circuits.find((c) => c.active === true);
102824
+ const tiles = tilesOf$1(slice);
102825
+ const pills = powerPills(slice);
102826
+ const rows = [
102827
+ ...slice.circuits.map(circuitRow),
102828
+ ...pills.length === 0 ? [] : [{
102829
+ id: "heat-pump-power",
102830
+ icon: "zap",
102831
+ status: null,
102832
+ controls: [],
102833
+ pills: [...pills]
102834
+ }],
102835
+ ...systemRows(slice)
102836
+ ];
102837
+ return {
102838
+ reading: reading("climate-control", running === true ? "running" : running === false ? "idle" : "on"),
102839
+ title: require_sleep.t("Heat pump", "Pompa di calore"),
102840
+ ...charging === void 0 ? {} : { caption: require_sleep.t(`${charging.label} · heating`.toUpperCase(), `${charging.label} · in riscaldamento`.toUpperCase()) },
102841
+ facts,
102842
+ ...tiles.left.length === 0 && tiles.right.length === 0 ? {} : { tiles },
102843
+ ...slice.power.electricalW === null ? {} : { consumption: {
102844
+ priority: 1,
102845
+ slot: {
102846
+ kind: "power",
102847
+ watts: slice.power.electricalW,
102848
+ detail: slice.power.thermalW === null ? [] : [{
102849
+ label: require_sleep.t("Thermal", "Termica"),
102850
+ value: Math.round(slice.power.thermalW),
102851
+ unit: "W"
102852
+ }]
102853
+ }
102854
+ } },
102855
+ rows
102856
+ };
102857
+ }) };
102858
+ //#endregion
101998
102859
  //#region src/device/hero/media-player-view.ts
101999
102860
  /** The position to show at `nowMs`: the reported one, advanced while playing when it is stamped. */
102000
102861
  function projectedPositionMs(status, nowMs) {
@@ -102204,6 +103065,13 @@ function minutesLeft(seconds) {
102204
103065
  const m = Math.ceil(seconds / 60);
102205
103066
  return require_sleep.t(`${m} min left`, `${m} min rimanenti`);
102206
103067
  }
103068
+ /** A time left as a tile reads it: "38 min", "1 h 12". */
103069
+ function durationText(seconds) {
103070
+ const m = Math.ceil(seconds / 60);
103071
+ if (m < 60) return require_sleep.t(`${m} min`, `${m} min`);
103072
+ const text = `${Math.floor(m / 60)} h ${String(m % 60).padStart(2, "0")}`;
103073
+ return require_sleep.t(text, text);
103074
+ }
102207
103075
  function deviceTypeOf(type) {
102208
103076
  return Object.values(require_device_type.DeviceType).find((t) => t === type);
102209
103077
  }
@@ -102220,7 +103088,7 @@ var switchContribution = contribution("switch", SwitchStatusSchema, (slice) => {
102220
103088
  }
102221
103089
  };
102222
103090
  });
102223
- var runningStateContribution = contribution("running-state", RunningStateStatusSchema, (slice) => {
103091
+ var runningStateContribution = contribution("running-state", RunningStateStatusSchema, (slice, ctx) => {
102224
103092
  const running = slice?.running ?? null;
102225
103093
  const phase = slice?.phase ?? null;
102226
103094
  const detail = [];
@@ -102234,13 +103102,6 @@ var runningStateContribution = contribution("running-state", RunningStateStatusS
102234
103102
  value: phase,
102235
103103
  unit: null
102236
103104
  });
102237
- const head = running === null ? require_sleep.t("Unknown", "Sconosciuto") : running ? require_sleep.t("Running", "In funzione") : require_sleep.t("Idle", "Inattivo");
102238
- const row = {
102239
- id: "cycle",
102240
- icon: "activity",
102241
- status: phase === null || running !== true ? head : require_sleep.t(`${head.en} · ${phase}`, `${head.it} · ${phase}`),
102242
- controls: []
102243
- };
102244
103105
  return {
102245
103106
  reading: reading("running-state", running === null ? "unknown" : running ? "running" : "idle"),
102246
103107
  consumption: {
@@ -102253,8 +103114,17 @@ var runningStateContribution = contribution("running-state", RunningStateStatusS
102253
103114
  detail
102254
103115
  }
102255
103116
  },
102256
- rows: [row],
102257
- ...phase !== null && running === true ? { facts: [fact("phase", "activity", require_sleep.t(phase, phase), "primary")] } : {}
103117
+ ...phase !== null && running === true ? { facts: [fact("phase", "activity", require_sleep.t(phase, phase), "primary")] } : {},
103118
+ ...running === true && (phase !== null || slice?.since != null) ? { tiles: {
103119
+ ...phase === null ? {} : { left: [{
103120
+ label: require_sleep.t("Phase", "Fase"),
103121
+ value: require_sleep.t(phase, phase)
103122
+ }] },
103123
+ ...slice?.since == null || elapsedText(slice.since, ctx.now) === null ? {} : { right: [{
103124
+ label: require_sleep.t("Started", "Avviata"),
103125
+ value: elapsedText(slice.since, ctx.now) ?? require_sleep.t("", "")
103126
+ }] }
103127
+ } } : {}
102258
103128
  };
102259
103129
  });
102260
103130
  var powerMeterContribution = contribution("power-meter", PowerMeterStatusSchema, (slice) => {
@@ -102287,6 +103157,7 @@ var powerMeterContribution = contribution("power-meter", PowerMeterStatusSchema,
102287
103157
  }
102288
103158
  },
102289
103159
  facts: [fact("power", "zap", text, watts > 0 ? "primary" : "muted")],
103160
+ tilesFallback: true,
102290
103161
  tiles: {
102291
103162
  right: [{
102292
103163
  label: require_sleep.t("Power", "Potenza"),
@@ -102317,6 +103188,7 @@ var batteryContribution = contribution("battery", BatteryStatusSchema, (slice) =
102317
103188
  badges: [badge],
102318
103189
  ...level === null ? {} : {
102319
103190
  facts: [fact("battery", "battery", badge.label, badge.tone)],
103191
+ tilesFallback: true,
102320
103192
  tiles: { left: [{
102321
103193
  label: require_sleep.t("Battery", "Batteria"),
102322
103194
  value: require_sleep.t(`${level}%`, `${level}%`),
@@ -102370,6 +103242,14 @@ var motionTriggerContribution = contribution("motion-trigger", MotionTriggerStat
102370
103242
  controls: [toggle]
102371
103243
  }] };
102372
103244
  });
103245
+ /** The armed run's length: "Timer 25 min". */
103246
+ function timerTile(quickRun) {
103247
+ const text = `${quickRun.duration} ${quickRun.unit}`;
103248
+ return {
103249
+ label: require_sleep.t("Timer", "Timer"),
103250
+ value: require_sleep.t(text, text)
103251
+ };
103252
+ }
102373
103253
  var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slice, ctx) => {
102374
103254
  const type = deviceTypeOf(ctx.type);
102375
103255
  const limit = type === void 0 ? void 0 : TIMED_RUN_LIMITS[type];
@@ -102390,6 +103270,7 @@ var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slic
102390
103270
  status: activeUntil === null ? require_sleep.t(`Run for ${quickRun.duration} ${quickRun.unit}`, `Avvia per ${quickRun.duration} ${quickRun.unit}`) : require_sleep.t(`Stops in ${left} min`, `Si ferma tra ${left} min`),
102391
103271
  controls: activeUntil === null ? [asAction(run)] : [asAction(cancel), asAction(restart)]
102392
103272
  };
103273
+ const armed = activeUntil === null ? {} : { right: [timerTile(quickRun)] };
102393
103274
  return {
102394
103275
  timedRun: {
102395
103276
  activeUntil,
@@ -102397,7 +103278,9 @@ var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slic
102397
103278
  run,
102398
103279
  cancel
102399
103280
  },
102400
- rows: [row]
103281
+ rows: [row],
103282
+ tilesFallback: true,
103283
+ tiles: armed
102401
103284
  };
102402
103285
  });
102403
103286
  var powerSourceContribution = contribution("power-source", PowerSourceStateSchema, (slice, ctx) => ({ powerSupply: {
@@ -102438,15 +103321,43 @@ var consumablesContribution = contribution("consumables", ConsumablesStatusSchem
102438
103321
  ...attention === 0 ? {} : { facts: [fact("consumables", null, require_sleep.t(`${attention} to check`, `${attention} da controllare`), "warning")] }
102439
103322
  };
102440
103323
  });
102441
- var dishwasherContribution = contribution("dishwasher", DishwasherStatusSchema, (slice) => {
103324
+ var pct = (n) => require_sleep.t(`${Math.round(n)}%`, `${Math.round(n)}%`);
103325
+ var dishCycle = (id, en, it, icon, method, emphasis = "normal") => asAction(action(`cycle.${id}`, require_sleep.t(en, it), icon, "dishwasher", method, {}, emphasis));
103326
+ /** Pause / resume / stop, per what the appliance is doing; nothing while it is not running. */
103327
+ function dishwasherCycleControls(state) {
103328
+ if (state === "running") return [dishCycle("pause", "Pause", "Pausa", "pause", "pause"), dishCycle("stop", "Stop", "Stop", "square", "stop")];
103329
+ if (state === "paused") return [dishCycle("resume", "Resume", "Riprendi", "play", "resume", "primary"), dishCycle("stop", "Stop", "Stop", "square", "stop")];
103330
+ return [];
103331
+ }
103332
+ var OPERATION_WORDS = {
103333
+ Run: require_sleep.t("Running", "In corso"),
103334
+ Pause: require_sleep.t("Paused", "In pausa"),
103335
+ Finished: require_sleep.t("Finished", "Finito"),
103336
+ Ready: require_sleep.t("Ready", "Pronta"),
103337
+ Inactive: require_sleep.t("Idle", "Inattiva"),
103338
+ DelayedStart: require_sleep.t("Delayed start", "Avvio ritardato"),
103339
+ ActionRequired: require_sleep.t("Action needed", "Serve un intervento"),
103340
+ Error: require_sleep.t("Error", "Errore"),
103341
+ Aborting: require_sleep.t("Stopping", "Arresto")
103342
+ };
103343
+ var dishwasherContribution = contribution("dishwasher", DishwasherStatusSchema, (slice, ctx) => {
102442
103344
  const state = slice === void 0 || slice.state === "unavailable" ? "unknown" : slice.state === "running" ? "running" : slice.state === "error" ? "alert" : "idle";
102443
- const stop = action("program.stop", require_sleep.t("Stop", "Ferma"), "square", "dishwasher", "stop");
102444
- const rows = [{
102445
- id: "program",
102446
- icon: "utensils",
102447
- status: slice?.remaining == null ? null : require_sleep.t(`${Math.ceil(slice.remaining / 60)} min left`, `${Math.ceil(slice.remaining / 60)} min rimanenti`),
102448
- controls: slice?.state === "running" ? [asAction(stop)] : []
102449
- }];
103345
+ const rows = [];
103346
+ const progress = slice?.progress ?? null;
103347
+ if (progress !== null) rows.push({
103348
+ id: "progress",
103349
+ icon: "activity",
103350
+ status: pct(progress),
103351
+ controls: [],
103352
+ progress: progress / 100
103353
+ });
103354
+ const cycle = dishwasherCycleControls(slice?.state);
103355
+ if (cycle.length > 0) rows.push({
103356
+ id: "cycle",
103357
+ icon: "activity",
103358
+ status: null,
103359
+ controls: cycle
103360
+ });
102450
103361
  if (slice?.powerOn != null) rows.push({
102451
103362
  id: "appliance-power",
102452
103363
  icon: "power",
@@ -102461,16 +103372,32 @@ var dishwasherContribution = contribution("dishwasher", DishwasherStatusSchema,
102461
103372
  }]
102462
103373
  });
102463
103374
  const remaining = slice?.remaining ?? null;
103375
+ const phase = slice?.operationState == null ? null : OPERATION_WORDS[slice.operationState] ?? null;
103376
+ const program = slice?.program ?? slice?.selectedProgram ?? null;
103377
+ const left = [...phase === null ? [] : [{
103378
+ label: require_sleep.t("Phase", "Fase"),
103379
+ value: phase
103380
+ }], ...program === null ? [] : [{
103381
+ label: require_sleep.t("Program", "Programma"),
103382
+ value: require_sleep.t(program, program)
103383
+ }]];
102464
103384
  return {
102465
103385
  reading: reading("dishwasher", state),
102466
103386
  rows,
102467
- ...remaining === null ? {} : {
102468
- facts: [fact("remaining", "timer", minutesLeft(remaining), "primary")],
102469
- tiles: { right: [{
102470
- label: require_sleep.t("Left", "Rimane"),
102471
- value: minutesLeft(remaining)
103387
+ ...remaining === null ? {} : { facts: [fact("remaining", "timer", minutesLeft(remaining), "primary")] },
103388
+ tiles: {
103389
+ left,
103390
+ ...remaining === null ? {} : { right: [{
103391
+ label: require_sleep.t("Ends", "Fine"),
103392
+ value: minutesLeft(remaining),
103393
+ tone: "warning",
103394
+ at: ctx.now + remaining * 1e3
103395
+ }, {
103396
+ label: require_sleep.t("Left", "Restano"),
103397
+ value: durationText(remaining)
102472
103398
  }] }
102473
- }
103399
+ },
103400
+ ...progress === null ? {} : { scene: { level: progress / 100 } }
102474
103401
  };
102475
103402
  });
102476
103403
  var has$1 = (ctx, f) => ctx.features.includes(f);
@@ -102528,6 +103455,44 @@ function volumeControls(view, volumeLevel, muted) {
102528
103455
  });
102529
103456
  return controls;
102530
103457
  }
103458
+ var clock = (ms) => {
103459
+ const total = Math.max(0, Math.floor(ms / 1e3));
103460
+ const h = Math.floor(total / 3600);
103461
+ const m = Math.floor(total % 3600 / 60);
103462
+ const sec = String(total % 60).padStart(2, "0");
103463
+ return h > 0 ? `${h}:${String(m).padStart(2, "0")}:${sec}` : `${m}:${sec}`;
103464
+ };
103465
+ var REPEAT_MODES = [
103466
+ "off",
103467
+ "all",
103468
+ "one"
103469
+ ];
103470
+ /** Shuffle and repeat, drawn only when the player declares them and reports a value. */
103471
+ function modeControls(view, shuffle, repeat) {
103472
+ const controls = [];
103473
+ if (view.shuffle) controls.push({
103474
+ kind: "toggle",
103475
+ id: "playback.shuffle",
103476
+ label: require_sleep.t("Shuffle", "Casuale"),
103477
+ on: shuffle,
103478
+ turnOn: action("playback.shuffle.on", require_sleep.t("Shuffle on", "Casuale attivo"), "shuffle", "media-player", "setShuffle", { shuffle: true }),
103479
+ turnOff: action("playback.shuffle.off", require_sleep.t("Shuffle off", "Casuale disattivo"), "shuffle", "media-player", "setShuffle", { shuffle: false })
103480
+ });
103481
+ if (view.repeat) controls.push({
103482
+ kind: "picker",
103483
+ id: "playback.repeat",
103484
+ label: require_sleep.t("Repeat", "Ripeti"),
103485
+ current: repeat,
103486
+ options: [...REPEAT_MODES],
103487
+ call: {
103488
+ cap: "media-player",
103489
+ method: "setRepeat",
103490
+ args: {}
103491
+ },
103492
+ valueArg: "repeat"
103493
+ });
103494
+ return controls;
103495
+ }
102531
103496
  /** Every contributing cap, in the order their fragments are merged. */
102532
103497
  var HERO_CAP_CONTRIBUTIONS = [
102533
103498
  contribution("media-player", MediaPlayerStatusSchema, (slice, ctx) => {
@@ -102543,7 +103508,7 @@ var HERO_CAP_CONTRIBUTIONS = [
102543
103508
  controls: []
102544
103509
  });
102545
103510
  }
102546
- const playback = playbackControls(view, ctx);
103511
+ const playback = [...playbackControls(view, ctx), ...modeControls(view, slice?.shuffle ?? null, slice?.repeat ?? null)];
102547
103512
  if (playback.length > 0) rows.push({
102548
103513
  id: "playback",
102549
103514
  icon: "play",
@@ -102593,13 +103558,30 @@ var HERO_CAP_CONTRIBUTIONS = [
102593
103558
  const facts = [];
102594
103559
  if (sourceNow !== null) facts.push(fact("source", "radio", require_sleep.t(sourceNow, sourceNow)));
102595
103560
  if (volumeNow !== null) facts.push(fact("volume", "volume-2", require_sleep.t(`${volumeNow}%`, `${volumeNow}%`)));
103561
+ const duration = slice?.duration ?? null;
103562
+ const position = slice === void 0 ? null : projectedPositionMs(slice, ctx.now);
103563
+ if (position !== null && duration !== null && duration > 0) {
103564
+ const line = `${clock(position)} / ${clock(duration)}`;
103565
+ facts.push(fact("progress", "activity", require_sleep.t(line, line)));
103566
+ }
103567
+ const trackNow = slice?.currentMedia?.title ?? null;
103568
+ const mediaTiles = {
103569
+ left: [...trackNow === null ? [] : [{
103570
+ label: require_sleep.t("Track", "Brano"),
103571
+ value: require_sleep.t(trackNow, trackNow)
103572
+ }], ...sourceNow === null ? [] : [{
103573
+ label: require_sleep.t("Source", "Sorgente"),
103574
+ value: require_sleep.t(sourceNow, sourceNow)
103575
+ }]],
103576
+ right: volumeNow === null ? [] : [{
103577
+ label: require_sleep.t("Volume", "Volume"),
103578
+ value: require_sleep.t(`${volumeNow}%`, `${volumeNow}%`)
103579
+ }]
103580
+ };
102596
103581
  return {
102597
103582
  reading: mediaReading(view),
102598
103583
  facts,
102599
- ...volumeNow === null ? {} : { tiles: { right: [{
102600
- label: require_sleep.t("Volume", "Volume"),
102601
- value: require_sleep.t(`${volumeNow}%`, `${volumeNow}%`)
102602
- }] } },
103584
+ ...mediaTiles.left.length === 0 && mediaTiles.right.length === 0 ? {} : { tiles: mediaTiles },
102603
103585
  scene: {
102604
103586
  ...mode === null ? {} : { mode },
102605
103587
  ...volumeNow === null ? {} : { level: volumeNow / 100 }
@@ -102632,7 +103614,8 @@ var HERO_CAP_CONTRIBUTIONS = [
102632
103614
  ...Object.values(GROUPS_FAMILY_CONTRIBUTIONS),
102633
103615
  ...Object.values(ACTUATORS_FAMILY_CONTRIBUTIONS),
102634
103616
  ...Object.values(SENSORS_FAMILY_CONTRIBUTIONS),
102635
- ...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS)
103617
+ ...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
103618
+ ...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
102636
103619
  ];
102637
103620
  //#endregion
102638
103621
  //#region src/device/hero/hero-layout.ts
@@ -102657,9 +103640,10 @@ var MEDIA_PLAYER_LAYOUT = { rows: [
102657
103640
  "source",
102658
103641
  "do-not-disturb"
102659
103642
  ] };
102660
- var APPLIANCE_LAYOUT = { rows: ["cycle"] };
103643
+ var APPLIANCE_LAYOUT = { rows: ["progress", "cycle"] };
102661
103644
  /** Its Home Connect PowerState is a secondary row action, never the own-power slot. */
102662
103645
  var DISHWASHER_LAYOUT = { rows: [
103646
+ "progress",
102663
103647
  "cycle",
102664
103648
  "program",
102665
103649
  "appliance-power"
@@ -102669,11 +103653,17 @@ var CLIMATE_LAYOUT = { rows: [
102669
103653
  "climate-fan",
102670
103654
  "setpoint"
102671
103655
  ] };
103656
+ /** The circuits, then the power pills, then the System group, one row per mode (D1026). */
103657
+ var HEAT_PUMP_LAYOUT = { rows: [
103658
+ "circuit",
103659
+ "heat-pump-power",
103660
+ "system-mode"
103661
+ ] };
102672
103662
  var SWITCH_LAYOUT = { rows: ["motion-trigger"] };
102673
103663
  var LOCK_LAYOUT = { rows: ["lock"] };
102674
103664
  var ALARM_LAYOUT = { rows: ["alarm"] };
102675
103665
  var FAN_LAYOUT = { rows: ["fan"] };
102676
- var VACUUM_LAYOUT = { rows: ["vacuum"] };
103666
+ var VACUUM_LAYOUT = { rows: ["vacuum", "vacuum-suction"] };
102677
103667
  var MOWER_LAYOUT = { rows: ["mower"] };
102678
103668
  var FEEDER_LAYOUT = { rows: ["feeder"] };
102679
103669
  var FOUNTAIN_LAYOUT = { rows: ["fountain", "pump-cycle"] };
@@ -102712,6 +103702,7 @@ var HERO_LAYOUT_BY_TYPE = {
102712
103702
  [require_device_type.DeviceType.Valve]: VALVE_LAYOUT,
102713
103703
  [require_device_type.DeviceType.Humidifier]: HUMIDIFIER_LAYOUT,
102714
103704
  [require_device_type.DeviceType.WaterHeater]: CLIMATE_LAYOUT,
103705
+ [require_device_type.DeviceType.HeatPump]: HEAT_PUMP_LAYOUT,
102715
103706
  [require_device_type.DeviceType.Fan]: FAN_LAYOUT,
102716
103707
  [require_device_type.DeviceType.MediaPlayer]: MEDIA_PLAYER_LAYOUT,
102717
103708
  [require_device_type.DeviceType.AlarmPanel]: ALARM_LAYOUT,
@@ -103137,12 +104128,12 @@ var LOCK_LOOK = {
103137
104128
  standby: look("lock-open", "warning", "plain", "none"),
103138
104129
  off: look("lock-open", "muted", "plain", "none")
103139
104130
  };
103140
- /** The shield glows while armed, blinks red in alarm and goes quiet when disarmed. */
104131
+ /** The shield glows red while armed, blinks red in alarm and goes quiet when disarmed. */
103141
104132
  var ALARM_LOOK = {
103142
104133
  ...lookOf({
103143
104134
  icon: "shield-check",
103144
104135
  on: [
103145
- "success",
104136
+ "danger",
103146
104137
  "glow",
103147
104138
  "halo"
103148
104139
  ],
@@ -103387,6 +104378,22 @@ var WATER_HEATER_LOOK = lookOf({
103387
104378
  idle: INFO,
103388
104379
  standby: MUTED
103389
104380
  });
104381
+ var HEAT_PUMP_LOOK = lookOf({
104382
+ icon: "thermometer-sun",
104383
+ on: [
104384
+ "warning",
104385
+ "heat-rise",
104386
+ "rise"
104387
+ ],
104388
+ off: MUTED,
104389
+ running: [
104390
+ "warning",
104391
+ "heat-rise",
104392
+ "rise"
104393
+ ],
104394
+ idle: INFO,
104395
+ standby: MUTED
104396
+ });
103390
104397
  /** What a climate device draws while it is on, by mode: warm air rises, cold falls, drops dry, the fan spins. */
103391
104398
  var HERO_MODE_LOOK = {
103392
104399
  heat: look("flame", "warning", "heat-rise", "rise"),
@@ -103421,6 +104428,7 @@ var HERO_LOOK_BY_TYPE = {
103421
104428
  [require_device_type.DeviceType.Valve]: VALVE_LOOK,
103422
104429
  [require_device_type.DeviceType.Humidifier]: HUMIDIFIER_LOOK,
103423
104430
  [require_device_type.DeviceType.WaterHeater]: WATER_HEATER_LOOK,
104431
+ [require_device_type.DeviceType.HeatPump]: HEAT_PUMP_LOOK,
103424
104432
  [require_device_type.DeviceType.Fan]: FAN_LOOK,
103425
104433
  [require_device_type.DeviceType.MediaPlayer]: MEDIA_PLAYER_LOOK,
103426
104434
  [require_device_type.DeviceType.AlarmPanel]: ALARM_LOOK,
@@ -103672,7 +104680,19 @@ function consumptionOf(fragments) {
103672
104680
  return best === null ? null : best.slot;
103673
104681
  }
103674
104682
  function tilesOf(fragments, side) {
103675
- return fragments.flatMap((f) => f.tiles?.[side] ?? []).slice(0, 2);
104683
+ const own = fragments.filter((f) => f.tilesFallback !== true).flatMap((f) => f.tiles?.[side] ?? []);
104684
+ return (own.length > 0 ? own : fragments.filter((f) => f.tilesFallback === true).flatMap((f) => f.tiles?.[side] ?? [])).slice(0, 2);
104685
+ }
104686
+ /** The foot button that opens the history, named for what the device keeps. */
104687
+ function historyLabelOf(type) {
104688
+ switch (type) {
104689
+ case require_device_type.DeviceType.Washer:
104690
+ case require_device_type.DeviceType.Dryer:
104691
+ case require_device_type.DeviceType.Dishwasher: return require_sleep.t("Cycles", "Cicli");
104692
+ case require_device_type.DeviceType.PetFeeder: return require_sleep.t("Meals", "Pasti");
104693
+ case require_device_type.DeviceType.Lock: return require_sleep.t("Access", "Accessi");
104694
+ default: return require_sleep.t("History", "Storico");
104695
+ }
103676
104696
  }
103677
104697
  function sceneOf(role, type, fragments) {
103678
104698
  const parts = fragments.flatMap((f) => f.scene === void 0 ? [] : [f.scene]);
@@ -103716,20 +104736,27 @@ function buildHeroModel(input) {
103716
104736
  };
103717
104737
  const allRows = fragments.flatMap((f) => f.rows ?? []);
103718
104738
  const rows = resolveHeroLayout(device.type).rows.flatMap((id) => {
103719
- const row = allRows.find((r) => r.id === id);
103720
- return row === void 0 ? [] : [row];
104739
+ return allRows.filter((r) => r.id === id);
103721
104740
  });
103722
104741
  const ownPower = resolveOwnPower(fragments.flatMap((f) => f.ownPower === void 0 ? [] : [f.ownPower]));
103723
104742
  const timedRun = fragments.find((f) => f.timedRun !== void 0)?.timedRun ?? null;
103724
104743
  const powerSupply = fragments.find((f) => f.powerSupply !== void 0)?.powerSupply ?? null;
103725
104744
  const remote = fragments.find((f) => f.remote !== void 0)?.remote ?? null;
103726
- const badges = fragments.flatMap((f) => f.badges ?? []);
104745
+ const integration = device.integration?.trim() ?? "";
104746
+ const badges = [...integration === "" ? [] : [{
104747
+ id: "integration",
104748
+ icon: "plug",
104749
+ tone: "muted",
104750
+ value: null,
104751
+ label: require_sleep.t(integration, integration)
104752
+ }], ...fragments.flatMap((f) => f.badges ?? [])];
103727
104753
  const headline = state === "offline" || state === "unknown" ? void 0 : fragments.find((f) => f.title !== void 0)?.title;
103728
104754
  const facts = fragments.flatMap((f) => f.facts ?? []).filter((f) => headline === void 0 || f.text.en !== headline.en);
103729
104755
  const sideTiles = {
103730
104756
  left: tilesOf(fragments, "left"),
103731
104757
  right: tilesOf(fragments, "right")
103732
104758
  };
104759
+ const caption = state === "offline" || state === "unknown" ? void 0 : fragments.find((f) => f.caption !== void 0)?.caption;
103733
104760
  const gated = [];
103734
104761
  if (!input.access.canActuate) {
103735
104762
  if (ownPower !== null) gated.push("own-power");
@@ -103751,8 +104778,10 @@ function buildHeroModel(input) {
103751
104778
  facts,
103752
104779
  sideTiles,
103753
104780
  title: headline ?? title,
104781
+ ...caption === void 0 ? {} : { caption },
103754
104782
  badges,
103755
104783
  remote,
104784
+ historyLabel: historyLabelOf(device.type),
103756
104785
  consumables: fragments.find((f) => f.consumables !== void 0)?.consumables ?? null,
103757
104786
  consumption: consumptionOf(fragments),
103758
104787
  ownPower,
@@ -103821,6 +104850,7 @@ var HERO_CAP_COVERAGE = {
103821
104850
  "group-active": "contributes",
103822
104851
  "group-commands": "contributes",
103823
104852
  "group-status": "contributes",
104853
+ "heat-pump-status": "contributes",
103824
104854
  "heating-valve": "contributes",
103825
104855
  humidifier: "contributes",
103826
104856
  "humidity-sensor": "contributes",
@@ -107378,6 +108408,111 @@ var METHOD_ACCESS_MAP = Object.freeze({
107378
108408
  access: "view",
107379
108409
  role: "viewer"
107380
108410
  },
108411
+ "heatPumpControl.setAdditionalHeaterMode": {
108412
+ capName: "heat-pump-control",
108413
+ capScope: "device",
108414
+ addonId: null,
108415
+ access: "create",
108416
+ role: "viewer"
108417
+ },
108418
+ "heatPumpControl.setAwayMode": {
108419
+ capName: "heat-pump-control",
108420
+ capScope: "device",
108421
+ addonId: null,
108422
+ access: "create",
108423
+ role: "viewer"
108424
+ },
108425
+ "heatPumpControl.setCircuitComfortSetpoint": {
108426
+ capName: "heat-pump-control",
108427
+ capScope: "device",
108428
+ addonId: null,
108429
+ access: "create",
108430
+ role: "viewer"
108431
+ },
108432
+ "heatPumpControl.setCircuitEcoSetpoint": {
108433
+ capName: "heat-pump-control",
108434
+ capScope: "device",
108435
+ addonId: null,
108436
+ access: "create",
108437
+ role: "viewer"
108438
+ },
108439
+ "heatPumpControl.setCircuitHeatCoolMode": {
108440
+ capName: "heat-pump-control",
108441
+ capScope: "device",
108442
+ addonId: null,
108443
+ access: "create",
108444
+ role: "viewer"
108445
+ },
108446
+ "heatPumpControl.setCircuitMaxFlowTemp": {
108447
+ capName: "heat-pump-control",
108448
+ capScope: "device",
108449
+ addonId: null,
108450
+ access: "create",
108451
+ role: "viewer"
108452
+ },
108453
+ "heatPumpControl.setCircuitOperationMode": {
108454
+ capName: "heat-pump-control",
108455
+ capScope: "device",
108456
+ addonId: null,
108457
+ access: "create",
108458
+ role: "viewer"
108459
+ },
108460
+ "heatPumpControl.setCircuitSummerWinter": {
108461
+ capName: "heat-pump-control",
108462
+ capScope: "device",
108463
+ addonId: null,
108464
+ access: "create",
108465
+ role: "viewer"
108466
+ },
108467
+ "heatPumpControl.setDhwChargeDuration": {
108468
+ capName: "heat-pump-control",
108469
+ capScope: "device",
108470
+ addonId: null,
108471
+ access: "create",
108472
+ role: "viewer"
108473
+ },
108474
+ "heatPumpControl.setDhwOperationMode": {
108475
+ capName: "heat-pump-control",
108476
+ capScope: "device",
108477
+ addonId: null,
108478
+ access: "create",
108479
+ role: "viewer"
108480
+ },
108481
+ "heatPumpControl.setDhwTemperatureLevel": {
108482
+ capName: "heat-pump-control",
108483
+ capScope: "device",
108484
+ addonId: null,
108485
+ access: "create",
108486
+ role: "viewer"
108487
+ },
108488
+ "heatPumpControl.setHolidayMode": {
108489
+ capName: "heat-pump-control",
108490
+ capScope: "device",
108491
+ addonId: null,
108492
+ access: "create",
108493
+ role: "viewer"
108494
+ },
108495
+ "heatPumpControl.setSilentMode": {
108496
+ capName: "heat-pump-control",
108497
+ capScope: "device",
108498
+ addonId: null,
108499
+ access: "create",
108500
+ role: "viewer"
108501
+ },
108502
+ "heatPumpControl.startExtraHotWater": {
108503
+ capName: "heat-pump-control",
108504
+ capScope: "device",
108505
+ addonId: null,
108506
+ access: "create",
108507
+ role: "viewer"
108508
+ },
108509
+ "heatPumpStatus.getStatus": {
108510
+ capName: "heat-pump-status",
108511
+ capScope: "device",
108512
+ addonId: null,
108513
+ access: "view",
108514
+ role: "viewer"
108515
+ },
107381
108516
  "heroLayout.getHeroModel": {
107382
108517
  capName: "hero-layout",
107383
108518
  capScope: "system",
@@ -114261,6 +115396,8 @@ var KNOWN_CAP_NAMES = [
114261
115396
  "group-active",
114262
115397
  "group-commands",
114263
115398
  "group-status",
115399
+ "heat-pump-control",
115400
+ "heat-pump-status",
114264
115401
  "heating-valve",
114265
115402
  "hero-layout",
114266
115403
  "humidifier",
@@ -114428,6 +115565,8 @@ var DEVICE_CAP_NAMES = [
114428
115565
  "group-active",
114429
115566
  "group-commands",
114430
115567
  "group-status",
115568
+ "heat-pump-control",
115569
+ "heat-pump-status",
114431
115570
  "heating-valve",
114432
115571
  "humidifier",
114433
115572
  "humidity-sensor",
@@ -114725,6 +115864,7 @@ var DEVICE_TYPE_DO_CAPS = {
114725
115864
  [require_device_type.DeviceType.Valve]: ["valve"],
114726
115865
  [require_device_type.DeviceType.Humidifier]: ["humidifier"],
114727
115866
  [require_device_type.DeviceType.WaterHeater]: ["water-heater"],
115867
+ [require_device_type.DeviceType.HeatPump]: ["heat-pump-control"],
114728
115868
  [require_device_type.DeviceType.Fan]: ["fan-control", "switch"],
114729
115869
  [require_device_type.DeviceType.MediaPlayer]: ["media-player"],
114730
115870
  [require_device_type.DeviceType.AlarmPanel]: ["alarm-panel"],
@@ -114764,7 +115904,8 @@ function deviceDoFamily(type) {
114764
115904
  case require_device_type.DeviceType.Climate:
114765
115905
  case require_device_type.DeviceType.Thermostat:
114766
115906
  case require_device_type.DeviceType.Humidifier:
114767
- case require_device_type.DeviceType.WaterHeater: return "climate-family";
115907
+ case require_device_type.DeviceType.WaterHeater:
115908
+ case require_device_type.DeviceType.HeatPump: return "climate-family";
114768
115909
  case require_device_type.DeviceType.Cover:
114769
115910
  case require_device_type.DeviceType.Valve: return "cover-family";
114770
115911
  case require_device_type.DeviceType.Switch:
@@ -116462,6 +117603,7 @@ var CAP_NAMES_WITH_STATUS = [
116462
117603
  "group-active",
116463
117604
  "group-commands",
116464
117605
  "group-status",
117606
+ "heat-pump-status",
116465
117607
  "heating-valve",
116466
117608
  "humidifier",
116467
117609
  "humidity-sensor",
@@ -117595,6 +118737,81 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
117595
118737
  form: "single",
117596
118738
  optional: false
117597
118739
  }],
118740
+ "heatPumpControl.setAdditionalHeaterMode": [{
118741
+ name: "deviceId",
118742
+ form: "single",
118743
+ optional: false
118744
+ }],
118745
+ "heatPumpControl.setAwayMode": [{
118746
+ name: "deviceId",
118747
+ form: "single",
118748
+ optional: false
118749
+ }],
118750
+ "heatPumpControl.setCircuitComfortSetpoint": [{
118751
+ name: "deviceId",
118752
+ form: "single",
118753
+ optional: false
118754
+ }],
118755
+ "heatPumpControl.setCircuitEcoSetpoint": [{
118756
+ name: "deviceId",
118757
+ form: "single",
118758
+ optional: false
118759
+ }],
118760
+ "heatPumpControl.setCircuitHeatCoolMode": [{
118761
+ name: "deviceId",
118762
+ form: "single",
118763
+ optional: false
118764
+ }],
118765
+ "heatPumpControl.setCircuitMaxFlowTemp": [{
118766
+ name: "deviceId",
118767
+ form: "single",
118768
+ optional: false
118769
+ }],
118770
+ "heatPumpControl.setCircuitOperationMode": [{
118771
+ name: "deviceId",
118772
+ form: "single",
118773
+ optional: false
118774
+ }],
118775
+ "heatPumpControl.setCircuitSummerWinter": [{
118776
+ name: "deviceId",
118777
+ form: "single",
118778
+ optional: false
118779
+ }],
118780
+ "heatPumpControl.setDhwChargeDuration": [{
118781
+ name: "deviceId",
118782
+ form: "single",
118783
+ optional: false
118784
+ }],
118785
+ "heatPumpControl.setDhwOperationMode": [{
118786
+ name: "deviceId",
118787
+ form: "single",
118788
+ optional: false
118789
+ }],
118790
+ "heatPumpControl.setDhwTemperatureLevel": [{
118791
+ name: "deviceId",
118792
+ form: "single",
118793
+ optional: false
118794
+ }],
118795
+ "heatPumpControl.setHolidayMode": [{
118796
+ name: "deviceId",
118797
+ form: "single",
118798
+ optional: false
118799
+ }],
118800
+ "heatPumpControl.setSilentMode": [{
118801
+ name: "deviceId",
118802
+ form: "single",
118803
+ optional: false
118804
+ }],
118805
+ "heatPumpControl.startExtraHotWater": [{
118806
+ name: "deviceId",
118807
+ form: "single",
118808
+ optional: false
118809
+ }],
118810
+ "heatPumpStatus.getStatus": [{
118811
+ name: "deviceId",
118812
+ form: "single",
118813
+ optional: false
118814
+ }],
117598
118815
  "heroLayout.getHeroModel": [{
117599
118816
  name: "deviceId",
117600
118817
  form: "single",
@@ -119786,7 +121003,7 @@ function getCapsByProviderKind(kind) {
119786
121003
  //#region src/generated/runtime-state-durability.ts
119787
121004
  /**
119788
121005
  * Per-cap runtime-state policy, projected from every `*.cap.ts` that declares
119789
- * `runtimeState`. 81 caps: 41 `restored`, 40 `session`.
121006
+ * `runtimeState`. 82 caps: 41 `restored`, 41 `session`.
119790
121007
  *
119791
121008
  * A cap absent from this map has no runtime-state slice at all. A cap PRESENT
119792
121009
  * with `durability: 'session'` has one and has decided not to keep it.
@@ -119921,6 +121138,10 @@ var RUNTIME_STATE_POLICY = {
119921
121138
  durability: "session",
119922
121139
  volatileFields: []
119923
121140
  },
121141
+ "heat-pump-status": {
121142
+ durability: "session",
121143
+ volatileFields: ["lastFetchedAt"]
121144
+ },
119924
121145
  "heating-valve": {
119925
121146
  durability: "session",
119926
121147
  volatileFields: ["lastFetchedAt"]
@@ -134095,6 +135316,7 @@ exports.HAP_AUDIO_BASE = HAP_AUDIO_BASE;
134095
135316
  exports.HAP_AUDIO_BITRATE_KBPS = HAP_AUDIO_BITRATE_KBPS;
134096
135317
  exports.HAP_AUDIO_VBV_KBITS = HAP_AUDIO_VBV_KBITS;
134097
135318
  exports.HAP_KEYFRAME_INTERVAL_SEC = HAP_KEYFRAME_INTERVAL_SEC;
135319
+ exports.HEAT_PUMP_CIRCUIT_KINDS = HEAT_PUMP_CIRCUIT_KINDS;
134098
135320
  exports.HERO_ANIMATIONS = HERO_ANIMATIONS;
134099
135321
  exports.HERO_BACKGROUNDS = HERO_BACKGROUNDS;
134100
135322
  exports.HERO_CAP_CONTRIBUTIONS = HERO_CAP_CONTRIBUTIONS;
@@ -134105,6 +135327,7 @@ exports.HERO_LOOK_BY_ROLE = HERO_LOOK_BY_ROLE;
134105
135327
  exports.HERO_LOOK_BY_TYPE = HERO_LOOK_BY_TYPE;
134106
135328
  exports.HERO_LOOK_DEFAULT = HERO_LOOK_DEFAULT;
134107
135329
  exports.HERO_ROW_IDS = HERO_ROW_IDS;
135330
+ exports.HERO_ROW_LABELS = HERO_ROW_LABELS;
134108
135331
  exports.HERO_ROW_MODELS_MAX = HERO_ROW_MODELS_MAX;
134109
135332
  exports.HERO_SCENES = HERO_SCENES;
134110
135333
  exports.HERO_SCENE_BY_ROLE = HERO_SCENE_BY_ROLE;
@@ -134134,6 +135357,15 @@ exports.HUB_VIEWER_MOUNT = HUB_VIEWER_MOUNT;
134134
135357
  exports.HWACCEL_OPTIONS = HWACCEL_OPTIONS;
134135
135358
  exports.HardwareClassIdSchema = HardwareClassIdSchema;
134136
135359
  exports.HealthStatusSchema = HealthStatusSchema;
135360
+ exports.HeatPumpCircuitKindSchema = HeatPumpCircuitKindSchema;
135361
+ exports.HeatPumpCircuitSchema = HeatPumpCircuitSchema;
135362
+ exports.HeatPumpEnergySchema = HeatPumpEnergySchema;
135363
+ exports.HeatPumpOptionSettingSchema = HeatPumpOptionSettingSchema;
135364
+ exports.HeatPumpPowerSchema = HeatPumpPowerSchema;
135365
+ exports.HeatPumpRangeSettingSchema = HeatPumpRangeSettingSchema;
135366
+ exports.HeatPumpStatusSchema = HeatPumpStatusSchema;
135367
+ exports.HeatPumpSystemSchema = HeatPumpSystemSchema;
135368
+ exports.HeatPumpTemperaturesSchema = HeatPumpTemperaturesSchema;
134137
135369
  exports.HeatingValveStatusSchema = HeatingValveStatusSchema;
134138
135370
  exports.HelperMemberSchema = require_composition.HelperMemberSchema;
134139
135371
  exports.HelperSpecSchema = require_composition.HelperSpecSchema;
@@ -136186,9 +137418,13 @@ exports.hasModelBoundOverrides = hasModelBoundOverrides;
136186
137418
  exports.hasMotionTrigger = hasMotionTrigger;
136187
137419
  exports.hasOwnRunningPowerDefaults = hasOwnRunningPowerDefaults;
136188
137420
  exports.hasUrlScheme = hasUrlScheme;
137421
+ exports.heatPumpControlCapability = heatPumpControlCapability;
137422
+ exports.heatPumpInstantCop = heatPumpInstantCop;
137423
+ exports.heatPumpStatusCapability = heatPumpStatusCapability;
136189
137424
  exports.heatingValveCapability = heatingValveCapability;
136190
137425
  exports.helperMembers = require_composition.helperMembers;
136191
137426
  exports.helperSaveProblems = helperSaveProblems;
137427
+ exports.heroArgsWithValue = heroArgsWithValue;
136192
137428
  exports.heroLayoutCapability = heroLayoutCapability;
136193
137429
  exports.heroText = require_sleep.t;
136194
137430
  exports.hfModelUrl = require_sleep.hfModelUrl;