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