@camstack/server 1.2.820 → 1.2.822
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/api/trpc/generated-cap-mounts.js +3 -1
- package/dist/api/trpc/generated-cap-routers.js +1863 -1697
- package/package.json +10 -24
- package/system/dist/{agent-https-XHjvcSEq.mjs → agent-https-C4yxMErF.mjs} +1 -1
- package/system/dist/{agent-https-CbysxRlV.js → agent-https-SGBI0xP8.js} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/actions-service.d.ts +16 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +158 -9
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +158 -9
- package/system/dist/builtins/core-blocks/device-template-door.d.ts +25 -0
- package/system/dist/builtins/core-blocks/fan-presets-service.d.ts +5 -0
- package/system/dist/builtins/core-blocks/hero-layout-service.d.ts +2 -0
- package/system/dist/builtins/core-blocks/scheduler/scheduler-engine.d.ts +5 -0
- package/system/dist/builtins/core-blocks/step-condition-door.d.ts +19 -0
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.d.ts +7 -0
- package/system/dist/builtins/device-manager/device-manager.addon.js +655 -2
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +653 -1
- package/system/dist/builtins/device-manager/device-template/template-host.d.ts +60 -0
- package/system/dist/builtins/device-manager/device-template-actions.d.ts +33 -0
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +9 -9
- package/system/dist/builtins/system-config/system-config.addon.mjs +6 -6
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-CKtkENOg.js → capture-engine-6MVUyUry.js} +1 -1
- package/system/dist/{capture-engine-WSpdP-gE.mjs → capture-engine-BSjE-CQA.mjs} +1 -1
- package/system/dist/{composition-sources-6Qx72gmK.js → composition-sources-BBAOXZdC.js} +1 -1
- package/system/dist/{composition-sources-Dr6uwBGw.mjs → composition-sources-C8T9DRbZ.mjs} +1 -1
- package/system/dist/{constants-URzk8siY.mjs → constants-CReG6K4k.mjs} +1 -1
- package/system/dist/{constants-BchSDmTD.js → constants-v0g9--wN.js} +1 -1
- package/system/dist/{device-ca-kANxsBE5.js → device-ca-BFcBTfff.js} +1 -1
- package/system/dist/{device-ca-Bu1E5Vgr.mjs → device-ca-cX8qUs2s.mjs} +1 -1
- package/system/dist/device-template-worker.js +5 -7032
- package/system/dist/device-template-worker.mjs +1 -7026
- package/system/dist/{dist-R_mOSFtH.js → dist-C2czR9xK.js} +2077 -167
- package/system/dist/{dist-C0Df8iJl.mjs → dist-DjBZ1HhF.mjs} +2036 -168
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-pxgLcmqO.mjs → hub-mdns-ciao-Cnr8xiSd.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-2AZ3ucDO.js → hub-mdns-ciao-CpCleue0.js} +2 -2
- package/system/dist/index.js +8 -8
- package/system/dist/index.mjs +8 -8
- package/system/dist/{legacy-integration-rows-door-Cj58BS60.mjs → legacy-integration-rows-door-CGajkVPh.mjs} +1 -1
- package/system/dist/{legacy-integration-rows-door-g4CeLJ9g.js → legacy-integration-rows-door-DhW6mPZj.js} +1 -1
- package/system/dist/{restore-archive-CAh7u-rY.js → restore-archive-BLab80kx.js} +7 -7
- package/system/dist/{restore-archive-Bd7fgVo8.mjs → restore-archive-eA7L58KT.mjs} +8 -8
- package/system/dist/template-protocol-BmMM5VBf.mjs +7033 -0
- package/system/dist/template-protocol-CTP4eAo_.js +7059 -0
- package/system/dist/{wal-maintenance-DMf2oEQ-.mjs → wal-maintenance-DeBxoOFh.mjs} +0 -0
- package/system/dist/{wal-maintenance--0liHBxL.js → wal-maintenance-DhnSF7K-.js} +0 -0
- package/system/package.json +1 -1
|
@@ -803,7 +803,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
803
803
|
return EventCategory;
|
|
804
804
|
}({});
|
|
805
805
|
//#endregion
|
|
806
|
-
//#region ../types/dist/device-type-
|
|
806
|
+
//#region ../types/dist/device-type-DTTZKB2I.mjs
|
|
807
807
|
/**
|
|
808
808
|
import { errMsg } from '@camstack/types'
|
|
809
809
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -929,6 +929,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
929
929
|
* (`reboot`, `device-admin-link`). Products are NOT its children — they are
|
|
930
930
|
* adopted beside it — and its connection settings stay on the integration. */
|
|
931
931
|
DeviceType["Gateway"] = "gateway";
|
|
932
|
+
/** A heat pump (any vendor): the compressor unit with its circuits (heating, hot
|
|
933
|
+
* water, cooling, solar), its system modes and its power. One main read-only
|
|
934
|
+
* `heat-pump-status` cap carries all of it; `heat-pump-control` sets it (D1026). */
|
|
935
|
+
DeviceType["HeatPump"] = "heat-pump";
|
|
932
936
|
return DeviceType;
|
|
933
937
|
}({});
|
|
934
938
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -1211,7 +1215,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1211
1215
|
return DeviceRole;
|
|
1212
1216
|
}({});
|
|
1213
1217
|
//#endregion
|
|
1214
|
-
//#region ../types/dist/sleep-
|
|
1218
|
+
//#region ../types/dist/sleep-DnVqHJc4.mjs
|
|
1215
1219
|
/**
|
|
1216
1220
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1217
1221
|
* window to float samples (D455).
|
|
@@ -3338,7 +3342,7 @@ var SecretOverwriteRefusedError = class extends Error {
|
|
|
3338
3342
|
this.name = "SecretOverwriteRefusedError";
|
|
3339
3343
|
}
|
|
3340
3344
|
};
|
|
3341
|
-
function isRecord$3(value) {
|
|
3345
|
+
function isRecord$3$1(value) {
|
|
3342
3346
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3343
3347
|
}
|
|
3344
3348
|
function resolvedValue(pass, marker) {
|
|
@@ -3367,7 +3371,7 @@ function inArray(pass, incoming, stored) {
|
|
|
3367
3371
|
return incoming.map((item, index) => {
|
|
3368
3372
|
const twin = stored[index];
|
|
3369
3373
|
if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
|
|
3370
|
-
if (isRecord$3(item) && isRecord$3(twin)) return inArrayRow(pass, item, twin);
|
|
3374
|
+
if (isRecord$3$1(item) && isRecord$3$1(twin)) return inArrayRow(pass, item, twin);
|
|
3371
3375
|
if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
|
|
3372
3376
|
return item;
|
|
3373
3377
|
});
|
|
@@ -3378,7 +3382,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
3378
3382
|
const twin = stored[key];
|
|
3379
3383
|
if (isSecretMarker(twin)) {
|
|
3380
3384
|
if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
|
|
3381
|
-
} else if (isRecord$3(value) && isRecord$3(twin)) out[key] = inArrayRow(pass, value, twin);
|
|
3385
|
+
} else if (isRecord$3$1(value) && isRecord$3$1(twin)) out[key] = inArrayRow(pass, value, twin);
|
|
3382
3386
|
else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
|
|
3383
3387
|
}
|
|
3384
3388
|
return out;
|
|
@@ -3386,7 +3390,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
3386
3390
|
async function walk(pass, incoming, stored) {
|
|
3387
3391
|
if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
|
|
3388
3392
|
if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
|
|
3389
|
-
if (!isRecord$3(incoming) || !isRecord$3(stored)) return incoming;
|
|
3393
|
+
if (!isRecord$3$1(incoming) || !isRecord$3$1(stored)) return incoming;
|
|
3390
3394
|
const out = { ...incoming };
|
|
3391
3395
|
for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
|
|
3392
3396
|
return out;
|
|
@@ -3417,7 +3421,7 @@ async function restoreUnchangedSecrets(input) {
|
|
|
3417
3421
|
function isJsonEqual(a, b) {
|
|
3418
3422
|
if (Object.is(a, b)) return true;
|
|
3419
3423
|
if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
|
|
3420
|
-
if (isRecord$3(a) && isRecord$3(b)) {
|
|
3424
|
+
if (isRecord$3$1(a) && isRecord$3$1(b)) {
|
|
3421
3425
|
const keys = Object.keys(a);
|
|
3422
3426
|
if (keys.length !== Object.keys(b).length) return false;
|
|
3423
3427
|
return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
|
|
@@ -3441,7 +3445,7 @@ function markerKeysOf(blob, owner) {
|
|
|
3441
3445
|
}
|
|
3442
3446
|
function nodeFromStored(value, owner) {
|
|
3443
3447
|
if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
|
|
3444
|
-
if (!isRecord$3(value)) return null;
|
|
3448
|
+
if (!isRecord$3$1(value)) return null;
|
|
3445
3449
|
const children = /* @__PURE__ */ new Map();
|
|
3446
3450
|
for (const [key, child] of Object.entries(value)) {
|
|
3447
3451
|
const node = nodeFromStored(child, owner);
|
|
@@ -6580,7 +6584,7 @@ function t(en, it) {
|
|
|
6580
6584
|
* Things an operator switches, opens, sets or arms: lights, plugs, sirens,
|
|
6581
6585
|
* covers, valves, locks, climate, fans, alarm panels.
|
|
6582
6586
|
*/
|
|
6583
|
-
var ON = t("On", "Acceso");
|
|
6587
|
+
var ON$1 = t("On", "Acceso");
|
|
6584
6588
|
var PERCENT = t("Percentage", "Percentuale");
|
|
6585
6589
|
var OPEN_CLOSE_STATES = [
|
|
6586
6590
|
{
|
|
@@ -6640,7 +6644,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
6640
6644
|
state: [{
|
|
6641
6645
|
kind: "boolean",
|
|
6642
6646
|
field: "on",
|
|
6643
|
-
label: ON,
|
|
6647
|
+
label: ON$1,
|
|
6644
6648
|
whenTrue: t("When {device} turns on", "Quando {device} si accende"),
|
|
6645
6649
|
whenFalse: t("When {device} turns off", "Quando {device} si spegne"),
|
|
6646
6650
|
icon: "power"
|
|
@@ -7806,7 +7810,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
7806
7810
|
state: [{
|
|
7807
7811
|
kind: "boolean",
|
|
7808
7812
|
field: "on",
|
|
7809
|
-
label: ON,
|
|
7813
|
+
label: ON$1,
|
|
7810
7814
|
whenTrue: t("When {device} turns on", "Quando {device} si accende"),
|
|
7811
7815
|
whenFalse: t("When {device} turns off", "Quando {device} si spegne"),
|
|
7812
7816
|
icon: "power"
|
|
@@ -10218,6 +10222,133 @@ var CAMERA_CAP_VOCABULARY = {
|
|
|
10218
10222
|
}
|
|
10219
10223
|
};
|
|
10220
10224
|
/**
|
|
10225
|
+
* The heat pump (D1026): its system modes are phrased for automations, each with the
|
|
10226
|
+
* values the gateway really accepts; the per-circuit parameters need a circuit and are
|
|
10227
|
+
* set from the device page.
|
|
10228
|
+
*/
|
|
10229
|
+
var OFF = {
|
|
10230
|
+
value: "off",
|
|
10231
|
+
label: t("Off", "Off")
|
|
10232
|
+
};
|
|
10233
|
+
var AUTO$1 = {
|
|
10234
|
+
value: "auto",
|
|
10235
|
+
label: t("Auto", "Auto")
|
|
10236
|
+
};
|
|
10237
|
+
var ON = {
|
|
10238
|
+
value: "on",
|
|
10239
|
+
label: t("On", "On")
|
|
10240
|
+
};
|
|
10241
|
+
var MANUAL = {
|
|
10242
|
+
value: "manual",
|
|
10243
|
+
label: t("Manual", "Manuale")
|
|
10244
|
+
};
|
|
10245
|
+
var HOLIDAY_PROGRAMMES = [OFF, ...[
|
|
10246
|
+
1,
|
|
10247
|
+
2,
|
|
10248
|
+
3,
|
|
10249
|
+
4,
|
|
10250
|
+
5,
|
|
10251
|
+
6,
|
|
10252
|
+
7,
|
|
10253
|
+
8
|
|
10254
|
+
].map((n) => ({
|
|
10255
|
+
value: `hm${n}`,
|
|
10256
|
+
label: t(`Programme ${n}`, `Programma ${n}`)
|
|
10257
|
+
}))];
|
|
10258
|
+
var PER_CIRCUIT = "Needs a circuit: set from the device page, not offered to automations";
|
|
10259
|
+
var HEAT_PUMP_CAP_VOCABULARY = {
|
|
10260
|
+
"heat-pump-status": {
|
|
10261
|
+
scope: "device",
|
|
10262
|
+
noun: t("Heat pump", "Pompa di calore")
|
|
10263
|
+
},
|
|
10264
|
+
"heat-pump-control": {
|
|
10265
|
+
scope: "device",
|
|
10266
|
+
noun: t("Heat pump settings", "Impostazioni pompa di calore"),
|
|
10267
|
+
actions: [
|
|
10268
|
+
{
|
|
10269
|
+
id: "heatPump.silent",
|
|
10270
|
+
method: "setSilentMode",
|
|
10271
|
+
label: t("Set silent mode", "Imposta la modalità silenziosa"),
|
|
10272
|
+
phrase: t("Set silent mode of {device} to {mode}", "Imposta la modalità silenziosa di {device} su {mode}"),
|
|
10273
|
+
icon: "volume-x",
|
|
10274
|
+
openArgs: [{
|
|
10275
|
+
key: "mode",
|
|
10276
|
+
label: t("Silent mode", "Modalità silenziosa"),
|
|
10277
|
+
offer: {
|
|
10278
|
+
kind: "enum",
|
|
10279
|
+
values: [
|
|
10280
|
+
OFF,
|
|
10281
|
+
AUTO$1,
|
|
10282
|
+
ON
|
|
10283
|
+
]
|
|
10284
|
+
}
|
|
10285
|
+
}]
|
|
10286
|
+
},
|
|
10287
|
+
{
|
|
10288
|
+
id: "heatPump.away",
|
|
10289
|
+
method: "setAwayMode",
|
|
10290
|
+
label: t("Set away mode", "Imposta la modalità assente"),
|
|
10291
|
+
phrase: t("Set away mode of {device} to {mode}", "Imposta la modalità assente di {device} su {mode}"),
|
|
10292
|
+
icon: "plane",
|
|
10293
|
+
openArgs: [{
|
|
10294
|
+
key: "mode",
|
|
10295
|
+
label: t("Away mode", "Modalità assente"),
|
|
10296
|
+
offer: {
|
|
10297
|
+
kind: "enum",
|
|
10298
|
+
values: [OFF, ON]
|
|
10299
|
+
}
|
|
10300
|
+
}]
|
|
10301
|
+
},
|
|
10302
|
+
{
|
|
10303
|
+
id: "heatPump.additionalHeater",
|
|
10304
|
+
method: "setAdditionalHeaterMode",
|
|
10305
|
+
label: t("Set additional heater", "Imposta il riscaldatore aggiuntivo"),
|
|
10306
|
+
phrase: t("Set the additional heater of {device} to {mode}", "Imposta il riscaldatore aggiuntivo di {device} su {mode}"),
|
|
10307
|
+
icon: "flame",
|
|
10308
|
+
openArgs: [{
|
|
10309
|
+
key: "mode",
|
|
10310
|
+
label: t("Additional heater", "Riscaldatore aggiuntivo"),
|
|
10311
|
+
offer: {
|
|
10312
|
+
kind: "enum",
|
|
10313
|
+
values: [
|
|
10314
|
+
OFF,
|
|
10315
|
+
MANUAL,
|
|
10316
|
+
AUTO$1
|
|
10317
|
+
]
|
|
10318
|
+
}
|
|
10319
|
+
}]
|
|
10320
|
+
},
|
|
10321
|
+
{
|
|
10322
|
+
id: "heatPump.holiday",
|
|
10323
|
+
method: "setHolidayMode",
|
|
10324
|
+
label: t("Set holiday mode", "Imposta la modalità vacanza"),
|
|
10325
|
+
phrase: t("Set holiday mode of {device} to {mode}", "Imposta la modalità vacanza di {device} su {mode}"),
|
|
10326
|
+
icon: "tree-palm",
|
|
10327
|
+
openArgs: [{
|
|
10328
|
+
key: "mode",
|
|
10329
|
+
label: t("Holiday programme", "Programma vacanza"),
|
|
10330
|
+
offer: {
|
|
10331
|
+
kind: "enum",
|
|
10332
|
+
values: HOLIDAY_PROGRAMMES
|
|
10333
|
+
}
|
|
10334
|
+
}]
|
|
10335
|
+
}
|
|
10336
|
+
],
|
|
10337
|
+
notOperatorFacing: {
|
|
10338
|
+
setCircuitOperationMode: PER_CIRCUIT,
|
|
10339
|
+
setCircuitHeatCoolMode: PER_CIRCUIT,
|
|
10340
|
+
setCircuitSummerWinter: PER_CIRCUIT,
|
|
10341
|
+
setCircuitComfortSetpoint: PER_CIRCUIT,
|
|
10342
|
+
setCircuitEcoSetpoint: PER_CIRCUIT,
|
|
10343
|
+
setCircuitMaxFlowTemp: PER_CIRCUIT,
|
|
10344
|
+
setDhwOperationMode: PER_CIRCUIT,
|
|
10345
|
+
setDhwTemperatureLevel: PER_CIRCUIT,
|
|
10346
|
+
setDhwChargeDuration: PER_CIRCUIT,
|
|
10347
|
+
startExtraHotWater: PER_CIRCUIT
|
|
10348
|
+
}
|
|
10349
|
+
}
|
|
10350
|
+
};
|
|
10351
|
+
/**
|
|
10221
10352
|
* Things an operator WATCHES: contacts, motion, leaks, smoke, measurements,
|
|
10222
10353
|
* presence, reachability, batteries, doorbells and event sources.
|
|
10223
10354
|
*/
|
|
@@ -10939,6 +11070,7 @@ var CAP_VOCABULARY_BY_NAME = {
|
|
|
10939
11070
|
...ACTUATOR_CAP_VOCABULARY,
|
|
10940
11071
|
...APPLIANCE_CAP_VOCABULARY,
|
|
10941
11072
|
...CAMERA_CAP_VOCABULARY,
|
|
11073
|
+
...HEAT_PUMP_CAP_VOCABULARY,
|
|
10942
11074
|
...SENSOR_CAP_VOCABULARY,
|
|
10943
11075
|
...SYSTEM_CAP_VOCABULARY
|
|
10944
11076
|
};
|
|
@@ -11484,6 +11616,8 @@ var CAP_NAMES = Object.freeze([
|
|
|
11484
11616
|
"group-active",
|
|
11485
11617
|
"group-commands",
|
|
11486
11618
|
"group-status",
|
|
11619
|
+
"heat-pump-control",
|
|
11620
|
+
"heat-pump-status",
|
|
11487
11621
|
"heating-valve",
|
|
11488
11622
|
"hero-layout",
|
|
11489
11623
|
"humidifier",
|
|
@@ -12349,6 +12483,48 @@ Object.freeze({
|
|
|
12349
12483
|
"valueType": "number"
|
|
12350
12484
|
}
|
|
12351
12485
|
],
|
|
12486
|
+
"heat-pump-status": [
|
|
12487
|
+
{
|
|
12488
|
+
"path": "power.thermalW",
|
|
12489
|
+
"valueType": "number"
|
|
12490
|
+
},
|
|
12491
|
+
{
|
|
12492
|
+
"path": "power.electricalW",
|
|
12493
|
+
"valueType": "number"
|
|
12494
|
+
},
|
|
12495
|
+
{
|
|
12496
|
+
"path": "power.compressorPct",
|
|
12497
|
+
"valueType": "number"
|
|
12498
|
+
},
|
|
12499
|
+
{
|
|
12500
|
+
"path": "temperatures.supply",
|
|
12501
|
+
"valueType": "number"
|
|
12502
|
+
},
|
|
12503
|
+
{
|
|
12504
|
+
"path": "temperatures.return",
|
|
12505
|
+
"valueType": "number"
|
|
12506
|
+
},
|
|
12507
|
+
{
|
|
12508
|
+
"path": "temperatures.outdoor",
|
|
12509
|
+
"valueType": "number"
|
|
12510
|
+
},
|
|
12511
|
+
{
|
|
12512
|
+
"path": "energy.thermalKwh",
|
|
12513
|
+
"valueType": "number"
|
|
12514
|
+
},
|
|
12515
|
+
{
|
|
12516
|
+
"path": "energy.electricalKwh",
|
|
12517
|
+
"valueType": "number"
|
|
12518
|
+
},
|
|
12519
|
+
{
|
|
12520
|
+
"path": "waterPressureBar",
|
|
12521
|
+
"valueType": "number"
|
|
12522
|
+
},
|
|
12523
|
+
{
|
|
12524
|
+
"path": "starts",
|
|
12525
|
+
"valueType": "number"
|
|
12526
|
+
}
|
|
12527
|
+
],
|
|
12352
12528
|
"heating-valve": [{
|
|
12353
12529
|
"path": "position",
|
|
12354
12530
|
"valueType": "number"
|
|
@@ -13629,7 +13805,7 @@ function sleep(ms) {
|
|
|
13629
13805
|
return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
13630
13806
|
}
|
|
13631
13807
|
//#endregion
|
|
13632
|
-
//#region ../types/dist/composition-
|
|
13808
|
+
//#region ../types/dist/composition-C6TZGqUb.mjs
|
|
13633
13809
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
13634
13810
|
opus: "libopus",
|
|
13635
13811
|
aac: "aac",
|
|
@@ -43705,11 +43881,35 @@ function normalizeStepTargets(steps) {
|
|
|
43705
43881
|
/**
|
|
43706
43882
|
* The steps an internal Action may contain: cap and wait, and nothing that can
|
|
43707
43883
|
* call back into an Action — so an Action can never reach itself (no cycles).
|
|
43884
|
+
* This is the LEAF shape: no condition of its own.
|
|
43885
|
+
*/
|
|
43886
|
+
var LeafActionStepSchema = z.discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
|
|
43887
|
+
/**
|
|
43888
|
+
* The optional guard of a step (#472): `if` is the ONE `when` tree (D980), read
|
|
43889
|
+
* on the state mirror when the step is reached; `else` runs when it is false.
|
|
43890
|
+
* An `else` holds leaf steps only — the nesting is bounded at ONE level, so a
|
|
43891
|
+
* branch can never grow a tree the trace has to draw.
|
|
43708
43892
|
*/
|
|
43709
|
-
var
|
|
43893
|
+
var stepGuardShape = {
|
|
43894
|
+
if: AutomationWhenSchema.optional(),
|
|
43895
|
+
else: z.array(LeafActionStepSchema).max(10).optional()
|
|
43896
|
+
};
|
|
43897
|
+
var elseNeedsIf = {
|
|
43898
|
+
message: "an else list needs the condition it is the other side of (if)",
|
|
43899
|
+
path: ["else"]
|
|
43900
|
+
};
|
|
43901
|
+
var GuardedWaitStepSchema = AutomationWaitStepSchema.extend(stepGuardShape).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
|
|
43902
|
+
var GuardedCapStepSchema = AutomationCapStepBaseSchema.extend(stepGuardShape).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
|
|
43903
|
+
message: "a cap step needs a target",
|
|
43904
|
+
path: ["target"]
|
|
43905
|
+
}).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
|
|
43906
|
+
message: "a domain target needs the vocabulary action it applies to (actionId)",
|
|
43907
|
+
path: ["actionId"]
|
|
43908
|
+
}).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
|
|
43909
|
+
var ActionStepSchema = z.discriminatedUnion("kind", [GuardedWaitStepSchema, GuardedCapStepSchema]);
|
|
43710
43910
|
var AutomationActionSchema = z.discriminatedUnion("kind", [
|
|
43711
|
-
|
|
43712
|
-
|
|
43911
|
+
GuardedWaitStepSchema,
|
|
43912
|
+
GuardedCapStepSchema,
|
|
43713
43913
|
z.object({
|
|
43714
43914
|
kind: z.literal("action"),
|
|
43715
43915
|
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
@@ -44628,7 +44828,7 @@ var StepDeviceTraceSchema = z.object({
|
|
|
44628
44828
|
outcome: z.enum(["ok", "error"]),
|
|
44629
44829
|
message: z.string().optional()
|
|
44630
44830
|
});
|
|
44631
|
-
var
|
|
44831
|
+
var StepTraceBaseSchema = z.object({
|
|
44632
44832
|
/** `actions.<i>` */
|
|
44633
44833
|
path: z.string().min(1),
|
|
44634
44834
|
kind: z.string().min(1),
|
|
@@ -44647,15 +44847,35 @@ var AutomationStepTraceSchema = z.object({
|
|
|
44647
44847
|
* is shown as {@link REDACTED_ARG}. Absent on traces written before it existed.
|
|
44648
44848
|
*/
|
|
44649
44849
|
args: z.record(z.string(), TraceValueSchema).optional(),
|
|
44650
|
-
/**
|
|
44850
|
+
/**
|
|
44851
|
+
* The device values a templated arg printed as `—`, one `ref: reason` each
|
|
44852
|
+
* (D1021): why a sentence says "—" where a number was expected. Bounded.
|
|
44853
|
+
*/
|
|
44854
|
+
templates: z.array(z.string()).max(20).optional(),
|
|
44855
|
+
/**
|
|
44856
|
+
* What the step's own `if` read when the step was reached (#472): `true` the
|
|
44857
|
+
* step ran, `false` its `else` ran (or nothing did), `unknown` a state leaf
|
|
44858
|
+
* could not be read, so NEITHER side ran. Absent on an unguarded step.
|
|
44859
|
+
*/
|
|
44860
|
+
condition: z.enum([
|
|
44861
|
+
"true",
|
|
44862
|
+
"false",
|
|
44863
|
+
"unknown"
|
|
44864
|
+
]).optional(),
|
|
44865
|
+
/** Why the condition read what it read, in the evaluator's own words. */
|
|
44866
|
+
conditionReason: z.string().optional(),
|
|
44867
|
+
/** `empty`: the target resolved to no device, so nothing was done — never silently `ok`. `skipped`: its `if` was false (or unknown) and nothing ran in its place. */
|
|
44651
44868
|
outcome: z.enum([
|
|
44652
44869
|
"ok",
|
|
44653
44870
|
"error",
|
|
44654
44871
|
"not-run",
|
|
44655
|
-
"empty"
|
|
44872
|
+
"empty",
|
|
44873
|
+
"skipped"
|
|
44656
44874
|
]),
|
|
44657
44875
|
message: z.string().optional()
|
|
44658
44876
|
});
|
|
44877
|
+
/** A step trace; the `else` steps that ran are one level of the same shape (the nesting is bounded at one). */
|
|
44878
|
+
var AutomationStepTraceSchema = StepTraceBaseSchema.extend({ else: z.array(StepTraceBaseSchema).optional() });
|
|
44659
44879
|
var AutomationRunTraceSchema = z.object({
|
|
44660
44880
|
runId: z.string().min(1),
|
|
44661
44881
|
startedAt: z.number(),
|
|
@@ -44963,6 +45183,7 @@ z.enum([
|
|
|
44963
45183
|
"invalid-variables",
|
|
44964
45184
|
"invalid-steps",
|
|
44965
45185
|
"not-linked",
|
|
45186
|
+
"template-scope",
|
|
44966
45187
|
"busy"
|
|
44967
45188
|
]);
|
|
44968
45189
|
/**
|
|
@@ -44987,9 +45208,50 @@ var ActionRunChangedSchema = z.object({
|
|
|
44987
45208
|
lastRunAt: z.number().nullable(),
|
|
44988
45209
|
lastError: z.string().nullable()
|
|
44989
45210
|
});
|
|
45211
|
+
/**
|
|
45212
|
+
* The guard of a conditional step (#472): the step's `if` is the ONE `when`
|
|
45213
|
+
* tree (D980), read on a {@link ConditionMirror} filled for exactly the leaves
|
|
45214
|
+
* the tree names, at the moment the step is reached. A state that cannot be
|
|
45215
|
+
* read is UNKNOWN, and unknown runs neither side (D49: a failed read changes
|
|
45216
|
+
* nothing, and never decides a branch).
|
|
45217
|
+
*/
|
|
45218
|
+
/** Fill a mirror for the tree's leaves from `fetchers` and judge it NOW. */
|
|
45219
|
+
async function evaluateStepCondition(when, fetchers, now = Date.now) {
|
|
45220
|
+
const mirror = new ConditionMirror(collectWhenMirrorSources(when));
|
|
45221
|
+
await mirror.refresh(fetchers);
|
|
45222
|
+
const evaluation = evaluateWhenTree(when, mirror, now());
|
|
45223
|
+
const first = evaluation.nodes.filter((n) => n.outcome !== "pass").map((n) => n.reason)[0];
|
|
45224
|
+
if (evaluation.unknown) return {
|
|
45225
|
+
result: "unknown",
|
|
45226
|
+
reason: `a state the condition reads is not known${first === void 0 ? "" : ` (${first})`}`
|
|
45227
|
+
};
|
|
45228
|
+
return evaluation.pass ? {
|
|
45229
|
+
result: "true",
|
|
45230
|
+
reason: "the condition holds"
|
|
45231
|
+
} : {
|
|
45232
|
+
result: "false",
|
|
45233
|
+
reason: first ?? "the condition does not hold"
|
|
45234
|
+
};
|
|
45235
|
+
}
|
|
44990
45236
|
function errorMessage(err) {
|
|
44991
45237
|
return err instanceof Error ? err.message : String(err);
|
|
44992
45238
|
}
|
|
45239
|
+
/** A guard that throws is an unknown, never a crash of the run. */
|
|
45240
|
+
async function readGuard(guard) {
|
|
45241
|
+
try {
|
|
45242
|
+
return await guard();
|
|
45243
|
+
} catch (err) {
|
|
45244
|
+
return {
|
|
45245
|
+
result: "unknown",
|
|
45246
|
+
reason: `the condition could not be read: ${errorMessage(err)}`
|
|
45247
|
+
};
|
|
45248
|
+
}
|
|
45249
|
+
}
|
|
45250
|
+
/** The else level of a trace is one level deep: a nested trace carries no `else` of its own. */
|
|
45251
|
+
function withoutElse(trace) {
|
|
45252
|
+
const { else: _else, ...rest } = trace;
|
|
45253
|
+
return rest;
|
|
45254
|
+
}
|
|
44993
45255
|
async function runSteps(steps, options) {
|
|
44994
45256
|
const traces = [];
|
|
44995
45257
|
let failed = false;
|
|
@@ -45007,10 +45269,57 @@ async function runSteps(steps, options) {
|
|
|
45007
45269
|
continue;
|
|
45008
45270
|
}
|
|
45009
45271
|
const startedAt = options.now();
|
|
45272
|
+
let guardTrace = {};
|
|
45273
|
+
if (step.guard !== void 0) {
|
|
45274
|
+
const verdict = await readGuard(step.guard);
|
|
45275
|
+
guardTrace = {
|
|
45276
|
+
condition: verdict.result,
|
|
45277
|
+
conditionReason: verdict.reason
|
|
45278
|
+
};
|
|
45279
|
+
if (verdict.result === "unknown") options.onGuardUnknown?.({
|
|
45280
|
+
index,
|
|
45281
|
+
path,
|
|
45282
|
+
reason: verdict.reason,
|
|
45283
|
+
deviceId: step.meta.deviceId
|
|
45284
|
+
});
|
|
45285
|
+
if (verdict.result !== "true") {
|
|
45286
|
+
const branch = verdict.result === "false" ? step.otherwise ?? [] : [];
|
|
45287
|
+
if (branch.length === 0) {
|
|
45288
|
+
traces.push({
|
|
45289
|
+
...step.meta,
|
|
45290
|
+
...guardTrace,
|
|
45291
|
+
path,
|
|
45292
|
+
startedAt,
|
|
45293
|
+
endedAt: options.now(),
|
|
45294
|
+
outcome: "skipped",
|
|
45295
|
+
message: verdict.result === "unknown" ? `not run: ${verdict.reason}` : `not run: the condition is false (${verdict.reason})`
|
|
45296
|
+
});
|
|
45297
|
+
continue;
|
|
45298
|
+
}
|
|
45299
|
+
const sub = await runSteps(branch, {
|
|
45300
|
+
...options,
|
|
45301
|
+
pathPrefix: `${path}.else`
|
|
45302
|
+
});
|
|
45303
|
+
if (sub.failed) failed = true;
|
|
45304
|
+
else if (sub.aborted) aborted = true;
|
|
45305
|
+
traces.push({
|
|
45306
|
+
...step.meta,
|
|
45307
|
+
...guardTrace,
|
|
45308
|
+
path,
|
|
45309
|
+
startedAt,
|
|
45310
|
+
endedAt: options.now(),
|
|
45311
|
+
outcome: sub.failed ? "error" : "ok",
|
|
45312
|
+
...sub.failed ? { message: "an else step failed" } : {},
|
|
45313
|
+
else: sub.steps.map(withoutElse)
|
|
45314
|
+
});
|
|
45315
|
+
continue;
|
|
45316
|
+
}
|
|
45317
|
+
}
|
|
45010
45318
|
let deviceId = step.meta.deviceId;
|
|
45011
45319
|
let sent;
|
|
45012
45320
|
const perDevice = [];
|
|
45013
45321
|
let emptyReason;
|
|
45322
|
+
let templateNotes = [];
|
|
45014
45323
|
const scope = {
|
|
45015
45324
|
setDeviceId: (id) => {
|
|
45016
45325
|
deviceId = id;
|
|
@@ -45023,8 +45332,12 @@ async function runSteps(steps, options) {
|
|
|
45023
45332
|
},
|
|
45024
45333
|
setArgs: (args) => {
|
|
45025
45334
|
sent = args;
|
|
45335
|
+
},
|
|
45336
|
+
setTemplateNotes: (notes) => {
|
|
45337
|
+
templateNotes = notes.slice(0, 20);
|
|
45026
45338
|
}
|
|
45027
45339
|
};
|
|
45340
|
+
const templatesTrace = () => templateNotes.length === 0 ? {} : { templates: [...templateNotes] };
|
|
45028
45341
|
const argsTrace = () => sent === void 0 ? {} : { args: buildStepArgsTrace(sent) };
|
|
45029
45342
|
const devicesTrace = () => perDevice.length === 0 ? {} : { devices: perDevice.slice(0, 200) };
|
|
45030
45343
|
try {
|
|
@@ -45033,7 +45346,9 @@ async function runSteps(steps, options) {
|
|
|
45033
45346
|
...step.meta,
|
|
45034
45347
|
...deviceId === void 0 || perDevice.length > 1 ? {} : { deviceId },
|
|
45035
45348
|
...argsTrace(),
|
|
45349
|
+
...templatesTrace(),
|
|
45036
45350
|
...devicesTrace(),
|
|
45351
|
+
...guardTrace,
|
|
45037
45352
|
path,
|
|
45038
45353
|
startedAt,
|
|
45039
45354
|
endedAt: options.now(),
|
|
@@ -45053,7 +45368,9 @@ async function runSteps(steps, options) {
|
|
|
45053
45368
|
...step.meta,
|
|
45054
45369
|
...deviceId === void 0 || perDevice.length > 1 ? {} : { deviceId },
|
|
45055
45370
|
...argsTrace(),
|
|
45371
|
+
...templatesTrace(),
|
|
45056
45372
|
...devicesTrace(),
|
|
45373
|
+
...guardTrace,
|
|
45057
45374
|
path,
|
|
45058
45375
|
startedAt,
|
|
45059
45376
|
endedAt: options.now(),
|
|
@@ -45102,6 +45419,125 @@ function resolveStepArgs(value, vars, onMissing) {
|
|
|
45102
45419
|
if (value !== null && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, resolveStepArgs(v, vars, onMissing)]));
|
|
45103
45420
|
return value;
|
|
45104
45421
|
}
|
|
45422
|
+
/** A device template that did not render: the step fails with this, never throws past `runSteps`. */
|
|
45423
|
+
var StepTemplateError = class extends Error {
|
|
45424
|
+
reason;
|
|
45425
|
+
constructor(reason, message) {
|
|
45426
|
+
super(`device template [${reason}]: ${message}`);
|
|
45427
|
+
this.reason = reason;
|
|
45428
|
+
this.name = "StepTemplateError";
|
|
45429
|
+
}
|
|
45430
|
+
};
|
|
45431
|
+
/**
|
|
45432
|
+
* A `{{vars.x}}` slot, set aside while a template renders. The slot carries a
|
|
45433
|
+
* nonce drawn per call, so a device value that happens to contain the sentinel
|
|
45434
|
+
* characters can never name a held variable.
|
|
45435
|
+
*/
|
|
45436
|
+
var VAR_SLOT_OPEN = "";
|
|
45437
|
+
var VAR_SLOT_CLOSE = "";
|
|
45438
|
+
var TEMPLATE_MARKUP_RE = /\{\{|\{%/;
|
|
45439
|
+
function newSlotNonce() {
|
|
45440
|
+
return Math.random().toString(36).slice(2, 12);
|
|
45441
|
+
}
|
|
45442
|
+
function slotPattern(nonce) {
|
|
45443
|
+
return new RegExp(`${VAR_SLOT_OPEN}${nonce}:([A-Za-z_][A-Za-z0-9_]*)${VAR_SLOT_CLOSE}`, "g");
|
|
45444
|
+
}
|
|
45445
|
+
/** True when a string, once its `{{vars.x}}` slots are set aside, still carries template markup. */
|
|
45446
|
+
function carriesDeviceTemplate(text) {
|
|
45447
|
+
return TEMPLATE_MARKUP_RE.test(text.replace(TEMPLATE_RE, ""));
|
|
45448
|
+
}
|
|
45449
|
+
/** Every string in `value` that is a device template (D1021), de-duplicated, in walk order. */
|
|
45450
|
+
function collectDeviceTemplates(value) {
|
|
45451
|
+
const found = /* @__PURE__ */ new Set();
|
|
45452
|
+
const walk = (node) => {
|
|
45453
|
+
if (typeof node === "string") {
|
|
45454
|
+
if (carriesDeviceTemplate(node)) found.add(node);
|
|
45455
|
+
} else if (Array.isArray(node)) for (const item of node) walk(item);
|
|
45456
|
+
else if (node !== null && typeof node === "object") for (const item of Object.values(node)) walk(item);
|
|
45457
|
+
};
|
|
45458
|
+
walk(value);
|
|
45459
|
+
return [...found];
|
|
45460
|
+
}
|
|
45461
|
+
function protectVarSlots(text, nonce) {
|
|
45462
|
+
return text.replace(TEMPLATE_RE, (_m, key) => `${VAR_SLOT_OPEN}${nonce}:${key}${VAR_SLOT_CLOSE}`);
|
|
45463
|
+
}
|
|
45464
|
+
function restoreVarSlots(text, nonce, vars, onMissing) {
|
|
45465
|
+
return text.replace(slotPattern(nonce), (_m, key) => {
|
|
45466
|
+
const v = vars[key];
|
|
45467
|
+
if (v === void 0) {
|
|
45468
|
+
onMissing(key);
|
|
45469
|
+
return "";
|
|
45470
|
+
}
|
|
45471
|
+
return String(v);
|
|
45472
|
+
});
|
|
45473
|
+
}
|
|
45474
|
+
/**
|
|
45475
|
+
* {@link resolveStepArgs} plus the device templates of a step (D1021). A string
|
|
45476
|
+
* that carries `{{ … }}` / `{% … %}` beyond a `{{vars.x}}` slot is rendered by
|
|
45477
|
+
* `render` BEFORE the variables are put in, so a variable's value is data and
|
|
45478
|
+
* never template source (an action variable can come from a non-admin caller).
|
|
45479
|
+
* A refused render, or no renderer, throws {@link StepTemplateError}: the step
|
|
45480
|
+
* fails with the typed reason and nothing is dispatched.
|
|
45481
|
+
*/
|
|
45482
|
+
async function resolveStepArgsWithTemplates(value, vars, onMissing, render) {
|
|
45483
|
+
const nonce = newSlotNonce();
|
|
45484
|
+
const sources = [];
|
|
45485
|
+
const indexOf = /* @__PURE__ */ new Map();
|
|
45486
|
+
const hold = (text) => {
|
|
45487
|
+
const known = indexOf.get(text);
|
|
45488
|
+
if (known !== void 0) return known;
|
|
45489
|
+
sources.push(text);
|
|
45490
|
+
indexOf.set(text, sources.length - 1);
|
|
45491
|
+
return sources.length - 1;
|
|
45492
|
+
};
|
|
45493
|
+
class Pending {
|
|
45494
|
+
index;
|
|
45495
|
+
constructor(index) {
|
|
45496
|
+
this.index = index;
|
|
45497
|
+
}
|
|
45498
|
+
}
|
|
45499
|
+
const collect = (node) => {
|
|
45500
|
+
if (isVarRef(node)) return resolveStepArgs(node, vars, onMissing);
|
|
45501
|
+
if (typeof node === "string") return carriesDeviceTemplate(node) ? new Pending(hold(protectVarSlots(node, nonce))) : resolveStepArgs(node, vars, onMissing);
|
|
45502
|
+
if (Array.isArray(node)) return node.map(collect);
|
|
45503
|
+
if (node !== null && typeof node === "object") return Object.fromEntries(Object.entries(node).map(([k, v]) => [k, collect(v)]));
|
|
45504
|
+
return node;
|
|
45505
|
+
};
|
|
45506
|
+
const skeleton = collect(value);
|
|
45507
|
+
if (sources.length === 0) return {
|
|
45508
|
+
value: skeleton,
|
|
45509
|
+
notes: []
|
|
45510
|
+
};
|
|
45511
|
+
if (render === void 0) throw new StepTemplateError("unavailable", "this node has no device template renderer");
|
|
45512
|
+
let answers;
|
|
45513
|
+
try {
|
|
45514
|
+
answers = await render(sources);
|
|
45515
|
+
} catch (err) {
|
|
45516
|
+
throw new StepTemplateError("unavailable", errorMessage(err));
|
|
45517
|
+
}
|
|
45518
|
+
const texts = [];
|
|
45519
|
+
const notes = [];
|
|
45520
|
+
for (const index of sources.keys()) {
|
|
45521
|
+
const answer = answers[index];
|
|
45522
|
+
if (answer === void 0) throw new StepTemplateError("unavailable", `no answer for template ${index + 1}`);
|
|
45523
|
+
if (!answer.ok) throw new StepTemplateError(answer.refusal.reason, answer.refusal.message);
|
|
45524
|
+
texts.push(restoreVarSlots(answer.text, nonce, vars, onMissing));
|
|
45525
|
+
for (const entry of answer.trace) {
|
|
45526
|
+
const note = `${entry.ref}: ${entry.reason}`;
|
|
45527
|
+
if (!notes.includes(note)) notes.push(note);
|
|
45528
|
+
}
|
|
45529
|
+
}
|
|
45530
|
+
const fill = (node) => {
|
|
45531
|
+
if (node instanceof Pending) return texts[node.index] ?? "";
|
|
45532
|
+
if (Array.isArray(node)) return node.map(fill);
|
|
45533
|
+
if (node !== null && typeof node === "object") return Object.fromEntries(Object.entries(node).map(([k, v]) => [k, fill(v)]));
|
|
45534
|
+
return node;
|
|
45535
|
+
};
|
|
45536
|
+
return {
|
|
45537
|
+
value: fill(skeleton),
|
|
45538
|
+
notes
|
|
45539
|
+
};
|
|
45540
|
+
}
|
|
45105
45541
|
function stepMetaOfAction(step) {
|
|
45106
45542
|
if (step.kind === "wait") return { kind: "wait" };
|
|
45107
45543
|
const { target, actionId } = normalizeCapStep(step);
|
|
@@ -45155,19 +45591,36 @@ async function runForDevices(deviceIds, scope, work, concurrency = 4) {
|
|
|
45155
45591
|
* variables. Variables are substituted per step, at the moment it runs, so a
|
|
45156
45592
|
* missing one fails THAT step (traced) and leaves the later ones not-run.
|
|
45157
45593
|
*/
|
|
45594
|
+
/** The guard and the else list of a step, bound to the run (#472); `{}` for an unguarded step. */
|
|
45595
|
+
function guardOf(step, vars, deps) {
|
|
45596
|
+
const when = step.if;
|
|
45597
|
+
if (when === void 0) return {};
|
|
45598
|
+
const evaluate = deps.evaluateCondition;
|
|
45599
|
+
return {
|
|
45600
|
+
guard: async () => evaluate === void 0 ? {
|
|
45601
|
+
result: "unknown",
|
|
45602
|
+
reason: "this consumer has no condition evaluator"
|
|
45603
|
+
} : evaluate(when),
|
|
45604
|
+
...step.else === void 0 ? {} : { otherwise: buildActionSteps(step.else, vars, deps) }
|
|
45605
|
+
};
|
|
45606
|
+
}
|
|
45158
45607
|
function buildActionSteps(steps, vars, deps) {
|
|
45159
45608
|
return steps.map((step) => {
|
|
45609
|
+
const guarded = guardOf(step, vars, deps);
|
|
45160
45610
|
const meta = stepMetaOfAction(step);
|
|
45161
45611
|
if (step.kind === "wait") return {
|
|
45162
45612
|
meta,
|
|
45613
|
+
...guarded,
|
|
45163
45614
|
run: () => deps.sleep(step.seconds * 1e3)
|
|
45164
45615
|
};
|
|
45165
45616
|
const normalized = normalizeCapStep(step);
|
|
45166
45617
|
return {
|
|
45167
45618
|
meta,
|
|
45619
|
+
...guarded,
|
|
45168
45620
|
run: async (scope) => {
|
|
45169
|
-
const
|
|
45170
|
-
|
|
45621
|
+
const templated = await resolveStepArgsWithTemplates(step.args ?? {}, vars, deps.onMissingVar, deps.renderTemplates);
|
|
45622
|
+
if (templated.notes.length > 0) scope.setTemplateNotes(templated.notes);
|
|
45623
|
+
const args = isPlainRecord(templated.value) ? templated.value : {};
|
|
45171
45624
|
const target = await deps.resolveTarget(normalized.target, normalized.actionId, vars, {
|
|
45172
45625
|
actionId: normalized.actionId,
|
|
45173
45626
|
owner: deps.owner
|
|
@@ -52010,7 +52463,7 @@ function irSourceProblem(source) {
|
|
|
52010
52463
|
throw err;
|
|
52011
52464
|
}
|
|
52012
52465
|
}
|
|
52013
|
-
function same$
|
|
52466
|
+
function same$2(a, b) {
|
|
52014
52467
|
return a.trim().toLowerCase() === b.trim().toLowerCase();
|
|
52015
52468
|
}
|
|
52016
52469
|
/** The `digits` source that declares this channel number, or null. */
|
|
@@ -52024,7 +52477,7 @@ function findChannelSource(sources, number) {
|
|
|
52024
52477
|
* the number reach the same source; nothing else is guessed.
|
|
52025
52478
|
*/
|
|
52026
52479
|
function resolveRemoteSource(sources, query) {
|
|
52027
|
-
const byName = sources.find((source) => same$
|
|
52480
|
+
const byName = sources.find((source) => same$2(source.name, query));
|
|
52028
52481
|
if (byName !== void 0) return byName;
|
|
52029
52482
|
const byId = sources.find((source) => source.id === query.trim());
|
|
52030
52483
|
if (byId !== void 0) return byId;
|
|
@@ -52386,7 +52839,8 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
52386
52839
|
DeviceType.Washer,
|
|
52387
52840
|
DeviceType.Heater,
|
|
52388
52841
|
DeviceType.Dryer,
|
|
52389
|
-
DeviceType.Gateway
|
|
52842
|
+
DeviceType.Gateway,
|
|
52843
|
+
DeviceType.HeatPump
|
|
52390
52844
|
],
|
|
52391
52845
|
apply: "add",
|
|
52392
52846
|
vocabularyCap: "consumables",
|
|
@@ -52929,6 +53383,25 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
52929
53383
|
}]
|
|
52930
53384
|
}
|
|
52931
53385
|
};
|
|
53386
|
+
/**
|
|
53387
|
+
* Unit meta on runtime-state fields. The composed-device row reads this;
|
|
53388
|
+
* it is not an override list (D944).
|
|
53389
|
+
*/
|
|
53390
|
+
var CAP_RUNTIME_FIELD_UNITS = {
|
|
53391
|
+
"ambient-light-sensor": { illuminance: "lx" },
|
|
53392
|
+
"battery": {
|
|
53393
|
+
level: "%",
|
|
53394
|
+
voltage: "V"
|
|
53395
|
+
},
|
|
53396
|
+
"humidity-sensor": { humidity: "%" },
|
|
53397
|
+
"power-meter": {
|
|
53398
|
+
power: "W",
|
|
53399
|
+
energy: "kWh",
|
|
53400
|
+
voltage: "V",
|
|
53401
|
+
current: "A"
|
|
53402
|
+
},
|
|
53403
|
+
"temperature-sensor": { temperature: "°C" }
|
|
53404
|
+
};
|
|
52932
53405
|
function problem(code, path, message) {
|
|
52933
53406
|
return {
|
|
52934
53407
|
code,
|
|
@@ -53970,7 +54443,7 @@ async function runFanOut(calls, invoke) {
|
|
|
53970
54443
|
}
|
|
53971
54444
|
/**
|
|
53972
54445
|
* Cap history catalog, projected from every `*.cap.ts` `history` block.
|
|
53973
|
-
*
|
|
54446
|
+
* 44 caps with series (87 series), 37 caps answered `'none'`.
|
|
53974
54447
|
* Field keys are `runtimeState` paths (`a.b` into fixed objects only).
|
|
53975
54448
|
*/
|
|
53976
54449
|
var HISTORY_CATALOG = {
|
|
@@ -54128,6 +54601,54 @@ var HISTORY_CATALOG = {
|
|
|
54128
54601
|
},
|
|
54129
54602
|
"flood": { "flooded": { kind: "boolean" } },
|
|
54130
54603
|
"gas": { "detected": { kind: "boolean" } },
|
|
54604
|
+
"heat-pump-status": {
|
|
54605
|
+
"power.thermalW": {
|
|
54606
|
+
kind: "gauge",
|
|
54607
|
+
unit: "W",
|
|
54608
|
+
deadband: 50,
|
|
54609
|
+
displayName: "Thermal power"
|
|
54610
|
+
},
|
|
54611
|
+
"power.electricalW": {
|
|
54612
|
+
kind: "gauge",
|
|
54613
|
+
unit: "W",
|
|
54614
|
+
deadband: 50,
|
|
54615
|
+
displayName: "Electrical power"
|
|
54616
|
+
},
|
|
54617
|
+
"power.compressorPct": {
|
|
54618
|
+
kind: "gauge",
|
|
54619
|
+
unit: "%",
|
|
54620
|
+
deadband: 2,
|
|
54621
|
+
displayName: "Compressor"
|
|
54622
|
+
},
|
|
54623
|
+
"temperatures.supply": {
|
|
54624
|
+
kind: "gauge",
|
|
54625
|
+
unit: "°C",
|
|
54626
|
+
deadband: .5,
|
|
54627
|
+
displayName: "Supply"
|
|
54628
|
+
},
|
|
54629
|
+
"temperatures.return": {
|
|
54630
|
+
kind: "gauge",
|
|
54631
|
+
unit: "°C",
|
|
54632
|
+
deadband: .5,
|
|
54633
|
+
displayName: "Return"
|
|
54634
|
+
},
|
|
54635
|
+
"temperatures.outdoor": {
|
|
54636
|
+
kind: "gauge",
|
|
54637
|
+
unit: "°C",
|
|
54638
|
+
deadband: .5,
|
|
54639
|
+
displayName: "Outdoor"
|
|
54640
|
+
},
|
|
54641
|
+
"energy.thermalKwh": {
|
|
54642
|
+
kind: "counter",
|
|
54643
|
+
unit: "kWh",
|
|
54644
|
+
displayName: "Thermal energy"
|
|
54645
|
+
},
|
|
54646
|
+
"energy.electricalKwh": {
|
|
54647
|
+
kind: "counter",
|
|
54648
|
+
unit: "kWh",
|
|
54649
|
+
displayName: "Electrical energy"
|
|
54650
|
+
}
|
|
54651
|
+
},
|
|
54131
54652
|
"heating-valve": { "position": {
|
|
54132
54653
|
kind: "gauge",
|
|
54133
54654
|
unit: "%",
|
|
@@ -54341,38 +54862,63 @@ var HISTORY_CATALOG = {
|
|
|
54341
54862
|
};
|
|
54342
54863
|
/**
|
|
54343
54864
|
* Keyed-array series (D917), projected from every `history.items` block:
|
|
54344
|
-
*
|
|
54865
|
+
* 2 caps (6 item fields). The item key is the series SCOPE;
|
|
54345
54866
|
* the series key is `cap:<capName>.<path>[].<field>`.
|
|
54346
54867
|
*/
|
|
54347
|
-
var HISTORY_ITEM_CATALOG = {
|
|
54348
|
-
|
|
54349
|
-
|
|
54350
|
-
|
|
54351
|
-
|
|
54352
|
-
|
|
54353
|
-
|
|
54354
|
-
|
|
54355
|
-
|
|
54356
|
-
|
|
54357
|
-
|
|
54358
|
-
|
|
54359
|
-
|
|
54360
|
-
|
|
54361
|
-
|
|
54362
|
-
|
|
54363
|
-
|
|
54364
|
-
|
|
54365
|
-
|
|
54366
|
-
|
|
54367
|
-
|
|
54368
|
-
|
|
54369
|
-
|
|
54370
|
-
|
|
54371
|
-
|
|
54372
|
-
|
|
54868
|
+
var HISTORY_ITEM_CATALOG = {
|
|
54869
|
+
"consumables": {
|
|
54870
|
+
path: "items",
|
|
54871
|
+
key: "key",
|
|
54872
|
+
label: "label",
|
|
54873
|
+
fields: {
|
|
54874
|
+
"level": {
|
|
54875
|
+
kind: "gauge",
|
|
54876
|
+
unit: "%",
|
|
54877
|
+
deadband: 2,
|
|
54878
|
+
displayName: "Level"
|
|
54879
|
+
},
|
|
54880
|
+
"status": {
|
|
54881
|
+
kind: "enum",
|
|
54882
|
+
displayName: "Status",
|
|
54883
|
+
values: [
|
|
54884
|
+
"ok",
|
|
54885
|
+
"low",
|
|
54886
|
+
"empty",
|
|
54887
|
+
"full",
|
|
54888
|
+
"replace"
|
|
54889
|
+
]
|
|
54890
|
+
},
|
|
54891
|
+
"remaining.value": {
|
|
54892
|
+
kind: "gauge",
|
|
54893
|
+
deadband: 1,
|
|
54894
|
+
displayName: "Remaining"
|
|
54895
|
+
}
|
|
54896
|
+
}
|
|
54897
|
+
},
|
|
54898
|
+
"heat-pump-status": {
|
|
54899
|
+
path: "circuits",
|
|
54900
|
+
key: "id",
|
|
54901
|
+
label: "label",
|
|
54902
|
+
fields: {
|
|
54903
|
+
"currentTemp": {
|
|
54904
|
+
kind: "gauge",
|
|
54905
|
+
unit: "°C",
|
|
54906
|
+
deadband: .5,
|
|
54907
|
+
displayName: "Temperature"
|
|
54908
|
+
},
|
|
54909
|
+
"targetTemp": {
|
|
54910
|
+
kind: "gauge",
|
|
54911
|
+
unit: "°C",
|
|
54912
|
+
minIntervalMs: 0,
|
|
54913
|
+
displayName: "Setpoint"
|
|
54914
|
+
},
|
|
54915
|
+
"mode": {
|
|
54916
|
+
kind: "enum",
|
|
54917
|
+
displayName: "Mode"
|
|
54918
|
+
}
|
|
54373
54919
|
}
|
|
54374
54920
|
}
|
|
54375
|
-
}
|
|
54921
|
+
};
|
|
54376
54922
|
/** The series specs of `capName`; empty for a `'none'` cap or an unknown one. */
|
|
54377
54923
|
function historyFieldsFor(capName) {
|
|
54378
54924
|
return HISTORY_CATALOG[capName] ?? {};
|
|
@@ -57697,6 +58243,161 @@ function checkDeviceAlias(alias, isTaken) {
|
|
|
57697
58243
|
};
|
|
57698
58244
|
}
|
|
57699
58245
|
/**
|
|
58246
|
+
* Device value templates, the parts that need no template engine (D1021).
|
|
58247
|
+
*
|
|
58248
|
+
* A template is plain text with Jinja-style `{{ … }}` / `{% … %}` blocks:
|
|
58249
|
+
* `{{ stufa_veranda.temperature | unit('°F') | round(1) }}`. Devices are named
|
|
58250
|
+
* by their alias (`device-alias.ts`); a field is `alias.field` when the field
|
|
58251
|
+
* name is unique across the device's capabilities, else `alias.<cap>.field`,
|
|
58252
|
+
* and an ambiguous `alias.field` is refused by name.
|
|
58253
|
+
*
|
|
58254
|
+
* The engine itself (nunjucks) lives ONLY in the hub's renderer
|
|
58255
|
+
* (`packages/system/src/builtins/device-manager/device-template/`, guard
|
|
58256
|
+
* `check-device-template-grammar`): it does not sandbox, so it renders only in
|
|
58257
|
+
* a worker thread under a wall-time budget, over frozen plain data. This file
|
|
58258
|
+
* is the shared vocabulary — limits, refusal reasons, the trace, and how a
|
|
58259
|
+
* `(alias, path)` reference resolves against a device's slices.
|
|
58260
|
+
*/
|
|
58261
|
+
var DEVICE_TEMPLATE_MAX_LENGTH = 4096;
|
|
58262
|
+
var DEVICE_TEMPLATE_MAX_OUTPUT = 4096;
|
|
58263
|
+
var DeviceTemplateSchema = z.string().min(1).max(DEVICE_TEMPLATE_MAX_LENGTH);
|
|
58264
|
+
/** The filters a template may use. Anything else is refused at parse time. */
|
|
58265
|
+
var DEVICE_TEMPLATE_FILTERS = [
|
|
58266
|
+
"unit",
|
|
58267
|
+
"round",
|
|
58268
|
+
"default",
|
|
58269
|
+
"since",
|
|
58270
|
+
"ago",
|
|
58271
|
+
"format",
|
|
58272
|
+
"upper",
|
|
58273
|
+
"lower",
|
|
58274
|
+
"title",
|
|
58275
|
+
"capitalize",
|
|
58276
|
+
"trim",
|
|
58277
|
+
"abs",
|
|
58278
|
+
"int",
|
|
58279
|
+
"float",
|
|
58280
|
+
"length",
|
|
58281
|
+
"d",
|
|
58282
|
+
"join",
|
|
58283
|
+
"replace",
|
|
58284
|
+
"first",
|
|
58285
|
+
"last",
|
|
58286
|
+
"sort",
|
|
58287
|
+
"reverse",
|
|
58288
|
+
"sum",
|
|
58289
|
+
"string",
|
|
58290
|
+
"list",
|
|
58291
|
+
"truncate"
|
|
58292
|
+
];
|
|
58293
|
+
var DeviceTemplateRefusalSchema = z.object({
|
|
58294
|
+
reason: z.enum([
|
|
58295
|
+
"too-long",
|
|
58296
|
+
"syntax",
|
|
58297
|
+
"forbidden-syntax",
|
|
58298
|
+
"forbidden-member",
|
|
58299
|
+
"unknown-filter",
|
|
58300
|
+
"ambiguous-field",
|
|
58301
|
+
"busy",
|
|
58302
|
+
"budget-exceeded",
|
|
58303
|
+
"timeout",
|
|
58304
|
+
"output-too-large",
|
|
58305
|
+
"render-failed",
|
|
58306
|
+
"out-of-scope",
|
|
58307
|
+
"unavailable"
|
|
58308
|
+
]),
|
|
58309
|
+
message: z.string()
|
|
58310
|
+
});
|
|
58311
|
+
var DeviceTemplateTraceEntrySchema = z.object({
|
|
58312
|
+
ref: z.string(),
|
|
58313
|
+
reason: z.enum([
|
|
58314
|
+
"unknown-alias",
|
|
58315
|
+
"unknown-field",
|
|
58316
|
+
"no-field",
|
|
58317
|
+
"unavailable"
|
|
58318
|
+
])
|
|
58319
|
+
});
|
|
58320
|
+
var DeviceTemplateRenderSchema = z.discriminatedUnion("ok", [z.object({
|
|
58321
|
+
ok: z.literal(true),
|
|
58322
|
+
text: z.string(),
|
|
58323
|
+
trace: z.array(DeviceTemplateTraceEntrySchema)
|
|
58324
|
+
}), z.object({
|
|
58325
|
+
ok: z.literal(false),
|
|
58326
|
+
refusal: DeviceTemplateRefusalSchema,
|
|
58327
|
+
trace: z.array(DeviceTemplateTraceEntrySchema)
|
|
58328
|
+
})]);
|
|
58329
|
+
/** A capability name as a template spells it: `temperature-sensor` → `temperature_sensor`. */
|
|
58330
|
+
function templateCapKey(cap) {
|
|
58331
|
+
return cap.replace(/-/g, "_");
|
|
58332
|
+
}
|
|
58333
|
+
function isRecord$3(value) {
|
|
58334
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
58335
|
+
}
|
|
58336
|
+
function pickPath(root, path) {
|
|
58337
|
+
let cursor = root;
|
|
58338
|
+
for (const part of path) if (Array.isArray(cursor) && typeof part === "number") cursor = cursor[part];
|
|
58339
|
+
else if (isRecord$3(cursor) && Object.hasOwn(cursor, String(part))) cursor = cursor[String(part)];
|
|
58340
|
+
else return;
|
|
58341
|
+
return cursor;
|
|
58342
|
+
}
|
|
58343
|
+
/**
|
|
58344
|
+
* Resolve the path after an alias. `<cap>.field…` when the first segment names
|
|
58345
|
+
* one of the device's caps; otherwise `field…` when exactly one cap carries a
|
|
58346
|
+
* field of that name; several caps carrying it is `ambiguous`, naming them.
|
|
58347
|
+
*/
|
|
58348
|
+
function resolveTemplateRef(view, path) {
|
|
58349
|
+
const head = path[0];
|
|
58350
|
+
if (head === void 0) return {
|
|
58351
|
+
kind: "missing",
|
|
58352
|
+
reason: "no-field"
|
|
58353
|
+
};
|
|
58354
|
+
const caps = Object.keys(view.slices);
|
|
58355
|
+
const named = caps.find((cap) => cap === head || templateCapKey(cap) === head);
|
|
58356
|
+
if (named !== void 0) {
|
|
58357
|
+
const rest = path.slice(1);
|
|
58358
|
+
if (rest.length === 0) return {
|
|
58359
|
+
kind: "missing",
|
|
58360
|
+
reason: "no-field"
|
|
58361
|
+
};
|
|
58362
|
+
const value = pickPath(view.slices[named], rest);
|
|
58363
|
+
if (value === void 0) return {
|
|
58364
|
+
kind: "missing",
|
|
58365
|
+
reason: "unknown-field"
|
|
58366
|
+
};
|
|
58367
|
+
return {
|
|
58368
|
+
kind: "value",
|
|
58369
|
+
cap: named,
|
|
58370
|
+
fieldPath: rest,
|
|
58371
|
+
value
|
|
58372
|
+
};
|
|
58373
|
+
}
|
|
58374
|
+
const owners = caps.filter((cap) => {
|
|
58375
|
+
const slice = view.slices[cap];
|
|
58376
|
+
return isRecord$3(slice) && Object.hasOwn(slice, String(head));
|
|
58377
|
+
});
|
|
58378
|
+
if (owners.length === 0) return {
|
|
58379
|
+
kind: "missing",
|
|
58380
|
+
reason: "unknown-field"
|
|
58381
|
+
};
|
|
58382
|
+
const [only] = owners;
|
|
58383
|
+
if (owners.length > 1 || only === void 0) return {
|
|
58384
|
+
kind: "ambiguous",
|
|
58385
|
+
field: String(head),
|
|
58386
|
+
caps: owners
|
|
58387
|
+
};
|
|
58388
|
+
const value = pickPath(view.slices[only], path);
|
|
58389
|
+
if (value === void 0) return {
|
|
58390
|
+
kind: "missing",
|
|
58391
|
+
reason: "unknown-field"
|
|
58392
|
+
};
|
|
58393
|
+
return {
|
|
58394
|
+
kind: "value",
|
|
58395
|
+
cap: only,
|
|
58396
|
+
fieldPath: path,
|
|
58397
|
+
value
|
|
58398
|
+
};
|
|
58399
|
+
}
|
|
58400
|
+
/**
|
|
57700
58401
|
* A SITE ZONE — a named part of the property that several locations belong to.
|
|
57701
58402
|
*
|
|
57702
58403
|
* "Night zone" holds every bedroom; "Zona giorno" the living room and the
|
|
@@ -58618,6 +59319,38 @@ var deviceManagerCapability = {
|
|
|
58618
59319
|
kind: "mutation",
|
|
58619
59320
|
auth: "admin"
|
|
58620
59321
|
}),
|
|
59322
|
+
/**
|
|
59323
|
+
* Render device value templates (D1021). The ONE door every consumer uses:
|
|
59324
|
+
* an action step, a scheduler point, a notification rule, a generated
|
|
59325
|
+
* automation block. Admin-only (an in-process block carries the mesh
|
|
59326
|
+
* principal): it reads device state by alias, so a non-admin never calls it
|
|
59327
|
+
* directly. `allowedDeviceIds` is the set the END caller was proven to see;
|
|
59328
|
+
* a template naming another device answers `out-of-scope`. Answers are
|
|
59329
|
+
* index-aligned with `templates`.
|
|
59330
|
+
*/
|
|
59331
|
+
renderDeviceTemplates: method(z.object({
|
|
59332
|
+
templates: z.array(DeviceTemplateSchema).max(64),
|
|
59333
|
+
allowedDeviceIds: z.array(z.number().int()).optional()
|
|
59334
|
+
}), z.object({ results: z.array(DeviceTemplateRenderSchema) }), { auth: "admin" }),
|
|
59335
|
+
/**
|
|
59336
|
+
* Vet templates without rendering them: the syntax refusal, or the devices
|
|
59337
|
+
* each names and whether `allowedDeviceIds` covers them. The save door and
|
|
59338
|
+
* the run-time scope check both ask this.
|
|
59339
|
+
*/
|
|
59340
|
+
checkDeviceTemplates: method(z.object({
|
|
59341
|
+
templates: z.array(z.string()).max(64),
|
|
59342
|
+
allowedDeviceIds: z.array(z.number().int()).optional()
|
|
59343
|
+
}), z.object({ results: z.array(z.discriminatedUnion("ok", [z.object({
|
|
59344
|
+
ok: z.literal(true),
|
|
59345
|
+
aliases: z.array(z.object({
|
|
59346
|
+
alias: z.string(),
|
|
59347
|
+
deviceId: z.number().int().nullable(),
|
|
59348
|
+
allowed: z.boolean()
|
|
59349
|
+
}))
|
|
59350
|
+
}), z.object({
|
|
59351
|
+
ok: z.literal(false),
|
|
59352
|
+
refusal: DeviceTemplateRefusalSchema
|
|
59353
|
+
})])) }), { auth: "admin" }),
|
|
58621
59354
|
/** Update the operator-organisational location label. `null`
|
|
58622
59355
|
* clears it. */
|
|
58623
59356
|
setLocation: method(z.object({
|
|
@@ -62838,6 +63571,332 @@ var groupStatusCapability = {
|
|
|
62838
63571
|
durability: "session",
|
|
62839
63572
|
history: "none"
|
|
62840
63573
|
};
|
|
63574
|
+
/**
|
|
63575
|
+
* Heat pump settable surface (D1026): one typed method per parameter, never a
|
|
63576
|
+
* generic `set(key, value)`. The values a mode takes and the limits of a number
|
|
63577
|
+
* are the ones `heat-pump-status` carries (`allowed`, `min`, `max`, `step`),
|
|
63578
|
+
* read from the gateway; a provider refuses a value outside them. The state is
|
|
63579
|
+
* `heat-pump-status` — this cap has none.
|
|
63580
|
+
*/
|
|
63581
|
+
var deviceId = z.number().int().nonnegative();
|
|
63582
|
+
var circuitId = z.string().min(1);
|
|
63583
|
+
var mode = z.string().min(1);
|
|
63584
|
+
var temp = z.number().finite();
|
|
63585
|
+
var heatPumpControlCapability = {
|
|
63586
|
+
name: "heat-pump-control",
|
|
63587
|
+
scope: "device",
|
|
63588
|
+
deviceNative: true,
|
|
63589
|
+
mode: "singleton",
|
|
63590
|
+
deviceTypes: [DeviceType.HeatPump],
|
|
63591
|
+
methods: {
|
|
63592
|
+
/** off / auto / on. */
|
|
63593
|
+
setSilentMode: method(z.object({
|
|
63594
|
+
deviceId,
|
|
63595
|
+
mode
|
|
63596
|
+
}), z.void(), {
|
|
63597
|
+
kind: "mutation",
|
|
63598
|
+
auth: "protected"
|
|
63599
|
+
}),
|
|
63600
|
+
/** off / on. */
|
|
63601
|
+
setAwayMode: method(z.object({
|
|
63602
|
+
deviceId,
|
|
63603
|
+
mode
|
|
63604
|
+
}), z.void(), {
|
|
63605
|
+
kind: "mutation",
|
|
63606
|
+
auth: "protected"
|
|
63607
|
+
}),
|
|
63608
|
+
/** off / manual / auto. */
|
|
63609
|
+
setAdditionalHeaterMode: method(z.object({
|
|
63610
|
+
deviceId,
|
|
63611
|
+
mode
|
|
63612
|
+
}), z.void(), {
|
|
63613
|
+
kind: "mutation",
|
|
63614
|
+
auth: "protected"
|
|
63615
|
+
}),
|
|
63616
|
+
/** off / hm1 .. hm8 (the programmes the gateway lists). */
|
|
63617
|
+
setHolidayMode: method(z.object({
|
|
63618
|
+
deviceId,
|
|
63619
|
+
mode
|
|
63620
|
+
}), z.void(), {
|
|
63621
|
+
kind: "mutation",
|
|
63622
|
+
auth: "protected"
|
|
63623
|
+
}),
|
|
63624
|
+
setCircuitOperationMode: method(z.object({
|
|
63625
|
+
deviceId,
|
|
63626
|
+
circuitId,
|
|
63627
|
+
mode
|
|
63628
|
+
}), z.void(), {
|
|
63629
|
+
kind: "mutation",
|
|
63630
|
+
auth: "protected"
|
|
63631
|
+
}),
|
|
63632
|
+
setCircuitHeatCoolMode: method(z.object({
|
|
63633
|
+
deviceId,
|
|
63634
|
+
circuitId,
|
|
63635
|
+
mode
|
|
63636
|
+
}), z.void(), {
|
|
63637
|
+
kind: "mutation",
|
|
63638
|
+
auth: "protected"
|
|
63639
|
+
}),
|
|
63640
|
+
setCircuitSummerWinter: method(z.object({
|
|
63641
|
+
deviceId,
|
|
63642
|
+
circuitId,
|
|
63643
|
+
mode
|
|
63644
|
+
}), z.void(), {
|
|
63645
|
+
kind: "mutation",
|
|
63646
|
+
auth: "protected"
|
|
63647
|
+
}),
|
|
63648
|
+
setCircuitComfortSetpoint: method(z.object({
|
|
63649
|
+
deviceId,
|
|
63650
|
+
circuitId,
|
|
63651
|
+
temp
|
|
63652
|
+
}), z.void(), {
|
|
63653
|
+
kind: "mutation",
|
|
63654
|
+
auth: "protected"
|
|
63655
|
+
}),
|
|
63656
|
+
setCircuitEcoSetpoint: method(z.object({
|
|
63657
|
+
deviceId,
|
|
63658
|
+
circuitId,
|
|
63659
|
+
temp
|
|
63660
|
+
}), z.void(), {
|
|
63661
|
+
kind: "mutation",
|
|
63662
|
+
auth: "protected"
|
|
63663
|
+
}),
|
|
63664
|
+
setCircuitMaxFlowTemp: method(z.object({
|
|
63665
|
+
deviceId,
|
|
63666
|
+
circuitId,
|
|
63667
|
+
temp
|
|
63668
|
+
}), z.void(), {
|
|
63669
|
+
kind: "mutation",
|
|
63670
|
+
auth: "protected"
|
|
63671
|
+
}),
|
|
63672
|
+
setDhwOperationMode: method(z.object({
|
|
63673
|
+
deviceId,
|
|
63674
|
+
circuitId,
|
|
63675
|
+
mode
|
|
63676
|
+
}), z.void(), {
|
|
63677
|
+
kind: "mutation",
|
|
63678
|
+
auth: "protected"
|
|
63679
|
+
}),
|
|
63680
|
+
setDhwTemperatureLevel: method(z.object({
|
|
63681
|
+
deviceId,
|
|
63682
|
+
circuitId,
|
|
63683
|
+
level: mode
|
|
63684
|
+
}), z.void(), {
|
|
63685
|
+
kind: "mutation",
|
|
63686
|
+
auth: "protected"
|
|
63687
|
+
}),
|
|
63688
|
+
setDhwChargeDuration: method(z.object({
|
|
63689
|
+
deviceId,
|
|
63690
|
+
circuitId,
|
|
63691
|
+
minutes: z.number().int().positive()
|
|
63692
|
+
}), z.void(), {
|
|
63693
|
+
kind: "mutation",
|
|
63694
|
+
auth: "protected"
|
|
63695
|
+
}),
|
|
63696
|
+
/** Start an extra-hot-water charge now: an action, not a stored mode. */
|
|
63697
|
+
startExtraHotWater: method(z.object({
|
|
63698
|
+
deviceId,
|
|
63699
|
+
circuitId
|
|
63700
|
+
}), z.void(), {
|
|
63701
|
+
kind: "mutation",
|
|
63702
|
+
auth: "protected"
|
|
63703
|
+
})
|
|
63704
|
+
}
|
|
63705
|
+
};
|
|
63706
|
+
var HeatPumpCircuitKindSchema = z.enum([
|
|
63707
|
+
"heating",
|
|
63708
|
+
"dhw",
|
|
63709
|
+
"cooling",
|
|
63710
|
+
"solar"
|
|
63711
|
+
]);
|
|
63712
|
+
/** A setting that takes one of a list of values the gateway named. */
|
|
63713
|
+
var HeatPumpOptionSettingSchema = z.object({
|
|
63714
|
+
/** The active value. Null when the gateway did not answer. */
|
|
63715
|
+
value: z.string().nullable(),
|
|
63716
|
+
/** Values the gateway accepts, in its order. Empty = read-only here. */
|
|
63717
|
+
allowed: z.array(z.string())
|
|
63718
|
+
});
|
|
63719
|
+
/** A numeric setting with the limits the gateway named. */
|
|
63720
|
+
var HeatPumpRangeSettingSchema = z.object({
|
|
63721
|
+
value: z.number().nullable(),
|
|
63722
|
+
min: z.number().nullable(),
|
|
63723
|
+
max: z.number().nullable(),
|
|
63724
|
+
step: z.number().nullable()
|
|
63725
|
+
});
|
|
63726
|
+
var HeatPumpCircuitSchema = z.object({
|
|
63727
|
+
/** Gateway id of the circuit (`hc1`, `dhw1`): the key of the series. */
|
|
63728
|
+
id: z.string().min(1),
|
|
63729
|
+
kind: HeatPumpCircuitKindSchema,
|
|
63730
|
+
label: z.string(),
|
|
63731
|
+
icon: IconKeySchema,
|
|
63732
|
+
/** Measured temperature of the circuit (room, tank, collector). */
|
|
63733
|
+
currentTemp: z.number().nullable().meta(readingMeta("temperature")),
|
|
63734
|
+
/** The setpoint in force now. */
|
|
63735
|
+
targetTemp: z.number().nullable().meta(readingMeta("temperature")),
|
|
63736
|
+
/** The operation mode in force (mirror of `operationMode.value`, for the series). */
|
|
63737
|
+
mode: z.string().nullable(),
|
|
63738
|
+
/** Whether the circuit is calling for heat right now. Null = unknown. */
|
|
63739
|
+
active: z.boolean().nullable(),
|
|
63740
|
+
operationMode: HeatPumpOptionSettingSchema.nullable(),
|
|
63741
|
+
/** Heating circuits: heat / cool / heatCool. */
|
|
63742
|
+
heatCoolMode: HeatPumpOptionSettingSchema.nullable(),
|
|
63743
|
+
/** Heating circuits: summer / winter changeover. */
|
|
63744
|
+
summerWinter: HeatPumpOptionSettingSchema.nullable(),
|
|
63745
|
+
comfortSetpoint: HeatPumpRangeSettingSchema.nullable(),
|
|
63746
|
+
ecoSetpoint: HeatPumpRangeSettingSchema.nullable(),
|
|
63747
|
+
maxFlowTemp: HeatPumpRangeSettingSchema.nullable(),
|
|
63748
|
+
/** Hot water: the temperature level (off / low / high / eco). */
|
|
63749
|
+
temperatureLevel: HeatPumpOptionSettingSchema.nullable(),
|
|
63750
|
+
/** Hot water: how long a charge lasts, minutes. */
|
|
63751
|
+
chargeDuration: HeatPumpRangeSettingSchema.nullable(),
|
|
63752
|
+
/** Hot water: whether an extra-hot-water charge is running. Null = no such surface. */
|
|
63753
|
+
extraHotWater: z.boolean().nullable()
|
|
63754
|
+
});
|
|
63755
|
+
/** The independent system modes, each with its real values. A null mode = the gateway has none. */
|
|
63756
|
+
var HeatPumpSystemSchema = z.object({
|
|
63757
|
+
silent: HeatPumpOptionSettingSchema.nullable(),
|
|
63758
|
+
away: HeatPumpOptionSettingSchema.nullable(),
|
|
63759
|
+
additionalHeater: HeatPumpOptionSettingSchema.nullable(),
|
|
63760
|
+
holiday: HeatPumpOptionSettingSchema.nullable()
|
|
63761
|
+
});
|
|
63762
|
+
var HeatPumpPowerSchema = z.object({
|
|
63763
|
+
thermalW: z.number().nullable().meta(readingMeta("power")),
|
|
63764
|
+
electricalW: z.number().nullable().meta(readingMeta("power")),
|
|
63765
|
+
/** Compressor modulation, percent. */
|
|
63766
|
+
compressorPct: z.number().nullable().meta(readingMeta("percentage"))
|
|
63767
|
+
});
|
|
63768
|
+
var HeatPumpTemperaturesSchema = z.object({
|
|
63769
|
+
supply: z.number().nullable().meta(readingMeta("temperature")),
|
|
63770
|
+
return: z.number().nullable().meta(readingMeta("temperature")),
|
|
63771
|
+
outdoor: z.number().nullable().meta(readingMeta("temperature"))
|
|
63772
|
+
});
|
|
63773
|
+
/** Lifetime meters, kWh: the energy of a period is computed at read time from their difference (D944). */
|
|
63774
|
+
var HeatPumpEnergySchema = z.object({
|
|
63775
|
+
thermalKwh: z.number().nullable().meta(readingMeta("energy")),
|
|
63776
|
+
electricalKwh: z.number().nullable().meta(readingMeta("energy"))
|
|
63777
|
+
});
|
|
63778
|
+
var HeatPumpStatusSchema = z.object({
|
|
63779
|
+
circuits: z.array(HeatPumpCircuitSchema),
|
|
63780
|
+
system: HeatPumpSystemSchema,
|
|
63781
|
+
power: HeatPumpPowerSchema,
|
|
63782
|
+
temperatures: HeatPumpTemperaturesSchema,
|
|
63783
|
+
energy: HeatPumpEnergySchema,
|
|
63784
|
+
/** Water pressure of the heating loop, bar. */
|
|
63785
|
+
waterPressureBar: z.number().nullable(),
|
|
63786
|
+
/** Compressor starts since commissioning. */
|
|
63787
|
+
starts: z.number().nullable(),
|
|
63788
|
+
/** Ms epoch when the slice was last read from the gateway. */
|
|
63789
|
+
lastFetchedAt: z.number()
|
|
63790
|
+
});
|
|
63791
|
+
/**
|
|
63792
|
+
* The instantaneous COP: thermal over electrical power. Null unless BOTH powers
|
|
63793
|
+
* are known and the unit draws power — a missing reading is never a 0 or a
|
|
63794
|
+
* division by it (D393). Computed on every read; there is no stored value.
|
|
63795
|
+
*/
|
|
63796
|
+
function heatPumpInstantCop(power) {
|
|
63797
|
+
const { thermalW, electricalW } = power;
|
|
63798
|
+
if (thermalW === null || electricalW === null || electricalW <= 0) return null;
|
|
63799
|
+
return thermalW / electricalW;
|
|
63800
|
+
}
|
|
63801
|
+
var heatPumpStatusCapability = {
|
|
63802
|
+
name: "heat-pump-status",
|
|
63803
|
+
scope: "device",
|
|
63804
|
+
deviceNative: true,
|
|
63805
|
+
mode: "singleton",
|
|
63806
|
+
deviceTypes: [DeviceType.HeatPump],
|
|
63807
|
+
methods: {},
|
|
63808
|
+
status: {
|
|
63809
|
+
schema: HeatPumpStatusSchema,
|
|
63810
|
+
kind: "push"
|
|
63811
|
+
},
|
|
63812
|
+
runtimeState: HeatPumpStatusSchema,
|
|
63813
|
+
/**
|
|
63814
|
+
* Runtime-state durability: **session** — a heat pump's gateway answers on the
|
|
63815
|
+
* next poll, so a restart that clears the slice loses nothing a reader needs
|
|
63816
|
+
* (the series are recorded). See `RuntimeStateDurability`.
|
|
63817
|
+
*/
|
|
63818
|
+
durability: "session",
|
|
63819
|
+
/**
|
|
63820
|
+
* History (D850, D917): `circuits[]` is a keyed array — one series per circuit and
|
|
63821
|
+
* field, named by the circuit's label. The mode is a state (D896); the energy
|
|
63822
|
+
* totals are lifetime counters, the kWh of a period is computed at read time (D944).
|
|
63823
|
+
* The COP is never recorded: it derives from the two powers.
|
|
63824
|
+
*/
|
|
63825
|
+
history: {
|
|
63826
|
+
fields: {
|
|
63827
|
+
"power.thermalW": {
|
|
63828
|
+
kind: "gauge",
|
|
63829
|
+
unit: "W",
|
|
63830
|
+
deadband: 50,
|
|
63831
|
+
displayName: "Thermal power"
|
|
63832
|
+
},
|
|
63833
|
+
"power.electricalW": {
|
|
63834
|
+
kind: "gauge",
|
|
63835
|
+
unit: "W",
|
|
63836
|
+
deadband: 50,
|
|
63837
|
+
displayName: "Electrical power"
|
|
63838
|
+
},
|
|
63839
|
+
"power.compressorPct": {
|
|
63840
|
+
kind: "gauge",
|
|
63841
|
+
unit: "%",
|
|
63842
|
+
deadband: 2,
|
|
63843
|
+
displayName: "Compressor"
|
|
63844
|
+
},
|
|
63845
|
+
"temperatures.supply": {
|
|
63846
|
+
kind: "gauge",
|
|
63847
|
+
unit: "°C",
|
|
63848
|
+
deadband: .5,
|
|
63849
|
+
displayName: "Supply"
|
|
63850
|
+
},
|
|
63851
|
+
"temperatures.return": {
|
|
63852
|
+
kind: "gauge",
|
|
63853
|
+
unit: "°C",
|
|
63854
|
+
deadband: .5,
|
|
63855
|
+
displayName: "Return"
|
|
63856
|
+
},
|
|
63857
|
+
"temperatures.outdoor": {
|
|
63858
|
+
kind: "gauge",
|
|
63859
|
+
unit: "°C",
|
|
63860
|
+
deadband: .5,
|
|
63861
|
+
displayName: "Outdoor"
|
|
63862
|
+
},
|
|
63863
|
+
"energy.thermalKwh": {
|
|
63864
|
+
kind: "counter",
|
|
63865
|
+
unit: "kWh",
|
|
63866
|
+
displayName: "Thermal energy"
|
|
63867
|
+
},
|
|
63868
|
+
"energy.electricalKwh": {
|
|
63869
|
+
kind: "counter",
|
|
63870
|
+
unit: "kWh",
|
|
63871
|
+
displayName: "Electrical energy"
|
|
63872
|
+
}
|
|
63873
|
+
},
|
|
63874
|
+
items: {
|
|
63875
|
+
path: "circuits",
|
|
63876
|
+
key: "id",
|
|
63877
|
+
label: "label",
|
|
63878
|
+
fields: {
|
|
63879
|
+
currentTemp: {
|
|
63880
|
+
kind: "gauge",
|
|
63881
|
+
unit: "°C",
|
|
63882
|
+
deadband: .5,
|
|
63883
|
+
displayName: "Temperature"
|
|
63884
|
+
},
|
|
63885
|
+
targetTemp: {
|
|
63886
|
+
kind: "gauge",
|
|
63887
|
+
unit: "°C",
|
|
63888
|
+
minIntervalMs: 0,
|
|
63889
|
+
displayName: "Setpoint"
|
|
63890
|
+
},
|
|
63891
|
+
mode: {
|
|
63892
|
+
kind: "enum",
|
|
63893
|
+
displayName: "Mode"
|
|
63894
|
+
}
|
|
63895
|
+
}
|
|
63896
|
+
}
|
|
63897
|
+
},
|
|
63898
|
+
volatileStateFields: ["lastFetchedAt"]
|
|
63899
|
+
};
|
|
62841
63900
|
var HeatingValveStatusSchema = z.object({
|
|
62842
63901
|
/** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
|
|
62843
63902
|
position: z.number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
@@ -62903,6 +63962,17 @@ var TIMED_RUN_DEVICE_TYPES = [DeviceType.Heater, DeviceType.PetFountain];
|
|
|
62903
63962
|
function timedRunLimitOf(deviceType) {
|
|
62904
63963
|
return TIMED_RUN_LIMITS[deviceType] ?? null;
|
|
62905
63964
|
}
|
|
63965
|
+
var MS_PER_SECOND = 1e3;
|
|
63966
|
+
var MS_PER_MINUTE = 6e4;
|
|
63967
|
+
/**
|
|
63968
|
+
* Whole units left on an armed run. Minutes and seconds both ceil, and a run
|
|
63969
|
+
* that has not expired yet never reads as zero.
|
|
63970
|
+
*/
|
|
63971
|
+
function timedRunRemaining(activeUntil, now, unit) {
|
|
63972
|
+
const left = activeUntil - now;
|
|
63973
|
+
if (left <= 0) return 0;
|
|
63974
|
+
return Math.max(1, Math.ceil(left / (unit === "min" ? MS_PER_MINUTE : MS_PER_SECOND)));
|
|
63975
|
+
}
|
|
62906
63976
|
/** Seconds in a duration of `duration` `unit`. */
|
|
62907
63977
|
function timedRunSeconds(duration, unit) {
|
|
62908
63978
|
return unit === "min" ? duration * 60 : duration;
|
|
@@ -63088,6 +64158,7 @@ var HeroSceneIdSchema = z.enum([
|
|
|
63088
64158
|
"ac",
|
|
63089
64159
|
"thermostat",
|
|
63090
64160
|
"heater",
|
|
64161
|
+
"heat-pump",
|
|
63091
64162
|
"fan",
|
|
63092
64163
|
"washer",
|
|
63093
64164
|
"dryer",
|
|
@@ -63155,6 +64226,7 @@ var HERO_SCENE_BY_TYPE = {
|
|
|
63155
64226
|
[DeviceType.Valve]: "control-dial",
|
|
63156
64227
|
[DeviceType.Humidifier]: "control-dial",
|
|
63157
64228
|
[DeviceType.WaterHeater]: "heater",
|
|
64229
|
+
[DeviceType.HeatPump]: "heat-pump",
|
|
63158
64230
|
[DeviceType.Fan]: "fan",
|
|
63159
64231
|
[DeviceType.MediaPlayer]: "tv",
|
|
63160
64232
|
[DeviceType.AlarmPanel]: "alarm",
|
|
@@ -63252,6 +64324,7 @@ var HeroTextSchema = z.object({
|
|
|
63252
64324
|
it: z.string()
|
|
63253
64325
|
});
|
|
63254
64326
|
var HeroRowIdSchema = z.enum([
|
|
64327
|
+
"progress",
|
|
63255
64328
|
"run-for",
|
|
63256
64329
|
"cycle",
|
|
63257
64330
|
"program",
|
|
@@ -63266,6 +64339,7 @@ var HeroRowIdSchema = z.enum([
|
|
|
63266
64339
|
"alarm",
|
|
63267
64340
|
"fan",
|
|
63268
64341
|
"vacuum",
|
|
64342
|
+
"vacuum-suction",
|
|
63269
64343
|
"mower",
|
|
63270
64344
|
"feeder",
|
|
63271
64345
|
"fountain",
|
|
@@ -63284,7 +64358,10 @@ var HeroRowIdSchema = z.enum([
|
|
|
63284
64358
|
"climate-fan",
|
|
63285
64359
|
"setpoint",
|
|
63286
64360
|
"channel",
|
|
63287
|
-
"control"
|
|
64361
|
+
"control",
|
|
64362
|
+
"circuit",
|
|
64363
|
+
"heat-pump-power",
|
|
64364
|
+
"system-mode"
|
|
63288
64365
|
]);
|
|
63289
64366
|
var HeroArgValueSchema = z.lazy(() => z.union([
|
|
63290
64367
|
z.string(),
|
|
@@ -63349,16 +64426,32 @@ var HeroControlSchema = z.discriminatedUnion("kind", [
|
|
|
63349
64426
|
label: HeroTextSchema,
|
|
63350
64427
|
current: z.string().nullable(),
|
|
63351
64428
|
options: z.array(z.string()),
|
|
64429
|
+
/** A readable label per option value; an option without one is drawn as its raw value. */
|
|
64430
|
+
optionLabels: z.record(z.string(), HeroTextSchema).optional(),
|
|
63352
64431
|
call: HeroCallSchema,
|
|
63353
64432
|
valueArg: z.string()
|
|
63354
64433
|
})
|
|
63355
64434
|
]);
|
|
64435
|
+
/** Declared by its interface: a `z.infer` of one more icon union pushes the cap's inferred type past what the compiler can print. */
|
|
64436
|
+
var HeroPillSchema = z.object({
|
|
64437
|
+
icon: IconKeySchema.nullable(),
|
|
64438
|
+
text: HeroTextSchema,
|
|
64439
|
+
tone: HeroToneSchema
|
|
64440
|
+
});
|
|
63356
64441
|
var HeroRowSchema = z.object({
|
|
63357
64442
|
id: HeroRowIdSchema,
|
|
64443
|
+
/** The row's own name when the kind's label would not tell rows of one kind apart (a circuit's label). */
|
|
64444
|
+
label: HeroTextSchema.optional(),
|
|
64445
|
+
/** A group header drawn above the row when it differs from the previous row's ("System"). */
|
|
64446
|
+
group: HeroTextSchema.optional(),
|
|
64447
|
+
/** Values drawn as pills across the row (a heat pump's powers). */
|
|
64448
|
+
pills: z.array(HeroPillSchema).optional(),
|
|
63358
64449
|
icon: IconKeySchema,
|
|
63359
64450
|
/** The row's status, in words. `null` = nothing to say. */
|
|
63360
64451
|
status: HeroTextSchema.nullable(),
|
|
63361
|
-
controls: z.array(HeroControlSchema)
|
|
64452
|
+
controls: z.array(HeroControlSchema),
|
|
64453
|
+
/** A bar under the row's label, 0..1; `null` / absent = no bar. */
|
|
64454
|
+
progress: z.number().min(0).max(1).nullable().optional()
|
|
63362
64455
|
});
|
|
63363
64456
|
var HeroDetailSchema = z.object({
|
|
63364
64457
|
label: HeroTextSchema,
|
|
@@ -63366,7 +64459,11 @@ var HeroDetailSchema = z.object({
|
|
|
63366
64459
|
unit: z.string().nullable()
|
|
63367
64460
|
});
|
|
63368
64461
|
var HeroBadgeSchema = z.object({
|
|
63369
|
-
id: z.enum([
|
|
64462
|
+
id: z.enum([
|
|
64463
|
+
"battery",
|
|
64464
|
+
"network-link",
|
|
64465
|
+
"integration"
|
|
64466
|
+
]),
|
|
63370
64467
|
icon: IconKeySchema,
|
|
63371
64468
|
tone: HeroToneSchema,
|
|
63372
64469
|
/** Percent for a battery, link quality for a link; `null` = not known. */
|
|
@@ -63415,7 +64512,13 @@ var HeroTimedRunSlotSchema = z.object({
|
|
|
63415
64512
|
activeUntil: z.number().nullable(),
|
|
63416
64513
|
quickRun: TimedRunQuickRunSchema,
|
|
63417
64514
|
run: HeroActionSchema,
|
|
63418
|
-
cancel: HeroActionSchema
|
|
64515
|
+
cancel: HeroActionSchema,
|
|
64516
|
+
/**
|
|
64517
|
+
* Whole units left (the limit's unit, ceil). `null` while nothing is armed.
|
|
64518
|
+
* A number, not words: the row formats it, and a text here would not fit the
|
|
64519
|
+
* hero-layout declaration.
|
|
64520
|
+
*/
|
|
64521
|
+
remaining: z.number().nullable()
|
|
63419
64522
|
});
|
|
63420
64523
|
var HeroPowerSupplySlotSchema = z.object({
|
|
63421
64524
|
/** The plug's state; `null` = unknown, never off. */
|
|
@@ -63467,7 +64570,12 @@ var HeroFactSchema = z.object({
|
|
|
63467
64570
|
var HeroSideTileSchema = z.object({
|
|
63468
64571
|
label: HeroTextSchema,
|
|
63469
64572
|
value: HeroTextSchema,
|
|
63470
|
-
tone: HeroToneSchema.optional()
|
|
64573
|
+
tone: HeroToneSchema.optional(),
|
|
64574
|
+
/**
|
|
64575
|
+
* Epoch ms when the tile reads a clock time (an appliance's end): a client prints it in
|
|
64576
|
+
* the viewer's own time zone; `value` is the fallback for one that cannot.
|
|
64577
|
+
*/
|
|
64578
|
+
at: z.number().optional()
|
|
63471
64579
|
});
|
|
63472
64580
|
var HeroSideTilesSchema = z.object({
|
|
63473
64581
|
left: z.array(HeroSideTileSchema).max(2),
|
|
@@ -63503,8 +64611,12 @@ var HeroModelSchema = z.object({
|
|
|
63503
64611
|
sideTiles: HeroSideTilesSchema,
|
|
63504
64612
|
/** The status line under the main icon. */
|
|
63505
64613
|
title: HeroTextSchema,
|
|
64614
|
+
/** The scene's top line when it says more than `title`; absent = draw the title. */
|
|
64615
|
+
caption: HeroTextSchema.optional(),
|
|
63506
64616
|
badges: z.array(HeroBadgeSchema),
|
|
63507
64617
|
remote: HeroRemoteSlotSchema.nullable(),
|
|
64618
|
+
/** The foot button that opens the device's history: "History", "Cycles", "Meals", "Access". */
|
|
64619
|
+
historyLabel: HeroTextSchema,
|
|
63508
64620
|
consumables: HeroConsumablesSlotSchema.nullable(),
|
|
63509
64621
|
consumption: HeroConsumptionSlotSchema.nullable(),
|
|
63510
64622
|
ownPower: HeroOwnPowerSlotSchema.nullable(),
|
|
@@ -63525,18 +64637,31 @@ var HeroModelSchema = z.object({
|
|
|
63525
64637
|
* 4. a trailing fact (power, else battery, else consumables).
|
|
63526
64638
|
*
|
|
63527
64639
|
* Selection rules, all taken from the model:
|
|
63528
|
-
* -
|
|
64640
|
+
* - the primary control is the device's own power; else the FIRST control of
|
|
63529
64641
|
* the FIRST row that has any (a later row's control is never promoted). When
|
|
63530
64642
|
* the model lists that part in `gated`, the row has no inline control: the
|
|
63531
64643
|
* projection never falls through to another control the caller could use.
|
|
64644
|
+
* - a timed run, when the model carries the slot, sits beside that primary:
|
|
64645
|
+
* Run while idle, Stop while armed. Gating the slot hides the control.
|
|
63532
64646
|
* - the status line is the head (what plays, else the state) plus at most
|
|
63533
|
-
* {@link ROW_STATUS_FACTS_MAX} facts, the trailing fact excluded
|
|
64647
|
+
* {@link ROW_STATUS_FACTS_MAX} facts, the trailing fact excluded, then the
|
|
64648
|
+
* time left on an armed timed run;
|
|
63534
64649
|
* - the trailing fact is the first of power, battery, consumables.
|
|
63535
64650
|
*
|
|
63536
64651
|
* `projectDeviceRow` is pure and computes nothing: it selects from a
|
|
63537
64652
|
* {@link HeroModel}. A row that needed a value the hero lacks would mean the
|
|
63538
64653
|
* model is missing it, so the fix goes in the model.
|
|
63539
64654
|
*/
|
|
64655
|
+
/**
|
|
64656
|
+
* The row's timed-run control. `id` is `timed-run.run` while idle and
|
|
64657
|
+
* `timed-run.cancel` while armed; `duration` and `unit` are the one-tap run
|
|
64658
|
+
* a Run press starts.
|
|
64659
|
+
*/
|
|
64660
|
+
var HeroRowTimedRunSchema = z.object({
|
|
64661
|
+
id: z.enum(["timed-run.run", "timed-run.cancel"]),
|
|
64662
|
+
duration: z.number(),
|
|
64663
|
+
unit: z.enum(["min", "s"])
|
|
64664
|
+
});
|
|
63540
64665
|
var HeroRowModelSchema = z.object({
|
|
63541
64666
|
deviceId: z.number().int(),
|
|
63542
64667
|
name: z.string(),
|
|
@@ -63549,6 +64674,11 @@ var HeroRowModelSchema = z.object({
|
|
|
63549
64674
|
statusLine: z.array(HeroTextSchema),
|
|
63550
64675
|
/** `null` = the type has no inline control, or the caller may not act on it. */
|
|
63551
64676
|
primary: HeroControlSchema.nullable(),
|
|
64677
|
+
/**
|
|
64678
|
+
* Beside `primary` when the device offers a timed run: Run while idle, Stop
|
|
64679
|
+
* while armed. `null` when there is no slot, or the caller may not act.
|
|
64680
|
+
*/
|
|
64681
|
+
timedRun: HeroRowTimedRunSchema.nullable(),
|
|
63552
64682
|
trailing: HeroFactSchema.nullable()
|
|
63553
64683
|
});
|
|
63554
64684
|
/** The trailing fact, in order of preference. */
|
|
@@ -63585,7 +64715,30 @@ function primaryOf(model) {
|
|
|
63585
64715
|
return null;
|
|
63586
64716
|
}
|
|
63587
64717
|
function statusLineOf(model, trailing) {
|
|
63588
|
-
|
|
64718
|
+
const head = model.rows.find((r) => r.id === "now-playing")?.status ?? null ?? model.title;
|
|
64719
|
+
const rest = model.facts.filter((f) => f !== trailing).map((f) => f.text).slice(0, 3);
|
|
64720
|
+
const slot = model.timedRun;
|
|
64721
|
+
if (slot === null || slot.remaining === null) return [head, ...rest];
|
|
64722
|
+
const word = slot.quickRun.unit === "min" ? "min" : "s";
|
|
64723
|
+
const left = {
|
|
64724
|
+
en: `${slot.remaining} ${word}`,
|
|
64725
|
+
it: `${slot.remaining} ${word}`
|
|
64726
|
+
};
|
|
64727
|
+
return [
|
|
64728
|
+
head,
|
|
64729
|
+
...rest,
|
|
64730
|
+
left
|
|
64731
|
+
];
|
|
64732
|
+
}
|
|
64733
|
+
/** Run while the slot is idle, Stop while it is armed. Hidden when the caller may not act. */
|
|
64734
|
+
function timedRunOf(model) {
|
|
64735
|
+
const slot = model.timedRun;
|
|
64736
|
+
if (slot === null || model.gated.includes("timed-run")) return null;
|
|
64737
|
+
return {
|
|
64738
|
+
id: slot.activeUntil === null ? "timed-run.run" : "timed-run.cancel",
|
|
64739
|
+
duration: slot.quickRun.duration,
|
|
64740
|
+
unit: slot.quickRun.unit
|
|
64741
|
+
};
|
|
63589
64742
|
}
|
|
63590
64743
|
function projectDeviceRow(model) {
|
|
63591
64744
|
const trailing = trailingOf(model.facts);
|
|
@@ -63599,6 +64752,7 @@ function projectDeviceRow(model) {
|
|
|
63599
64752
|
scene: model.scene,
|
|
63600
64753
|
statusLine: statusLineOf(model, trailing),
|
|
63601
64754
|
primary: primaryOf(model),
|
|
64755
|
+
timedRun: timedRunOf(model),
|
|
63602
64756
|
trailing
|
|
63603
64757
|
};
|
|
63604
64758
|
}
|
|
@@ -93877,6 +95031,8 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
93877
95031
|
groupActiveCapability,
|
|
93878
95032
|
groupCommandsCapability,
|
|
93879
95033
|
groupStatusCapability,
|
|
95034
|
+
heatPumpControlCapability,
|
|
95035
|
+
heatPumpStatusCapability,
|
|
93880
95036
|
heatingValveCapability,
|
|
93881
95037
|
heroLayoutCapability,
|
|
93882
95038
|
humidifierCapability,
|
|
@@ -96429,6 +97585,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
96429
97585
|
groupCommands: groupCommandsCapability,
|
|
96430
97586
|
groupStatus: groupStatusCapability,
|
|
96431
97587
|
heatingValve: heatingValveCapability,
|
|
97588
|
+
heatPumpStatus: heatPumpStatusCapability,
|
|
96432
97589
|
humidifier: humidifierCapability,
|
|
96433
97590
|
humiditySensor: humiditySensorCapability,
|
|
96434
97591
|
image: imageCapability,
|
|
@@ -97525,7 +98682,7 @@ var DeclaredDevices = class {
|
|
|
97525
98682
|
return removed;
|
|
97526
98683
|
}
|
|
97527
98684
|
};
|
|
97528
|
-
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
98685
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
97529
98686
|
new Set(Object.values(DeviceType));
|
|
97530
98687
|
/** True when a value is a navigable node: a plain object OR a tRPC v11 client
|
|
97531
98688
|
* proxy node (a callable `Proxy(noop)` → `typeof === 'function'`, NOT an
|
|
@@ -97678,6 +98835,13 @@ var lockContribution = contribution("lock-control", LockControlStatusSchema, (sl
|
|
|
97678
98835
|
reading: reading("lock-control", words?.state ?? "unknown", false, words?.title),
|
|
97679
98836
|
rows: [row$1("lock", state === "locked" || state === "locking" ? "lock" : "lock-open", joinText([title, since]), lockControls(state, ctx.features.includes(DeviceFeature.LockOpen)))],
|
|
97680
98837
|
...since === null || words === null ? {} : { facts: [fact("since", "clock", since, "muted")] },
|
|
98838
|
+
...words === null ? {} : { tiles: { left: [{
|
|
98839
|
+
label: t("Door", "Porta"),
|
|
98840
|
+
value: title
|
|
98841
|
+
}, ...since === null ? [] : [{
|
|
98842
|
+
label: t("Since", "Da"),
|
|
98843
|
+
value: since
|
|
98844
|
+
}]] } },
|
|
97681
98845
|
...words?.door == null ? {} : { scene: { mode: words.door } }
|
|
97682
98846
|
};
|
|
97683
98847
|
});
|
|
@@ -97759,7 +98923,17 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
|
|
|
97759
98923
|
return {
|
|
97760
98924
|
reading: reading("alarm-panel", words?.state ?? "unknown", false, words?.title),
|
|
97761
98925
|
rows: [row$1("alarm", state === "triggered" ? "shield-alert" : state === "disarmed" ? "shield-off" : "shield-check", joinText([words?.title ?? t("Unknown", "Sconosciuto"), since]), alarmControls(state, modes, slice?.requiresCode ?? false))],
|
|
97762
|
-
...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] }
|
|
98926
|
+
...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] },
|
|
98927
|
+
...words === null ? {} : { tiles: {
|
|
98928
|
+
left: [{
|
|
98929
|
+
label: t("Mode", "Modalità"),
|
|
98930
|
+
value: words.title
|
|
98931
|
+
}],
|
|
98932
|
+
...since === null ? {} : { right: [{
|
|
98933
|
+
label: t("Since", "Da"),
|
|
98934
|
+
value: since
|
|
98935
|
+
}] }
|
|
98936
|
+
} }
|
|
97763
98937
|
};
|
|
97764
98938
|
}),
|
|
97765
98939
|
"automation-control": contribution("automation-control", AutomationControlStatusSchema, (slice, ctx) => {
|
|
@@ -97823,7 +98997,7 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
|
|
|
97823
98997
|
*/
|
|
97824
98998
|
var has$3 = (ctx, f) => ctx.features.includes(f);
|
|
97825
98999
|
var unknownText = t("Unknown", "Sconosciuto");
|
|
97826
|
-
var pct$
|
|
99000
|
+
var pct$2 = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
|
|
97827
99001
|
var unit = (n) => Math.min(1, Math.max(0, n / 100));
|
|
97828
99002
|
/** Battery as a fact, unless the device is also bound to the `battery` cap (it already says so). */
|
|
97829
99003
|
function ownBattery(level, ctx) {
|
|
@@ -97885,7 +99059,7 @@ var fanContribution = contribution("fan-control", FanControlStatusSchema, (slice
|
|
|
97885
99059
|
},
|
|
97886
99060
|
valueArg: "direction"
|
|
97887
99061
|
});
|
|
97888
|
-
const speedText = speed === null ? null : pct$
|
|
99062
|
+
const speedText = speed === null ? null : pct$2(speed);
|
|
97889
99063
|
const preset = slice?.preset ?? "";
|
|
97890
99064
|
const status = speed === null ? unknownText : joinText([speed === 0 ? t("Off", "Spento") : t(`Speed ${speed}%`, `Velocità ${speed}%`), preset === "" ? null : t(preset, preset)]);
|
|
97891
99065
|
return {
|
|
@@ -97898,10 +99072,16 @@ var fanContribution = contribution("fan-control", FanControlStatusSchema, (slice
|
|
|
97898
99072
|
}],
|
|
97899
99073
|
...speedText === null ? {} : {
|
|
97900
99074
|
facts: [fact("speed", "fan", speedText, speed === 0 ? "muted" : "primary")],
|
|
97901
|
-
tiles: {
|
|
97902
|
-
|
|
97903
|
-
|
|
97904
|
-
|
|
99075
|
+
tiles: {
|
|
99076
|
+
...slice?.oscillating == null ? {} : { left: [{
|
|
99077
|
+
label: t("Oscillation", "Oscilla"),
|
|
99078
|
+
value: slice.oscillating ? t("Yes", "Sì") : t("No", "No")
|
|
99079
|
+
}] },
|
|
99080
|
+
...preset === "" ? {} : { right: [{
|
|
99081
|
+
label: t("Mode", "Modalità"),
|
|
99082
|
+
value: t(preset, preset)
|
|
99083
|
+
}] }
|
|
99084
|
+
},
|
|
97905
99085
|
scene: { level: unit(speed ?? 0) }
|
|
97906
99086
|
}
|
|
97907
99087
|
};
|
|
@@ -97965,7 +99145,8 @@ var vacuumContribution = contribution("vacuum-control", VacuumControlStatusSchem
|
|
|
97965
99145
|
const words = state === null ? null : VACUUM_WORDS[state];
|
|
97966
99146
|
const title = state === "error" && slice?.errorLabel ? t(slice.errorLabel, slice.errorLabel) : words?.title;
|
|
97967
99147
|
const controls = vacuumControls(state);
|
|
97968
|
-
|
|
99148
|
+
const suctionControls = [];
|
|
99149
|
+
if (slice !== void 0 && slice.availableFanSpeeds.length > 0) suctionControls.push({
|
|
97969
99150
|
kind: "picker",
|
|
97970
99151
|
id: "vacuum.suction",
|
|
97971
99152
|
label: t("Suction", "Aspirazione"),
|
|
@@ -97980,22 +99161,31 @@ var vacuumContribution = contribution("vacuum-control", VacuumControlStatusSchem
|
|
|
97980
99161
|
});
|
|
97981
99162
|
if (state !== null) controls.push(vac("locate", "Locate", "Trova", "map-pin", "locate"));
|
|
97982
99163
|
const progress = state === "cleaning" ? slice?.progress ?? null : null;
|
|
99164
|
+
const suction = slice?.fanSpeed == null || slice.fanSpeed === "" ? [] : [{
|
|
99165
|
+
label: t("Suction", "Aspirazione"),
|
|
99166
|
+
value: t(slice.fanSpeed, slice.fanSpeed)
|
|
99167
|
+
}];
|
|
99168
|
+
const suctionRows = suctionControls.length === 0 ? [] : [{
|
|
99169
|
+
id: "vacuum-suction",
|
|
99170
|
+
icon: "bot",
|
|
99171
|
+
status: null,
|
|
99172
|
+
controls: suctionControls
|
|
99173
|
+
}];
|
|
99174
|
+
const vacuumRows = [{
|
|
99175
|
+
id: "vacuum",
|
|
99176
|
+
icon: "bot",
|
|
99177
|
+
status: title ?? unknownText,
|
|
99178
|
+
controls
|
|
99179
|
+
}, ...suctionRows];
|
|
97983
99180
|
return {
|
|
97984
99181
|
reading: reading("vacuum-control", words?.state ?? "unknown", false, title),
|
|
97985
|
-
rows:
|
|
97986
|
-
|
|
97987
|
-
|
|
97988
|
-
|
|
97989
|
-
|
|
97990
|
-
}],
|
|
97991
|
-
|
|
97992
|
-
...progress === null ? {} : {
|
|
97993
|
-
tiles: { right: [{
|
|
97994
|
-
label: t("Progress", "Avanzamento"),
|
|
97995
|
-
value: pct$1(progress)
|
|
97996
|
-
}] },
|
|
97997
|
-
scene: { level: unit(progress) }
|
|
97998
|
-
}
|
|
99182
|
+
rows: vacuumRows,
|
|
99183
|
+
facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$2(progress), "primary")]],
|
|
99184
|
+
...suction.length === 0 && progress === null ? {} : { tiles: { right: [...suction, ...progress === null ? [] : [{
|
|
99185
|
+
label: t("Progress", "Avanzamento"),
|
|
99186
|
+
value: pct$2(progress)
|
|
99187
|
+
}]] } },
|
|
99188
|
+
...progress === null ? {} : { scene: { level: unit(progress) } }
|
|
97999
99189
|
};
|
|
98000
99190
|
});
|
|
98001
99191
|
var MOWER_WORDS = {
|
|
@@ -98051,11 +99241,11 @@ var mowerContribution = contribution("lawn-mower-control", LawnMowerControlStatu
|
|
|
98051
99241
|
status: title ?? unknownText,
|
|
98052
99242
|
controls: mowerControls(activity)
|
|
98053
99243
|
}],
|
|
98054
|
-
facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$
|
|
99244
|
+
facts: [...ownBattery(slice?.batteryLevel ?? null, ctx), ...progress === null ? [] : [fact("progress", "activity", pct$2(progress), "primary")]],
|
|
98055
99245
|
...progress === null ? {} : {
|
|
98056
99246
|
tiles: { right: [{
|
|
98057
99247
|
label: t("Progress", "Avanzamento"),
|
|
98058
|
-
value: pct$
|
|
99248
|
+
value: pct$2(progress)
|
|
98059
99249
|
}] },
|
|
98060
99250
|
scene: { level: unit(progress) }
|
|
98061
99251
|
}
|
|
@@ -98126,10 +99316,13 @@ var feederContribution = contribution("pet-feeder", PetFeederStatusSchema, (slic
|
|
|
98126
99316
|
...last === null ? [] : [fact("last-run", "clock", t(`Last ${last} g`, `Ultimo ${last} g`))],
|
|
98127
99317
|
...ownBattery(slice?.powerSource === "battery" ? slice.batteryPower : null, ctx)
|
|
98128
99318
|
],
|
|
98129
|
-
...
|
|
99319
|
+
tiles: { left: [...slice?.foodLevel == null ? [] : [{
|
|
99320
|
+
label: t("Tank", "Serbatoio"),
|
|
99321
|
+
value: pct$2(slice.foodLevel)
|
|
99322
|
+
}], ...last === null ? [] : [{
|
|
98130
99323
|
label: t("Last portion", "Ultima porzione"),
|
|
98131
99324
|
value: t(`${last} g`, `${last} g`)
|
|
98132
|
-
}] }
|
|
99325
|
+
}]] }
|
|
98133
99326
|
};
|
|
98134
99327
|
});
|
|
98135
99328
|
var fountainContribution = contribution("pet-fountain", PetFountainStatusSchema, (slice) => {
|
|
@@ -98157,10 +99350,13 @@ var fountainContribution = contribution("pet-fountain", PetFountainStatusSchema,
|
|
|
98157
99350
|
}],
|
|
98158
99351
|
...level === null ? {} : {
|
|
98159
99352
|
facts: [fact("level", "droplets", t(`Water ${Math.round(level)}%`, `Acqua ${Math.round(level)}%`), level <= 20 ? "warning" : "primary")],
|
|
98160
|
-
tiles: {
|
|
99353
|
+
tiles: { left: [{
|
|
98161
99354
|
label: t("Water", "Acqua"),
|
|
98162
|
-
value: pct$
|
|
98163
|
-
}]
|
|
99355
|
+
value: pct$2(level)
|
|
99356
|
+
}, ...slice?.waterVolume == null ? [] : [{
|
|
99357
|
+
label: t("Volume", "Volume"),
|
|
99358
|
+
value: t(`${Math.round(slice.waterVolume)} ml`, `${Math.round(slice.waterVolume)} ml`)
|
|
99359
|
+
}]] },
|
|
98164
99360
|
scene: { level: unit(level) }
|
|
98165
99361
|
}
|
|
98166
99362
|
};
|
|
@@ -98192,14 +99388,18 @@ var DEVICES_FAMILY_CONTRIBUTIONS = {
|
|
|
98192
99388
|
* that does not parse reads `unknown`, never closed or off (D315/D393).
|
|
98193
99389
|
*/
|
|
98194
99390
|
var has$2 = (ctx, f) => ctx.features.includes(f);
|
|
98195
|
-
var pct = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
|
|
99391
|
+
var pct$1 = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
|
|
98196
99392
|
var brightnessContribution = contribution("brightness", BrightnessStatusSchema, (slice) => {
|
|
98197
99393
|
const level = slice?.level ?? null;
|
|
98198
99394
|
return {
|
|
98199
99395
|
...level === null ? {} : { reading: reading("brightness", level > 0 ? "on" : "off") },
|
|
98200
99396
|
...level === null ? {} : {
|
|
98201
|
-
facts: [fact("level", "sun-dim", pct(level), level > 0 ? "primary" : "muted")],
|
|
98202
|
-
scene: { level: level / 100 }
|
|
99397
|
+
facts: [fact("level", "sun-dim", pct$1(level), level > 0 ? "primary" : "muted")],
|
|
99398
|
+
scene: { level: level / 100 },
|
|
99399
|
+
tiles: { left: [{
|
|
99400
|
+
label: t("Brightness", "Luminosità"),
|
|
99401
|
+
value: pct$1(level)
|
|
99402
|
+
}] }
|
|
98203
99403
|
},
|
|
98204
99404
|
rows: [row$1("brightness", "sun-dim", level === null ? null : t(`Brightness ${Math.round(level)}%`, `Luminosità ${Math.round(level)}%`), [{
|
|
98205
99405
|
kind: "slider",
|
|
@@ -98408,12 +99608,16 @@ function travelFragment(s, state, position, tilt, ctx) {
|
|
|
98408
99608
|
});
|
|
98409
99609
|
return {
|
|
98410
99610
|
reading: reading(s.source, words.state, false, words.title),
|
|
98411
|
-
...position === null ? {} : { facts: [fact("level", "arrow-up-down", pct(position))] },
|
|
99611
|
+
...position === null ? {} : { facts: [fact("level", "arrow-up-down", pct$1(position))] },
|
|
99612
|
+
...position === null ? {} : { tiles: { left: [{
|
|
99613
|
+
label: t("Opening", "Apertura"),
|
|
99614
|
+
value: pct$1(position)
|
|
99615
|
+
}] } },
|
|
98412
99616
|
scene: {
|
|
98413
99617
|
...words.mode === null ? {} : { mode: words.mode },
|
|
98414
99618
|
...position === null ? {} : { level: position / 100 }
|
|
98415
99619
|
},
|
|
98416
|
-
rows: [row$1(s.rowId, "arrow-up-down", joinText([words.title, position !== null && state !== "open" ? pct(position) : null]), controls)]
|
|
99620
|
+
rows: [row$1(s.rowId, "arrow-up-down", joinText([words.title, position !== null && state !== "open" ? pct$1(position) : null]), controls)]
|
|
98417
99621
|
};
|
|
98418
99622
|
}
|
|
98419
99623
|
var ACTUATORS_FAMILY_CONTRIBUTIONS = {
|
|
@@ -98491,10 +99695,10 @@ var ACTUATORS_FAMILY_CONTRIBUTIONS = {
|
|
|
98491
99695
|
const now = slice.currentHumidity;
|
|
98492
99696
|
return {
|
|
98493
99697
|
reading: reading("humidifier", state, false, title),
|
|
98494
|
-
...now === null ? {} : { facts: [fact("level", "droplets", pct(now), "info")] },
|
|
99698
|
+
...now === null ? {} : { facts: [fact("level", "droplets", pct$1(now), "info")] },
|
|
98495
99699
|
...slice.targetHumidity === null ? {} : { tiles: { right: [{
|
|
98496
99700
|
label: t("Target", "Obiettivo"),
|
|
98497
|
-
value: pct(slice.targetHumidity)
|
|
99701
|
+
value: pct$1(slice.targetHumidity)
|
|
98498
99702
|
}] } },
|
|
98499
99703
|
...now === null ? {} : { scene: { level: now / 100 } },
|
|
98500
99704
|
rows: [row$1("humidifier", "droplets", joinText([title, slice.mode === null ? null : t(slice.mode, slice.mode)]), controls)]
|
|
@@ -98742,17 +99946,16 @@ var weatherContribution = contribution("weather", WeatherStatusSchema, (slice, c
|
|
|
98742
99946
|
});
|
|
98743
99947
|
var updateContribution = contribution("update", UpdateStatusSchema, (slice) => {
|
|
98744
99948
|
if (slice === void 0) return { reading: reading("update", "unknown") };
|
|
98745
|
-
const { currentVersion, availableVersion, inProgress
|
|
99949
|
+
const { currentVersion, availableVersion, inProgress } = slice;
|
|
98746
99950
|
const pending = availableVersion !== null && availableVersion !== "" && availableVersion !== currentVersion;
|
|
98747
99951
|
if (!pending && currentVersion === null && !inProgress) return { reading: reading("update", "unknown") };
|
|
98748
99952
|
const state = inProgress ? "running" : pending ? "standby" : "idle";
|
|
98749
99953
|
const title = inProgress ? t("Updating", "Aggiornamento in corso") : pending ? t("Update available", "Aggiornamento disponibile") : t("Up to date", "Aggiornato");
|
|
98750
99954
|
const versions = currentVersion === null ? pending ? t(`${availableVersion}`, `${availableVersion}`) : null : pending ? t(`${currentVersion} → ${availableVersion}`, `${currentVersion} → ${availableVersion}`) : t(`Version ${currentVersion}`, `Versione ${currentVersion}`);
|
|
98751
|
-
const install = pending && updatable && !inProgress ? [asAction(action("update.install", t("Install", "Installa"), "download", "update", "installUpdate", {}, "primary", "install"))] : [];
|
|
98752
99955
|
return {
|
|
98753
99956
|
reading: reading("update", state, false, title),
|
|
98754
99957
|
facts: versions === null ? [] : [fact("reading", "download", versions, pending ? "warning" : "muted")],
|
|
98755
|
-
rows: [row$1("update", "download", versions,
|
|
99958
|
+
rows: [row$1("update", "download", versions, [])]
|
|
98756
99959
|
};
|
|
98757
99960
|
});
|
|
98758
99961
|
var imageContribution = contribution("image", ImageStatusSchema, (slice, ctx) => {
|
|
@@ -98860,6 +100063,33 @@ var ON_MODE_PREFERENCE = [
|
|
|
98860
100063
|
"heat",
|
|
98861
100064
|
"cool"
|
|
98862
100065
|
];
|
|
100066
|
+
var FAN_LABEL = {
|
|
100067
|
+
auto: t("Auto", "Auto"),
|
|
100068
|
+
quiet: t("Quiet", "Silenziosa"),
|
|
100069
|
+
low: t("Low", "Bassa"),
|
|
100070
|
+
medium: t("Medium", "Media"),
|
|
100071
|
+
high: t("High", "Alta"),
|
|
100072
|
+
turbo: t("Turbo", "Turbo"),
|
|
100073
|
+
off: t("Off", "Spenta")
|
|
100074
|
+
};
|
|
100075
|
+
/** A readable label for a fan speed name; an unknown one is shown as the device reported it. */
|
|
100076
|
+
function fanLabelOf(fan) {
|
|
100077
|
+
return FAN_LABEL[fan] ?? t(fan, fan);
|
|
100078
|
+
}
|
|
100079
|
+
/** Short labels for a segmented control: one word each, so the segments stay on a line. */
|
|
100080
|
+
var MODE_SEGMENT_LABEL = {
|
|
100081
|
+
off: t("Off", "Spento"),
|
|
100082
|
+
heat: t("Heat", "Caldo"),
|
|
100083
|
+
cool: t("Cool", "Freddo"),
|
|
100084
|
+
auto: t("Auto", "Auto"),
|
|
100085
|
+
heat_cool: t("Heat/Cool", "Caldo/Freddo"),
|
|
100086
|
+
fan_only: t("Fan", "Vent."),
|
|
100087
|
+
dry: t("Dry", "Deum.")
|
|
100088
|
+
};
|
|
100089
|
+
/** The segment label of every available HVAC mode, keyed by the mode value. */
|
|
100090
|
+
function modeLabelsOf(modes) {
|
|
100091
|
+
return Object.fromEntries(modes.map((m) => [m, MODE_SEGMENT_LABEL[m]]));
|
|
100092
|
+
}
|
|
98863
100093
|
/** 22 -> "22", 22.3 -> "22.3": a trailing zero is noise on a thermostat. */
|
|
98864
100094
|
function formatDegrees(value) {
|
|
98865
100095
|
return `${Number(value.toFixed(1))}°`;
|
|
@@ -98924,11 +100154,11 @@ function rangeFrom(min, max, step) {
|
|
|
98924
100154
|
* contribute, types never do (D14). A slice that is absent or does not parse is
|
|
98925
100155
|
* "not answered": the state reads unknown, no row is drawn (D315, D393).
|
|
98926
100156
|
*/
|
|
98927
|
-
var same = (text) => t(text, text);
|
|
98928
|
-
function tile(en, it, value) {
|
|
100157
|
+
var same$1 = (text) => t(text, text);
|
|
100158
|
+
function tile$1(en, it, value) {
|
|
98929
100159
|
return {
|
|
98930
100160
|
label: t(en, it),
|
|
98931
|
-
value: same(value)
|
|
100161
|
+
value: same$1(value)
|
|
98932
100162
|
};
|
|
98933
100163
|
}
|
|
98934
100164
|
function setpointSlider(id, cap, method, valueArg, value, range) {
|
|
@@ -98963,18 +100193,19 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
|
|
|
98963
100193
|
const status = climateStatusText(view);
|
|
98964
100194
|
const facts = [];
|
|
98965
100195
|
if (status !== null) facts.push(fact("climate", "thermometer", status));
|
|
98966
|
-
if (view.humidity !== null) facts.push(fact("humidity", "droplets", same(`${Math.round(view.humidity)}%`)));
|
|
98967
|
-
if (view.targetHumidity !== null) facts.push(fact("humidity", "droplets", same(`→ ${Math.round(view.targetHumidity)}%`)));
|
|
100196
|
+
if (view.humidity !== null) facts.push(fact("humidity", "droplets", same$1(`${Math.round(view.humidity)}%`)));
|
|
100197
|
+
if (view.targetHumidity !== null) facts.push(fact("humidity", "droplets", same$1(`→ ${Math.round(view.targetHumidity)}%`)));
|
|
98968
100198
|
const left = [];
|
|
98969
100199
|
const right = [];
|
|
98970
|
-
if (view.measured !== null) left.push(tile("Indoor", "In casa", formatDegrees(view.measured)));
|
|
98971
|
-
if (view.humidity !== null) left.push(tile("Humidity", "Umidità", `${Math.round(view.humidity)}%`));
|
|
100200
|
+
if (view.measured !== null) left.push(tile$1("Indoor", "In casa", formatDegrees(view.measured)));
|
|
100201
|
+
if (view.humidity !== null) left.push(tile$1("Humidity", "Umidità", `${Math.round(view.humidity)}%`));
|
|
98972
100202
|
const modeControls = [{
|
|
98973
100203
|
kind: "picker",
|
|
98974
100204
|
id: "climate.mode",
|
|
98975
100205
|
label: t("Mode", "Modalità"),
|
|
98976
100206
|
current: view.mode,
|
|
98977
|
-
options: [...view.availableModes],
|
|
100207
|
+
options: [...view.availableModes.filter((m) => m !== "off"), ...view.availableModes.filter((m) => m === "off")],
|
|
100208
|
+
optionLabels: modeLabelsOf(view.availableModes),
|
|
98978
100209
|
call: {
|
|
98979
100210
|
cap: "climate-control",
|
|
98980
100211
|
method: "setMode",
|
|
@@ -99002,6 +100233,7 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
|
|
|
99002
100233
|
label: t("Fan", "Ventola"),
|
|
99003
100234
|
current: slice.fanMode === "" ? null : slice.fanMode,
|
|
99004
100235
|
options: [...slice.availableFanModes],
|
|
100236
|
+
optionLabels: Object.fromEntries(slice.availableFanModes.map((m) => [m, fanLabelOf(m)])),
|
|
99005
100237
|
call: {
|
|
99006
100238
|
cap: "climate-control",
|
|
99007
100239
|
method: "setFanMode",
|
|
@@ -99027,14 +100259,15 @@ var climateContribution = contribution("climate-control", ClimateControlStatusSc
|
|
|
99027
100259
|
if (fanControls.length > 0) rows.push({
|
|
99028
100260
|
id: "climate-fan",
|
|
99029
100261
|
icon: "fan",
|
|
99030
|
-
status: slice.fanMode === "" ? null : same(slice.fanMode),
|
|
100262
|
+
status: slice.fanMode === "" ? null : same$1(slice.fanMode),
|
|
99031
100263
|
controls: fanControls
|
|
99032
100264
|
});
|
|
99033
|
-
rows.push(...setpointRow(view.target === null ? null : same(formatDegrees(view.target)), view.range === null || view.target === null ? null : setpointSlider("climate.target", "climate-control", "setTarget", "target", view.target, view.range)));
|
|
100265
|
+
rows.push(...setpointRow(view.target === null ? null : same$1(formatDegrees(view.target)), view.range === null || view.target === null ? null : setpointSlider("climate.target", "climate-control", "setTarget", "target", view.target, view.range)));
|
|
99034
100266
|
const sceneMode = view.sceneMode;
|
|
99035
100267
|
return {
|
|
99036
100268
|
reading: reading("climate-control", view.isOff ? "off" : "on"),
|
|
99037
100269
|
title: view.modeLabel,
|
|
100270
|
+
...view.isOff || slice.fanMode === "" ? {} : { caption: t(`${view.modeLabel.en} · fan ${fanLabelOf(slice.fanMode).en}`, `${view.modeLabel.it} · ventola ${fanLabelOf(slice.fanMode).it}`) },
|
|
99038
100271
|
facts,
|
|
99039
100272
|
...left.length === 0 && right.length === 0 ? {} : { tiles: {
|
|
99040
100273
|
left,
|
|
@@ -99061,7 +100294,7 @@ var WATER_ON_PREFERENCE = [
|
|
|
99061
100294
|
"performance"
|
|
99062
100295
|
];
|
|
99063
100296
|
function capitalised(word) {
|
|
99064
|
-
return same(word.charAt(0).toUpperCase() + word.slice(1).replace(/_/g, " "));
|
|
100297
|
+
return same$1(word.charAt(0).toUpperCase() + word.slice(1).replace(/_/g, " "));
|
|
99065
100298
|
}
|
|
99066
100299
|
var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSchema, (slice) => {
|
|
99067
100300
|
if (slice === void 0 || slice.operationMode === null) return { reading: reading("climate-control", "unknown") };
|
|
@@ -99098,13 +100331,13 @@ var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSche
|
|
|
99098
100331
|
icon: "flame",
|
|
99099
100332
|
status: label,
|
|
99100
100333
|
controls: modeControls
|
|
99101
|
-
}, ...setpointRow(slice.targetTemp === null ? null : same(formatDegrees(slice.targetTemp)), range === null || slice.targetTemp === null ? null : setpointSlider("water-heater.target", "water-heater", "setTargetTemp", "temp", slice.targetTemp, range))];
|
|
100334
|
+
}, ...setpointRow(slice.targetTemp === null ? null : same$1(formatDegrees(slice.targetTemp)), range === null || slice.targetTemp === null ? null : setpointSlider("water-heater.target", "water-heater", "setTargetTemp", "temp", slice.targetTemp, range))];
|
|
99102
100335
|
const level = levelWithin(slice.targetTemp, range);
|
|
99103
100336
|
return {
|
|
99104
100337
|
reading: reading("climate-control", isOff ? "off" : "on"),
|
|
99105
100338
|
title: label,
|
|
99106
100339
|
facts: status === null ? [] : [fact("climate", "flame", status)],
|
|
99107
|
-
...slice.currentTemp === null ? {} : { tiles: { left: [tile("Water", "Acqua", formatDegrees(slice.currentTemp))] } },
|
|
100340
|
+
...slice.currentTemp === null ? {} : { tiles: { left: [tile$1("Water", "Acqua", formatDegrees(slice.currentTemp))] } },
|
|
99108
100341
|
scene: {
|
|
99109
100342
|
...isOff ? {} : { mode: "heat" },
|
|
99110
100343
|
...level === null ? {} : { level }
|
|
@@ -99122,11 +100355,12 @@ var waterHeaterContribution = contribution("water-heater", WaterHeaterStatusSche
|
|
|
99122
100355
|
var heatingValveContribution = contribution("heating-valve", HeatingValveStatusSchema, (slice) => {
|
|
99123
100356
|
const position = slice?.position ?? null;
|
|
99124
100357
|
if (position === null) return { reading: reading("sensor", "unknown") };
|
|
99125
|
-
const text = same(`${Math.round(position)}%`);
|
|
100358
|
+
const text = same$1(`${Math.round(position)}%`);
|
|
99126
100359
|
return {
|
|
99127
100360
|
reading: reading("sensor", position > 0 ? "running" : "idle"),
|
|
99128
100361
|
facts: [fact("valve", "gauge", t(`Valve ${text.en}`, `Valvola ${text.it}`))],
|
|
99129
|
-
tiles: { right: [tile("Valve", "Valvola", text.en)] },
|
|
100362
|
+
tiles: { right: [tile$1("Valve", "Valvola", text.en)] },
|
|
100363
|
+
...position > 0 ? { caption: t(`Heating · valve ${text.en}`, `Riscalda · valvola ${text.it}`) } : {},
|
|
99130
100364
|
scene: { level: position / 100 }
|
|
99131
100365
|
};
|
|
99132
100366
|
});
|
|
@@ -99135,9 +100369,9 @@ function sensorFragment(value, id, icon, en, it, text) {
|
|
|
99135
100369
|
if (value === null) return { reading: reading("sensor", "unknown") };
|
|
99136
100370
|
return {
|
|
99137
100371
|
reading: reading("sensor", "on"),
|
|
99138
|
-
title: same(text),
|
|
99139
|
-
facts: [fact(id, icon, same(text))],
|
|
99140
|
-
tiles: { right: [tile(en, it, text)] }
|
|
100372
|
+
title: same$1(text),
|
|
100373
|
+
facts: [fact(id, icon, same$1(text))],
|
|
100374
|
+
tiles: { right: [tile$1(en, it, text)] }
|
|
99141
100375
|
};
|
|
99142
100376
|
}
|
|
99143
100377
|
var temperatureContribution = contribution("temperature-sensor", TemperatureSensorStatusSchema, (slice) => sensorFragment(slice?.temperature ?? null, "temperature", "thermometer", "Temperature", "Temperatura", formatDegrees(slice?.temperature ?? 0)));
|
|
@@ -99192,8 +100426,8 @@ var CLIMATE_FAMILY_CONTRIBUTIONS = {
|
|
|
99192
100426
|
return {
|
|
99193
100427
|
reading: reading("sensor", "on"),
|
|
99194
100428
|
...slice.aqi === void 0 ? {} : { title: airQualityWord(slice.aqi) },
|
|
99195
|
-
facts: parts.map((p) => fact("air-quality", "wind", same(`${p.label} ${p.value}`))),
|
|
99196
|
-
tiles: { right: parts.slice(0, 2).map((p) => tile(p.label, p.label, p.value)) }
|
|
100429
|
+
facts: parts.map((p) => fact("air-quality", "wind", same$1(`${p.label} ${p.value}`))),
|
|
100430
|
+
tiles: { right: parts.slice(0, 2).map((p) => tile$1(p.label, p.label, p.value)) }
|
|
99197
100431
|
};
|
|
99198
100432
|
}),
|
|
99199
100433
|
"carbon-monoxide": contribution("carbon-monoxide", CarbonMonoxideStatusSchema, (slice) => {
|
|
@@ -99208,6 +100442,262 @@ var CLIMATE_FAMILY_CONTRIBUTIONS = {
|
|
|
99208
100442
|
"numeric-sensor": numericContribution,
|
|
99209
100443
|
"enum-sensor": enumContribution
|
|
99210
100444
|
};
|
|
100445
|
+
/**
|
|
100446
|
+
* The heat pump's contribution to a hero (D1026): the compressor scene, every
|
|
100447
|
+
* circuit as a row with its own label and icon, the powers as pills (the
|
|
100448
|
+
* instantaneous COP only when both powers are known) and a "System" group with
|
|
100449
|
+
* one selector per mode. Values and their limits come from the slice, which the
|
|
100450
|
+
* gateway filled: a selector with no allowed value is not drawn, a missing
|
|
100451
|
+
* reading is never a 0 (D393).
|
|
100452
|
+
*/
|
|
100453
|
+
var CAP = "heat-pump-control";
|
|
100454
|
+
var same = (text) => t(text, text);
|
|
100455
|
+
/** The words of the values the gateway names; a value not listed is drawn as the gateway wrote it. */
|
|
100456
|
+
var VALUE_LABELS = {
|
|
100457
|
+
off: t("Off", "Off"),
|
|
100458
|
+
on: t("On", "On"),
|
|
100459
|
+
auto: t("Auto", "Auto"),
|
|
100460
|
+
manual: t("Manual", "Manuale"),
|
|
100461
|
+
low: t("Low", "Bassa"),
|
|
100462
|
+
high: t("High", "Alta"),
|
|
100463
|
+
eco: t("Eco", "Eco"),
|
|
100464
|
+
heat: t("Heat", "Caldo"),
|
|
100465
|
+
cool: t("Cool", "Freddo"),
|
|
100466
|
+
heatCool: t("Heat/cool", "Caldo/freddo"),
|
|
100467
|
+
ownprogram: t("Programme", "Programma")
|
|
100468
|
+
};
|
|
100469
|
+
function valueLabel(value) {
|
|
100470
|
+
const known = VALUE_LABELS[value];
|
|
100471
|
+
if (known !== void 0) return known;
|
|
100472
|
+
const holiday = /^hm(\d+)$/.exec(value);
|
|
100473
|
+
if (holiday?.[1] !== void 0) return t(`Programme ${holiday[1]}`, `Programma ${holiday[1]}`);
|
|
100474
|
+
return same(value);
|
|
100475
|
+
}
|
|
100476
|
+
function optionLabels(allowed) {
|
|
100477
|
+
return Object.fromEntries(allowed.map((value) => [value, valueLabel(value)]));
|
|
100478
|
+
}
|
|
100479
|
+
function picker(id, label, setting, method, args, valueArg = "mode") {
|
|
100480
|
+
return {
|
|
100481
|
+
kind: "picker",
|
|
100482
|
+
id,
|
|
100483
|
+
label,
|
|
100484
|
+
current: setting.value,
|
|
100485
|
+
options: [...setting.allowed],
|
|
100486
|
+
optionLabels: optionLabels(setting.allowed),
|
|
100487
|
+
call: {
|
|
100488
|
+
cap: CAP,
|
|
100489
|
+
method,
|
|
100490
|
+
args: { ...args }
|
|
100491
|
+
},
|
|
100492
|
+
valueArg
|
|
100493
|
+
};
|
|
100494
|
+
}
|
|
100495
|
+
/** A selector exists only where the gateway named values to choose from. */
|
|
100496
|
+
function choosable(setting) {
|
|
100497
|
+
return setting !== null && setting.allowed.length > 0;
|
|
100498
|
+
}
|
|
100499
|
+
function circuitControl(circuit) {
|
|
100500
|
+
const args = { circuitId: circuit.id };
|
|
100501
|
+
if (circuit.kind === "dhw" && choosable(circuit.temperatureLevel)) return picker(`heat-pump.${circuit.id}.level`, t("Level", "Livello"), circuit.temperatureLevel, "setDhwTemperatureLevel", args, "level");
|
|
100502
|
+
if (!choosable(circuit.operationMode)) return null;
|
|
100503
|
+
const method = circuit.kind === "dhw" ? "setDhwOperationMode" : "setCircuitOperationMode";
|
|
100504
|
+
return picker(`heat-pump.${circuit.id}.mode`, t("Mode", "Modalità"), circuit.operationMode, method, args);
|
|
100505
|
+
}
|
|
100506
|
+
/** A circuit with no reading is still a row: it shows that nothing is known, not nothing. */
|
|
100507
|
+
var UNKNOWN_STATUS = same("—");
|
|
100508
|
+
function circuitRow(circuit) {
|
|
100509
|
+
const control = circuitControl(circuit);
|
|
100510
|
+
const status = thermalStatusText(circuit.targetTemp, circuit.currentTemp) ?? UNKNOWN_STATUS;
|
|
100511
|
+
return {
|
|
100512
|
+
id: "circuit",
|
|
100513
|
+
label: same(circuit.label),
|
|
100514
|
+
icon: circuit.icon,
|
|
100515
|
+
status,
|
|
100516
|
+
controls: control === null ? [] : [control]
|
|
100517
|
+
};
|
|
100518
|
+
}
|
|
100519
|
+
var kilowatts = (watts) => `${Number((watts / 1e3).toFixed(2))} kW`;
|
|
100520
|
+
function powerPills(status) {
|
|
100521
|
+
const { thermalW, electricalW } = status.power;
|
|
100522
|
+
const cop = heatPumpInstantCop(status.power);
|
|
100523
|
+
const pills = [];
|
|
100524
|
+
if (thermalW !== null) pills.push({
|
|
100525
|
+
icon: "flame",
|
|
100526
|
+
text: t(`Thermal ${kilowatts(thermalW)}`, `Termica ${kilowatts(thermalW)}`),
|
|
100527
|
+
tone: "muted"
|
|
100528
|
+
});
|
|
100529
|
+
if (electricalW !== null) pills.push({
|
|
100530
|
+
icon: "zap",
|
|
100531
|
+
text: t(`Electrical ${kilowatts(electricalW)}`, `Elettrica ${kilowatts(electricalW)}`),
|
|
100532
|
+
tone: "muted"
|
|
100533
|
+
});
|
|
100534
|
+
if (cop !== null) {
|
|
100535
|
+
const text = String(Number(cop.toFixed(1)));
|
|
100536
|
+
pills.push({
|
|
100537
|
+
icon: "gauge",
|
|
100538
|
+
text: t(`Instantaneous COP ${text}`, `COP istantaneo ${text}`),
|
|
100539
|
+
tone: "success"
|
|
100540
|
+
});
|
|
100541
|
+
}
|
|
100542
|
+
return pills;
|
|
100543
|
+
}
|
|
100544
|
+
/** The independent system modes, in the order the card draws them. */
|
|
100545
|
+
var SYSTEM_MODES = [
|
|
100546
|
+
{
|
|
100547
|
+
key: "silent",
|
|
100548
|
+
label: t("Silent", "Silenzioso"),
|
|
100549
|
+
icon: "volume-x",
|
|
100550
|
+
method: "setSilentMode"
|
|
100551
|
+
},
|
|
100552
|
+
{
|
|
100553
|
+
key: "away",
|
|
100554
|
+
label: t("Away", "Assente"),
|
|
100555
|
+
icon: "plane",
|
|
100556
|
+
method: "setAwayMode"
|
|
100557
|
+
},
|
|
100558
|
+
{
|
|
100559
|
+
key: "additionalHeater",
|
|
100560
|
+
label: t("Additional heater", "Riscaldatore aggiuntivo"),
|
|
100561
|
+
icon: "flame",
|
|
100562
|
+
method: "setAdditionalHeaterMode"
|
|
100563
|
+
},
|
|
100564
|
+
{
|
|
100565
|
+
key: "holiday",
|
|
100566
|
+
label: t("Holiday", "Vacanza"),
|
|
100567
|
+
icon: "tree-palm",
|
|
100568
|
+
method: "setHolidayMode"
|
|
100569
|
+
}
|
|
100570
|
+
];
|
|
100571
|
+
var SYSTEM_GROUP = t("System", "Sistema");
|
|
100572
|
+
var PROGRAMME = /^hm\d+$/;
|
|
100573
|
+
/**
|
|
100574
|
+
* Holiday is two segments, off / programme. Choosing "programme" keeps the programme
|
|
100575
|
+
* that is set, else the first one the gateway allowed, so a write never leaves
|
|
100576
|
+
* `allowed`. The full hm1..hm8 pick is not in the hero (D1026). A holiday whose values
|
|
100577
|
+
* are not programmes keeps the plain selector.
|
|
100578
|
+
*/
|
|
100579
|
+
function holidayRow(def, setting) {
|
|
100580
|
+
if (!setting.allowed.includes("off")) return null;
|
|
100581
|
+
const current = setting.value !== null && PROGRAMME.test(setting.value) ? setting.value : null;
|
|
100582
|
+
const programme = current ?? setting.allowed.find((v) => PROGRAMME.test(v));
|
|
100583
|
+
if (programme === void 0) return null;
|
|
100584
|
+
const control = picker("heat-pump.system.holiday", def.label, {
|
|
100585
|
+
value: setting.value,
|
|
100586
|
+
allowed: ["off", programme]
|
|
100587
|
+
}, def.method, {});
|
|
100588
|
+
const number = programme.slice(2);
|
|
100589
|
+
return {
|
|
100590
|
+
id: "system-mode",
|
|
100591
|
+
label: def.label,
|
|
100592
|
+
group: SYSTEM_GROUP,
|
|
100593
|
+
icon: def.icon,
|
|
100594
|
+
status: current === null ? null : t(`Programme ${number}`, `Programma ${number}`),
|
|
100595
|
+
controls: [control.kind === "picker" ? {
|
|
100596
|
+
...control,
|
|
100597
|
+
optionLabels: {
|
|
100598
|
+
off: t("Off", "Off"),
|
|
100599
|
+
[programme]: t("Programme", "Programma")
|
|
100600
|
+
}
|
|
100601
|
+
} : control]
|
|
100602
|
+
};
|
|
100603
|
+
}
|
|
100604
|
+
function systemRows(status) {
|
|
100605
|
+
const rows = [];
|
|
100606
|
+
for (const def of SYSTEM_MODES) {
|
|
100607
|
+
const setting = status.system[def.key];
|
|
100608
|
+
if (!choosable(setting)) continue;
|
|
100609
|
+
if (def.key === "holiday") {
|
|
100610
|
+
const holiday = holidayRow(def, setting);
|
|
100611
|
+
if (holiday !== null) {
|
|
100612
|
+
rows.push(holiday);
|
|
100613
|
+
continue;
|
|
100614
|
+
}
|
|
100615
|
+
}
|
|
100616
|
+
rows.push({
|
|
100617
|
+
id: "system-mode",
|
|
100618
|
+
label: def.label,
|
|
100619
|
+
group: SYSTEM_GROUP,
|
|
100620
|
+
icon: def.icon,
|
|
100621
|
+
status: null,
|
|
100622
|
+
controls: [picker(`heat-pump.system.${def.key}`, def.label, setting, def.method, {})]
|
|
100623
|
+
});
|
|
100624
|
+
}
|
|
100625
|
+
return rows;
|
|
100626
|
+
}
|
|
100627
|
+
function tile(en, it, value) {
|
|
100628
|
+
return {
|
|
100629
|
+
label: t(en, it),
|
|
100630
|
+
value: same(value)
|
|
100631
|
+
};
|
|
100632
|
+
}
|
|
100633
|
+
function tilesOf$1(status) {
|
|
100634
|
+
const { supply, return: back, outdoor } = status.temperatures;
|
|
100635
|
+
const left = [];
|
|
100636
|
+
const right = [];
|
|
100637
|
+
if (supply !== null) left.push(tile("Supply", "Mandata", formatDegrees(supply)));
|
|
100638
|
+
if (back !== null) left.push(tile("Return", "Ritorno", formatDegrees(back)));
|
|
100639
|
+
if (outdoor !== null) right.push(tile("Outdoor", "Esterna", formatDegrees(outdoor)));
|
|
100640
|
+
if (status.waterPressureBar !== null) right.push(tile("Pressure", "Pressione", `${Number(status.waterPressureBar.toFixed(1))} bar`));
|
|
100641
|
+
return {
|
|
100642
|
+
left,
|
|
100643
|
+
right
|
|
100644
|
+
};
|
|
100645
|
+
}
|
|
100646
|
+
function isRunning(status) {
|
|
100647
|
+
const { compressorPct, electricalW } = status.power;
|
|
100648
|
+
if (compressorPct !== null) return compressorPct > 0;
|
|
100649
|
+
if (electricalW !== null) return electricalW > 0;
|
|
100650
|
+
return null;
|
|
100651
|
+
}
|
|
100652
|
+
var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pump-status", HeatPumpStatusSchema, (slice) => {
|
|
100653
|
+
if (slice === void 0) return { reading: reading("climate-control", "unknown") };
|
|
100654
|
+
const running = isRunning(slice);
|
|
100655
|
+
const facts = [];
|
|
100656
|
+
if (slice.power.electricalW !== null) facts.push(fact("power", "zap", same(`${Math.round(slice.power.electricalW)} W`)));
|
|
100657
|
+
if (slice.power.compressorPct !== null) facts.push(fact("level", "gauge", t(`Compressor ${Math.round(slice.power.compressorPct)} %`, `Compressore ${Math.round(slice.power.compressorPct)} %`)));
|
|
100658
|
+
const charging = slice.circuits.find((c) => c.active === true);
|
|
100659
|
+
const tiles = tilesOf$1(slice);
|
|
100660
|
+
const pills = powerPills(slice);
|
|
100661
|
+
const rows = [
|
|
100662
|
+
...slice.circuits.map(circuitRow),
|
|
100663
|
+
...pills.length === 0 ? [] : [{
|
|
100664
|
+
id: "heat-pump-power",
|
|
100665
|
+
icon: "zap",
|
|
100666
|
+
status: null,
|
|
100667
|
+
controls: [],
|
|
100668
|
+
pills: [...pills]
|
|
100669
|
+
}],
|
|
100670
|
+
...systemRows(slice)
|
|
100671
|
+
];
|
|
100672
|
+
return {
|
|
100673
|
+
reading: reading("climate-control", running === true ? "running" : running === false ? "idle" : "on"),
|
|
100674
|
+
title: t("Heat pump", "Pompa di calore"),
|
|
100675
|
+
...charging === void 0 ? {} : { caption: t(`${charging.label} · heating`.toUpperCase(), `${charging.label} · in riscaldamento`.toUpperCase()) },
|
|
100676
|
+
facts,
|
|
100677
|
+
...tiles.left.length === 0 && tiles.right.length === 0 ? {} : { tiles },
|
|
100678
|
+
...slice.power.electricalW === null ? {} : { consumption: {
|
|
100679
|
+
priority: 1,
|
|
100680
|
+
slot: {
|
|
100681
|
+
kind: "power",
|
|
100682
|
+
watts: slice.power.electricalW,
|
|
100683
|
+
detail: slice.power.thermalW === null ? [] : [{
|
|
100684
|
+
label: t("Thermal", "Termica"),
|
|
100685
|
+
value: Math.round(slice.power.thermalW),
|
|
100686
|
+
unit: "W"
|
|
100687
|
+
}]
|
|
100688
|
+
}
|
|
100689
|
+
} },
|
|
100690
|
+
rows
|
|
100691
|
+
};
|
|
100692
|
+
}) };
|
|
100693
|
+
/** The position to show at `nowMs`: the reported one, advanced while playing when it is stamped. */
|
|
100694
|
+
function projectedPositionMs(status, nowMs) {
|
|
100695
|
+
if (status.position === null) return null;
|
|
100696
|
+
const stamp = status.positionUpdatedAt;
|
|
100697
|
+
if (status.state !== "playing" || typeof stamp !== "number") return status.position;
|
|
100698
|
+
const advanced = status.position + Math.max(0, nowMs - stamp);
|
|
100699
|
+
return status.duration !== null && status.duration > 0 ? Math.min(advanced, status.duration) : advanced;
|
|
100700
|
+
}
|
|
99211
100701
|
var NO_TRANSPORT = {
|
|
99212
100702
|
playPause: false,
|
|
99213
100703
|
previous: false,
|
|
@@ -99391,6 +100881,13 @@ function minutesLeft(seconds) {
|
|
|
99391
100881
|
const m = Math.ceil(seconds / 60);
|
|
99392
100882
|
return t(`${m} min left`, `${m} min rimanenti`);
|
|
99393
100883
|
}
|
|
100884
|
+
/** A time left as a tile reads it: "38 min", "1 h 12". */
|
|
100885
|
+
function durationText(seconds) {
|
|
100886
|
+
const m = Math.ceil(seconds / 60);
|
|
100887
|
+
if (m < 60) return t(`${m} min`, `${m} min`);
|
|
100888
|
+
const text = `${Math.floor(m / 60)} h ${String(m % 60).padStart(2, "0")}`;
|
|
100889
|
+
return t(text, text);
|
|
100890
|
+
}
|
|
99394
100891
|
function deviceTypeOf(type) {
|
|
99395
100892
|
return Object.values(DeviceType).find((t) => t === type);
|
|
99396
100893
|
}
|
|
@@ -99407,7 +100904,7 @@ var switchContribution = contribution("switch", SwitchStatusSchema, (slice) => {
|
|
|
99407
100904
|
}
|
|
99408
100905
|
};
|
|
99409
100906
|
});
|
|
99410
|
-
var runningStateContribution = contribution("running-state", RunningStateStatusSchema, (slice) => {
|
|
100907
|
+
var runningStateContribution = contribution("running-state", RunningStateStatusSchema, (slice, ctx) => {
|
|
99411
100908
|
const running = slice?.running ?? null;
|
|
99412
100909
|
const phase = slice?.phase ?? null;
|
|
99413
100910
|
const detail = [];
|
|
@@ -99421,13 +100918,6 @@ var runningStateContribution = contribution("running-state", RunningStateStatusS
|
|
|
99421
100918
|
value: phase,
|
|
99422
100919
|
unit: null
|
|
99423
100920
|
});
|
|
99424
|
-
const head = running === null ? t("Unknown", "Sconosciuto") : running ? t("Running", "In funzione") : t("Idle", "Inattivo");
|
|
99425
|
-
const row = {
|
|
99426
|
-
id: "cycle",
|
|
99427
|
-
icon: "activity",
|
|
99428
|
-
status: phase === null || running !== true ? head : t(`${head.en} · ${phase}`, `${head.it} · ${phase}`),
|
|
99429
|
-
controls: []
|
|
99430
|
-
};
|
|
99431
100921
|
return {
|
|
99432
100922
|
reading: reading("running-state", running === null ? "unknown" : running ? "running" : "idle"),
|
|
99433
100923
|
consumption: {
|
|
@@ -99440,8 +100930,17 @@ var runningStateContribution = contribution("running-state", RunningStateStatusS
|
|
|
99440
100930
|
detail
|
|
99441
100931
|
}
|
|
99442
100932
|
},
|
|
99443
|
-
|
|
99444
|
-
...
|
|
100933
|
+
...phase !== null && running === true ? { facts: [fact("phase", "activity", t(phase, phase), "primary")] } : {},
|
|
100934
|
+
...running === true && (phase !== null || slice?.since != null) ? { tiles: {
|
|
100935
|
+
...phase === null ? {} : { left: [{
|
|
100936
|
+
label: t("Phase", "Fase"),
|
|
100937
|
+
value: t(phase, phase)
|
|
100938
|
+
}] },
|
|
100939
|
+
...slice?.since == null || elapsedText(slice.since, ctx.now) === null ? {} : { right: [{
|
|
100940
|
+
label: t("Started", "Avviata"),
|
|
100941
|
+
value: elapsedText(slice.since, ctx.now) ?? t("", "")
|
|
100942
|
+
}] }
|
|
100943
|
+
} } : {}
|
|
99445
100944
|
};
|
|
99446
100945
|
});
|
|
99447
100946
|
var powerMeterContribution = contribution("power-meter", PowerMeterStatusSchema, (slice) => {
|
|
@@ -99474,6 +100973,7 @@ var powerMeterContribution = contribution("power-meter", PowerMeterStatusSchema,
|
|
|
99474
100973
|
}
|
|
99475
100974
|
},
|
|
99476
100975
|
facts: [fact("power", "zap", text, watts > 0 ? "primary" : "muted")],
|
|
100976
|
+
tilesFallback: true,
|
|
99477
100977
|
tiles: {
|
|
99478
100978
|
right: [{
|
|
99479
100979
|
label: t("Power", "Potenza"),
|
|
@@ -99504,6 +101004,7 @@ var batteryContribution = contribution("battery", BatteryStatusSchema, (slice) =
|
|
|
99504
101004
|
badges: [badge],
|
|
99505
101005
|
...level === null ? {} : {
|
|
99506
101006
|
facts: [fact("battery", "battery", badge.label, badge.tone)],
|
|
101007
|
+
tilesFallback: true,
|
|
99507
101008
|
tiles: { left: [{
|
|
99508
101009
|
label: t("Battery", "Batteria"),
|
|
99509
101010
|
value: t(`${level}%`, `${level}%`),
|
|
@@ -99557,10 +101058,22 @@ var motionTriggerContribution = contribution("motion-trigger", MotionTriggerStat
|
|
|
99557
101058
|
controls: [toggle]
|
|
99558
101059
|
}] };
|
|
99559
101060
|
});
|
|
101061
|
+
/** The armed run's length: "Timer 25 min". */
|
|
101062
|
+
function timerTile(quickRun) {
|
|
101063
|
+
const text = `${quickRun.duration} ${quickRun.unit}`;
|
|
101064
|
+
return {
|
|
101065
|
+
label: t("Timer", "Timer"),
|
|
101066
|
+
value: t(text, text)
|
|
101067
|
+
};
|
|
101068
|
+
}
|
|
101069
|
+
function remainingWords(amount, unit) {
|
|
101070
|
+
const word = unit === "min" ? "min" : "s";
|
|
101071
|
+
return t(`${amount} ${word}`, `${amount} ${word}`);
|
|
101072
|
+
}
|
|
99560
101073
|
var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slice, ctx) => {
|
|
99561
101074
|
const type = deviceTypeOf(ctx.type);
|
|
99562
|
-
const limit = type === void 0 ?
|
|
99563
|
-
if (limit ===
|
|
101075
|
+
const limit = type === void 0 ? null : timedRunLimitOf(type);
|
|
101076
|
+
if (limit === null) return {};
|
|
99564
101077
|
const quickRun = slice?.quickRun ?? timedRunQuickRun(limit, null);
|
|
99565
101078
|
const activeUntil = slice?.activeUntil != null && slice.activeUntil > ctx.now ? slice.activeUntil : null;
|
|
99566
101079
|
const runArgs = {
|
|
@@ -99570,21 +101083,26 @@ var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slic
|
|
|
99570
101083
|
const run = action("timed-run.run", t(`Run ${quickRun.duration} ${quickRun.unit}`, `Avvia ${quickRun.duration} ${quickRun.unit}`), "timer", "timed-run", "runFor", runArgs, "primary");
|
|
99571
101084
|
const cancel = action("timed-run.cancel", t("Stop", "Ferma"), "timer-off", "timed-run", "cancel");
|
|
99572
101085
|
const restart = action("timed-run.restart", t("Restart", "Riavvia"), "rotate-cw", "timed-run", "runFor", runArgs);
|
|
99573
|
-
const
|
|
101086
|
+
const remaining = activeUntil === null ? null : timedRunRemaining(activeUntil, ctx.now, quickRun.unit);
|
|
101087
|
+
const words = remaining === null ? null : remainingWords(remaining, quickRun.unit);
|
|
99574
101088
|
const row = {
|
|
99575
101089
|
id: "run-for",
|
|
99576
101090
|
icon: "timer",
|
|
99577
|
-
status:
|
|
101091
|
+
status: words === null ? t(`Run for ${quickRun.duration} ${quickRun.unit}`, `Avvia per ${quickRun.duration} ${quickRun.unit}`) : t(`Stops in ${words.en}`, `Si ferma tra ${words.it}`),
|
|
99578
101092
|
controls: activeUntil === null ? [asAction(run)] : [asAction(cancel), asAction(restart)]
|
|
99579
101093
|
};
|
|
101094
|
+
const armed = activeUntil === null ? {} : { right: [timerTile(quickRun)] };
|
|
99580
101095
|
return {
|
|
99581
101096
|
timedRun: {
|
|
99582
101097
|
activeUntil,
|
|
99583
101098
|
quickRun,
|
|
99584
101099
|
run,
|
|
99585
|
-
cancel
|
|
101100
|
+
cancel,
|
|
101101
|
+
remaining
|
|
99586
101102
|
},
|
|
99587
|
-
rows: [row]
|
|
101103
|
+
rows: [row],
|
|
101104
|
+
tilesFallback: true,
|
|
101105
|
+
tiles: armed
|
|
99588
101106
|
};
|
|
99589
101107
|
});
|
|
99590
101108
|
var powerSourceContribution = contribution("power-source", PowerSourceStateSchema, (slice, ctx) => ({ powerSupply: {
|
|
@@ -99625,15 +101143,43 @@ var consumablesContribution = contribution("consumables", ConsumablesStatusSchem
|
|
|
99625
101143
|
...attention === 0 ? {} : { facts: [fact("consumables", null, t(`${attention} to check`, `${attention} da controllare`), "warning")] }
|
|
99626
101144
|
};
|
|
99627
101145
|
});
|
|
99628
|
-
var
|
|
101146
|
+
var pct = (n) => t(`${Math.round(n)}%`, `${Math.round(n)}%`);
|
|
101147
|
+
var dishCycle = (id, en, it, icon, method, emphasis = "normal") => asAction(action(`cycle.${id}`, t(en, it), icon, "dishwasher", method, {}, emphasis));
|
|
101148
|
+
/** Pause / resume / stop, per what the appliance is doing; nothing while it is not running. */
|
|
101149
|
+
function dishwasherCycleControls(state) {
|
|
101150
|
+
if (state === "running") return [dishCycle("pause", "Pause", "Pausa", "pause", "pause"), dishCycle("stop", "Stop", "Stop", "square", "stop")];
|
|
101151
|
+
if (state === "paused") return [dishCycle("resume", "Resume", "Riprendi", "play", "resume", "primary"), dishCycle("stop", "Stop", "Stop", "square", "stop")];
|
|
101152
|
+
return [];
|
|
101153
|
+
}
|
|
101154
|
+
var OPERATION_WORDS = {
|
|
101155
|
+
Run: t("Running", "In corso"),
|
|
101156
|
+
Pause: t("Paused", "In pausa"),
|
|
101157
|
+
Finished: t("Finished", "Finito"),
|
|
101158
|
+
Ready: t("Ready", "Pronta"),
|
|
101159
|
+
Inactive: t("Idle", "Inattiva"),
|
|
101160
|
+
DelayedStart: t("Delayed start", "Avvio ritardato"),
|
|
101161
|
+
ActionRequired: t("Action needed", "Serve un intervento"),
|
|
101162
|
+
Error: t("Error", "Errore"),
|
|
101163
|
+
Aborting: t("Stopping", "Arresto")
|
|
101164
|
+
};
|
|
101165
|
+
var dishwasherContribution = contribution("dishwasher", DishwasherStatusSchema, (slice, ctx) => {
|
|
99629
101166
|
const state = slice === void 0 || slice.state === "unavailable" ? "unknown" : slice.state === "running" ? "running" : slice.state === "error" ? "alert" : "idle";
|
|
99630
|
-
const
|
|
99631
|
-
const
|
|
99632
|
-
|
|
99633
|
-
|
|
99634
|
-
|
|
99635
|
-
|
|
99636
|
-
|
|
101167
|
+
const rows = [];
|
|
101168
|
+
const progress = slice?.progress ?? null;
|
|
101169
|
+
if (progress !== null) rows.push({
|
|
101170
|
+
id: "progress",
|
|
101171
|
+
icon: "activity",
|
|
101172
|
+
status: pct(progress),
|
|
101173
|
+
controls: [],
|
|
101174
|
+
progress: progress / 100
|
|
101175
|
+
});
|
|
101176
|
+
const cycle = dishwasherCycleControls(slice?.state);
|
|
101177
|
+
if (cycle.length > 0) rows.push({
|
|
101178
|
+
id: "cycle",
|
|
101179
|
+
icon: "activity",
|
|
101180
|
+
status: null,
|
|
101181
|
+
controls: cycle
|
|
101182
|
+
});
|
|
99637
101183
|
if (slice?.powerOn != null) rows.push({
|
|
99638
101184
|
id: "appliance-power",
|
|
99639
101185
|
icon: "power",
|
|
@@ -99648,16 +101194,32 @@ var dishwasherContribution = contribution("dishwasher", DishwasherStatusSchema,
|
|
|
99648
101194
|
}]
|
|
99649
101195
|
});
|
|
99650
101196
|
const remaining = slice?.remaining ?? null;
|
|
101197
|
+
const phase = slice?.operationState == null ? null : OPERATION_WORDS[slice.operationState] ?? null;
|
|
101198
|
+
const program = slice?.program ?? slice?.selectedProgram ?? null;
|
|
101199
|
+
const left = [...phase === null ? [] : [{
|
|
101200
|
+
label: t("Phase", "Fase"),
|
|
101201
|
+
value: phase
|
|
101202
|
+
}], ...program === null ? [] : [{
|
|
101203
|
+
label: t("Program", "Programma"),
|
|
101204
|
+
value: t(program, program)
|
|
101205
|
+
}]];
|
|
99651
101206
|
return {
|
|
99652
101207
|
reading: reading("dishwasher", state),
|
|
99653
101208
|
rows,
|
|
99654
|
-
...remaining === null ? {} : {
|
|
99655
|
-
|
|
99656
|
-
|
|
99657
|
-
|
|
99658
|
-
|
|
101209
|
+
...remaining === null ? {} : { facts: [fact("remaining", "timer", minutesLeft(remaining), "primary")] },
|
|
101210
|
+
tiles: {
|
|
101211
|
+
left,
|
|
101212
|
+
...remaining === null ? {} : { right: [{
|
|
101213
|
+
label: t("Ends", "Fine"),
|
|
101214
|
+
value: minutesLeft(remaining),
|
|
101215
|
+
tone: "warning",
|
|
101216
|
+
at: ctx.now + remaining * 1e3
|
|
101217
|
+
}, {
|
|
101218
|
+
label: t("Left", "Restano"),
|
|
101219
|
+
value: durationText(remaining)
|
|
99659
101220
|
}] }
|
|
99660
|
-
}
|
|
101221
|
+
},
|
|
101222
|
+
...progress === null ? {} : { scene: { level: progress / 100 } }
|
|
99661
101223
|
};
|
|
99662
101224
|
});
|
|
99663
101225
|
var has$1 = (ctx, f) => ctx.features.includes(f);
|
|
@@ -99715,6 +101277,44 @@ function volumeControls(view, volumeLevel, muted) {
|
|
|
99715
101277
|
});
|
|
99716
101278
|
return controls;
|
|
99717
101279
|
}
|
|
101280
|
+
var clock = (ms) => {
|
|
101281
|
+
const total = Math.max(0, Math.floor(ms / 1e3));
|
|
101282
|
+
const h = Math.floor(total / 3600);
|
|
101283
|
+
const m = Math.floor(total % 3600 / 60);
|
|
101284
|
+
const sec = String(total % 60).padStart(2, "0");
|
|
101285
|
+
return h > 0 ? `${h}:${String(m).padStart(2, "0")}:${sec}` : `${m}:${sec}`;
|
|
101286
|
+
};
|
|
101287
|
+
var REPEAT_MODES = [
|
|
101288
|
+
"off",
|
|
101289
|
+
"all",
|
|
101290
|
+
"one"
|
|
101291
|
+
];
|
|
101292
|
+
/** Shuffle and repeat, drawn only when the player declares them and reports a value. */
|
|
101293
|
+
function modeControls(view, shuffle, repeat) {
|
|
101294
|
+
const controls = [];
|
|
101295
|
+
if (view.shuffle) controls.push({
|
|
101296
|
+
kind: "toggle",
|
|
101297
|
+
id: "playback.shuffle",
|
|
101298
|
+
label: t("Shuffle", "Casuale"),
|
|
101299
|
+
on: shuffle,
|
|
101300
|
+
turnOn: action("playback.shuffle.on", t("Shuffle on", "Casuale attivo"), "shuffle", "media-player", "setShuffle", { shuffle: true }),
|
|
101301
|
+
turnOff: action("playback.shuffle.off", t("Shuffle off", "Casuale disattivo"), "shuffle", "media-player", "setShuffle", { shuffle: false })
|
|
101302
|
+
});
|
|
101303
|
+
if (view.repeat) controls.push({
|
|
101304
|
+
kind: "picker",
|
|
101305
|
+
id: "playback.repeat",
|
|
101306
|
+
label: t("Repeat", "Ripeti"),
|
|
101307
|
+
current: repeat,
|
|
101308
|
+
options: [...REPEAT_MODES],
|
|
101309
|
+
call: {
|
|
101310
|
+
cap: "media-player",
|
|
101311
|
+
method: "setRepeat",
|
|
101312
|
+
args: {}
|
|
101313
|
+
},
|
|
101314
|
+
valueArg: "repeat"
|
|
101315
|
+
});
|
|
101316
|
+
return controls;
|
|
101317
|
+
}
|
|
99718
101318
|
/** Every contributing cap, in the order their fragments are merged. */
|
|
99719
101319
|
var HERO_CAP_CONTRIBUTIONS = [
|
|
99720
101320
|
contribution("media-player", MediaPlayerStatusSchema, (slice, ctx) => {
|
|
@@ -99730,7 +101330,7 @@ var HERO_CAP_CONTRIBUTIONS = [
|
|
|
99730
101330
|
controls: []
|
|
99731
101331
|
});
|
|
99732
101332
|
}
|
|
99733
|
-
const playback = playbackControls(view, ctx);
|
|
101333
|
+
const playback = [...playbackControls(view, ctx), ...modeControls(view, slice?.shuffle ?? null, slice?.repeat ?? null)];
|
|
99734
101334
|
if (playback.length > 0) rows.push({
|
|
99735
101335
|
id: "playback",
|
|
99736
101336
|
icon: "play",
|
|
@@ -99780,13 +101380,30 @@ var HERO_CAP_CONTRIBUTIONS = [
|
|
|
99780
101380
|
const facts = [];
|
|
99781
101381
|
if (sourceNow !== null) facts.push(fact("source", "radio", t(sourceNow, sourceNow)));
|
|
99782
101382
|
if (volumeNow !== null) facts.push(fact("volume", "volume-2", t(`${volumeNow}%`, `${volumeNow}%`)));
|
|
101383
|
+
const duration = slice?.duration ?? null;
|
|
101384
|
+
const position = slice === void 0 ? null : projectedPositionMs(slice, ctx.now);
|
|
101385
|
+
if (position !== null && duration !== null && duration > 0) {
|
|
101386
|
+
const line = `${clock(position)} / ${clock(duration)}`;
|
|
101387
|
+
facts.push(fact("progress", "activity", t(line, line)));
|
|
101388
|
+
}
|
|
101389
|
+
const trackNow = slice?.currentMedia?.title ?? null;
|
|
101390
|
+
const mediaTiles = {
|
|
101391
|
+
left: [...trackNow === null ? [] : [{
|
|
101392
|
+
label: t("Track", "Brano"),
|
|
101393
|
+
value: t(trackNow, trackNow)
|
|
101394
|
+
}], ...sourceNow === null ? [] : [{
|
|
101395
|
+
label: t("Source", "Sorgente"),
|
|
101396
|
+
value: t(sourceNow, sourceNow)
|
|
101397
|
+
}]],
|
|
101398
|
+
right: volumeNow === null ? [] : [{
|
|
101399
|
+
label: t("Volume", "Volume"),
|
|
101400
|
+
value: t(`${volumeNow}%`, `${volumeNow}%`)
|
|
101401
|
+
}]
|
|
101402
|
+
};
|
|
99783
101403
|
return {
|
|
99784
101404
|
reading: mediaReading(view),
|
|
99785
101405
|
facts,
|
|
99786
|
-
...
|
|
99787
|
-
label: t("Volume", "Volume"),
|
|
99788
|
-
value: t(`${volumeNow}%`, `${volumeNow}%`)
|
|
99789
|
-
}] } },
|
|
101406
|
+
...mediaTiles.left.length === 0 && mediaTiles.right.length === 0 ? {} : { tiles: mediaTiles },
|
|
99790
101407
|
scene: {
|
|
99791
101408
|
...mode === null ? {} : { mode },
|
|
99792
101409
|
...volumeNow === null ? {} : { level: volumeNow / 100 }
|
|
@@ -99819,7 +101436,8 @@ var HERO_CAP_CONTRIBUTIONS = [
|
|
|
99819
101436
|
...Object.values(GROUPS_FAMILY_CONTRIBUTIONS),
|
|
99820
101437
|
...Object.values(ACTUATORS_FAMILY_CONTRIBUTIONS),
|
|
99821
101438
|
...Object.values(SENSORS_FAMILY_CONTRIBUTIONS),
|
|
99822
|
-
...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS)
|
|
101439
|
+
...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
|
|
101440
|
+
...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
|
|
99823
101441
|
];
|
|
99824
101442
|
/**
|
|
99825
101443
|
* The FIXED layout of each device type's hero (D1023). A layout lives in this
|
|
@@ -99842,9 +101460,10 @@ var MEDIA_PLAYER_LAYOUT = { rows: [
|
|
|
99842
101460
|
"source",
|
|
99843
101461
|
"do-not-disturb"
|
|
99844
101462
|
] };
|
|
99845
|
-
var APPLIANCE_LAYOUT = { rows: ["cycle"] };
|
|
101463
|
+
var APPLIANCE_LAYOUT = { rows: ["progress", "cycle"] };
|
|
99846
101464
|
/** Its Home Connect PowerState is a secondary row action, never the own-power slot. */
|
|
99847
101465
|
var DISHWASHER_LAYOUT = { rows: [
|
|
101466
|
+
"progress",
|
|
99848
101467
|
"cycle",
|
|
99849
101468
|
"program",
|
|
99850
101469
|
"appliance-power"
|
|
@@ -99854,11 +101473,17 @@ var CLIMATE_LAYOUT = { rows: [
|
|
|
99854
101473
|
"climate-fan",
|
|
99855
101474
|
"setpoint"
|
|
99856
101475
|
] };
|
|
101476
|
+
/** The circuits, then the power pills, then the System group, one row per mode (D1026). */
|
|
101477
|
+
var HEAT_PUMP_LAYOUT = { rows: [
|
|
101478
|
+
"circuit",
|
|
101479
|
+
"heat-pump-power",
|
|
101480
|
+
"system-mode"
|
|
101481
|
+
] };
|
|
99857
101482
|
var SWITCH_LAYOUT = { rows: ["motion-trigger"] };
|
|
99858
101483
|
var LOCK_LAYOUT = { rows: ["lock"] };
|
|
99859
101484
|
var ALARM_LAYOUT = { rows: ["alarm"] };
|
|
99860
101485
|
var FAN_LAYOUT = { rows: ["fan"] };
|
|
99861
|
-
var VACUUM_LAYOUT = { rows: ["vacuum"] };
|
|
101486
|
+
var VACUUM_LAYOUT = { rows: ["vacuum", "vacuum-suction"] };
|
|
99862
101487
|
var MOWER_LAYOUT = { rows: ["mower"] };
|
|
99863
101488
|
var FEEDER_LAYOUT = { rows: ["feeder"] };
|
|
99864
101489
|
var FOUNTAIN_LAYOUT = { rows: ["fountain", "pump-cycle"] };
|
|
@@ -99897,6 +101522,7 @@ var HERO_LAYOUT_BY_TYPE = {
|
|
|
99897
101522
|
[DeviceType.Valve]: VALVE_LAYOUT,
|
|
99898
101523
|
[DeviceType.Humidifier]: HUMIDIFIER_LAYOUT,
|
|
99899
101524
|
[DeviceType.WaterHeater]: CLIMATE_LAYOUT,
|
|
101525
|
+
[DeviceType.HeatPump]: HEAT_PUMP_LAYOUT,
|
|
99900
101526
|
[DeviceType.Fan]: FAN_LAYOUT,
|
|
99901
101527
|
[DeviceType.MediaPlayer]: MEDIA_PLAYER_LAYOUT,
|
|
99902
101528
|
[DeviceType.AlarmPanel]: ALARM_LAYOUT,
|
|
@@ -100320,12 +101946,12 @@ var LOCK_LOOK = {
|
|
|
100320
101946
|
standby: look("lock-open", "warning", "plain", "none"),
|
|
100321
101947
|
off: look("lock-open", "muted", "plain", "none")
|
|
100322
101948
|
};
|
|
100323
|
-
/** The shield glows while armed, blinks red in alarm and goes quiet when disarmed. */
|
|
101949
|
+
/** The shield glows red while armed, blinks red in alarm and goes quiet when disarmed. */
|
|
100324
101950
|
var ALARM_LOOK = {
|
|
100325
101951
|
...lookOf({
|
|
100326
101952
|
icon: "shield-check",
|
|
100327
101953
|
on: [
|
|
100328
|
-
"
|
|
101954
|
+
"danger",
|
|
100329
101955
|
"glow",
|
|
100330
101956
|
"halo"
|
|
100331
101957
|
],
|
|
@@ -100570,6 +102196,22 @@ var WATER_HEATER_LOOK = lookOf({
|
|
|
100570
102196
|
idle: INFO,
|
|
100571
102197
|
standby: MUTED
|
|
100572
102198
|
});
|
|
102199
|
+
var HEAT_PUMP_LOOK = lookOf({
|
|
102200
|
+
icon: "thermometer-sun",
|
|
102201
|
+
on: [
|
|
102202
|
+
"warning",
|
|
102203
|
+
"heat-rise",
|
|
102204
|
+
"rise"
|
|
102205
|
+
],
|
|
102206
|
+
off: MUTED,
|
|
102207
|
+
running: [
|
|
102208
|
+
"warning",
|
|
102209
|
+
"heat-rise",
|
|
102210
|
+
"rise"
|
|
102211
|
+
],
|
|
102212
|
+
idle: INFO,
|
|
102213
|
+
standby: MUTED
|
|
102214
|
+
});
|
|
100573
102215
|
/** What a climate device draws while it is on, by mode: warm air rises, cold falls, drops dry, the fan spins. */
|
|
100574
102216
|
var HERO_MODE_LOOK = {
|
|
100575
102217
|
heat: look("flame", "warning", "heat-rise", "rise"),
|
|
@@ -100604,6 +102246,7 @@ var HERO_LOOK_BY_TYPE = {
|
|
|
100604
102246
|
[DeviceType.Valve]: VALVE_LOOK,
|
|
100605
102247
|
[DeviceType.Humidifier]: HUMIDIFIER_LOOK,
|
|
100606
102248
|
[DeviceType.WaterHeater]: WATER_HEATER_LOOK,
|
|
102249
|
+
[DeviceType.HeatPump]: HEAT_PUMP_LOOK,
|
|
100607
102250
|
[DeviceType.Fan]: FAN_LOOK,
|
|
100608
102251
|
[DeviceType.MediaPlayer]: MEDIA_PLAYER_LOOK,
|
|
100609
102252
|
[DeviceType.AlarmPanel]: ALARM_LOOK,
|
|
@@ -100843,7 +102486,19 @@ function consumptionOf(fragments) {
|
|
|
100843
102486
|
return best === null ? null : best.slot;
|
|
100844
102487
|
}
|
|
100845
102488
|
function tilesOf(fragments, side) {
|
|
100846
|
-
|
|
102489
|
+
const own = fragments.filter((f) => f.tilesFallback !== true).flatMap((f) => f.tiles?.[side] ?? []);
|
|
102490
|
+
return (own.length > 0 ? own : fragments.filter((f) => f.tilesFallback === true).flatMap((f) => f.tiles?.[side] ?? [])).slice(0, 2);
|
|
102491
|
+
}
|
|
102492
|
+
/** The foot button that opens the history, named for what the device keeps. */
|
|
102493
|
+
function historyLabelOf(type) {
|
|
102494
|
+
switch (type) {
|
|
102495
|
+
case DeviceType.Washer:
|
|
102496
|
+
case DeviceType.Dryer:
|
|
102497
|
+
case DeviceType.Dishwasher: return t("Cycles", "Cicli");
|
|
102498
|
+
case DeviceType.PetFeeder: return t("Meals", "Pasti");
|
|
102499
|
+
case DeviceType.Lock: return t("Access", "Accessi");
|
|
102500
|
+
default: return t("History", "Storico");
|
|
102501
|
+
}
|
|
100847
102502
|
}
|
|
100848
102503
|
function sceneOf(role, type, fragments) {
|
|
100849
102504
|
const parts = fragments.flatMap((f) => f.scene === void 0 ? [] : [f.scene]);
|
|
@@ -100887,20 +102542,27 @@ function buildHeroModel(input) {
|
|
|
100887
102542
|
};
|
|
100888
102543
|
const allRows = fragments.flatMap((f) => f.rows ?? []);
|
|
100889
102544
|
const rows = resolveHeroLayout(device.type).rows.flatMap((id) => {
|
|
100890
|
-
|
|
100891
|
-
return row === void 0 ? [] : [row];
|
|
102545
|
+
return allRows.filter((r) => r.id === id);
|
|
100892
102546
|
});
|
|
100893
102547
|
const ownPower = resolveOwnPower(fragments.flatMap((f) => f.ownPower === void 0 ? [] : [f.ownPower]));
|
|
100894
102548
|
const timedRun = fragments.find((f) => f.timedRun !== void 0)?.timedRun ?? null;
|
|
100895
102549
|
const powerSupply = fragments.find((f) => f.powerSupply !== void 0)?.powerSupply ?? null;
|
|
100896
102550
|
const remote = fragments.find((f) => f.remote !== void 0)?.remote ?? null;
|
|
100897
|
-
const
|
|
102551
|
+
const integration = device.integration?.trim() ?? "";
|
|
102552
|
+
const badges = [...integration === "" ? [] : [{
|
|
102553
|
+
id: "integration",
|
|
102554
|
+
icon: "plug",
|
|
102555
|
+
tone: "muted",
|
|
102556
|
+
value: null,
|
|
102557
|
+
label: t(integration, integration)
|
|
102558
|
+
}], ...fragments.flatMap((f) => f.badges ?? [])];
|
|
100898
102559
|
const headline = state === "offline" || state === "unknown" ? void 0 : fragments.find((f) => f.title !== void 0)?.title;
|
|
100899
102560
|
const facts = fragments.flatMap((f) => f.facts ?? []).filter((f) => headline === void 0 || f.text.en !== headline.en);
|
|
100900
102561
|
const sideTiles = {
|
|
100901
102562
|
left: tilesOf(fragments, "left"),
|
|
100902
102563
|
right: tilesOf(fragments, "right")
|
|
100903
102564
|
};
|
|
102565
|
+
const caption = state === "offline" || state === "unknown" ? void 0 : fragments.find((f) => f.caption !== void 0)?.caption;
|
|
100904
102566
|
const gated = [];
|
|
100905
102567
|
if (!input.access.canActuate) {
|
|
100906
102568
|
if (ownPower !== null) gated.push("own-power");
|
|
@@ -100922,8 +102584,10 @@ function buildHeroModel(input) {
|
|
|
100922
102584
|
facts,
|
|
100923
102585
|
sideTiles,
|
|
100924
102586
|
title: headline ?? title,
|
|
102587
|
+
...caption === void 0 ? {} : { caption },
|
|
100925
102588
|
badges,
|
|
100926
102589
|
remote,
|
|
102590
|
+
historyLabel: historyLabelOf(device.type),
|
|
100927
102591
|
consumables: fragments.find((f) => f.consumables !== void 0)?.consumables ?? null,
|
|
100928
102592
|
consumption: consumptionOf(fragments),
|
|
100929
102593
|
ownPower,
|
|
@@ -103098,6 +104762,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
103098
104762
|
access: "create",
|
|
103099
104763
|
role: "admin"
|
|
103100
104764
|
},
|
|
104765
|
+
"deviceManager.checkDeviceTemplates": {
|
|
104766
|
+
capName: "device-manager",
|
|
104767
|
+
capScope: "system",
|
|
104768
|
+
addonId: null,
|
|
104769
|
+
access: "view",
|
|
104770
|
+
role: "admin"
|
|
104771
|
+
},
|
|
103101
104772
|
"deviceManager.cleanupDeletedDevicesData": {
|
|
103102
104773
|
capName: "device-manager",
|
|
103103
104774
|
capScope: "system",
|
|
@@ -103497,6 +105168,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
103497
105168
|
access: "create",
|
|
103498
105169
|
role: "admin"
|
|
103499
105170
|
},
|
|
105171
|
+
"deviceManager.renderDeviceTemplates": {
|
|
105172
|
+
capName: "device-manager",
|
|
105173
|
+
capScope: "system",
|
|
105174
|
+
addonId: null,
|
|
105175
|
+
access: "view",
|
|
105176
|
+
role: "admin"
|
|
105177
|
+
},
|
|
103500
105178
|
"deviceManager.reportDiscoveryObservations": {
|
|
103501
105179
|
capName: "device-manager",
|
|
103502
105180
|
capScope: "system",
|
|
@@ -104428,6 +106106,111 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
104428
106106
|
access: "view",
|
|
104429
106107
|
role: "viewer"
|
|
104430
106108
|
},
|
|
106109
|
+
"heatPumpControl.setAdditionalHeaterMode": {
|
|
106110
|
+
capName: "heat-pump-control",
|
|
106111
|
+
capScope: "device",
|
|
106112
|
+
addonId: null,
|
|
106113
|
+
access: "create",
|
|
106114
|
+
role: "viewer"
|
|
106115
|
+
},
|
|
106116
|
+
"heatPumpControl.setAwayMode": {
|
|
106117
|
+
capName: "heat-pump-control",
|
|
106118
|
+
capScope: "device",
|
|
106119
|
+
addonId: null,
|
|
106120
|
+
access: "create",
|
|
106121
|
+
role: "viewer"
|
|
106122
|
+
},
|
|
106123
|
+
"heatPumpControl.setCircuitComfortSetpoint": {
|
|
106124
|
+
capName: "heat-pump-control",
|
|
106125
|
+
capScope: "device",
|
|
106126
|
+
addonId: null,
|
|
106127
|
+
access: "create",
|
|
106128
|
+
role: "viewer"
|
|
106129
|
+
},
|
|
106130
|
+
"heatPumpControl.setCircuitEcoSetpoint": {
|
|
106131
|
+
capName: "heat-pump-control",
|
|
106132
|
+
capScope: "device",
|
|
106133
|
+
addonId: null,
|
|
106134
|
+
access: "create",
|
|
106135
|
+
role: "viewer"
|
|
106136
|
+
},
|
|
106137
|
+
"heatPumpControl.setCircuitHeatCoolMode": {
|
|
106138
|
+
capName: "heat-pump-control",
|
|
106139
|
+
capScope: "device",
|
|
106140
|
+
addonId: null,
|
|
106141
|
+
access: "create",
|
|
106142
|
+
role: "viewer"
|
|
106143
|
+
},
|
|
106144
|
+
"heatPumpControl.setCircuitMaxFlowTemp": {
|
|
106145
|
+
capName: "heat-pump-control",
|
|
106146
|
+
capScope: "device",
|
|
106147
|
+
addonId: null,
|
|
106148
|
+
access: "create",
|
|
106149
|
+
role: "viewer"
|
|
106150
|
+
},
|
|
106151
|
+
"heatPumpControl.setCircuitOperationMode": {
|
|
106152
|
+
capName: "heat-pump-control",
|
|
106153
|
+
capScope: "device",
|
|
106154
|
+
addonId: null,
|
|
106155
|
+
access: "create",
|
|
106156
|
+
role: "viewer"
|
|
106157
|
+
},
|
|
106158
|
+
"heatPumpControl.setCircuitSummerWinter": {
|
|
106159
|
+
capName: "heat-pump-control",
|
|
106160
|
+
capScope: "device",
|
|
106161
|
+
addonId: null,
|
|
106162
|
+
access: "create",
|
|
106163
|
+
role: "viewer"
|
|
106164
|
+
},
|
|
106165
|
+
"heatPumpControl.setDhwChargeDuration": {
|
|
106166
|
+
capName: "heat-pump-control",
|
|
106167
|
+
capScope: "device",
|
|
106168
|
+
addonId: null,
|
|
106169
|
+
access: "create",
|
|
106170
|
+
role: "viewer"
|
|
106171
|
+
},
|
|
106172
|
+
"heatPumpControl.setDhwOperationMode": {
|
|
106173
|
+
capName: "heat-pump-control",
|
|
106174
|
+
capScope: "device",
|
|
106175
|
+
addonId: null,
|
|
106176
|
+
access: "create",
|
|
106177
|
+
role: "viewer"
|
|
106178
|
+
},
|
|
106179
|
+
"heatPumpControl.setDhwTemperatureLevel": {
|
|
106180
|
+
capName: "heat-pump-control",
|
|
106181
|
+
capScope: "device",
|
|
106182
|
+
addonId: null,
|
|
106183
|
+
access: "create",
|
|
106184
|
+
role: "viewer"
|
|
106185
|
+
},
|
|
106186
|
+
"heatPumpControl.setHolidayMode": {
|
|
106187
|
+
capName: "heat-pump-control",
|
|
106188
|
+
capScope: "device",
|
|
106189
|
+
addonId: null,
|
|
106190
|
+
access: "create",
|
|
106191
|
+
role: "viewer"
|
|
106192
|
+
},
|
|
106193
|
+
"heatPumpControl.setSilentMode": {
|
|
106194
|
+
capName: "heat-pump-control",
|
|
106195
|
+
capScope: "device",
|
|
106196
|
+
addonId: null,
|
|
106197
|
+
access: "create",
|
|
106198
|
+
role: "viewer"
|
|
106199
|
+
},
|
|
106200
|
+
"heatPumpControl.startExtraHotWater": {
|
|
106201
|
+
capName: "heat-pump-control",
|
|
106202
|
+
capScope: "device",
|
|
106203
|
+
addonId: null,
|
|
106204
|
+
access: "create",
|
|
106205
|
+
role: "viewer"
|
|
106206
|
+
},
|
|
106207
|
+
"heatPumpStatus.getStatus": {
|
|
106208
|
+
capName: "heat-pump-status",
|
|
106209
|
+
capScope: "device",
|
|
106210
|
+
addonId: null,
|
|
106211
|
+
access: "view",
|
|
106212
|
+
role: "viewer"
|
|
106213
|
+
},
|
|
104431
106214
|
"heroLayout.getHeroModel": {
|
|
104432
106215
|
capName: "hero-layout",
|
|
104433
106216
|
capScope: "system",
|
|
@@ -111267,7 +113050,7 @@ function projectAction(cap, action) {
|
|
|
111267
113050
|
};
|
|
111268
113051
|
}
|
|
111269
113052
|
Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
|
|
111270
|
-
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
113053
|
+
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Heater, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
111271
113054
|
DeviceFeature.BatteryOperated;
|
|
111272
113055
|
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
111273
113056
|
var HA_AS = "a power sensor (device_class power). Home Assistant has no laundry domain. running-state stays unexported until a null reading can be published as unavailable.";
|
|
@@ -111308,7 +113091,6 @@ function offered(received) {
|
|
|
111308
113091
|
};
|
|
111309
113092
|
}
|
|
111310
113093
|
offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
|
|
111311
|
-
z.string().min(1).max(4096);
|
|
111312
113094
|
/**
|
|
111313
113095
|
* Runtime list of cap names with status. Used by the settings
|
|
111314
113096
|
* aggregator to enumerate caps whose `status` should be polled +
|
|
@@ -111350,6 +113132,7 @@ var CAP_NAMES_WITH_STATUS = [
|
|
|
111350
113132
|
"group-active",
|
|
111351
113133
|
"group-commands",
|
|
111352
113134
|
"group-status",
|
|
113135
|
+
"heat-pump-status",
|
|
111353
113136
|
"heating-valve",
|
|
111354
113137
|
"humidifier",
|
|
111355
113138
|
"humidity-sensor",
|
|
@@ -112481,6 +114264,81 @@ Object.freeze({
|
|
|
112481
114264
|
form: "single",
|
|
112482
114265
|
optional: false
|
|
112483
114266
|
}],
|
|
114267
|
+
"heatPumpControl.setAdditionalHeaterMode": [{
|
|
114268
|
+
name: "deviceId",
|
|
114269
|
+
form: "single",
|
|
114270
|
+
optional: false
|
|
114271
|
+
}],
|
|
114272
|
+
"heatPumpControl.setAwayMode": [{
|
|
114273
|
+
name: "deviceId",
|
|
114274
|
+
form: "single",
|
|
114275
|
+
optional: false
|
|
114276
|
+
}],
|
|
114277
|
+
"heatPumpControl.setCircuitComfortSetpoint": [{
|
|
114278
|
+
name: "deviceId",
|
|
114279
|
+
form: "single",
|
|
114280
|
+
optional: false
|
|
114281
|
+
}],
|
|
114282
|
+
"heatPumpControl.setCircuitEcoSetpoint": [{
|
|
114283
|
+
name: "deviceId",
|
|
114284
|
+
form: "single",
|
|
114285
|
+
optional: false
|
|
114286
|
+
}],
|
|
114287
|
+
"heatPumpControl.setCircuitHeatCoolMode": [{
|
|
114288
|
+
name: "deviceId",
|
|
114289
|
+
form: "single",
|
|
114290
|
+
optional: false
|
|
114291
|
+
}],
|
|
114292
|
+
"heatPumpControl.setCircuitMaxFlowTemp": [{
|
|
114293
|
+
name: "deviceId",
|
|
114294
|
+
form: "single",
|
|
114295
|
+
optional: false
|
|
114296
|
+
}],
|
|
114297
|
+
"heatPumpControl.setCircuitOperationMode": [{
|
|
114298
|
+
name: "deviceId",
|
|
114299
|
+
form: "single",
|
|
114300
|
+
optional: false
|
|
114301
|
+
}],
|
|
114302
|
+
"heatPumpControl.setCircuitSummerWinter": [{
|
|
114303
|
+
name: "deviceId",
|
|
114304
|
+
form: "single",
|
|
114305
|
+
optional: false
|
|
114306
|
+
}],
|
|
114307
|
+
"heatPumpControl.setDhwChargeDuration": [{
|
|
114308
|
+
name: "deviceId",
|
|
114309
|
+
form: "single",
|
|
114310
|
+
optional: false
|
|
114311
|
+
}],
|
|
114312
|
+
"heatPumpControl.setDhwOperationMode": [{
|
|
114313
|
+
name: "deviceId",
|
|
114314
|
+
form: "single",
|
|
114315
|
+
optional: false
|
|
114316
|
+
}],
|
|
114317
|
+
"heatPumpControl.setDhwTemperatureLevel": [{
|
|
114318
|
+
name: "deviceId",
|
|
114319
|
+
form: "single",
|
|
114320
|
+
optional: false
|
|
114321
|
+
}],
|
|
114322
|
+
"heatPumpControl.setHolidayMode": [{
|
|
114323
|
+
name: "deviceId",
|
|
114324
|
+
form: "single",
|
|
114325
|
+
optional: false
|
|
114326
|
+
}],
|
|
114327
|
+
"heatPumpControl.setSilentMode": [{
|
|
114328
|
+
name: "deviceId",
|
|
114329
|
+
form: "single",
|
|
114330
|
+
optional: false
|
|
114331
|
+
}],
|
|
114332
|
+
"heatPumpControl.startExtraHotWater": [{
|
|
114333
|
+
name: "deviceId",
|
|
114334
|
+
form: "single",
|
|
114335
|
+
optional: false
|
|
114336
|
+
}],
|
|
114337
|
+
"heatPumpStatus.getStatus": [{
|
|
114338
|
+
name: "deviceId",
|
|
114339
|
+
form: "single",
|
|
114340
|
+
optional: false
|
|
114341
|
+
}],
|
|
112484
114342
|
"heroLayout.getHeroModel": [{
|
|
112485
114343
|
name: "deviceId",
|
|
112486
114344
|
form: "single",
|
|
@@ -114450,7 +116308,7 @@ Object.freeze({
|
|
|
114450
116308
|
});
|
|
114451
116309
|
/**
|
|
114452
116310
|
* Per-cap runtime-state policy, projected from every `*.cap.ts` that declares
|
|
114453
|
-
* `runtimeState`.
|
|
116311
|
+
* `runtimeState`. 82 caps: 41 `restored`, 41 `session`.
|
|
114454
116312
|
*
|
|
114455
116313
|
* A cap absent from this map has no runtime-state slice at all. A cap PRESENT
|
|
114456
116314
|
* with `durability: 'session'` has one and has decided not to keep it.
|
|
@@ -114585,6 +116443,10 @@ var RUNTIME_STATE_POLICY = {
|
|
|
114585
116443
|
durability: "session",
|
|
114586
116444
|
volatileFields: []
|
|
114587
116445
|
},
|
|
116446
|
+
"heat-pump-status": {
|
|
116447
|
+
durability: "session",
|
|
116448
|
+
volatileFields: ["lastFetchedAt"]
|
|
116449
|
+
},
|
|
114588
116450
|
"heating-valve": {
|
|
114589
116451
|
durability: "session",
|
|
114590
116452
|
volatileFields: ["lastFetchedAt"]
|
|
@@ -114798,6 +116660,12 @@ var SESSION_ONLY_POLICY = {
|
|
|
114798
116660
|
durability: "session",
|
|
114799
116661
|
volatileFields: []
|
|
114800
116662
|
};
|
|
116663
|
+
/**
|
|
116664
|
+
* The unit a composed-device field row offers convert-unit from (D941, D944).
|
|
116665
|
+
*/
|
|
116666
|
+
function runtimeFieldUnit(cap, path) {
|
|
116667
|
+
return CAP_RUNTIME_FIELD_UNITS[cap]?.[path];
|
|
116668
|
+
}
|
|
114801
116669
|
var G711_SCALE_CORRECTION_DB = {
|
|
114802
116670
|
PCMU: 20 * Math.log10(4),
|
|
114803
116671
|
PCMA: 20 * Math.log10(8)
|
|
@@ -116601,4 +118469,4 @@ z.object({
|
|
|
116601
118469
|
commands: z.record(z.string(), z.unknown())
|
|
116602
118470
|
});
|
|
116603
118471
|
//#endregion
|
|
116604
|
-
export { EMPTY_AUTOMATION_STATE as $, templateCapability as $a, processTimeZoneOr as $i, coreBlocksCapability as $n, BaseAddon as $o, isDefaultAppConnectionEndpoint as $r, defineEntryKind as $s, SsoBridgeClaimsSchema as $t, ControlStatusSchema as A, scopesAllowDeviceCap as Aa, parseSecretRef as Ac, nextOccurrence as Ai, buildHeroModel as An, composedDeviceRef as Ao, fanControlCapability as Ar, StoredRecordKindDeclarationSchema as As, PREFERENCES_MAX_VALUE_BYTES as At, DEVICE_ENROLLMENT_TTL_MS as B, snapshotCapability as Ba, toNodeId as Bc, parseAcceleratorFactsJson as Bi, climateControlCapability as Bn, helperMembers as Bo, generateDeviceAlias as Br, assertValidDeclaration as Bs, REMOTE_MEDIA_COMMANDS as Bt, CORE_BLOCKS_ADDON_ID as C, resolveRunnerId as Ca, mapSecretLeaves as Cc, memoizePinnedFfmpeg as Ci, bareAddonId as Cn, HISTORY_FAST_MS as Co, enumerateSchemaFields as Cr, RecordIntegrationInstances as Cs, MINUTES_PER_DAY as Ct, CatalogFileSchema as D, runtimeStatePolicyFor as Da, normalizeSecretOwner as Dc, modeForSwitch as Di, buildCapabilityLookup as Dn, MINUTE_MS as Do, expandContainer as Dr, RecordUniqueViolationError as Ds, MigrationMetaSchema as Dt, CalendarPreferencesSchema as E, runSteps as Ea, normalizeNodeId as Ec, migrationsCapability as Ei, buildActionSteps as En, HelperMemberSchema as Eo, evictionPolicyOfLocation as Er, RecordTooLargeError as Es, MigrationLedgerEntrySchema as Et, DATABASE_SNAPSHOT_TIMEOUT_MS as F, sharedActuatorMethods as Fa, scopeKey as Fc, normalizeUnit as Fi, capUnitResolver as Fn, compositionSourceKey as Fo, findChannelSource as Fr, actionEffect as Fs, PreferenceDeviceIdSchema as Ft, DEVICE_SAN_USER_PREFIX as G, storageMigrationCapability as Ga, withoutCallerStamp as Gc, pickAppLinkHub as Gi, composerCapability as Gn, nextLocalMidnight as Go, internalActionId as Gr, collectSecretMarkerRefs as Gs, RunningStateStatusSchema as Gt, DEVICE_ID_FIELD as H, stableIdMapOf as Ha, transformSecretWrite as Hc, parseStreamParamsFormPatch as Hi, colorCapability as Hn, integrateReading as Ho, groupTemplate as Hr, buildSecretRef as Hs, RecordingStatusSchema as Ht, DATA_STORE_DATABASES as I, sharedColorModes as Ia, secretTreeFromPaths as Ic, objectInputDeclaresAddonId as Ii, catalogueIssues as In, createStatefulExpressionMemory as Io, foldSnapshotByFunction as Ir, asJsonObject as Is, PreferenceNamespaceSchema as It, DeclaredDevices as J, streamCatalogCapability as Ja, DeviceType as Jc, powerSourceCapability as Ji, consumablesCapability as Jn, planResetTier as Jo, isAlertEpisodeSeverity as Jr, commandOrigin as Js, STREAM_PROFILE_META as Jt, DEVICE_TOMBSTONE_RETENTION_MS as K, storageOccupancyCapability as Ka, DeviceFeature as Kc, planComposition as Ki, compositionFieldKey as Kn, openReset as Ko, interpolate as Kr, collectZodSecretPaths as Ks, STORAGE_ACCESS_FALLBACK as Kt, DAY_NAMES as L, shortHostname as La, secretTreeFromSchema as Lc, objectInputDeclaresRequiredDeviceId as Li, checkDeviceAlias as Ln, disarmRoseMemory as Lo, formatDeviceRevoker as Lr, asNumber as Ls, PreferenceValueSchema as Lt, CredentialTokenClaimsSchema as M, seedInstanceOnce as Ma, recordSecretRef as Mc, normalizeCapStep as Mi, calendarsCapability as Mn, compositionFeatureEnabled as Mo, fanPresetsCapability as Mr, UnindexedFilterError as Ms, PackageRequiresSchema as Mt, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as N, settingsStoreCapability as Na, resolveCapMount as Nc, normalizeCoreBlockWrite as Ni, cameraGridLayoutCapability as Nn, compositionItemFieldPath as No, featureForwards as Nr, UnknownRecordKindError as Ns, PetFountainStatusSchema as Nt, ConditionMirror as O, schedulersCapability as Oa, parseJsonObject as Oc, modeMayWrite as Oi, buildDeviceEnrollmentLink as On, buildFfmpegArgs as Oo, expressionContainsBuiltinCall as Or, RevConflictError as Os, NetworkTunnelStartedDataSchema as Ot, DATABASE_SNAPSHOT_SUFFIX as P, sharedActuatorFeatures as Pa, resolveSecretMarkers as Pc, normalizeStepTargets as Pi, canonicalIconKey as Pn, compositionSliceKey as Po, filesystemBrowseCapability as Pr, WELL_KNOWN_TAB_MAP as Ps, PowerSourceInfoSchema as Pt, DiscoveryProposalBodySchema as Q, switchStateOfMode as Qa, procedureAuthKey as Qi, coreBlockSourceKind as Qn, wattMillisecondsToKwh as Qo, isCredentialTokenPayload as Qr, defineCustomActions as Qs, ServerNameSchema as Qt, DEFAULT_HOLD_OVERRIDE as R, siteFor as Ra, secretViewsOf as Rc, occurrenceOn as Ri, checkRoleAddress as Rn, evaluateDerivative as Ro, formatMinutes as Rr, asString$1 as Rs, QuantityUnitError as Rt, COMPOSER_RUNNER_ID as S, resolveRemoteSource as Sa, makeSecretMarker as Sc, mediaPlayerFeaturesOfRoles as Si, backupCapability as Sn, DEFAULT_HISTORY_RETENTION as So, enumerateItemArrayFields as Sr, ReadinessTimeoutError as Ss, MIGRATION_API_V1_METHODS as St, CREDENTIAL_TOKEN_AUDIENCE as T, runFanOut as Ta, nodePin as Tc, metricsProviderCapability as Ti, brightnessCapability as Tn, HOUR_MS as To, evaluateWhenTree as Tr, RecordNotFoundError as Ts, MediaPlayerStatusSchema as Tt, DEVICE_NONCE_TTL_MS as U, storageAdminCapability as Ua, userError as Uc, petFountainCapability as Ui, compareVersions as Un, isForwardInputRef as Uo, heroLayoutCapability as Ur, collectSecretConfigKeys as Us, RemoteAssumedStateSchema as Ut, DEVICE_HISTORY_ENERGY_KEY as V, splitTranslationRef as Va, toSecretFieldView as Vc, parseColorInput as Vi, collectWhenMirrorSources as Vn, historyRetentionFromSettings as Vo, groupCommandsCapability as Vr, auditedFields as Vs, ROOT_BUCKET_KEY as Vt, DEVICE_SAN_CREDENTIAL_PREFIX as W, storageCapability as Wa, vocabActionIdFor as Wc, petFountainWaterItem as Wi, compileScalarOverride as Wn, isHistoryHelper as Wo, integrationInstancesCapability as Wr, collectSecretLeaves as Ws, RemoteLayoutPayloadSchema as Wt, DeviceStatusSchema as X, supportedRuntimes as Xa, featuresOfBoundCaps as Xc, preconditionOf as Xi, coreBlockComposition as Xn, statisticCadenceMs as Xo, isArrayOutputSchema as Xr, customAction as Xs, SchedulerSchema as Xt, DeviceRunSchema as Y, streamQualityLabel as Ya, errMsg as Yc, powerSourceLinkOfComposition as Yi, coreBlockAddonId as Yn, planStatisticTier as Yo, isAppLinkBase as Yr, createEvent as Ys, SchedulerError as Yt, DeviceTombstoneSchema as Z, switchCapability as Za, EventCategory as Zc, problemsBlockSave as Zi, coreBlockIdFromAddonId as Zn, toExpressionValue as Zo, isCollectionArrayMethod as Zr, defineAddonMigrations as Zs, ScopedTokenSchema as Zt, CAMERA_SWITCH_ORDER as _, resolveHubAddressRoles as _a, isSecretClear as _c, logLevelAtMost as _i, alertEpisodePayload as _n, withLocationMode as _o, deviceRunsCapability as _r, RECORD_SWEEP_INTERVAL_MS as _s, KEYCHAIN_RESET_TRIGGER_ACTOR as _t, AGENT_MDNS_SERVICE_TYPE as a, recordsCapability as aa, formatSecretScope as ac, kebabToCamel as ai, TemplateKindSchema as an, toTimings as ao, declarationOwnerNodeId as ar, DeclarationRefusedError as as, FanDirectionSchema as at, CATALOG_LANGS as b, resolveMutate as ba, isSecretMarkerLike as bc, mayWriteToLocation as bi, armRemovalReconcile as bn, CompositionSchema as bo, deviceTransitionsCapability as br, RUNTIME_DEFAULTS as bs, LOG_LEVEL_RANK as bt, ActionError as c, remoteLayoutComponentsCapability as ca, historyUnitFor as cc, legacyAutoLinkIds as ci, UserRecordSchema as cn, validateComposition as co, defineExtensionSlotProvider as cr, ForeignSecretMarkerError as cs, FieldClaimSchema as ct, ActionVariableSchema as d, resolveActionVariables as da, isDebugChannelName as dc, localDateOf as di, actionsCapability as dn, valveCapability as do, describeUnmet as dr, NoCallerError as ds, HISTORY_ITEM_CATALOG as dt, projectDeviceRow as ea, defineRecordKinds as ec, isInternalActionId as ei, StorageCleanupJobSchema as en, timedRunCapability as eo, coverCapability as er, BatchTooLargeError as es, EMPTY_REMOTE_ASSUMED_STATE as et, AlertSchema as f, resolveAppConnections as fa, isDeviceConfigCap as fc, localNetworkCapability as fi, addonIdOfActionId as fn, vectorDimFromBase64 as fo, deviceCredentialsCapability as fr, PlaintextSecretError as fs, HUB_MDNS_SERVICE_TYPE as ft, BatteryStatusSchema as g, resolveHeroLayout as ga, isReadingQuantity as gc, logDestinationCapability as gi, alertEpisodeId as gn, withDefaultRunning as go, deviceRemovalHookCapability as gr, RECORD_SECRET_COLLECTION_PREFIX as gs, INTERNAL_ACTION_PREFIX as gt, BaseDevice as h, resolveCoreBlockFiles as ha, isKeychainStoredField as hc, lockDoorLinkOfComposition as hi, addonWidgetsCapability as hn, weekdayOfLocalDate as ho, deviceManagerCapability as hr, RECORD_DELETE_BATCH as hs, IDLE_ACTION_STATUS as ht, ACTUATOR_TEMPLATE_IDS as i, recordEntriesCapability as ia, expandCapMethods as ic, isVoidInput as ii, SwitchStatusSchema as in, timedRunSeconds as io, databaseSnapshotCapability as ir, DEVICE_STATUS_METHOD as is, FanControlStatusSchema as it, CoreBlockSchema as j, scoreRuntimes as ja, readinessKey as jc, normalizeActionUnits as ji, buildStreamParamsConfigSchema as jn, composedDeviceStableId as jo, fanOutTargets as jr, TransactRefusedError as js, PROPOSAL_MIN_SPAN_MS as jt, ConsumableItemSchema as k, scopesAllowAddon as ka, parseJsonUnknown as kc, motionCapability as ki, buildDeviceSignatureMessage as kn, cloneStatefulExpressionMemory as ko, extractNestedAddonId as kr, SECRET_CLEAR as ks, PET_FOUNTAIN_WATER_KEY as kt, ActionStepSchema as l, remoteSourceSteps as la, hydrateSchema as lc, legacyModeOf as li, actionSourceCapability as ln, validateCustomAddress as lo, deriveBatteryPresence as lr, HISTORY_DEFAULT_MIN_INTERVAL_MS as ls, GroupCommandResultSchema as lt, BUILTIN_REMOTE_COMPONENTS as m, resolveCoreBlockEntry as ma, isInstanceEnabled as mc, lockControlCapability as mi, addonSettingsCapability as mn, vectorStoreCapability as mo, deviceHistoryCapability as mr, RECORD_BATCH_MAX_BYTES as ms, HvacModeSchema as mt, ACTION_TARGET_INVALIDATION_EVENTS as n, ptzAutotrackCapability as na, emitReadiness as nc, isObjectInput as ni, StorageLocationTypeSchema as nn, timedRunMaxIn as no, customKeyOfRole as nr, DATAPLANE_SECRET_HEADER as ns, FAN_CAPTURE_FIELDS as nt, AGENT_MDNS_TXT_KEYS as o, reducePoints as oa, getDebugInterest as oc, keychainAdminCapability as oi, TokenScopeSchema as on, unmetRequirements as oo, declaredSeriesKind as or, DeviceTransitionSchema as os, FanPresetSchema as ot, AutomationStateDocSchema as p, resolveBucketMs as pa, isEvent as pc, locationIconKey as pi, addonPagesCapability as pn, vectorIndexDimConflictError as po, deviceExtensionCapability as pr, RECORD_BATCH_MAX as ps, HUB_MDNS_TXT_KEYS as pt, DataStoreDatabaseSchema as q, storageProviderCapability as qa, DeviceRole as qc, platformProbeCapability as qi, compositionSourceRefs as qn, openStatistic as qo, isAlertEpisodeOpen as qr, commandEffect as qs, STORAGE_LOCATION_MODES as qt, ACTUATOR_METHODS as r, readStoredRemoteConfig as ra, entryBody as rc, isSameAddonId as ri, StorageMigrationJobSchema as rn, timedRunQuickRun as ro, dataStoreProviderCapability as rr, DEVICE_SETTINGS_CONTRIBUTION_METHODS as rs, FIRST_LEVEL_MACRO_CLASSES as rt, ALL_CAPABILITY_DEFINITIONS as s, remoteCapability as sa, historyItemFieldPath as sc, keychainCapability as si, UNATTRIBUTED_BUCKET_KEY as sn, userManagementCapability as so, decodeVectorBase64 as sr, FilterRequiredError as ss, FieldClaimModeSchema as st, ACTION_RUN_MAX_MS as t, proposeRunningThreshold as ta, emitDownForOwnedCaps as tc, isLocationEnabled as ti, StorageLocationModeSchema as tn, timedRunLimitOf as to, createDeviceExtensionProvider as tr, CALLER_STAMPED_CAPABILITIES as ts, EMPTY_REMOTE_CONFIG as tt, ActionTargetResolver as u, replacedFieldKeys as ua, isCommand as uc, lifecycleJobSchema as ui, actionWaitTotalMs as un, validateSchedulerInput as uo, describeComposableCaps as ur, InvalidRecordError as us, HISTORY_CATALOG as ut, CAMSTACK_APP_LINK_ORIGIN as v, resolveLocationMode as va, isSecretFieldView as vc, looseSchema as vi, alertsCapability as vn, zoneOnlySite as vo, deviceStateCapability as vr, REDACTED_SECRET as vs, KeychainAuditEntrySchema as vt, CORE_BLOCK_ADDON_PREFIX as w, resolveStepArgs as wa, nodeIdOfScopedKey as wc, methodRefusal as wi, batteryCapability as wn, HISTORY_SLOW_MS as wo, evaluateCompositionField as wr, RecordKindDeclarationSchema as ws, MOTION_CLOSE_AFTER_MS as wt, COMPOSED_ITEM_FIXED_FIELDS as x, resolveNotificationTapAddress as xa, isSecretRefOwnedBy as xc, mediaPlayerCapability as xi, authProviderCapability as xn, DAY_MS as xo, enumerateInferenceDevices as xr, ReadinessRegistry as xs, METHOD_ACCESS_MAP as xt, CAP_NAMES_WITH_STATUS as y, resolveMethodAuth as ya, isSecretMarker as yc, mayReadLocation as yi, appendTrace as yn, COMPOSER_ADDON_ID as yo, deviceStatusCapability as yr, REMOVE_LEAF as ys, KeychainResetRecordSchema as yt, DERIVED_CAMERA_SILENCED_CAP_NAMES as z, siteZoneKey as za, sleep as zc, orderMigrations as zi, checkTemplatePayload as zn, evaluateStatistic as zo, gbToBytes as zr, assertTransactScope as zs, RECORDING_SOURCE_CAMSTACK_ADDON as zt };
|
|
118472
|
+
export { DeviceStatusSchema as $, storageOccupancyCapability as $a, DeviceFeature as $c, powerSourceCapability as $i, coreBlockAddonId as $n, openReset as $o, isAlertEpisodeSeverity as $r, collectZodSecretPaths as $s, SchedulerSchema as $t, ControlStatusSchema as A, resolveTemplateRef as Aa, mapSecretLeaves as Ac, metricsProviderCapability as Ai, buildCapabilityLookup as An, HISTORY_FAST_MS as Ao, evaluateWhenTree as Ar, RecordIntegrationInstances as As, MigrationMetaSchema as At, DEVICE_ENROLLMENT_TTL_MS as B, settingsStoreCapability as Ba, resolveCapMount as Bc, normalizeUnit as Bi, checkDeviceAlias as Bn, compositionItemFieldPath as Bo, findChannelSource as Br, UnknownRecordKindError as Bs, PreferenceValueSchema as Bt, CORE_BLOCKS_ADDON_ID as C, resolveLocationMode as Ca, isReadingQuantity as Cc, looseSchema as Ci, armRemovalReconcile as Cn, withDefaultRunning as Co, deviceStatusCapability as Cr, RECORD_SECRET_COLLECTION_PREFIX as Cs, LOG_LEVEL_RANK as Ct, CatalogFileSchema as D, resolveRemoteSource as Da, isSecretMarkerLike as Dc, mediaPlayerFeaturesOfRoles as Di, batteryCapability as Dn, CompositionSchema as Do, enumerateSchemaFields as Dr, RUNTIME_DEFAULTS as Ds, MOTION_CLOSE_AFTER_MS as Dt, CalendarPreferencesSchema as E, resolveNotificationTapAddress as Ea, isSecretMarker as Ec, mediaPlayerCapability as Ei, bareAddonId as En, COMPOSER_ADDON_ID as Eo, enumerateItemArrayFields as Er, REMOVE_LEAF as Es, MINUTES_PER_DAY as Et, DATABASE_SNAPSHOT_TIMEOUT_MS as F, schedulersCapability as Fa, parseJsonObject as Fc, nextOccurrence as Fi, calendarsCapability as Fn, buildFfmpegArgs as Fo, fanControlCapability as Fr, RevConflictError as Fs, PackageRequiresSchema as Ft, DEVICE_SAN_USER_PREFIX as G, siteFor as Ga, secretViewsOf as Gc, parseAcceleratorFactsJson as Gi, collectWhenMirrorSources as Gn, evaluateDerivative as Go, generateDeviceAlias as Gr, asString$1 as Gs, RecordingStatusSchema as Gt, DEVICE_ID_FIELD as H, sharedActuatorMethods as Ha, scopeKey as Hc, objectInputDeclaresRequiredDeviceId as Hi, checkTemplatePayload as Hn, compositionSourceKey as Ho, formatDeviceRevoker as Hr, actionEffect as Hs, RECORDING_SOURCE_CAMSTACK_ADDON as Ht, DATA_STORE_DATABASES as I, scopesAllowAddon as Ia, parseJsonUnknown as Ic, normalizeActionUnits as Ii, cameraGridLayoutCapability as In, cloneStatefulExpressionMemory as Io, fanOutTargets as Ir, SECRET_CLEAR as Is, PetFountainStatusSchema as It, DEVICE_TEMPLATE_MAX_OUTPUT as J, splitTranslationRef as Ja, toSecretFieldView as Jc, petFountainCapability as Ji, compileScalarOverride as Jn, historyRetentionFromSettings as Jo, heroLayoutCapability as Jr, auditedFields as Js, RunningStateStatusSchema as Jt, DEVICE_TEMPLATE_FILTERS as K, siteZoneKey as Ka, sleep as Kc, parseColorInput as Ki, colorCapability as Kn, evaluateStatistic as Ko, groupCommandsCapability as Kr, assertTransactScope as Ks, RemoteAssumedStateSchema as Kt, DAY_NAMES as L, scopesAllowDeviceCap as La, parseSecretRef as Lc, normalizeCapStep as Li, canonicalIconKey as Ln, composedDeviceRef as Lo, fanPresetsCapability as Lr, StoredRecordKindDeclarationSchema as Ls, PowerSourceInfoSchema as Lt, CredentialTokenClaimsSchema as M, runSteps as Ma, nodePin as Mc, modeForSwitch as Mi, buildDeviceSignatureMessage as Mn, HOUR_MS as Mo, expandContainer as Mr, RecordNotFoundError as Ms, PET_FOUNTAIN_WATER_KEY as Mt, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as N, runtimeFieldUnit as Na, normalizeNodeId as Nc, modeMayWrite as Ni, buildHeroModel as Nn, HelperMemberSchema as No, expressionContainsBuiltinCall as Nr, RecordTooLargeError as Ns, PREFERENCES_MAX_VALUE_BYTES as Nt, ConditionMirror as O, resolveRunnerId as Oa, isSecretRefOwnedBy as Oc, memoizePinnedFfmpeg as Oi, brightnessCapability as On, DAY_MS as Oo, evaluateCompositionField as Or, ReadinessRegistry as Os, MediaPlayerStatusSchema as Ot, DATABASE_SNAPSHOT_SUFFIX as P, runtimeStatePolicyFor as Pa, normalizeSecretOwner as Pc, motionCapability as Pi, buildStreamParamsConfigSchema as Pn, MINUTE_MS as Po, extractNestedAddonId as Pr, RecordUniqueViolationError as Ps, PROPOSAL_MIN_SPAN_MS as Pt, DeviceRunSchema as Q, storageMigrationCapability as Qa, withoutCallerStamp as Qc, platformProbeCapability as Qi, consumablesCapability as Qn, nextLocalMidnight as Qo, isAlertEpisodeOpen as Qr, collectSecretMarkerRefs as Qs, SchedulerError as Qt, DEFAULT_HOLD_OVERRIDE as R, scoreRuntimes as Ra, readinessKey as Rc, normalizeCoreBlockWrite as Ri, capUnitResolver as Rn, composedDeviceStableId as Ro, featureForwards as Rr, TransactRefusedError as Rs, PreferenceDeviceIdSchema as Rt, COMPOSER_RUNNER_ID as S, resolveHubAddressRoles as Sa, isKeychainStoredField as Sc, logLevelAtMost as Si, appendTrace as Sn, weekdayOfLocalDate as So, deviceStateCapability as Sr, RECORD_DELETE_BATCH as Ss, KeychainResetRecordSchema as St, CREDENTIAL_TOKEN_AUDIENCE as T, resolveMutate as Ta, isSecretFieldView as Tc, mayWriteToLocation as Ti, backupCapability as Tn, zoneOnlySite as To, enumerateInferenceDevices as Tr, REDACTED_SECRET as Ts, MIGRATION_API_V1_METHODS as Tt, DEVICE_NONCE_TTL_MS as U, sharedColorModes as Ua, secretTreeFromPaths as Uc, occurrenceOn as Ui, climateControlCapability as Un, createStatefulExpressionMemory as Uo, formatMinutes as Ur, asJsonObject as Us, REMOTE_MEDIA_COMMANDS as Ut, DEVICE_HISTORY_ENERGY_KEY as V, sharedActuatorFeatures as Va, resolveSecretMarkers as Vc, objectInputDeclaresAddonId as Vi, checkRoleAddress as Vn, compositionSliceKey as Vo, foldSnapshotByFunction as Vr, WELL_KNOWN_TAB_MAP as Vs, QuantityUnitError as Vt, DEVICE_SAN_CREDENTIAL_PREFIX as W, shortHostname as Wa, secretTreeFromSchema as Wc, orderMigrations as Wi, collectDeviceTemplates as Wn, disarmRoseMemory as Wo, gbToBytes as Wr, asNumber as Ws, ROOT_BUCKET_KEY as Wt, DataStoreDatabaseSchema as X, storageAdminCapability as Xa, userError as Xc, pickAppLinkHub as Xi, compositionFieldKey as Xn, isForwardInputRef as Xo, internalActionId as Xr, collectSecretConfigKeys as Xs, STORAGE_LOCATION_MODES as Xt, DEVICE_TOMBSTONE_RETENTION_MS as Y, stableIdMapOf as Ya, transformSecretWrite as Yc, petFountainWaterItem as Yi, composerCapability as Yn, integrateReading as Yo, integrationInstancesCapability as Yr, buildSecretRef as Ys, STORAGE_ACCESS_FALLBACK as Yt, DeclaredDevices as Z, storageCapability as Za, vocabActionIdFor as Zc, planComposition as Zi, compositionSourceRefs as Zn, isHistoryHelper as Zo, interpolate as Zr, collectSecretLeaves as Zs, STREAM_PROFILE_META as Zt, CAMERA_SWITCH_ORDER as _, resolveAppConnections as _a, isCommand as _c, localNetworkCapability as _i, addonSettingsCapability as _n, validateSchedulerInput as _o, deviceExtensionCapability as _r, InvalidRecordError as _s, HvacModeSchema as _t, AGENT_MDNS_SERVICE_TYPE as a, projectDeviceRow as aa, defineCustomActions as ac, isInternalActionId as ai, StorageLocationTypeSchema as an, switchStateOfMode as ao, createDeviceExtensionProvider as ar, wattMillisecondsToKwh as as, FAN_CAPTURE_FIELDS as at, CATALOG_LANGS as b, resolveCoreBlockFiles as ba, isEvent as bc, lockDoorLinkOfComposition as bi, alertEpisodePayload as bn, vectorIndexDimConflictError as bo, deviceRemovalHookCapability as br, RECORD_BATCH_MAX as bs, KEYCHAIN_RESET_TRIGGER_ACTOR as bt, ActionError as c, readStoredRemoteConfig as ca, emitDownForOwnedCaps as cc, isSameAddonId as ci, TemplateKindSchema as cn, timedRunLimitOf as co, databaseSnapshotCapability as cr, CALLER_STAMPED_CAPABILITIES as cs, FanDirectionSchema as ct, ActionVariableSchema as d, reducePoints as da, expandCapMethods as dc, keychainAdminCapability as di, UserRecordSchema as dn, timedRunSeconds as do, decodeVectorBase64 as dr, DEVICE_STATUS_METHOD as ds, FieldClaimSchema as dt, powerSourceLinkOfComposition as ea, commandEffect as ec, isAppLinkBase as ei, DeviceRole as el, ScopedTokenSchema as en, storageProviderCapability as eo, coreBlockComposition as er, openStatistic as es, DeviceTombstoneSchema as et, AlertSchema as f, remoteCapability as fa, formatSecretScope as fc, keychainCapability as fi, actionSourceCapability as fn, toTimings as fo, defineExtensionSlotProvider as fr, DeclarationRefusedError as fs, GroupCommandResultSchema as ft, BatteryStatusSchema as g, resolveActionVariables as ga, hydrateSchema as gc, localDateOf as gi, addonPagesCapability as gn, validateCustomAddress as go, deviceCredentialsCapability as gr, HISTORY_DEFAULT_MIN_INTERVAL_MS as gs, HUB_MDNS_TXT_KEYS as gt, BaseDevice as h, replacedFieldKeys as ha, historyUnitFor as hc, lifecycleJobSchema as hi, addonIdOfActionId as hn, validateComposition as ho, describeUnmet as hr, ForeignSecretMarkerError as hs, HUB_MDNS_SERVICE_TYPE as ht, ACTUATOR_TEMPLATE_IDS as i, processTimeZoneOr as ia, defineAddonMigrations as ic, isDefaultAppConnectionEndpoint as ii, EventCategory as il, StorageLocationModeSchema as in, switchCapability as io, coverCapability as ir, toExpressionValue as is, EMPTY_REMOTE_CONFIG as it, CoreBlockSchema as j, runFanOut as ja, nodeIdOfScopedKey as jc, migrationsCapability as ji, buildDeviceEnrollmentLink as jn, HISTORY_SLOW_MS as jo, evictionPolicyOfLocation as jr, RecordKindDeclarationSchema as js, NetworkTunnelStartedDataSchema as jt, ConsumableItemSchema as k, resolveStepArgs as ka, makeSecretMarker as kc, methodRefusal as ki, buildActionSteps as kn, DEFAULT_HISTORY_RETENTION as ko, evaluateStepCondition as kr, ReadinessTimeoutError as ks, MigrationLedgerEntrySchema as kt, ActionStepSchema as l, recordEntriesCapability as la, emitReadiness as lc, isVoidInput as li, TokenScopeSchema as ln, timedRunMaxIn as lo, declarationOwnerNodeId as lr, DATAPLANE_SECRET_HEADER as ls, FanPresetSchema as lt, BUILTIN_REMOTE_COMPONENTS as m, remoteSourceSteps as ma, historyItemFieldPath as mc, legacyModeOf as mi, actionsCapability as mn, userManagementCapability as mo, describeComposableCaps as mr, FilterRequiredError as ms, HISTORY_ITEM_CATALOG as mt, ACTION_TARGET_INVALIDATION_EVENTS as n, problemsBlockSave as na, createEvent as nc, isCollectionArrayMethod as ni, errMsg as nl, SsoBridgeClaimsSchema as nn, streamQualityLabel as no, coreBlockSourceKind as nr, planStatisticTier as ns, EMPTY_AUTOMATION_STATE as nt, AGENT_MDNS_TXT_KEYS as o, proposeRunningThreshold as oa, defineEntryKind as oc, isLocationEnabled as oi, StorageMigrationJobSchema as on, templateCapability as oo, customKeyOfRole as or, BaseAddon as os, FIRST_LEVEL_MACRO_CLASSES as ot, AutomationStateDocSchema as p, remoteLayoutComponentsCapability as pa, getDebugInterest as pc, legacyAutoLinkIds as pi, actionWaitTotalMs as pn, unmetRequirements as po, deriveBatteryPresence as pr, DeviceTransitionSchema as ps, HISTORY_CATALOG as pt, DEVICE_TEMPLATE_MAX_LENGTH as q, snapshotCapability as qa, toNodeId as qc, parseStreamParamsFormPatch as qi, compareVersions as qn, helperMembers as qo, groupTemplate as qr, assertValidDeclaration as qs, RemoteLayoutPayloadSchema as qt, ACTUATOR_METHODS as r, procedureAuthKey as ra, customAction as rc, isCredentialTokenPayload as ri, featuresOfBoundCaps as rl, StorageCleanupJobSchema as rn, supportedRuntimes as ro, coreBlocksCapability as rr, statisticCadenceMs as rs, EMPTY_REMOTE_ASSUMED_STATE as rt, ALL_CAPABILITY_DEFINITIONS as s, ptzAutotrackCapability as sa, defineRecordKinds as sc, isObjectInput as si, SwitchStatusSchema as sn, timedRunCapability as so, dataStoreProviderCapability as sr, BatchTooLargeError as ss, FanControlStatusSchema as st, ACTION_RUN_MAX_MS as t, preconditionOf as ta, commandOrigin as tc, isArrayOutputSchema as ti, DeviceType as tl, ServerNameSchema as tn, streamCatalogCapability as to, coreBlockIdFromAddonId as tr, planResetTier as ts, DiscoveryProposalBodySchema as tt, ActionTargetResolver as u, recordsCapability as ua, entryBody as uc, kebabToCamel as ui, UNATTRIBUTED_BUCKET_KEY as un, timedRunQuickRun as uo, declaredSeriesKind as ur, DEVICE_SETTINGS_CONTRIBUTION_METHODS as us, FieldClaimModeSchema as ut, CAMSTACK_APP_LINK_ORIGIN as v, resolveBucketMs as va, isDebugChannelName as vc, locationIconKey as vi, addonWidgetsCapability as vn, valveCapability as vo, deviceHistoryCapability as vr, NoCallerError as vs, IDLE_ACTION_STATUS as vt, CORE_BLOCK_ADDON_PREFIX as w, resolveMethodAuth as wa, isSecretClear as wc, mayReadLocation as wi, authProviderCapability as wn, withLocationMode as wo, deviceTransitionsCapability as wr, RECORD_SWEEP_INTERVAL_MS as ws, METHOD_ACCESS_MAP as wt, COMPOSED_ITEM_FIXED_FIELDS as x, resolveHeroLayout as xa, isInstanceEnabled as xc, logDestinationCapability as xi, alertsCapability as xn, vectorStoreCapability as xo, deviceRunsCapability as xr, RECORD_BATCH_MAX_BYTES as xs, KeychainAuditEntrySchema as xt, CAP_NAMES_WITH_STATUS as y, resolveCoreBlockEntry as ya, isDeviceConfigCap as yc, lockControlCapability as yi, alertEpisodeId as yn, vectorDimFromBase64 as yo, deviceManagerCapability as yr, PlaintextSecretError as ys, INTERNAL_ACTION_PREFIX as yt, DERIVED_CAMERA_SILENCED_CAP_NAMES as z, seedInstanceOnce as za, recordSecretRef as zc, normalizeStepTargets as zi, catalogueIssues as zn, compositionFeatureEnabled as zo, filesystemBrowseCapability as zr, UnindexedFilterError as zs, PreferenceNamespaceSchema as zt };
|