@camstack/addon-provider-homematic 1.2.199 → 1.2.201

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/_stub.js +2 -2
  3. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-DDcL1t5T.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-BxV59wdC.mjs} +4 -4
  4. package/dist/_virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-skuvsVHe.mjs +26 -0
  5. package/dist/addon-provider-homematic.css +1 -1
  6. package/dist/addon.js +779 -197
  7. package/dist/addon.mjs +779 -197
  8. package/dist/{hostInit-C0MhIUdL.mjs → hostInit-CNluvxTs.mjs} +3 -3
  9. package/dist/remoteEntry.js +1 -1
  10. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-DKU9EFsI.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-6snx-90f.mjs} +1 -1
  11. package/dist/widgets/_stub.js +1 -1
  12. package/dist/widgets/{_virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_widgets-BZgCnc-f.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_widgets-DHK12kT3.mjs} +2 -2
  13. package/dist/widgets/_virtual_mf___mfe_internal__addon_provider_homematic_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DGJJvlsA.mjs +26 -0
  14. package/dist/widgets/{hostInit-Chcfw46X.mjs → hostInit-DTRrkNyS.mjs} +2 -2
  15. package/dist/widgets/remoteEntry.js +1 -1
  16. package/package.json +3 -3
  17. package/dist/_virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-JVtI9IQh.mjs +0 -26
  18. package/dist/widgets/_virtual_mf___mfe_internal__addon_provider_homematic_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BEMWyRfG.mjs +0 -26
package/dist/addon.js CHANGED
@@ -8,7 +8,7 @@ let crypto$1 = require("crypto");
8
8
  let fs_promises = require("fs/promises");
9
9
  let path = require("path");
10
10
  let node_os = require("node:os");
11
- //#region ../types/dist/event-category-Dv-Gcv1f.mjs
11
+ //#region ../types/dist/event-category-Dhcd0TRH.mjs
12
12
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
13
13
  EventCategory["SystemBoot"] = "system.boot";
14
14
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -282,6 +282,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
282
282
  EventCategory["StorageLocationCritical"] = "storage.location.critical";
283
283
  /** Recovery from low/critical on a storage location. */
284
284
  EventCategory["StorageLocationOk"] = "storage.location.ok";
285
+ /**
286
+ * A `drain` location's regular progress ping (#538) — location id + name,
287
+ * bytes remaining, the observed cede rate and the estimated empty date, or
288
+ * `null` fields when the occupancy read that sweep failed (D393: never
289
+ * folded to 0). Cadence is the named constant
290
+ * `DRAIN_PROGRESS_EVENT_INTERVAL_MS` (15 min) plus once on drain start — no
291
+ * operator knob. Telemetry (D8): a lost tick is a stale progress bar the
292
+ * next sweep corrects.
293
+ */
294
+ EventCategory["StorageDrainProgress"] = "storage.drain.progress";
295
+ /** Fires once when a draining location reaches zero evictable bytes. */
296
+ EventCategory["StorageDrainComplete"] = "storage.drain.complete";
285
297
  EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
286
298
  EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
287
299
  EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
@@ -6069,7 +6081,7 @@ var ZodIssueCode = {
6069
6081
  var ZodFirstPartyTypeKind;
6070
6082
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6071
6083
  //#endregion
6072
- //#region ../types/dist/sleep-B5XPl2YP.mjs
6084
+ //#region ../types/dist/sleep-DEd_klYQ.mjs
6073
6085
  /**
6074
6086
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6075
6087
  * window to float samples (D455).
@@ -13391,6 +13403,76 @@ var CAP_VOCABULARY_BY_NAME = {
13391
13403
  en: "Control",
13392
13404
  it: "Controllo"
13393
13405
  },
13406
+ actions: [
13407
+ {
13408
+ id: "select.next",
13409
+ method: "next",
13410
+ label: {
13411
+ en: "Next option",
13412
+ it: "Opzione successiva"
13413
+ },
13414
+ phrase: {
13415
+ en: "Select the next option on {device}",
13416
+ it: "Seleziona l’opzione successiva su {device}"
13417
+ },
13418
+ icon: "skip-forward",
13419
+ openArgs: [{
13420
+ key: "cycle",
13421
+ label: {
13422
+ en: "Wrap to the first option",
13423
+ it: "Ricomincia dalla prima opzione"
13424
+ },
13425
+ offer: { kind: "boolean" }
13426
+ }]
13427
+ },
13428
+ {
13429
+ id: "select.previous",
13430
+ method: "previous",
13431
+ label: {
13432
+ en: "Previous option",
13433
+ it: "Opzione precedente"
13434
+ },
13435
+ phrase: {
13436
+ en: "Select the previous option on {device}",
13437
+ it: "Seleziona l’opzione precedente su {device}"
13438
+ },
13439
+ icon: "skip-back",
13440
+ openArgs: [{
13441
+ key: "cycle",
13442
+ label: {
13443
+ en: "Wrap to the last option",
13444
+ it: "Ricomincia dall’ultima opzione"
13445
+ },
13446
+ offer: { kind: "boolean" }
13447
+ }]
13448
+ },
13449
+ {
13450
+ id: "select.first",
13451
+ method: "first",
13452
+ label: {
13453
+ en: "First option",
13454
+ it: "Prima opzione"
13455
+ },
13456
+ phrase: {
13457
+ en: "Select the first option on {device}",
13458
+ it: "Seleziona la prima opzione su {device}"
13459
+ },
13460
+ icon: "chevron-first"
13461
+ },
13462
+ {
13463
+ id: "select.last",
13464
+ method: "last",
13465
+ label: {
13466
+ en: "Last option",
13467
+ it: "Ultima opzione"
13468
+ },
13469
+ phrase: {
13470
+ en: "Select the last option on {device}",
13471
+ it: "Seleziona l’ultima opzione su {device}"
13472
+ },
13473
+ icon: "chevron-last"
13474
+ }
13475
+ ],
13394
13476
  notOperatorFacing: { setValue: "the value shape depends on the control kind (numeric / select / text / datetime) read from status; a typed picker for it is a follow-up of the automations rework" },
13395
13477
  state: [{
13396
13478
  kind: "value",
@@ -19900,6 +19982,18 @@ Object.freeze({
19900
19982
  "dry"
19901
19983
  ]
19902
19984
  },
19985
+ {
19986
+ "path": "action",
19987
+ "valueType": "enum",
19988
+ "enumValues": [
19989
+ "heating",
19990
+ "cooling",
19991
+ "drying",
19992
+ "fan",
19993
+ "idle",
19994
+ "off"
19995
+ ]
19996
+ },
19903
19997
  {
19904
19998
  "path": "fanMode",
19905
19999
  "valueType": "string"
@@ -47972,69 +48066,6 @@ function eventTypesOfVocabulary(vocabulary) {
47972
48066
  function findVocabularyEntry(vocabulary, eventType, sourceId) {
47973
48067
  return vocabulary.find((entry) => entry.id === eventType && entry.source?.id === sourceId);
47974
48068
  }
47975
- /**
47976
- * The link an automation made FROM a template carries (#527): which template,
47977
- * the values the operator filled in, and — when the template has since changed
47978
- * so that those values no longer fit — the problems that say why.
47979
- *
47980
- * It lives inside the recipe (`AutomationRecipe.template`), so the one row in
47981
- * `core_blocks` stays the one artefact: there is no second store of instances
47982
- * to drift from the blocks, and deleting the automation deletes the link.
47983
- * "Convert to a free automation" is dropping this field.
47984
- *
47985
- * This file depends on nothing in `recipe.ts`, so the recipe can embed it and
47986
- * the template engine (`template/automation-template.ts`) can import both.
47987
- */
47988
- /** An `event` input's value: the same three narrowing lists a `device-fired` row takes. */
47989
- var TemplateEventValueSchema = object({
47990
- eventIds: array(string().min(1)).min(1).max(64).optional(),
47991
- sourceIds: array(string().min(1)).min(1).max(64).optional(),
47992
- kinds: array(EventVocabularyKindSchema).min(1).optional()
47993
- }).refine((value) => value.eventIds !== void 0 || value.sourceIds !== void 0 || value.kinds !== void 0, { message: "an event names at least one event, part or kind" });
47994
- /** An `action` input's value: a vocabulary action and its open args. */
47995
- var TemplateActionValueSchema = object({
47996
- actionId: string().min(1),
47997
- args: record$1(string(), unknown()).optional()
47998
- });
47999
- /** The value of one non-group input. Which member is right is the input kind's to judge. */
48000
- var TemplateScalarValueSchema = union([
48001
- number$1(),
48002
- string(),
48003
- boolean(),
48004
- array(number$1().int().nonnegative()),
48005
- TemplateEventValueSchema,
48006
- TemplateActionValueSchema
48007
- ]);
48008
- var TemplateInputValueSchema = union([TemplateScalarValueSchema, array(record$1(string(), TemplateScalarValueSchema))]);
48009
- /** Input key → value. */
48010
- var TemplateInputValuesSchema = record$1(string(), TemplateInputValueSchema);
48011
- var TemplateInstanceProblemSchema = object({
48012
- code: _enum([
48013
- "missing-input",
48014
- "invalid-input",
48015
- "invalid-recipe",
48016
- "missing-template",
48017
- "edited-by-hand"
48018
- ]),
48019
- /** Dotted input address (`buttons.2.targets`); absent for a whole-recipe problem. */
48020
- input: string().optional(),
48021
- detail: string()
48022
- });
48023
- var AutomationTemplateLinkSchema = object({
48024
- templateId: string().min(1),
48025
- values: TemplateInputValuesSchema,
48026
- /**
48027
- * Fingerprint of the generated code with this literal blanked
48028
- * (`instanceCodeHash`), stamped by `generateAutomationBlock`. Code that no
48029
- * longer matches it was edited by hand, and is never regenerated over.
48030
- */
48031
- codeHash: string().optional(),
48032
- /**
48033
- * Present when the last re-expansion refused these values. The automation
48034
- * keeps running the body of its last good expansion; nothing is dropped.
48035
- */
48036
- problems: array(TemplateInstanceProblemSchema).min(1).optional()
48037
- });
48038
48069
  var ExpressionBindingSourceSchema = union([
48039
48070
  object({
48040
48071
  kind: literal("field").optional(),
@@ -48070,6 +48101,58 @@ object({
48070
48101
  path: ["expr"]
48071
48102
  });
48072
48103
  });
48104
+ Math.PI / 180;
48105
+ /**
48106
+ * WHEN something happens, as data (D983) — the one time vocabulary of the
48107
+ * scheduler and of an automation's schedule leaf. Three shapes, no cron:
48108
+ *
48109
+ * - `clock` — a wall-clock time every day (`07:30`), read in the site's zone;
48110
+ * - `sun` — a sun event (`sunrise`, `sunset`, `dawn`, `dusk`) plus or minus
48111
+ * up to twelve hours, from the site's coordinates;
48112
+ * - `date` — one local date and time (`2026-12-24T18:00`), once.
48113
+ *
48114
+ * A site is a place and its IANA zone ({@link TimeSite}). Every function here
48115
+ * is pure: the zone arithmetic uses `Intl`, no date library.
48116
+ *
48117
+ * Wall-clock honesty across a DST change: a local time that does not exist
48118
+ * (02:30 on the spring-forward day) happens at the first minute that does
48119
+ * (03:00); one that happens twice (02:30 on the fall-back day) happens at its
48120
+ * FIRST occurrence.
48121
+ */
48122
+ var SunEventSchema = _enum([
48123
+ "sunrise",
48124
+ "sunset",
48125
+ "dawn",
48126
+ "dusk"
48127
+ ]);
48128
+ var TimeSpecSchema = discriminatedUnion("kind", [
48129
+ object({
48130
+ kind: literal("clock"),
48131
+ hh: number$1().int().min(0).max(23),
48132
+ mm: number$1().int().min(0).max(59)
48133
+ }),
48134
+ object({
48135
+ kind: literal("sun"),
48136
+ event: SunEventSchema,
48137
+ /** Minutes after the event (negative: before). */
48138
+ offsetMin: number$1().int().min(-720).max(720)
48139
+ }),
48140
+ object({
48141
+ kind: literal("date"),
48142
+ /** `YYYY-MM-DDTHH:mm`, site-local. */
48143
+ local: string().regex(/^(\d{4}-\d{2}-\d{2})T([01]\d|2[0-3]):([0-5]\d)$/, "expected YYYY-MM-DDTHH:mm")
48144
+ })
48145
+ ]);
48146
+ /** A day of the week as a schedule names it. */
48147
+ var WeekdayKeySchema = _enum([
48148
+ "mon",
48149
+ "tue",
48150
+ "wed",
48151
+ "thu",
48152
+ "fri",
48153
+ "sat",
48154
+ "sun"
48155
+ ]);
48073
48156
  /**
48074
48157
  * Identity envelope for a device's upstream-system metadata.
48075
48158
  *
@@ -48462,58 +48545,6 @@ function macroOnly(macro) {
48462
48545
  };
48463
48546
  }
48464
48547
  }
48465
- Math.PI / 180;
48466
- /**
48467
- * WHEN something happens, as data (D983) — the one time vocabulary of the
48468
- * scheduler and of an automation's schedule leaf. Three shapes, no cron:
48469
- *
48470
- * - `clock` — a wall-clock time every day (`07:30`), read in the site's zone;
48471
- * - `sun` — a sun event (`sunrise`, `sunset`, `dawn`, `dusk`) plus or minus
48472
- * up to twelve hours, from the site's coordinates;
48473
- * - `date` — one local date and time (`2026-12-24T18:00`), once.
48474
- *
48475
- * A site is a place and its IANA zone ({@link TimeSite}). Every function here
48476
- * is pure: the zone arithmetic uses `Intl`, no date library.
48477
- *
48478
- * Wall-clock honesty across a DST change: a local time that does not exist
48479
- * (02:30 on the spring-forward day) happens at the first minute that does
48480
- * (03:00); one that happens twice (02:30 on the fall-back day) happens at its
48481
- * FIRST occurrence.
48482
- */
48483
- var SunEventSchema = _enum([
48484
- "sunrise",
48485
- "sunset",
48486
- "dawn",
48487
- "dusk"
48488
- ]);
48489
- var TimeSpecSchema = discriminatedUnion("kind", [
48490
- object({
48491
- kind: literal("clock"),
48492
- hh: number$1().int().min(0).max(23),
48493
- mm: number$1().int().min(0).max(59)
48494
- }),
48495
- object({
48496
- kind: literal("sun"),
48497
- event: SunEventSchema,
48498
- /** Minutes after the event (negative: before). */
48499
- offsetMin: number$1().int().min(-720).max(720)
48500
- }),
48501
- object({
48502
- kind: literal("date"),
48503
- /** `YYYY-MM-DDTHH:mm`, site-local. */
48504
- local: string().regex(/^(\d{4}-\d{2}-\d{2})T([01]\d|2[0-3]):([0-5]\d)$/, "expected YYYY-MM-DDTHH:mm")
48505
- })
48506
- ]);
48507
- /** A day of the week as a schedule names it. */
48508
- var WeekdayKeySchema = _enum([
48509
- "mon",
48510
- "tue",
48511
- "wed",
48512
- "thu",
48513
- "fri",
48514
- "sat",
48515
- "sun"
48516
- ]);
48517
48548
  /**
48518
48549
  * Hold semantics — "for N seconds" on a leaf of the `when` tree (#498).
48519
48550
  *
@@ -48770,24 +48801,33 @@ var StationaryPresentLeafSchema = object({
48770
48801
  * (`kind: 'date'`) is refused: only a clock time or a sun event makes a window
48771
48802
  * that repeats every day.
48772
48803
  */
48773
- var TimeIsLeafSchema = object({
48774
- kind: literal("time-is"),
48804
+ var timeIsWindowShape = {
48775
48805
  between: object({
48776
48806
  from: TimeSpecSchema,
48777
48807
  to: TimeSpecSchema
48778
48808
  }).optional(),
48779
48809
  days: array(WeekdayKeySchema).min(1).max(7).optional()
48780
- }).superRefine((leaf, ctx) => {
48781
- if (leaf.between === void 0 && leaf.days === void 0) ctx.addIssue({
48810
+ };
48811
+ function timeIsWindowProblems(window, ctx) {
48812
+ if (window.between === void 0 && window.days === void 0) ctx.addIssue({
48782
48813
  code: "custom",
48783
48814
  message: "a time-is leaf needs a between window, days, or both"
48784
48815
  });
48785
- for (const end of ["from", "to"]) if (leaf.between?.[end].kind === "date") ctx.addIssue({
48816
+ for (const end of ["from", "to"]) if (window.between?.[end].kind === "date") ctx.addIssue({
48786
48817
  code: "custom",
48787
48818
  message: "a one-date time cannot bound a daily window: use a clock time or a sun event",
48788
48819
  path: ["between", end]
48789
48820
  });
48790
- });
48821
+ }
48822
+ /**
48823
+ * What a `time-is` leaf holds beside its kind, judged by the leaf's own rules.
48824
+ * A template's time-window input stores exactly this.
48825
+ */
48826
+ var TimeIsWindowSchema = object(timeIsWindowShape).superRefine(timeIsWindowProblems);
48827
+ var TimeIsLeafSchema = object({
48828
+ kind: literal("time-is"),
48829
+ ...timeIsWindowShape
48830
+ }).superRefine(timeIsWindowProblems);
48791
48831
  /**
48792
48832
  * True for the run that one of the named event leaves started. It reads the
48793
48833
  * run, not a device: in the tree it is judged against the leaf that fired, in
@@ -48995,6 +49035,79 @@ function validateWhenTree(when) {
48995
49035
  return null;
48996
49036
  }
48997
49037
  /**
49038
+ * The link an automation made FROM a template carries (#527): which template,
49039
+ * the values the operator filled in, and — when the template has since changed
49040
+ * so that those values no longer fit — the problems that say why.
49041
+ *
49042
+ * It lives inside the recipe (`AutomationRecipe.template`), so the one row in
49043
+ * `core_blocks` stays the one artefact: there is no second store of instances
49044
+ * to drift from the blocks, and deleting the automation deletes the link.
49045
+ * "Convert to a free automation" is dropping this field.
49046
+ *
49047
+ * This file depends on nothing in `recipe.ts`, so the recipe can embed it and
49048
+ * the template engine (`template/automation-template.ts`) can import both.
49049
+ */
49050
+ /** An `event` input's value: the same three narrowing lists a `device-fired` row takes. */
49051
+ var TemplateEventValueSchema = object({
49052
+ eventIds: array(string().min(1)).min(1).max(64).optional(),
49053
+ sourceIds: array(string().min(1)).min(1).max(64).optional(),
49054
+ kinds: array(EventVocabularyKindSchema).min(1).optional()
49055
+ }).refine((value) => value.eventIds !== void 0 || value.sourceIds !== void 0 || value.kinds !== void 0, { message: "an event names at least one event, part or kind" });
49056
+ /** An `action` input's value: a vocabulary action and its open args. */
49057
+ var TemplateActionValueSchema = object({
49058
+ actionId: string().min(1),
49059
+ args: record$1(string(), unknown()).optional()
49060
+ });
49061
+ /**
49062
+ * A `time-window` input's value: what a `time-is` leaf holds beside its kind.
49063
+ * "No limit" is the input left without a value, never an empty object.
49064
+ */
49065
+ var TemplateTimeWindowValueSchema = TimeIsWindowSchema;
49066
+ var TemplateEntriesValueSchema = array(record$1(string(), unknown()));
49067
+ /** The value of one non-group input. Which member is right is the input kind's to judge. */
49068
+ var TemplateScalarValueSchema = union([
49069
+ number$1(),
49070
+ string(),
49071
+ boolean(),
49072
+ array(number$1().int().nonnegative()),
49073
+ TemplateEventValueSchema,
49074
+ TemplateActionValueSchema,
49075
+ TemplateTimeWindowValueSchema,
49076
+ TemplateEntriesValueSchema
49077
+ ]);
49078
+ /** What a group row holds under one key: a value, or the rows of a group it nests. */
49079
+ var TemplateRowValueSchema = union([TemplateScalarValueSchema, array(record$1(string(), TemplateScalarValueSchema))]);
49080
+ var TemplateInputValueSchema = union([TemplateScalarValueSchema, array(record$1(string(), TemplateRowValueSchema))]);
49081
+ /** Input key → value. */
49082
+ var TemplateInputValuesSchema = record$1(string(), TemplateInputValueSchema);
49083
+ var TemplateInstanceProblemSchema = object({
49084
+ code: _enum([
49085
+ "missing-input",
49086
+ "invalid-input",
49087
+ "invalid-recipe",
49088
+ "missing-template",
49089
+ "edited-by-hand"
49090
+ ]),
49091
+ /** Dotted input address (`buttons.2.targets`, `buttons.0.commands.1.targets`); absent for a whole-recipe problem. */
49092
+ input: string().optional(),
49093
+ detail: string()
49094
+ });
49095
+ var AutomationTemplateLinkSchema = object({
49096
+ templateId: string().min(1),
49097
+ values: TemplateInputValuesSchema,
49098
+ /**
49099
+ * Fingerprint of the generated code with this literal blanked
49100
+ * (`instanceCodeHash`), stamped by `generateAutomationBlock`. Code that no
49101
+ * longer matches it was edited by hand, and is never regenerated over.
49102
+ */
49103
+ codeHash: string().optional(),
49104
+ /**
49105
+ * Present when the last re-expansion refused these values. The automation
49106
+ * keeps running the body of its last good expansion; nothing is dropped.
49107
+ */
49108
+ problems: array(TemplateInstanceProblemSchema).min(1).optional()
49109
+ });
49110
+ /**
48998
49111
  * The recipe shape before the single `when` tree: a flat list of triggers
48999
49112
  * (OR'd, each an instant) and an optional condition tree. Stored recipes —
49000
49113
  * the `AUTOMATION_RECIPE` literal of every block saved so far, and whatever an
@@ -54992,6 +55105,16 @@ var HvacModeSchema = _enum([
54992
55105
  var ClimateControlStatusSchema = object({
54993
55106
  /** Active HVAC mode. */
54994
55107
  mode: HvacModeSchema,
55108
+ /** What the device is doing now (`heating` while the valve is open, `idle`
55109
+ * at setpoint). Absent or null = the device does not say; never a guess (D393). */
55110
+ action: _enum([
55111
+ "heating",
55112
+ "cooling",
55113
+ "drying",
55114
+ "fan",
55115
+ "idle",
55116
+ "off"
55117
+ ]).nullable().optional(),
54995
55118
  /** Available HVAC modes the device accepts. Subset of HvacMode. */
54996
55119
  availableModes: array(HvacModeSchema),
54997
55120
  /** Active fan mode (`auto` / `low` / `medium` / `high` / `on` / `off`
@@ -55045,6 +55168,40 @@ var ClimateControlStatusSchema = object({
55045
55168
  /** Ms epoch when the slice was last updated (push or command). */
55046
55169
  lastFetchedAt: number$1()
55047
55170
  });
55171
+ /**
55172
+ * Linked room sensor (Customize): the OPERATOR may replace the thermostat's own
55173
+ * `currentTemp` / `currentHumidity` with a sensor in the room. Never linked on
55174
+ * its own (D356). Once linked it ALWAYS replaces the native value, a null
55175
+ * native included — the operator chose the better reading.
55176
+ */
55177
+ var CLIMATE_CUSTOMIZE_DEVICE_TYPES = [DeviceType.Climate];
55178
+ function roomSensorTarget(id, path) {
55179
+ return {
55180
+ id,
55181
+ cardinality: "scalar",
55182
+ vocabulary: {
55183
+ cap: "climate-control",
55184
+ stateField: path
55185
+ },
55186
+ deviceTypes: CLIMATE_CUSTOMIZE_DEVICE_TYPES,
55187
+ apply: "replace",
55188
+ path,
55189
+ sources: [{
55190
+ kind: "numeric",
55191
+ transforms: [{ kind: "identity" }]
55192
+ }],
55193
+ sourceReport: { status: "assignment-status" }
55194
+ };
55195
+ }
55196
+ var CLIMATE_CONTROL_TARGETS = [roomSensorTarget("room-temperature", "currentTemp"), roomSensorTarget("room-humidity", "currentHumidity")];
55197
+ var climateControlCustomize = {
55198
+ version: 1,
55199
+ overridable: CLIMATE_CONTROL_TARGETS.map((target) => ({
55200
+ path: target.path,
55201
+ by: target.id
55202
+ })),
55203
+ targets: CLIMATE_CONTROL_TARGETS
55204
+ };
55048
55205
  var climateControlCapability = {
55049
55206
  name: "climate-control",
55050
55207
  scope: "device",
@@ -55355,6 +55512,7 @@ var climateControlCapability = {
55355
55512
  * on every push without re-querying the provider.
55356
55513
  */
55357
55514
  runtimeState: ClimateControlStatusSchema,
55515
+ customize: climateControlCustomize,
55358
55516
  /**
55359
55517
  * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
55360
55518
  *
@@ -56543,20 +56701,95 @@ var ControlSetValueInputSchema = discriminatedUnion("kind", [
56543
56701
  value: string().min(1)
56544
56702
  })
56545
56703
  ]);
56704
+ /**
56705
+ * `next` / `previous` input (#544, operator scripts driving a selector).
56706
+ * `cycle` is a TOP-LEVEL default so a direct `ctx.api.control.next` call
56707
+ * (which skips the tRPC router's Zod parse) still gets `true` via
56708
+ * `CAP_INPUT_DEFAULTS` — matching HA's own `select_next` / `select_previous`
56709
+ * default.
56710
+ */
56711
+ var ControlStepInputSchema = object({
56712
+ deviceId: number$1().int().nonnegative(),
56713
+ cycle: boolean().default(true)
56714
+ });
56715
+ /** `first` / `last` input — no `cycle`, there is no boundary to stop at. */
56716
+ var ControlBoundaryInputSchema = object({ deviceId: number$1().int().nonnegative() });
56546
56717
  var controlCapability = {
56547
56718
  name: "control",
56548
56719
  scope: "device",
56549
56720
  deviceNative: true,
56550
56721
  mode: "singleton",
56551
56722
  deviceTypes: [DeviceType.Control],
56552
- methods: { setValue: method(object({
56553
- deviceId: number$1().int().nonnegative(),
56554
- control: ControlSetValueInputSchema
56555
- }), _void(), {
56556
- kind: "mutation",
56557
- auth: "protected",
56558
- notOperatorFacing: "the value shape depends on the control kind (numeric / select / text / datetime) read from status; a typed picker for it is a follow-up of the automations rework"
56559
- }) },
56723
+ methods: {
56724
+ setValue: method(object({
56725
+ deviceId: number$1().int().nonnegative(),
56726
+ control: ControlSetValueInputSchema
56727
+ }), _void(), {
56728
+ kind: "mutation",
56729
+ auth: "protected",
56730
+ notOperatorFacing: "the value shape depends on the control kind (numeric / select / text / datetime) read from status; a typed picker for it is a follow-up of the automations rework"
56731
+ }),
56732
+ /**
56733
+ * Select one step forward through `options` (#544). `providerOptional`
56734
+ * (hence `optionalMethod`): only a `kind: 'select'` provider implements
56735
+ * it — the stepping math is NOT re-derived per provider, it is the one
56736
+ * shared helper `selectNavigationMethods` (`control-select-navigation.ts`)
56737
+ * every select-kind driver spreads in.
56738
+ */
56739
+ next: optionalMethod(ControlStepInputSchema, _void(), {
56740
+ kind: "mutation",
56741
+ auth: "protected",
56742
+ actions: [{
56743
+ id: "select.next",
56744
+ label: t("Next option", "Opzione successiva"),
56745
+ phrase: t("Select the next option on {device}", "Seleziona l’opzione successiva su {device}"),
56746
+ icon: "skip-forward",
56747
+ openArgs: [{
56748
+ key: "cycle",
56749
+ label: t("Wrap to the first option", "Ricomincia dalla prima opzione"),
56750
+ offer: { kind: "boolean" }
56751
+ }]
56752
+ }]
56753
+ }),
56754
+ /** Select one step backward through `options` (#544) — mirrors `next`. */
56755
+ previous: optionalMethod(ControlStepInputSchema, _void(), {
56756
+ kind: "mutation",
56757
+ auth: "protected",
56758
+ actions: [{
56759
+ id: "select.previous",
56760
+ label: t("Previous option", "Opzione precedente"),
56761
+ phrase: t("Select the previous option on {device}", "Seleziona l’opzione precedente su {device}"),
56762
+ icon: "skip-back",
56763
+ openArgs: [{
56764
+ key: "cycle",
56765
+ label: t("Wrap to the last option", "Ricomincia dall’ultima opzione"),
56766
+ offer: { kind: "boolean" }
56767
+ }]
56768
+ }]
56769
+ }),
56770
+ /** Select the first entry of `options` (#544). */
56771
+ first: optionalMethod(ControlBoundaryInputSchema, _void(), {
56772
+ kind: "mutation",
56773
+ auth: "protected",
56774
+ actions: [{
56775
+ id: "select.first",
56776
+ label: t("First option", "Prima opzione"),
56777
+ phrase: t("Select the first option on {device}", "Seleziona la prima opzione su {device}"),
56778
+ icon: "chevron-first"
56779
+ }]
56780
+ }),
56781
+ /** Select the last entry of `options` (#544). */
56782
+ last: optionalMethod(ControlBoundaryInputSchema, _void(), {
56783
+ kind: "mutation",
56784
+ auth: "protected",
56785
+ actions: [{
56786
+ id: "select.last",
56787
+ label: t("Last option", "Ultima opzione"),
56788
+ phrase: t("Select the last option on {device}", "Seleziona l’ultima opzione su {device}"),
56789
+ icon: "chevron-last"
56790
+ }]
56791
+ })
56792
+ },
56560
56793
  status: {
56561
56794
  schema: ControlStatusSchema,
56562
56795
  kind: "push"
@@ -57533,7 +57766,7 @@ var mediaPlayerCapability = {
57533
57766
  ]
57534
57767
  }
57535
57768
  };
57536
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer;
57769
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Climate, DeviceType.Climate, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer;
57537
57770
  var NUMBER = {
57538
57771
  kind: "fixed",
57539
57772
  result: ["number"]
@@ -77832,6 +78065,8 @@ var NcSystemEventKindSchema = _enum([
77832
78065
  "storage-location-low",
77833
78066
  "storage-location-critical",
77834
78067
  "storage-location-ok",
78068
+ "storage-drain-progress",
78069
+ "storage-drain-complete",
77835
78070
  "addon-crash-loop",
77836
78071
  "addon-update-available",
77837
78072
  "server-update-available",
@@ -86232,7 +86467,10 @@ object({
86232
86467
  value: boolean(),
86233
86468
  at: number$1()
86234
86469
  }).nullable(),
86235
- /** The declared source last sent; unknown after a power off or a channel step. */
86470
+ /**
86471
+ * Retired: a sent source is never a state (an infrared set cannot report its
86472
+ * input). Kept only so records written before parse; nothing writes or reads it.
86473
+ */
86236
86474
  source: object({
86237
86475
  name: string(),
86238
86476
  at: number$1()
@@ -89861,31 +90099,57 @@ var TemplateSelectOptionSchema = object({
89861
90099
  value: string().min(1),
89862
90100
  label: string().min(1).max(80)
89863
90101
  });
90102
+ var SelectInputSchema = object({
90103
+ kind: literal("select"),
90104
+ ...inputBase,
90105
+ options: array(TemplateSelectOptionSchema).min(1).max(50),
90106
+ default: string().optional()
90107
+ });
90108
+ var BooleanInputSchema = object({
90109
+ kind: literal("boolean"),
90110
+ ...inputBase,
90111
+ default: boolean().optional()
90112
+ });
90113
+ /** A limit on when the automation may run; only a `gate` binding reads it. */
90114
+ var TimeWindowInputSchema = object({
90115
+ kind: literal("time-window"),
90116
+ ...inputBase
90117
+ });
89864
90118
  var TemplateScalarInputSchema = discriminatedUnion("kind", [
90119
+ object({
90120
+ kind: literal("entries"),
90121
+ ...inputBase,
90122
+ entry: _enum(["trigger", "step"]),
90123
+ allow: array(string().min(1)).min(1).max(10),
90124
+ maxItems: number$1().int().min(1).max(20).optional()
90125
+ }),
89865
90126
  DeviceInputSchema,
89866
90127
  EventInputSchema,
89867
90128
  ActionInputSchema$1,
89868
90129
  NumberInputSchema,
89869
90130
  DurationInputSchema,
89870
90131
  TextInputSchema,
89871
- object({
89872
- kind: literal("select"),
89873
- ...inputBase,
89874
- options: array(TemplateSelectOptionSchema).min(1).max(50),
89875
- default: string().optional()
89876
- }),
89877
- object({
89878
- kind: literal("boolean"),
89879
- ...inputBase,
89880
- default: boolean().optional()
89881
- })
90132
+ SelectInputSchema,
90133
+ BooleanInputSchema,
90134
+ TimeWindowInputSchema
89882
90135
  ]);
89883
- var GroupInputSchema = object({
90136
+ var groupBase = {
89884
90137
  kind: literal("group"),
89885
90138
  ...inputBase,
89886
- inputs: array(TemplateScalarInputSchema).min(1).max(10),
90139
+ /** What one row is, in the singular and lower case ("button"): "Add button". */
90140
+ rowLabel: string().min(1).max(40).optional(),
89887
90141
  minRows: number$1().int().min(0).max(20).optional(),
89888
90142
  maxRows: number$1().int().min(1).max(20).optional()
90143
+ };
90144
+ /** A group inside a group row: its rows hold values only, never another group. */
90145
+ var NestedGroupInputSchema = object({
90146
+ ...groupBase,
90147
+ inputs: array(TemplateScalarInputSchema).min(1).max(10)
90148
+ });
90149
+ var TemplateRowInputSchema = discriminatedUnion("kind", [...TemplateScalarInputSchema.options, NestedGroupInputSchema]);
90150
+ var GroupInputSchema = object({
90151
+ ...groupBase,
90152
+ inputs: array(TemplateRowInputSchema).min(1).max(10)
89889
90153
  });
89890
90154
  var TemplateInputSchema = discriminatedUnion("kind", [...TemplateScalarInputSchema.options, GroupInputSchema]);
89891
90155
  var TemplatePathSchema = array(union([string().min(1), number$1().int().nonnegative()])).max(24);
@@ -89896,41 +90160,154 @@ var TemplateValueBindingSchema = object({
89896
90160
  /** A device value written as a step target (`{ kind: 'devices', ids }`). */
89897
90161
  as: literal("target").optional()
89898
90162
  });
89899
- var TemplateRowItemBindingSchema = discriminatedUnion("kind", [TemplateValueBindingSchema, object({
90163
+ var TemplateRowIdBindingSchema = object({
89900
90164
  kind: literal("row-id"),
89901
90165
  path: TemplatePathSchema
89902
- })]);
89903
- var TemplateBindingSchema = discriminatedUnion("kind", [TemplateValueBindingSchema, object({
89904
- kind: literal("rows"),
90166
+ });
90167
+ /**
90168
+ * Appends an `entries` input's elements, verbatim, to the list at `path`. In a
90169
+ * row's bindings `input` is the row's own entries input and `path` is from the
90170
+ * row's item; at the top level, with `in`, it appends the `input` entries of
90171
+ * EVERY row of the group `in` (all buttons' triggers into one `when`), and
90172
+ * without `in` it appends a top-level entries input.
90173
+ */
90174
+ var TemplateEntriesBindingSchema = object({
90175
+ kind: literal("entries"),
89905
90176
  input: inputKey,
89906
- /** The list in the body the rows are appended to. */
89907
90177
  path: TemplatePathSchema,
89908
- /** The JSON copied once per row. */
89909
- item: unknown(),
89910
- bindings: array(TemplateRowItemBindingSchema).max(40)
89911
- })]);
89912
- function bindingProblems(payload, ctx) {
89913
- const byKey = /* @__PURE__ */ new Map();
89914
- payload.inputs.forEach((input, index) => {
89915
- if (byKey.has(input.key)) ctx.addIssue({
89916
- code: "custom",
90178
+ in: inputKey.optional()
90179
+ });
90180
+ /** What fills the item of a row that holds values only. */
90181
+ var TemplateLeafRowBindingSchema = discriminatedUnion("kind", [TemplateValueBindingSchema, TemplateRowIdBindingSchema]);
90182
+ var TemplateRowItemBindingSchema = discriminatedUnion("kind", [
90183
+ TemplateValueBindingSchema,
90184
+ TemplateEntriesBindingSchema,
90185
+ TemplateRowIdBindingSchema,
90186
+ object({
90187
+ kind: literal("row-ids"),
90188
+ /** The nested group whose rows are named. */
90189
+ input: inputKey,
90190
+ path: TemplatePathSchema
90191
+ }),
90192
+ object({
90193
+ kind: literal("rows"),
90194
+ /** The nested group, declared by the parent row's group. */
90195
+ input: inputKey,
90196
+ /** The list the nested rows are appended to, from the parent row's item. */
90197
+ path: TemplatePathSchema,
90198
+ item: unknown(),
90199
+ bindings: array(TemplateLeafRowBindingSchema).max(40)
90200
+ })
90201
+ ]);
90202
+ var TemplateBindingSchema = discriminatedUnion("kind", [
90203
+ TemplateValueBindingSchema,
90204
+ TemplateEntriesBindingSchema,
90205
+ object({
90206
+ kind: literal("rows"),
90207
+ input: inputKey,
90208
+ /**
90209
+ * A group the rows of `input` hold: the binding then appends one item per
90210
+ * NESTED row of every row, and its bindings read the nested row.
90211
+ */
90212
+ nested: inputKey.optional(),
90213
+ /** The list in the body the rows are appended to. */
90214
+ path: TemplatePathSchema,
90215
+ /** The JSON copied once per row. */
90216
+ item: unknown(),
90217
+ bindings: array(TemplateRowItemBindingSchema).max(40)
90218
+ }),
90219
+ object({
90220
+ kind: literal("gate"),
90221
+ /** A top-level `time-window` input. */
90222
+ input: inputKey,
90223
+ path: TemplatePathSchema
90224
+ })
90225
+ ]);
90226
+ /** Twice-declared keys and event / action inputs that read no device beside them. */
90227
+ function levelProblems(inputs, path, inRow = false) {
90228
+ const issues = [];
90229
+ const seen = /* @__PURE__ */ new Set();
90230
+ for (const input of inputs) {
90231
+ if (seen.has(input.key)) issues.push({
89917
90232
  message: `input "${input.key}" is declared twice`,
89918
- path: ["inputs", index]
90233
+ path
89919
90234
  });
89920
- byKey.set(input.key, input);
89921
- const siblings = input.kind === "group" ? input.inputs : payload.inputs;
89922
- for (const scalar of input.kind === "group" ? input.inputs : [input]) {
89923
- if (scalar.kind !== "event" && scalar.kind !== "action") continue;
89924
- if (scalar.deviceInput === void 0) continue;
89925
- const device = siblings.find((s) => s.key === scalar.deviceInput);
89926
- if (device === void 0 || device.kind !== "device") ctx.addIssue({
89927
- code: "custom",
89928
- message: `"${scalar.key}" reads the device input "${scalar.deviceInput}", which is not a device input beside it`,
89929
- path: ["inputs", index]
89930
- });
90235
+ seen.add(input.key);
90236
+ if (input.kind === "group") {
90237
+ issues.push(...levelProblems(input.inputs, path, true));
90238
+ continue;
90239
+ }
90240
+ if (input.kind === "time-window" && inRow) issues.push({
90241
+ message: `time window "${input.key}" limits the whole automation: it is not a row input`,
90242
+ path
90243
+ });
90244
+ if (input.kind !== "event" && input.kind !== "action") continue;
90245
+ if (input.deviceInput === void 0) continue;
90246
+ const device = inputs.find((sibling) => sibling.key === input.deviceInput);
90247
+ if (device === void 0 || device.kind !== "device") issues.push({
90248
+ message: `"${input.key}" reads the device input "${input.deviceInput}", which is not a device input beside it`,
90249
+ path
90250
+ });
90251
+ }
90252
+ return issues;
90253
+ }
90254
+ function nestedGroupOf(group, key) {
90255
+ const found = group.inputs.find((input) => input.key === key);
90256
+ return found !== void 0 && found.kind === "group" ? found : void 0;
90257
+ }
90258
+ function leafBindingProblems(bindings, owner) {
90259
+ const issues = [];
90260
+ for (const row of bindings) {
90261
+ if (row.kind === "row-id") continue;
90262
+ if (row.kind === "value") {
90263
+ const input = owner.inputs.find((i) => i.key === row.input);
90264
+ if (input === void 0) issues.push(`row binding names "${row.input}", which group "${owner.key}" does not declare`);
90265
+ else if (input.kind === "group") issues.push(`group "${input.key}" is bound with rows, not a value`);
90266
+ else if (input.kind === "entries") issues.push(`entries "${input.key}" are bound with entries, not a value`);
90267
+ continue;
90268
+ }
90269
+ const nested = owner.inputs.find((i) => i.key === row.input);
90270
+ if (row.kind === "entries") {
90271
+ if (nested === void 0 || nested.kind !== "entries") issues.push(`"${row.input}" is not an entries input inside "${owner.key}"`);
90272
+ continue;
90273
+ }
90274
+ if (row.kind === "row-ids") {
90275
+ if (nested === void 0 || nested.kind !== "group" && nested.kind !== "entries") issues.push(`"${row.input}" is not a group or entries input inside "${owner.key}"`);
90276
+ continue;
90277
+ }
90278
+ if (nested === void 0 || nested.kind !== "group") {
90279
+ issues.push(`"${row.input}" is not a group inside "${owner.key}"`);
90280
+ continue;
89931
90281
  }
90282
+ issues.push(...leafBindingProblems(row.bindings, nested));
90283
+ }
90284
+ return issues;
90285
+ }
90286
+ function rowsBindingProblems(binding, group) {
90287
+ if (binding.nested === void 0) return leafBindingProblems(binding.bindings, group);
90288
+ const nested = nestedGroupOf(group, binding.nested);
90289
+ if (nested === void 0) return [`"${binding.nested}" is not a group inside "${group.key}"`];
90290
+ return leafBindingProblems(binding.bindings, nested);
90291
+ }
90292
+ function bindingProblems(payload, ctx) {
90293
+ const byKey = /* @__PURE__ */ new Map();
90294
+ for (const input of payload.inputs) byKey.set(input.key, input);
90295
+ for (const issue of levelProblems(payload.inputs, ["inputs"])) ctx.addIssue({
90296
+ code: "custom",
90297
+ message: issue.message,
90298
+ path: [...issue.path]
89932
90299
  });
89933
90300
  payload.bindings.forEach((binding, index) => {
90301
+ if (binding.kind === "entries" && binding.in !== void 0) {
90302
+ const group = byKey.get(binding.in);
90303
+ const entries = group !== void 0 && group.kind === "group" ? group.inputs.find((i) => i.key === binding.input) : void 0;
90304
+ if (entries === void 0 || entries.kind !== "entries") ctx.addIssue({
90305
+ code: "custom",
90306
+ message: `"${binding.input}" is not an entries input inside the group "${binding.in}"`,
90307
+ path: ["bindings", index]
90308
+ });
90309
+ return;
90310
+ }
89934
90311
  const input = byKey.get(binding.input);
89935
90312
  if (input === void 0) {
89936
90313
  ctx.addIssue({
@@ -89945,6 +90322,18 @@ function bindingProblems(payload, ctx) {
89945
90322
  message: `group "${input.key}" is bound with rows, not a value`,
89946
90323
  path: ["bindings", index]
89947
90324
  });
90325
+ if (binding.kind === "entries" !== (input.kind === "entries") && binding.kind !== "rows") {
90326
+ if (binding.kind === "entries" || binding.kind === "value") ctx.addIssue({
90327
+ code: "custom",
90328
+ message: binding.kind === "entries" ? `entries bindings read an entries input: "${input.key}" is ${input.kind}` : `entries "${input.key}" are bound with entries, not a value`,
90329
+ path: ["bindings", index]
90330
+ });
90331
+ }
90332
+ if (binding.kind === "gate" !== (input.kind === "time-window")) ctx.addIssue({
90333
+ code: "custom",
90334
+ message: `a gate reads a time window and a time window is bound with a gate: "${input.key}" is ${input.kind}`,
90335
+ path: ["bindings", index]
90336
+ });
89948
90337
  if (binding.kind === "rows") {
89949
90338
  if (input.kind !== "group") {
89950
90339
  ctx.addIssue({
@@ -89954,9 +90343,9 @@ function bindingProblems(payload, ctx) {
89954
90343
  });
89955
90344
  return;
89956
90345
  }
89957
- for (const row of binding.bindings) if (row.kind === "value" && !input.inputs.some((i) => i.key === row.input)) ctx.addIssue({
90346
+ for (const message of rowsBindingProblems(binding, input)) ctx.addIssue({
89958
90347
  code: "custom",
89959
- message: `row binding names "${row.input}", which group "${input.key}" does not declare`,
90348
+ message,
89960
90349
  path: ["bindings", index]
89961
90350
  });
89962
90351
  }
@@ -99006,6 +99395,13 @@ Object.freeze({
99006
99395
  access: "view",
99007
99396
  role: "viewer"
99008
99397
  },
99398
+ "control.first": {
99399
+ capName: "control",
99400
+ capScope: "device",
99401
+ addonId: null,
99402
+ access: "create",
99403
+ role: "viewer"
99404
+ },
99009
99405
  "control.getStatus": {
99010
99406
  capName: "control",
99011
99407
  capScope: "device",
@@ -99013,6 +99409,27 @@ Object.freeze({
99013
99409
  access: "view",
99014
99410
  role: "viewer"
99015
99411
  },
99412
+ "control.last": {
99413
+ capName: "control",
99414
+ capScope: "device",
99415
+ addonId: null,
99416
+ access: "create",
99417
+ role: "viewer"
99418
+ },
99419
+ "control.next": {
99420
+ capName: "control",
99421
+ capScope: "device",
99422
+ addonId: null,
99423
+ access: "create",
99424
+ role: "viewer"
99425
+ },
99426
+ "control.previous": {
99427
+ capName: "control",
99428
+ capScope: "device",
99429
+ addonId: null,
99430
+ access: "create",
99431
+ role: "viewer"
99432
+ },
99016
99433
  "control.setValue": {
99017
99434
  capName: "control",
99018
99435
  capScope: "device",
@@ -108654,11 +109071,31 @@ Object.freeze({
108654
109071
  form: "single",
108655
109072
  optional: false
108656
109073
  }],
109074
+ "control.first": [{
109075
+ name: "deviceId",
109076
+ form: "single",
109077
+ optional: false
109078
+ }],
108657
109079
  "control.getStatus": [{
108658
109080
  name: "deviceId",
108659
109081
  form: "single",
108660
109082
  optional: false
108661
109083
  }],
109084
+ "control.last": [{
109085
+ name: "deviceId",
109086
+ form: "single",
109087
+ optional: false
109088
+ }],
109089
+ "control.next": [{
109090
+ name: "deviceId",
109091
+ form: "single",
109092
+ optional: false
109093
+ }],
109094
+ "control.previous": [{
109095
+ name: "deviceId",
109096
+ form: "single",
109097
+ optional: false
109098
+ }],
108662
109099
  "control.setValue": [{
108663
109100
  name: "deviceId",
108664
109101
  form: "single",
@@ -111560,6 +111997,8 @@ new Map(Object.entries({
111560
111997
  "storage-location-low": "system",
111561
111998
  "storage-location-critical": "system",
111562
111999
  "storage-location-ok": "system",
112000
+ "storage-drain-progress": "system",
112001
+ "storage-drain-complete": "system",
111563
112002
  "alarm-triggered": "alarm",
111564
112003
  "alarm-armed": "alarm",
111565
112004
  "alarm-disarmed": "alarm",
@@ -111695,6 +112134,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
111695
112134
  "storage-location-ok"
111696
112135
  ]
111697
112136
  },
112137
+ {
112138
+ id: "storage-drain",
112139
+ family: "system",
112140
+ label: "Storage drain progress",
112141
+ kinds: ["storage-drain-progress", "storage-drain-complete"]
112142
+ },
111698
112143
  {
111699
112144
  id: "alerts",
111700
112145
  family: "system",
@@ -111889,6 +112334,7 @@ var ALERT_EPISODE = [
111889
112334
  "alert-error",
111890
112335
  "alert-critical-resolved"
111891
112336
  ];
112337
+ var STORAGE_DRAIN = ["storage-drain-progress", "storage-drain-complete"];
111892
112338
  var DEVICE_ATTENTION = ["device-attention-required", "device-attention-resolved"];
111893
112339
  var UPDATES = [
111894
112340
  "addon-update-available",
@@ -112112,8 +112558,16 @@ var STATE_SUMMARY_VARS = [
112112
112558
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
112113
112559
  ([...RULE_TEXT], [...CONSUMABLE]),
112114
112560
  [...RULE_TEXT],
112115
- ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
112116
- ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
112561
+ ([...RULE_TEXT], [
112562
+ ...UPDATES,
112563
+ ...STORAGE_DRAIN,
112564
+ ...ALERT_EPISODE
112565
+ ]),
112566
+ ([...RULE_TEXT], [
112567
+ ...UPDATES,
112568
+ ...STORAGE_DRAIN,
112569
+ ...ALERT_EPISODE
112570
+ ]),
112117
112571
  [...RULE_TEXT],
112118
112572
  [...RULE_TEXT],
112119
112573
  [...RULE_TEXT],
@@ -112127,6 +112581,9 @@ var STATE_SUMMARY_VARS = [
112127
112581
  [...RULE_TEXT],
112128
112582
  [...RULE_TEXT],
112129
112583
  [...RULE_TEXT],
112584
+ ([...RULE_TEXT], [...STORAGE_DRAIN]),
112585
+ ([...RULE_TEXT], [...STORAGE_DRAIN]),
112586
+ [...RULE_TEXT],
112130
112587
  [...RULE_TEXT],
112131
112588
  [...RULE_TEXT],
112132
112589
  [...RULE_TEXT],
@@ -140390,12 +140847,26 @@ var HmChildDevice = class extends BaseDevice {
140390
140847
  }
140391
140848
  });
140392
140849
  }
140850
+ /**
140851
+ * A (channel, parameter) outside the entity's channels that this child still
140852
+ * reads. Default: none. A climate child reads the `STATE` of the device's
140853
+ * floor-heating relay channel (the heat demand); every other parameter of
140854
+ * that channel stays foreign.
140855
+ */
140856
+ readsForeignDatapoint(_channel, _parameter) {
140857
+ return false;
140858
+ }
140859
+ readsForeignEvent(event) {
140860
+ const channel = this.resolveHmDevice()?.channels.find((c) => c.address === event.channel);
140861
+ return channel !== void 0 && this.readsForeignDatapoint(channel, event.parameter);
140862
+ }
140393
140863
  ownsEventChannel(event) {
140394
140864
  const owned = this.channel;
140395
140865
  if (owned === void 0) return true;
140396
140866
  const channel = event.channel;
140397
140867
  if (typeof channel === "string" && channel.length > 0) {
140398
140868
  if (!this.ownedChannels().includes(channel)) {
140869
+ if (this.readsForeignEvent(event)) return true;
140399
140870
  this.logValueDropped(event, "foreign-channel");
140400
140871
  return false;
140401
140872
  }
@@ -140439,8 +140910,9 @@ var HmChildDevice = class extends BaseDevice {
140439
140910
  const now = Date.now();
140440
140911
  const accepted = this.ownedChannels();
140441
140912
  for (const channel of device.channels) {
140442
- if (!accepted.includes(channel.address)) continue;
140913
+ const ownedChannel = accepted.includes(channel.address);
140443
140914
  for (const dp of channel.dataPoints ?? []) {
140915
+ if (!ownedChannel && !this.readsForeignDatapoint(channel, dp.parameter)) continue;
140444
140916
  if (dp.value === null || dp.value === void 0) continue;
140445
140917
  if (!this.isPreferredSource({
140446
140918
  dpId: dp.id,
@@ -140474,8 +140946,17 @@ var HmChildDevice = class extends BaseDevice {
140474
140946
  this.seedTriggerUnsubs = [];
140475
140947
  }
140476
140948
  };
140477
- function isHmOffSetpoint(target) {
140478
- return target !== null && target <= 4.5;
140949
+ //#endregion
140950
+ //#region src/homematic-decode.ts
140951
+ /** HmIP OFF is MANU with the CCU off temperature ({@link HM_OFF_SETPOINT_C}). */
140952
+ var HM_OFF_SETPOINT_C = 4.5;
140953
+ /**
140954
+ * Is `target` the off setpoint? OFF is the device's own minimum setpoint when
140955
+ * known (a HmIP-BWTH clamps the 4.5 write to its 5.0 minimum and reports 5),
140956
+ * {@link HM_OFF_SETPOINT_C} otherwise.
140957
+ */
140958
+ function isHmOffSetpoint(target, offSetpointC = HM_OFF_SETPOINT_C) {
140959
+ return target !== null && target <= offSetpointC;
140479
140960
  }
140480
140961
  /**
140481
140962
  * HmIP `SET_POINT_MODE` index → library climate mode.
@@ -140483,12 +140964,13 @@ function isHmOffSetpoint(target) {
140483
140964
  * Observed 2026-11-13 via `getParamsetDescription` on `INT0000001:1`: the
140484
140965
  * datapoint is `TYPE INTEGER`, `MIN 0`, `MAX 3`, with no value list. The
140485
140966
  * live CCU therefore delivers the index, not a name.
140486
- * 0 auto, 1 manual heat, 2 party (a timed override — still auto).
140967
+ * 0 auto, 1 manual heat, 2 party (a timed override: mode auto, preset `party`).
140487
140968
  * 3 is absent: unknown, so {@link fromHmSetPointMode} returns null and the
140488
140969
  * caller keeps the previous mode.
140489
140970
  * `CONTROL_MODE` is write-only on HmIP heating groups and always reads `0`;
140490
140971
  * mode is read from here.
140491
140972
  */
140973
+ var HM_SET_POINT_MODE_PARTY = 2;
140492
140974
  var HM_SET_POINT_MODE_BY_INDEX = {
140493
140975
  0: "auto",
140494
140976
  1: "heat",
@@ -140533,6 +141015,19 @@ function fromHmSetPointMode(value) {
140533
141015
  if (mode === void 0) return null;
140534
141016
  return mode === "auto" ? "auto" : "heat";
140535
141017
  }
141018
+ /**
141019
+ * Like {@link fromHmSetPointMode}, but it also says whether the timed override
141020
+ * (index 2 / `PARTY`) is running. The mode stays `auto` under a party; the
141021
+ * override is the `party` preset, as `boost` is.
141022
+ */
141023
+ function readHmSetPointMode(value) {
141024
+ const mode = fromHmSetPointMode(value);
141025
+ if (mode === null) return null;
141026
+ return {
141027
+ mode,
141028
+ party: typeof value === "string" ? value.toUpperCase() === "PARTY" : value === HM_SET_POINT_MODE_PARTY
141029
+ };
141030
+ }
140536
141031
  /** Convert a 0..1 HmIP LEVEL into a 0..100 CamStack position (rounded). */
140537
141032
  function levelToPercent(level) {
140538
141033
  return Math.round(Math.max(0, Math.min(1, level)) * 100);
@@ -140678,18 +141173,56 @@ function decodeLock(parameter, value, now) {
140678
141173
  * (current °C), HUMIDITY (%), SET_POINT_MODE (ENUM, readable mode),
140679
141174
  * BOOST_MODE (bool). `CONTROL_MODE` is write-only on HmIP and ignored here.
140680
141175
  */
140681
- function modeWithHmOffTarget(previous, target) {
140682
- if (isHmOffSetpoint(target)) return previous.mode === "auto" ? "auto" : "off";
141176
+ function modeWithHmOffTarget(previous, target, offSetpointC) {
141177
+ if (isHmOffSetpoint(target, offSetpointC)) return previous.mode === "auto" ? "auto" : "off";
140683
141178
  if (previous.mode === "off") return previous.lastActiveMode ?? "heat";
140684
141179
  return previous.mode;
140685
141180
  }
140686
- function decodeClimate(previous, parameter, value, now) {
140687
- if (parameter === "SET_POINT_TEMPERATURE" && typeof value === "number") return {
141181
+ /** The action a device with a known heat demand reports, or `off` when it is switched off. */
141182
+ function actionFor(mode, demand) {
141183
+ if (mode === "off") return "off";
141184
+ if (demand === null) return null;
141185
+ return demand ? "heating" : "idle";
141186
+ }
141187
+ /** The demand the previous slice recorded in its `action`; unknown when it said `off` or nothing. */
141188
+ function demandOf(previous) {
141189
+ if (previous.action === "heating") return true;
141190
+ if (previous.action === "idle") return false;
141191
+ return null;
141192
+ }
141193
+ /**
141194
+ * A mode change settles the action: off is `off`; LEAVING off forgets the
141195
+ * demand (the valve was shut by the off setpoint and the device has not said
141196
+ * yet, D393); otherwise the last demand stands.
141197
+ */
141198
+ function withModeAction(previous, next) {
141199
+ if (next.mode === previous.mode) return next;
141200
+ const demand = previous.mode === "off" ? null : demandOf(previous);
141201
+ return {
141202
+ ...next,
141203
+ action: actionFor(next.mode, demand)
141204
+ };
141205
+ }
141206
+ /**
141207
+ * Decode a heat-demand report: a floor-heating relay's `STATE` (BWTH `:8`) or a
141208
+ * radiator valve's `LEVEL` (0..1). Switched off wins over any demand.
141209
+ */
141210
+ function decodeClimateDemand(previous, source, value, now) {
141211
+ const demand = source === "floor-direct-state" ? typeof value === "boolean" ? value : null : typeof value === "number" ? value > 0 : null;
141212
+ if (demand === null) return null;
141213
+ return {
140688
141214
  ...previous,
140689
- target: value,
140690
- mode: modeWithHmOffTarget(previous, value),
141215
+ action: actionFor(previous.mode, demand),
140691
141216
  lastFetchedAt: now
140692
141217
  };
141218
+ }
141219
+ function decodeClimate(previous, parameter, value, now, offSetpointC = HM_OFF_SETPOINT_C) {
141220
+ if (parameter === "SET_POINT_TEMPERATURE" && typeof value === "number") return withModeAction(previous, {
141221
+ ...previous,
141222
+ target: value,
141223
+ mode: modeWithHmOffTarget(previous, value, offSetpointC),
141224
+ lastFetchedAt: now
141225
+ });
140693
141226
  if (parameter === "ACTUAL_TEMPERATURE" && typeof value === "number") return {
140694
141227
  ...previous,
140695
141228
  currentTemp: value,
@@ -140701,14 +141234,17 @@ function decodeClimate(previous, parameter, value, now) {
140701
141234
  lastFetchedAt: now
140702
141235
  };
140703
141236
  if (parameter === "SET_POINT_MODE") {
140704
- const mode = fromHmSetPointMode(value);
140705
- if (mode === null) return null;
140706
- const resolved = mode === "heat" && isHmOffSetpoint(previous.target) ? "off" : mode;
140707
- return {
141237
+ const reading = readHmSetPointMode(value);
141238
+ if (reading === null) return null;
141239
+ const { mode, party } = reading;
141240
+ const resolved = mode === "heat" && isHmOffSetpoint(previous.target, offSetpointC) ? "off" : mode;
141241
+ const preset = party ? "party" : previous.preset === "party" ? "" : previous.preset;
141242
+ return withModeAction(previous, {
140708
141243
  ...previous,
140709
141244
  mode: resolved,
141245
+ preset,
140710
141246
  lastFetchedAt: now
140711
- };
141247
+ });
140712
141248
  }
140713
141249
  if (parameter === "BOOST_MODE" && typeof value === "boolean") return {
140714
141250
  ...previous,
@@ -140761,7 +141297,7 @@ var hmActuatorSchema = hmChildSchema.extend({
140761
141297
  * Status flows back via the facade `valueChanged` stream, decoded by the
140762
141298
  * existing pure decoders (`decodeCover` / `decodeLock` / `decodeClimate`).
140763
141299
  */
140764
- var HmActuatorDevice = class extends HmChildDevice {
141300
+ var HmActuatorDevice = class HmActuatorDevice extends HmChildDevice {
140765
141301
  /** A cover's `stop` drives the channel's real STOP (`coverStop`). */
140766
141302
  features = this.config.values.kind === "cover" ? [DeviceFeature.CoverStoppable] : [];
140767
141303
  kind;
@@ -140852,15 +141388,17 @@ var HmActuatorDevice = class extends HmChildDevice {
140852
141388
  const facade = this.requireFacade();
140853
141389
  const prev = this.runtimeState.getCapState("climate-control") ?? COLD_CLIMATE;
140854
141390
  const hmMode = toHmClimateMode(mode);
140855
- if (hmMode === "off" && prev.target !== null && prev.target > 4.5) this.climateRestoreTargetC = prev.target;
141391
+ const offC = this.climateOffSetpointC();
141392
+ if (hmMode === "off" && prev.target !== null && prev.target > offC) this.climateRestoreTargetC = prev.target;
140856
141393
  await facade.climateSetMode(this.address, channel, hmMode);
140857
- if (mode === "heat" && (prev.mode === "off" || isHmOffSetpoint(prev.target))) {
141394
+ if (hmMode === "off" && offC !== 4.5) await facade.climateSetTemperature(this.address, channel, offC);
141395
+ if (mode === "heat" && (prev.mode === "off" || isHmOffSetpoint(prev.target, offC))) {
140858
141396
  const restore = this.climateRestoreTargetC ?? 21;
140859
141397
  await facade.climateSetTemperature(this.address, channel, restore);
140860
141398
  }
140861
141399
  },
140862
141400
  setTarget: async ({ target }) => {
140863
- if (target > 4.5) this.climateRestoreTargetC = target;
141401
+ if (target > this.climateOffSetpointC()) this.climateRestoreTargetC = target;
140864
141402
  await this.requireFacade().climateSetTemperature(this.address, channel, target);
140865
141403
  },
140866
141404
  setPreset: async ({ preset }) => {
@@ -140877,6 +141415,37 @@ var HmActuatorDevice = class extends HmChildDevice {
140877
141415
  this.runtimeState.setCapState("climate-control", COLD_CLIMATE);
140878
141416
  this.registeredCap = "climate-control";
140879
141417
  }
141418
+ /**
141419
+ * The off setpoint of THIS thermostat: the entity's own minimum setpoint
141420
+ * (the library reads it from the SETPOINT datapoint metadata), else the
141421
+ * CCU default {@link HM_OFF_SETPOINT_C}.
141422
+ */
141423
+ climateOffSetpointC() {
141424
+ const entity = this.facade?.customEntities().find((e) => e.device === this.address && e.channel === this.actuatorChannel);
141425
+ return entity?.kind === "climate" ? entity.minTemp : HM_OFF_SETPOINT_C;
141426
+ }
141427
+ /** The channel type of a floor-heating relay's demand report (HmIP-BWTH `:8`). */
141428
+ static FLOOR_DIRECT_CHANNEL_TYPE = "CLIMATECONTROL_FLOOR_DIRECT_TRANSMITTER";
141429
+ static isFloorDirect(channel) {
141430
+ return channel.type === HmActuatorDevice.FLOOR_DIRECT_CHANNEL_TYPE;
141431
+ }
141432
+ /**
141433
+ * A climate child reads the `STATE` of the device's floor-direct transmitter
141434
+ * as its heat demand. It is the ONLY foreign datapoint it takes: the other
141435
+ * parameters of that channel and every other channel (`:9`, `:10`) stay dropped.
141436
+ */
141437
+ readsForeignDatapoint(channel, parameter) {
141438
+ return this.registeredCap === "climate-control" && parameter === "STATE" && HmActuatorDevice.isFloorDirect(channel);
141439
+ }
141440
+ hasFloorDirectChannel() {
141441
+ return this.resolveHmDevice()?.channels.some(HmActuatorDevice.isFloorDirect) === true;
141442
+ }
141443
+ /** Is this event the floor-direct `STATE`, as opposed to the owned channel's own? */
141444
+ isFloorDirectState(event) {
141445
+ if (event.parameter !== "STATE") return false;
141446
+ const channel = this.resolveHmDevice()?.channels.find((c) => c.address === event.channel);
141447
+ return channel !== void 0 && HmActuatorDevice.isFloorDirect(channel);
141448
+ }
140880
141449
  handleValueChanged(event, origin) {
140881
141450
  const now = event.ts || Date.now();
140882
141451
  const { parameter, value } = event;
@@ -140893,7 +141462,9 @@ var HmActuatorDevice = class extends HmChildDevice {
140893
141462
  if (cap === "cover") return this.applyCover(parameter, value, now, origin);
140894
141463
  if (cap === "lock-control") return this.applyLock(parameter, value, now, origin);
140895
141464
  if (cap === "climate-control") {
140896
- const next = decodeClimate(this.runtimeState.getCapState("climate-control") ?? COLD_CLIMATE, parameter, value, now);
141465
+ const prev = this.runtimeState.getCapState("climate-control") ?? COLD_CLIMATE;
141466
+ const offC = this.climateOffSetpointC();
141467
+ const next = this.decodeClimateEvent(prev, event, now, offC);
140897
141468
  if (next === null && parameter === "SET_POINT_MODE") this.ctx.logger.debug("Homematic climate: SET_POINT_MODE unknown — mode unchanged", {
140898
141469
  tags: { deviceId: this.id },
140899
141470
  meta: {
@@ -140902,11 +141473,22 @@ var HmActuatorDevice = class extends HmChildDevice {
140902
141473
  }
140903
141474
  });
140904
141475
  if (next) {
140905
- if (next.target !== null && next.target > 4.5) this.climateRestoreTargetC = next.target;
141476
+ if (next.target !== null && next.target > offC) this.climateRestoreTargetC = next.target;
140906
141477
  this.runtimeState.setCapState("climate-control", next);
140907
141478
  }
140908
141479
  }
140909
141480
  }
141481
+ /**
141482
+ * Heat demand has two sources: the floor relay's `STATE` (BWTH `:8`) and a
141483
+ * radiator valve's `LEVEL`. A device with a floor relay takes its demand from
141484
+ * there only, so a `LEVEL` it also carries cannot contradict it.
141485
+ */
141486
+ decodeClimateEvent(prev, event, now, offC) {
141487
+ const { parameter, value } = event;
141488
+ if (this.isFloorDirectState(event)) return decodeClimateDemand(prev, "floor-direct-state", value, now);
141489
+ if (parameter === "LEVEL" && !this.hasFloorDirectChannel()) return decodeClimateDemand(prev, "valve-level", value, now);
141490
+ return decodeClimate(prev, parameter, value, now, offC);
141491
+ }
140910
141492
  applyCover(parameter, value, now, origin) {
140911
141493
  const prev = this.runtimeState.getCapState("cover") ?? COLD_COVER;
140912
141494
  const next = decodeCover(prev, parameter, value, now);