@camstack/types 1.2.533 → 1.2.535
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/addon/base-addon.d.ts +1 -20
- package/dist/addon/notification-targets.d.ts +34 -9
- package/dist/addon.js +2 -2
- package/dist/addon.mjs +2 -2
- package/dist/capabilities/addon-settings.cap.d.ts +0 -41
- package/dist/capabilities/capability-definition.d.ts +26 -2
- package/dist/capabilities/heat-pump-control.cap.d.ts +83 -0
- package/dist/capabilities/heat-pump-status.cap.d.ts +517 -0
- package/dist/capabilities/hero-layout.cap.d.ts +46 -0
- package/dist/capabilities/index.d.ts +5 -1
- package/dist/capabilities/integration-instances.cap.d.ts +22 -7
- package/dist/capabilities/integrations.cap.d.ts +13 -0
- package/dist/capabilities/smtp-provider.cap.d.ts +2 -10
- package/dist/client.js +24 -7
- package/dist/client.mjs +24 -7
- package/dist/{composition-BjHGoicU.js → composition-BxalDSTt.js} +1 -1
- package/dist/{composition-CXCX78IR.mjs → composition-C6TZGqUb.mjs} +1 -1
- package/dist/device/cap-vocabulary/entries/heat-pump.d.ts +4 -0
- package/dist/device/device-type.d.ts +5 -1
- package/dist/device/hero/build-hero-model.d.ts +2 -0
- package/dist/device/hero/climate-view.d.ts +4 -0
- package/dist/device/hero/hero-contributions-heat-pump.d.ts +2 -0
- package/dist/device/hero/hero-fragment.d.ts +4 -0
- package/dist/device/hero/hero-layout.d.ts +1 -0
- package/dist/device/hero/hero-look.d.ts +6 -0
- package/dist/device/hero/hero-model.d.ts +80 -1
- package/dist/device/hero/hero-row.d.ts +5 -0
- package/dist/device/hero/hero-scene.d.ts +4 -1
- package/dist/device/hero/index.d.ts +1 -1
- package/dist/{device-type-BaYa0UGS.js → device-type-BfvqqzRp.js} +4 -0
- package/dist/{device-type-CbDhVwFP.mjs → device-type-DTTZKB2I.mjs} +4 -0
- package/dist/generated/addon-api.d.ts +122 -17
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/cap-status-types.d.ts +3 -1
- package/dist/generated/capability-router-map.d.ts +8 -2
- package/dist/generated/customize-catalog.d.ts +1 -1
- package/dist/generated/device-local-state.d.ts +3 -0
- package/dist/generated/device-proxy.d.ts +5 -0
- package/dist/generated/device-scoped-caps.d.ts +1 -1
- package/dist/generated/history-catalog.d.ts +2 -2
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/generated/runtime-state-durability.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/i18n/camstack-error.d.ts +8 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1580 -208
- package/dist/index.mjs +1560 -208
- package/dist/interfaces/addon.d.ts +0 -6
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/{sleep-ComzlWyT.js → sleep-CCAQ_PEp.js} +278 -99
- package/dist/{sleep-CS5Xp1iQ.mjs → sleep-DnVqHJc4.mjs} +267 -100
- package/package.json +1 -1
- package/dist/addon/integration-instance-ref.d.ts +0 -21
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as EventCategory } from "./event-category-78tcBemo.mjs";
|
|
2
|
-
import { i as DeviceType, o as errMsg, r as DeviceRole } from "./device-type-
|
|
2
|
+
import { i as DeviceType, o as errMsg, r as DeviceRole } from "./device-type-DTTZKB2I.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/audio/audio-chunk-format.ts
|
|
5
5
|
/**
|
|
@@ -3309,16 +3309,6 @@ var BaseAddon = class {
|
|
|
3309
3309
|
return null;
|
|
3310
3310
|
}
|
|
3311
3311
|
/**
|
|
3312
|
-
* The form schema of ONE integration instance, or `null` to use the scoped form.
|
|
3313
|
-
*
|
|
3314
|
-
* Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
|
|
3315
|
-
* needs its connection fields, the default integration the addon's own sections. It is the
|
|
3316
|
-
* SHAPE of the form only — the values live on the instance record.
|
|
3317
|
-
*/
|
|
3318
|
-
async integrationFormSchema(_instance) {
|
|
3319
|
-
return null;
|
|
3320
|
-
}
|
|
3321
|
-
/**
|
|
3322
3312
|
* D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
|
|
3323
3313
|
* provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
|
|
3324
3314
|
* declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
|
|
@@ -3346,8 +3336,7 @@ var BaseAddon = class {
|
|
|
3346
3336
|
}
|
|
3347
3337
|
/**
|
|
3348
3338
|
* The host's read of the scoped declarations: the schema one capability declares for `scope`,
|
|
3349
|
-
* or `null`.
|
|
3350
|
-
* host asks this method.
|
|
3339
|
+
* or `null`. The hook is protected, the host asks this method.
|
|
3351
3340
|
*/
|
|
3352
3341
|
async getScopedSettingsSchema(scope, cap) {
|
|
3353
3342
|
switch (scope) {
|
|
@@ -3515,22 +3504,6 @@ var BaseAddon = class {
|
|
|
3515
3504
|
return Object.fromEntries([...collectHydratedFieldValues(form)].filter(([, value]) => value !== void 0));
|
|
3516
3505
|
}
|
|
3517
3506
|
/**
|
|
3518
|
-
* What the create wizard and the integration edit page render for one instance: the addon's
|
|
3519
|
-
* per-instance schema when it declares one, else its global schema (what they always showed).
|
|
3520
|
-
*/
|
|
3521
|
-
async getIntegrationFormSchema(instance, nodeId) {
|
|
3522
|
-
const scoped = await this.integrationFormSchema(instance);
|
|
3523
|
-
if (scoped === null) return this.scopedForm(nodeId);
|
|
3524
|
-
return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
|
|
3525
|
-
}
|
|
3526
|
-
/** The form of the scoped schemas this addon declared, hydrated from its store. */
|
|
3527
|
-
async scopedForm(nodeId) {
|
|
3528
|
-
await this.loadScopedSchemas();
|
|
3529
|
-
const schema = this.scopedFormSchema();
|
|
3530
|
-
if (!schema) return { sections: [] };
|
|
3531
|
-
return hydrateSchema(schema, await this.readRawProjectedStore(nodeId), { inlineSecretsAsViews: true });
|
|
3532
|
-
}
|
|
3533
|
-
/**
|
|
3534
3507
|
* The raw addon store PROJECTED onto the target node's bare per-node keys:
|
|
3535
3508
|
* every `perNode: true` field carries THAT node's scoped value on its bare
|
|
3536
3509
|
* key (absent scoped key ⇒ key absent, so the schema `default` wins — no
|
|
@@ -3717,12 +3690,6 @@ var BaseAddon = class {
|
|
|
3717
3690
|
this._nodeKeysByCap = /* @__PURE__ */ new Map();
|
|
3718
3691
|
this._addonSecretTree = null;
|
|
3719
3692
|
}
|
|
3720
|
-
/** The form of an addon's scoped schemas: their sections, each shown once. */
|
|
3721
|
-
scopedFormSchema(cap) {
|
|
3722
|
-
const byId = /* @__PURE__ */ new Map();
|
|
3723
|
-
for (const entry of this.loadedScopedSchemas(cap)) for (const section of entry.schema.sections) if (!byId.has(section.id)) byId.set(section.id, section);
|
|
3724
|
-
return byId.size === 0 ? null : { sections: [...byId.values()] };
|
|
3725
|
-
}
|
|
3726
3693
|
/** Every loaded scoped schema of `cap`, or of every loaded capability. */
|
|
3727
3694
|
loadedScopedSchemas(cap) {
|
|
3728
3695
|
if (cap !== void 0) return this._scopedByCap.get(cap) ?? [];
|
|
@@ -4312,6 +4279,70 @@ function normalizeAddonInitResult(result) {
|
|
|
4312
4279
|
if (Array.isArray(result)) return { providers: result };
|
|
4313
4280
|
return result;
|
|
4314
4281
|
}
|
|
4282
|
+
//#endregion
|
|
4283
|
+
//#region src/i18n/camstack-error.ts
|
|
4284
|
+
/**
|
|
4285
|
+
* A user-facing error with a STABLE code (D863).
|
|
4286
|
+
*
|
|
4287
|
+
* `message` is always the English text, so every consumer that knows nothing
|
|
4288
|
+
* of codes (old clients, logs, the mesh) behaves exactly as before. The hub's
|
|
4289
|
+
* tRPC error formatter reads `code` + `params` and, when the request language
|
|
4290
|
+
* has a text for `server:<code>`, replaces the response `message`; the code
|
|
4291
|
+
* stays in the payload (`data.i18n`).
|
|
4292
|
+
*/
|
|
4293
|
+
/** Dotted lower-case code, e.g. `auth.invalid-credentials`. It is the key in the `server` catalog. */
|
|
4294
|
+
var ErrorCodeSchema = z.string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/);
|
|
4295
|
+
/** What travels in the error payload next to the message. */
|
|
4296
|
+
var ErrorI18nPayloadSchema = z.object({
|
|
4297
|
+
code: ErrorCodeSchema,
|
|
4298
|
+
params: z.record(z.string(), z.union([z.string(), z.number()])).optional()
|
|
4299
|
+
});
|
|
4300
|
+
var CamstackError = class extends Error {
|
|
4301
|
+
i18nCode;
|
|
4302
|
+
i18nParams;
|
|
4303
|
+
constructor(code, params, englishMessage) {
|
|
4304
|
+
super(englishMessage);
|
|
4305
|
+
this.name = "CamstackError";
|
|
4306
|
+
this.i18nCode = code;
|
|
4307
|
+
this.i18nParams = params;
|
|
4308
|
+
}
|
|
4309
|
+
};
|
|
4310
|
+
/** `throw userError('device.not-found', { id }, 'Device 12 not found')` */
|
|
4311
|
+
function userError(code, params, englishFallback) {
|
|
4312
|
+
return new CamstackError(code, params, englishFallback);
|
|
4313
|
+
}
|
|
4314
|
+
/**
|
|
4315
|
+
* Finds a code on `err` or anywhere down its `.cause` chain. Duck-typed on
|
|
4316
|
+
* the field so it survives a module boundary (self-contained addons).
|
|
4317
|
+
*/
|
|
4318
|
+
function readErrorI18n(err) {
|
|
4319
|
+
let current = err;
|
|
4320
|
+
for (let depth = 0; depth < 8; depth++) {
|
|
4321
|
+
if (typeof current !== "object" || current === null) return null;
|
|
4322
|
+
const code = Reflect.get(current, "i18nCode");
|
|
4323
|
+
if (typeof code === "string") {
|
|
4324
|
+
const parsed = ErrorI18nPayloadSchema.safeParse({
|
|
4325
|
+
code,
|
|
4326
|
+
params: Reflect.get(current, "i18nParams")
|
|
4327
|
+
});
|
|
4328
|
+
return parsed.success ? parsed.data : null;
|
|
4329
|
+
}
|
|
4330
|
+
const cause = Reflect.get(current, "cause");
|
|
4331
|
+
if (cause === current) return null;
|
|
4332
|
+
current = cause;
|
|
4333
|
+
}
|
|
4334
|
+
return null;
|
|
4335
|
+
}
|
|
4336
|
+
/**
|
|
4337
|
+
* A provider that refuses a caller throws an Error whose message starts with this prefix. The
|
|
4338
|
+
* class does not survive the UDS hop to a forked addon, the message does, so the hub's tRPC
|
|
4339
|
+
* error formatter answers FORBIDDEN (403) for it instead of a 500.
|
|
4340
|
+
*/
|
|
4341
|
+
var FORBIDDEN_MESSAGE_PREFIX = "forbidden: ";
|
|
4342
|
+
/** `throw forbiddenError('target not owned: tg-1')` */
|
|
4343
|
+
function forbiddenError(reason) {
|
|
4344
|
+
return /* @__PURE__ */ new Error(`${FORBIDDEN_MESSAGE_PREFIX}${reason}`);
|
|
4345
|
+
}
|
|
4315
4346
|
z.object({
|
|
4316
4347
|
field: z.string().min(1),
|
|
4317
4348
|
on: z.literal("advance")
|
|
@@ -4509,12 +4540,6 @@ function systemMethod(input, output, options) {
|
|
|
4509
4540
|
systemOnly: true
|
|
4510
4541
|
};
|
|
4511
4542
|
}
|
|
4512
|
-
/**
|
|
4513
|
-
* A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
|
|
4514
|
-
* on `InferProvider`. The `providerOptional: true` literal is what
|
|
4515
|
-
* `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
|
|
4516
|
-
* for when this is the honest answer and when it is a soft stub.
|
|
4517
|
-
*/
|
|
4518
4543
|
function optionalMethod(input, output, options) {
|
|
4519
4544
|
return {
|
|
4520
4545
|
...method(input, output, options),
|
|
@@ -7818,7 +7843,7 @@ function t(en, it) {
|
|
|
7818
7843
|
* Things an operator switches, opens, sets or arms: lights, plugs, sirens,
|
|
7819
7844
|
* covers, valves, locks, climate, fans, alarm panels.
|
|
7820
7845
|
*/
|
|
7821
|
-
var ON = t("On", "Acceso");
|
|
7846
|
+
var ON$1 = t("On", "Acceso");
|
|
7822
7847
|
var PERCENT = t("Percentage", "Percentuale");
|
|
7823
7848
|
var OPEN_CLOSE_STATES = [
|
|
7824
7849
|
{
|
|
@@ -7878,7 +7903,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
7878
7903
|
state: [{
|
|
7879
7904
|
kind: "boolean",
|
|
7880
7905
|
field: "on",
|
|
7881
|
-
label: ON,
|
|
7906
|
+
label: ON$1,
|
|
7882
7907
|
whenTrue: t("When {device} turns on", "Quando {device} si accende"),
|
|
7883
7908
|
whenFalse: t("When {device} turns off", "Quando {device} si spegne"),
|
|
7884
7909
|
icon: "power"
|
|
@@ -9044,7 +9069,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
9044
9069
|
state: [{
|
|
9045
9070
|
kind: "boolean",
|
|
9046
9071
|
field: "on",
|
|
9047
|
-
label: ON,
|
|
9072
|
+
label: ON$1,
|
|
9048
9073
|
whenTrue: t("When {device} turns on", "Quando {device} si accende"),
|
|
9049
9074
|
whenFalse: t("When {device} turns off", "Quando {device} si spegne"),
|
|
9050
9075
|
icon: "power"
|
|
@@ -11460,6 +11485,135 @@ var CAMERA_CAP_VOCABULARY = {
|
|
|
11460
11485
|
}
|
|
11461
11486
|
};
|
|
11462
11487
|
//#endregion
|
|
11488
|
+
//#region src/device/cap-vocabulary/entries/heat-pump.ts
|
|
11489
|
+
/**
|
|
11490
|
+
* The heat pump (D1026): its system modes are phrased for automations, each with the
|
|
11491
|
+
* values the gateway really accepts; the per-circuit parameters need a circuit and are
|
|
11492
|
+
* set from the device page.
|
|
11493
|
+
*/
|
|
11494
|
+
var OFF = {
|
|
11495
|
+
value: "off",
|
|
11496
|
+
label: t("Off", "Off")
|
|
11497
|
+
};
|
|
11498
|
+
var AUTO = {
|
|
11499
|
+
value: "auto",
|
|
11500
|
+
label: t("Auto", "Auto")
|
|
11501
|
+
};
|
|
11502
|
+
var ON = {
|
|
11503
|
+
value: "on",
|
|
11504
|
+
label: t("On", "On")
|
|
11505
|
+
};
|
|
11506
|
+
var MANUAL = {
|
|
11507
|
+
value: "manual",
|
|
11508
|
+
label: t("Manual", "Manuale")
|
|
11509
|
+
};
|
|
11510
|
+
var HOLIDAY_PROGRAMMES = [OFF, ...[
|
|
11511
|
+
1,
|
|
11512
|
+
2,
|
|
11513
|
+
3,
|
|
11514
|
+
4,
|
|
11515
|
+
5,
|
|
11516
|
+
6,
|
|
11517
|
+
7,
|
|
11518
|
+
8
|
|
11519
|
+
].map((n) => ({
|
|
11520
|
+
value: `hm${n}`,
|
|
11521
|
+
label: t(`Programme ${n}`, `Programma ${n}`)
|
|
11522
|
+
}))];
|
|
11523
|
+
var PER_CIRCUIT = "Needs a circuit: set from the device page, not offered to automations";
|
|
11524
|
+
var HEAT_PUMP_CAP_VOCABULARY = {
|
|
11525
|
+
"heat-pump-status": {
|
|
11526
|
+
scope: "device",
|
|
11527
|
+
noun: t("Heat pump", "Pompa di calore")
|
|
11528
|
+
},
|
|
11529
|
+
"heat-pump-control": {
|
|
11530
|
+
scope: "device",
|
|
11531
|
+
noun: t("Heat pump settings", "Impostazioni pompa di calore"),
|
|
11532
|
+
actions: [
|
|
11533
|
+
{
|
|
11534
|
+
id: "heatPump.silent",
|
|
11535
|
+
method: "setSilentMode",
|
|
11536
|
+
label: t("Set silent mode", "Imposta la modalità silenziosa"),
|
|
11537
|
+
phrase: t("Set silent mode of {device} to {mode}", "Imposta la modalità silenziosa di {device} su {mode}"),
|
|
11538
|
+
icon: "volume-x",
|
|
11539
|
+
openArgs: [{
|
|
11540
|
+
key: "mode",
|
|
11541
|
+
label: t("Silent mode", "Modalità silenziosa"),
|
|
11542
|
+
offer: {
|
|
11543
|
+
kind: "enum",
|
|
11544
|
+
values: [
|
|
11545
|
+
OFF,
|
|
11546
|
+
AUTO,
|
|
11547
|
+
ON
|
|
11548
|
+
]
|
|
11549
|
+
}
|
|
11550
|
+
}]
|
|
11551
|
+
},
|
|
11552
|
+
{
|
|
11553
|
+
id: "heatPump.away",
|
|
11554
|
+
method: "setAwayMode",
|
|
11555
|
+
label: t("Set away mode", "Imposta la modalità assente"),
|
|
11556
|
+
phrase: t("Set away mode of {device} to {mode}", "Imposta la modalità assente di {device} su {mode}"),
|
|
11557
|
+
icon: "plane",
|
|
11558
|
+
openArgs: [{
|
|
11559
|
+
key: "mode",
|
|
11560
|
+
label: t("Away mode", "Modalità assente"),
|
|
11561
|
+
offer: {
|
|
11562
|
+
kind: "enum",
|
|
11563
|
+
values: [OFF, ON]
|
|
11564
|
+
}
|
|
11565
|
+
}]
|
|
11566
|
+
},
|
|
11567
|
+
{
|
|
11568
|
+
id: "heatPump.additionalHeater",
|
|
11569
|
+
method: "setAdditionalHeaterMode",
|
|
11570
|
+
label: t("Set additional heater", "Imposta il riscaldatore aggiuntivo"),
|
|
11571
|
+
phrase: t("Set the additional heater of {device} to {mode}", "Imposta il riscaldatore aggiuntivo di {device} su {mode}"),
|
|
11572
|
+
icon: "flame",
|
|
11573
|
+
openArgs: [{
|
|
11574
|
+
key: "mode",
|
|
11575
|
+
label: t("Additional heater", "Riscaldatore aggiuntivo"),
|
|
11576
|
+
offer: {
|
|
11577
|
+
kind: "enum",
|
|
11578
|
+
values: [
|
|
11579
|
+
OFF,
|
|
11580
|
+
MANUAL,
|
|
11581
|
+
AUTO
|
|
11582
|
+
]
|
|
11583
|
+
}
|
|
11584
|
+
}]
|
|
11585
|
+
},
|
|
11586
|
+
{
|
|
11587
|
+
id: "heatPump.holiday",
|
|
11588
|
+
method: "setHolidayMode",
|
|
11589
|
+
label: t("Set holiday mode", "Imposta la modalità vacanza"),
|
|
11590
|
+
phrase: t("Set holiday mode of {device} to {mode}", "Imposta la modalità vacanza di {device} su {mode}"),
|
|
11591
|
+
icon: "tree-palm",
|
|
11592
|
+
openArgs: [{
|
|
11593
|
+
key: "mode",
|
|
11594
|
+
label: t("Holiday programme", "Programma vacanza"),
|
|
11595
|
+
offer: {
|
|
11596
|
+
kind: "enum",
|
|
11597
|
+
values: HOLIDAY_PROGRAMMES
|
|
11598
|
+
}
|
|
11599
|
+
}]
|
|
11600
|
+
}
|
|
11601
|
+
],
|
|
11602
|
+
notOperatorFacing: {
|
|
11603
|
+
setCircuitOperationMode: PER_CIRCUIT,
|
|
11604
|
+
setCircuitHeatCoolMode: PER_CIRCUIT,
|
|
11605
|
+
setCircuitSummerWinter: PER_CIRCUIT,
|
|
11606
|
+
setCircuitComfortSetpoint: PER_CIRCUIT,
|
|
11607
|
+
setCircuitEcoSetpoint: PER_CIRCUIT,
|
|
11608
|
+
setCircuitMaxFlowTemp: PER_CIRCUIT,
|
|
11609
|
+
setDhwOperationMode: PER_CIRCUIT,
|
|
11610
|
+
setDhwTemperatureLevel: PER_CIRCUIT,
|
|
11611
|
+
setDhwChargeDuration: PER_CIRCUIT,
|
|
11612
|
+
startExtraHotWater: PER_CIRCUIT
|
|
11613
|
+
}
|
|
11614
|
+
}
|
|
11615
|
+
};
|
|
11616
|
+
//#endregion
|
|
11463
11617
|
//#region src/device/cap-vocabulary/entries/sensors.ts
|
|
11464
11618
|
/**
|
|
11465
11619
|
* Things an operator WATCHES: contacts, motion, leaks, smoke, measurements,
|
|
@@ -12198,6 +12352,7 @@ var CAP_VOCABULARY = {
|
|
|
12198
12352
|
...ACTUATOR_CAP_VOCABULARY,
|
|
12199
12353
|
...APPLIANCE_CAP_VOCABULARY,
|
|
12200
12354
|
...CAMERA_CAP_VOCABULARY,
|
|
12355
|
+
...HEAT_PUMP_CAP_VOCABULARY,
|
|
12201
12356
|
...SENSOR_CAP_VOCABULARY,
|
|
12202
12357
|
...SYSTEM_CAP_VOCABULARY
|
|
12203
12358
|
};
|
|
@@ -12853,6 +13008,8 @@ var CAP_NAMES = Object.freeze([
|
|
|
12853
13008
|
"group-active",
|
|
12854
13009
|
"group-commands",
|
|
12855
13010
|
"group-status",
|
|
13011
|
+
"heat-pump-control",
|
|
13012
|
+
"heat-pump-status",
|
|
12856
13013
|
"heating-valve",
|
|
12857
13014
|
"hero-layout",
|
|
12858
13015
|
"humidifier",
|
|
@@ -13719,6 +13876,48 @@ var CAP_STATE_LEAVES = Object.freeze({
|
|
|
13719
13876
|
"valueType": "number"
|
|
13720
13877
|
}
|
|
13721
13878
|
],
|
|
13879
|
+
"heat-pump-status": [
|
|
13880
|
+
{
|
|
13881
|
+
"path": "power.thermalW",
|
|
13882
|
+
"valueType": "number"
|
|
13883
|
+
},
|
|
13884
|
+
{
|
|
13885
|
+
"path": "power.electricalW",
|
|
13886
|
+
"valueType": "number"
|
|
13887
|
+
},
|
|
13888
|
+
{
|
|
13889
|
+
"path": "power.compressorPct",
|
|
13890
|
+
"valueType": "number"
|
|
13891
|
+
},
|
|
13892
|
+
{
|
|
13893
|
+
"path": "temperatures.supply",
|
|
13894
|
+
"valueType": "number"
|
|
13895
|
+
},
|
|
13896
|
+
{
|
|
13897
|
+
"path": "temperatures.return",
|
|
13898
|
+
"valueType": "number"
|
|
13899
|
+
},
|
|
13900
|
+
{
|
|
13901
|
+
"path": "temperatures.outdoor",
|
|
13902
|
+
"valueType": "number"
|
|
13903
|
+
},
|
|
13904
|
+
{
|
|
13905
|
+
"path": "energy.thermalKwh",
|
|
13906
|
+
"valueType": "number"
|
|
13907
|
+
},
|
|
13908
|
+
{
|
|
13909
|
+
"path": "energy.electricalKwh",
|
|
13910
|
+
"valueType": "number"
|
|
13911
|
+
},
|
|
13912
|
+
{
|
|
13913
|
+
"path": "waterPressureBar",
|
|
13914
|
+
"valueType": "number"
|
|
13915
|
+
},
|
|
13916
|
+
{
|
|
13917
|
+
"path": "starts",
|
|
13918
|
+
"valueType": "number"
|
|
13919
|
+
}
|
|
13920
|
+
],
|
|
13722
13921
|
"heating-valve": [{
|
|
13723
13922
|
"path": "position",
|
|
13724
13923
|
"valueType": "number"
|
|
@@ -15491,6 +15690,23 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
15491
15690
|
const groupCommandsInterface = { getStatus: (input) => dispatch("group-commands", "groupCommands", "getStatus", "query", input) };
|
|
15492
15691
|
const groupStatusInterface = { getStatus: (input) => dispatch("group-status", "groupStatus", "getStatus", "query", input) };
|
|
15493
15692
|
const heatingValveInterface = { getStatus: (input) => dispatch("heating-valve", "heatingValve", "getStatus", "query", input) };
|
|
15693
|
+
const heatPumpControlInterface = {
|
|
15694
|
+
setSilentMode: (input) => dispatch("heat-pump-control", "heatPumpControl", "setSilentMode", "mutation", input),
|
|
15695
|
+
setAwayMode: (input) => dispatch("heat-pump-control", "heatPumpControl", "setAwayMode", "mutation", input),
|
|
15696
|
+
setAdditionalHeaterMode: (input) => dispatch("heat-pump-control", "heatPumpControl", "setAdditionalHeaterMode", "mutation", input),
|
|
15697
|
+
setHolidayMode: (input) => dispatch("heat-pump-control", "heatPumpControl", "setHolidayMode", "mutation", input),
|
|
15698
|
+
setCircuitOperationMode: (input) => dispatch("heat-pump-control", "heatPumpControl", "setCircuitOperationMode", "mutation", input),
|
|
15699
|
+
setCircuitHeatCoolMode: (input) => dispatch("heat-pump-control", "heatPumpControl", "setCircuitHeatCoolMode", "mutation", input),
|
|
15700
|
+
setCircuitSummerWinter: (input) => dispatch("heat-pump-control", "heatPumpControl", "setCircuitSummerWinter", "mutation", input),
|
|
15701
|
+
setCircuitComfortSetpoint: (input) => dispatch("heat-pump-control", "heatPumpControl", "setCircuitComfortSetpoint", "mutation", input),
|
|
15702
|
+
setCircuitEcoSetpoint: (input) => dispatch("heat-pump-control", "heatPumpControl", "setCircuitEcoSetpoint", "mutation", input),
|
|
15703
|
+
setCircuitMaxFlowTemp: (input) => dispatch("heat-pump-control", "heatPumpControl", "setCircuitMaxFlowTemp", "mutation", input),
|
|
15704
|
+
setDhwOperationMode: (input) => dispatch("heat-pump-control", "heatPumpControl", "setDhwOperationMode", "mutation", input),
|
|
15705
|
+
setDhwTemperatureLevel: (input) => dispatch("heat-pump-control", "heatPumpControl", "setDhwTemperatureLevel", "mutation", input),
|
|
15706
|
+
setDhwChargeDuration: (input) => dispatch("heat-pump-control", "heatPumpControl", "setDhwChargeDuration", "mutation", input),
|
|
15707
|
+
startExtraHotWater: (input) => dispatch("heat-pump-control", "heatPumpControl", "startExtraHotWater", "mutation", input)
|
|
15708
|
+
};
|
|
15709
|
+
const heatPumpStatusInterface = { getStatus: (input) => dispatch("heat-pump-status", "heatPumpStatus", "getStatus", "query", input) };
|
|
15494
15710
|
const humidifierInterface = {
|
|
15495
15711
|
setOn: (input) => dispatch("humidifier", "humidifier", "setOn", "mutation", input),
|
|
15496
15712
|
setTargetHumidity: (input) => dispatch("humidifier", "humidifier", "setTargetHumidity", "mutation", input),
|
|
@@ -16092,6 +16308,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
16092
16308
|
groupCommands: createSliceHandle(stateSource, binding.deviceId, "group-commands"),
|
|
16093
16309
|
groupStatus: createSliceHandle(stateSource, binding.deviceId, "group-status"),
|
|
16094
16310
|
heatingValve: createSliceHandle(stateSource, binding.deviceId, "heating-valve"),
|
|
16311
|
+
heatPumpStatus: createSliceHandle(stateSource, binding.deviceId, "heat-pump-status"),
|
|
16095
16312
|
humidifier: createSliceHandle(stateSource, binding.deviceId, "humidifier"),
|
|
16096
16313
|
humiditySensor: createSliceHandle(stateSource, binding.deviceId, "humidity-sensor"),
|
|
16097
16314
|
image: createSliceHandle(stateSource, binding.deviceId, "image"),
|
|
@@ -16186,6 +16403,8 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
16186
16403
|
...bound("group-commands") ? { groupCommands: groupCommandsInterface } : {},
|
|
16187
16404
|
...bound("group-status") ? { groupStatus: groupStatusInterface } : {},
|
|
16188
16405
|
...bound("heating-valve") ? { heatingValve: heatingValveInterface } : {},
|
|
16406
|
+
...bound("heat-pump-control") ? { heatPumpControl: heatPumpControlInterface } : {},
|
|
16407
|
+
...bound("heat-pump-status") ? { heatPumpStatus: heatPumpStatusInterface } : {},
|
|
16189
16408
|
...bound("humidifier") ? { humidifier: humidifierInterface } : {},
|
|
16190
16409
|
...bound("humidity-sensor") ? { humiditySensor: humiditySensorInterface } : {},
|
|
16191
16410
|
...bound("image") ? { image: imageInterface } : {},
|
|
@@ -16275,7 +16494,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
16275
16494
|
* can answer "may a rule actuate this?" without importing the schema barrel
|
|
16276
16495
|
* (~144MB RSS per runner, D28).
|
|
16277
16496
|
*
|
|
16278
|
-
* Coverage:
|
|
16497
|
+
* Coverage: 105 device-scoped capabilities.
|
|
16279
16498
|
*/
|
|
16280
16499
|
var DEVICE_SCOPED_CAPS = new Set([
|
|
16281
16500
|
"accessories",
|
|
@@ -16322,6 +16541,8 @@ var DEVICE_SCOPED_CAPS = new Set([
|
|
|
16322
16541
|
"group-active",
|
|
16323
16542
|
"group-commands",
|
|
16324
16543
|
"group-status",
|
|
16544
|
+
"heat-pump-control",
|
|
16545
|
+
"heat-pump-status",
|
|
16325
16546
|
"heating-valve",
|
|
16326
16547
|
"humidifier",
|
|
16327
16548
|
"humidity-sensor",
|
|
@@ -16395,60 +16616,6 @@ function isDeviceScopedCap(capName) {
|
|
|
16395
16616
|
return DEVICE_SCOPED_CAPS.has(capName);
|
|
16396
16617
|
}
|
|
16397
16618
|
//#endregion
|
|
16398
|
-
//#region src/i18n/camstack-error.ts
|
|
16399
|
-
/**
|
|
16400
|
-
* A user-facing error with a STABLE code (D863).
|
|
16401
|
-
*
|
|
16402
|
-
* `message` is always the English text, so every consumer that knows nothing
|
|
16403
|
-
* of codes (old clients, logs, the mesh) behaves exactly as before. The hub's
|
|
16404
|
-
* tRPC error formatter reads `code` + `params` and, when the request language
|
|
16405
|
-
* has a text for `server:<code>`, replaces the response `message`; the code
|
|
16406
|
-
* stays in the payload (`data.i18n`).
|
|
16407
|
-
*/
|
|
16408
|
-
/** Dotted lower-case code, e.g. `auth.invalid-credentials`. It is the key in the `server` catalog. */
|
|
16409
|
-
var ErrorCodeSchema = z.string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/);
|
|
16410
|
-
/** What travels in the error payload next to the message. */
|
|
16411
|
-
var ErrorI18nPayloadSchema = z.object({
|
|
16412
|
-
code: ErrorCodeSchema,
|
|
16413
|
-
params: z.record(z.string(), z.union([z.string(), z.number()])).optional()
|
|
16414
|
-
});
|
|
16415
|
-
var CamstackError = class extends Error {
|
|
16416
|
-
i18nCode;
|
|
16417
|
-
i18nParams;
|
|
16418
|
-
constructor(code, params, englishMessage) {
|
|
16419
|
-
super(englishMessage);
|
|
16420
|
-
this.name = "CamstackError";
|
|
16421
|
-
this.i18nCode = code;
|
|
16422
|
-
this.i18nParams = params;
|
|
16423
|
-
}
|
|
16424
|
-
};
|
|
16425
|
-
/** `throw userError('device.not-found', { id }, 'Device 12 not found')` */
|
|
16426
|
-
function userError(code, params, englishFallback) {
|
|
16427
|
-
return new CamstackError(code, params, englishFallback);
|
|
16428
|
-
}
|
|
16429
|
-
/**
|
|
16430
|
-
* Finds a code on `err` or anywhere down its `.cause` chain. Duck-typed on
|
|
16431
|
-
* the field so it survives a module boundary (self-contained addons).
|
|
16432
|
-
*/
|
|
16433
|
-
function readErrorI18n(err) {
|
|
16434
|
-
let current = err;
|
|
16435
|
-
for (let depth = 0; depth < 8; depth++) {
|
|
16436
|
-
if (typeof current !== "object" || current === null) return null;
|
|
16437
|
-
const code = Reflect.get(current, "i18nCode");
|
|
16438
|
-
if (typeof code === "string") {
|
|
16439
|
-
const parsed = ErrorI18nPayloadSchema.safeParse({
|
|
16440
|
-
code,
|
|
16441
|
-
params: Reflect.get(current, "i18nParams")
|
|
16442
|
-
});
|
|
16443
|
-
return parsed.success ? parsed.data : null;
|
|
16444
|
-
}
|
|
16445
|
-
const cause = Reflect.get(current, "cause");
|
|
16446
|
-
if (cause === current) return null;
|
|
16447
|
-
current = cause;
|
|
16448
|
-
}
|
|
16449
|
-
return null;
|
|
16450
|
-
}
|
|
16451
|
-
//#endregion
|
|
16452
16619
|
//#region src/util/boot-recovery-backoff.ts
|
|
16453
16620
|
/**
|
|
16454
16621
|
* The ONE retry schedule for work that can fail simply because the node was
|
|
@@ -16680,4 +16847,4 @@ function sleepCancellable(ms, signal) {
|
|
|
16680
16847
|
});
|
|
16681
16848
|
}
|
|
16682
16849
|
//#endregion
|
|
16683
|
-
export {
|
|
16850
|
+
export { DEVICE_CHILDREN_BATCH_MAX as $, collectHydratedFieldValues as $i, event as $n, RECORD_DELETE_BATCH as $r, displayUnitFor as $t, CAP_ADVANCE_FIELDS as A, RecordUniqueViolationError as Ai, SHARE_VIEW_KINDS as An, resolvedValues as Ar, CAM_PROFILE_ORDER as At, CAP_COMMAND_ORIGIN_CONTEXT_KEY as B, recordsOverMigrationApi as Bi, StoredRecordKindDeclarationSchema as Bn, REMOVE_LEAF as Br, StreamSourceEntrySchema$1 as Bt, auditedFields as C, expandAudioChunkToF32le as Ca, InvalidRecordError as Ci, PEER_BYTES_CHUNK_BYTES as Cn, collectSecretMarkerRefs as Cr, createDebugEmitter as Ct, HF_BASE_URL as D, RecordNotFoundError as Di, PeerBytesTicketSchema as Dn, SCOPED_SETTINGS_SCOPES as Dr, AudioStreamPickSchema as Dt, DEFAULT_TOKEN_EXPIRY as E, RECORDS_ERROR_CODES as Ei, PEER_BYTES_TICKET_TTL_MS as En, transformSecretWrite as Er, AudioChunkFormatSchema as Et, withoutCallerStamp as F, UnknownRecordKindError as Fi, RecordFieldPathSchema as Fn, registrySwitchToBodyId as Fr, DecodedAudioChunkSchema as Ft, readNodePin as G, defineAddonMigrations as Gi, collectZodSecretPaths as Gn, recordSecretCollection as Gr, makeSourceBrokerId as Gt, commandOrigin as H, secretsOverMigrationApi as Hi, declarationsOf as Hn, mapSecretLeaves as Hr, SubscribeAudioChunksInputSchema as Ht, customAction as I, asRecordsError as Ii, RecordIndexSchema as In, registrySwitchToBodyMigration as Ir, FrameHandleSchema as It, PipelineRunResultBridge as J, emitReadiness as Ji, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Jn, RECORD_BATCH_MAX as Jr, DEFAULT_DISPLAY_PREFERENCE as Jt, toNodeId as K, runAddonMigrations as Ki, isZodSecret as Kn, recordSecretRef as Kr, parseProfileBrokerId as Kt, defineCustomActions as L, recordsErrorFromMessage as Li, RecordKindDeclarationSchema as Ln, RecordIntegrationInstances as Lr, ProfileRtspEntrySchema as Lt, CAP_NAMES as M, RevConflictError as Mi, defineEntryKind as Mn, createDurableState as Mr, CamStreamKindSchema as Mt, CAP_STATE_LEAVES as N, TransactRefusedError as Ni, entryBody as Nn, moveRegistrySwitchToBody as Nr, CamStreamResolutionSchema as Nt, HF_REPO as O, RecordSecretUnavailableError as Oi, CALLER_USERNAME_HEADER as On, nodeIdOfScopedKey as Or, BrokerStatsSchema as Ot, CALLER_STAMPED_CAPABILITIES as P, UnindexedFilterError as Pi, EntryDescriptorSchema as Pn, registrySwitchPortsOver as Pr, CameraStreamSchema as Pt, deviceOpsCapability as Q, collectHydratedFieldEntries as Qi, PROVIDER_PIN_FIELD as Qn, RECORD_DEFAULT_MAX_DATA_BYTES as Qr, baseUnitOf as Qt, describeCustomActions as R, defaultIntegrationDepsOver as Ri, RecordKindNameSchema as Rn, isInstanceEnabled as Rr, ProfileSlotSchema as Rt, createSliceHandle as S, audioChunkBytesPerSample as Sa, ForeignSecretMarkerError as Si, shortSecretRefHash as Sn, KeychainWriteRefusedError as Sr, __resetDebugInterestForTests as St, isCommand as T, PlaintextSecretError as Ti, PEER_BYTES_STALL_MS as Tn, resolveSecretMarkers as Tr, isDebugChannelName as Tt, nodePin as U, switchRecordsOverMigrationApi as Ui, defineRecordKinds as Un, parseSecretPath as Ur, SubscribeAudioChunksResultSchema as Ut, CAP_NODE_PIN_CONTEXT_KEY as V, rowsDepsOver as Vi, assertValidDeclaration as Vn, collectSecretLeaves as Vr, StreamSourceSchema as Vt, readCommandOrigin as W, AddonMigrationDefinitionError as Wi, SECRET_META as Wn, recordArrayItemPath as Wr, makeProfileBrokerId as Wt, MIGRATION_API_VERSION as X, WELL_KNOWN_TABS as Xi, HISTORY_DEFAULT_MIN_INTERVAL_MS as Xn, RECORD_CLASSES as Xr, QUANTITY_BASE as Xt, PipelineStepInputSchema as Y, isEvent as Yi, DEVICE_STATUS_METHOD as Yn, RECORD_BATCH_MAX_BYTES as Yr, DISPLAY_PREFERENCES as Yt, RawStateResultSchema as Z, WELL_KNOWN_TAB_MAP as Zi, HISTORY_UNIT_LABELS as Zn, RECORD_DATABASES as Zr, ReadingQuantitySchema as Zt, invokeTrpcLeaf as _, omitTransientConfig as _a, linksOfKind as _i, clearKnownSecrets as _n, normalizeAddonInitResult as _r, DEBUG_WATCH_HARD_CAP_MS as _t, asJsonArray as a, classifySecretWrite as aa, RECORD_SECRET_COLLECTION_PREFIX as ai, TransitionActorSchema as an, resolveCapMount as ar, findVocabAction as at, createLazyTrpcSource as b, findMigrationsBlocked as ba, DeclarationRefusedError as bi, registerKnownSecret as bn, secretTreeFromPaths as br, DebugInterest as bt, asString as c, isSecretMarker as ca, SECRET_REF_SCHEME as ci, TransitionValueSchema as cn, ErrorCodeSchema as cr, CAP_VOCABULARY_BY_NAME as ct, parseJsonUnknown as d, toSecretFieldView as da, formatSecretScope as di, createRecordsAccess as dn, forbiddenError as dr, ReadinessRegistry as dt, dehydrateConfigField as ea, RECORD_ID_MAX_LENGTH as ei, historyUnitFor as en, expandCapMethods as er, adminUiCapability as et, hfModelUrl as f, REDACTED_SECRET as fa, globalSecretScope as fi, assertTransactScope as fn, readErrorI18n as fr, ReadinessTimeoutError as ft, createDeviceProxy as g, isSecretConfigField as ga, linkField as gi, MIN_SCRUBBED_LENGTH as gn, migrationSet as gr, DEBUG_CHANNEL_PREFIX as gt, isDeviceScopedCap as h, isKeychainStoredField as ha, parseSecretRef as hi, createSecretsAccess as hn, classifyStoreError as hr, scopeKey as ht, asBoolean as i, SECRET_CLEAR as ia, RECORD_QUERY_MAX as ii, TransitionActorKindSchema as in, optionalMethod as ir, allVocabActions as it, CAP_METHOD_TIMEOUTS_MS as j, RecordsError as ji, DisposerChain as jn, normalizeNodeId as jr, CamProfileSchema as jt, RUNTIME_DEFAULTS as k, RecordTooLargeError as ki, DATAPLANE_SECRET_HEADER as kn, resolveDeviceSettings as kr, BrokerStatusSchema as kt, parseJsonArray as l, isSecretMarkerLike as la, arrayItemFieldPath as li, CommandOriginClaimSchema as ln, ErrorI18nPayloadSchema as lr, t as lt, DEVICE_SCOPED_CAPS as m, collectSecretConfigKeys as ma, normalizeSecretOwner as mi, REVALIDATE_AFTER_MS as mn, BaseAddon as mr, readinessKey as mt, sleepCancellable as n, hydrateSchema as na, RECORD_MAX_INDEXES as ni, readingMeta as nn, isDeviceConfigCap as nr, addonPagesSourceCapability as nt, asJsonObject as o, isSecretClear as oa, RECORD_SETTINGS_MAX_ROWS as oi, TransitionCommandSchema as on, systemMethod as or, vocabActionIdFor as ot, BOOT_RECOVERY_BACKOFF_MS as p, collectKeychainStoredKeys as pa, isSecretRef as pi, resolveSecretViewsIn as pn, userError as pr, emitDownForOwnedCaps as pt, viewerUiCapability as q, createEvent as qi, DEFAULT_RUNTIME_STATE_DURABILITY as qn, secretArrayPrefixes as qr, selectAssignedProfileSlots as qt, maskUrlCredentials as r, resolveHydratedFieldValue as ra, RECORD_MAX_INDEX_FIELDS as ri, DeviceTransitionSchema as rn, method as rr, actionEffect as rt, asNumber as s, isSecretFieldView as sa, RECORD_SWEEP_INTERVAL_MS as si, TransitionOutcomeSchema as sn, CamstackError as sr, CAP_VOCABULARY as st, sleep as t, dehydrateSchema as ta, RECORD_MAX_DATA_BYTES as ti, isReadingQuantity as tn, historyItemFieldPath as tr, AddonPageDeclarationSchema as tt, parseJsonObject as u, makeSecretMarker as ua, buildSecretRef as ui, makeInMemoryRecords as un, FORBIDDEN_MESSAGE_PREFIX as ur, MODEL_FORMATS as ut, addonSliceHandleApi as v, schemaDeclaresAnyField as va, optionalLinkField as vi, forgetKnownSecret as vn, mergeSecretStatePaths as vr, DEBUG_WATCH_REARM_EVERY_MS as vt, commandEffect as w, isAudioChunkFormat as wa, NoCallerError as wi, PEER_BYTES_MAX_OUTSTANDING as wn, isSecretRefOwnedBy as wr, getDebugInterest as wt, createMirrorSource as x, AUDIO_CHUNK_FORMATS as xa, FilterRequiredError as xi, scrubKnownSecrets as xn, secretTreeFromSchema as xr, DebugWatchTable as xt, createEventBusSliceSource as y, AddonMigrationsBlockedError as ya, BatchTooLargeError as yi, knownSecretCount as yn, parseSecretStatePath as yr, DEBUG_WATCH_WINDOW_MS as yt, deviceCustomAction as z, integrationRowsApiOver as zi, RecordRetentionSchema as zn, secretViewsOf as zr, ProfileSlotStatusSchema as zt };
|
package/package.json
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Which integration instance a settings form is for. An addon that serves several instances
|
|
4
|
-
* (`instanceMode: multiple`) can show a different form per instance — an NVR integration
|
|
5
|
-
* needs its connection, the default integration needs the addon's own sections.
|
|
6
|
-
*
|
|
7
|
-
* - `integrationId` is `null` in the create wizard: nothing exists yet, the operator is
|
|
8
|
-
* setting up a NEW instance.
|
|
9
|
-
* - `mode` is the wizard mode of the integration type (`getAvailableTypes`).
|
|
10
|
-
* - `candidateStableId` is the discovery candidate a wizard was seeded from, if any.
|
|
11
|
-
*/
|
|
12
|
-
export declare const IntegrationInstanceRefSchema: z.ZodObject<{
|
|
13
|
-
integrationId: z.ZodNullable<z.ZodString>;
|
|
14
|
-
mode: z.ZodEnum<{
|
|
15
|
-
account: "account";
|
|
16
|
-
broker: "broker";
|
|
17
|
-
standalone: "standalone";
|
|
18
|
-
}>;
|
|
19
|
-
candidateStableId: z.ZodOptional<z.ZodString>;
|
|
20
|
-
}, z.core.$strip>;
|
|
21
|
-
export type IntegrationInstanceRef = z.infer<typeof IntegrationInstanceRefSchema>;
|