@camstack/server 1.2.840 → 1.2.841
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 +6 -0
- package/dist/api/trpc/generated-cap-routers.js +16 -0
- package/package.json +17 -7
- package/system/dist/addon-runner.js +4 -2
- package/system/dist/addon-runner.mjs +4 -2
- 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 +5 -5
- package/system/dist/builtins/composer/composer.addon.mjs +5 -5
- 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/composition-api.d.ts +2 -2
- package/system/dist/builtins/core-blocks/composition-sources.d.ts +9 -2
- package/system/dist/builtins/core-blocks/core-blocks.addon.d.ts +2 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +598 -395
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +598 -395
- package/system/dist/builtins/core-blocks/fan-link-forward.d.ts +42 -0
- package/system/dist/builtins/core-blocks/fan-presets-service.d.ts +25 -39
- package/system/dist/builtins/core-blocks/fan-presets-wiring.d.ts +5 -3
- package/system/dist/builtins/core-blocks/migrations/helper-to-customize.d.ts +3 -1
- package/system/dist/builtins/core-blocks/power-source-service.d.ts +2 -0
- package/system/dist/builtins/core-blocks/timed-run/timed-run-service.d.ts +8 -2
- 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-bindings-store.d.ts +8 -5
- package/system/dist/builtins/device-manager/device-manager.addon.js +116 -22
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +116 -22
- package/system/dist/builtins/device-manager/device-row-store.d.ts +0 -52
- 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 +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
- 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 +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
- 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-7E2O4-UN.js → capture-engine-CGU4rnN-.js} +1 -1
- package/system/dist/{capture-engine-B5IBWIRT.mjs → capture-engine-CLrh3FG0.mjs} +1 -1
- package/system/dist/{composition-sources-Cfqn4cly.mjs → composition-sources-CoLbBru1.mjs} +32 -5
- package/system/dist/{composition-sources-DLtc8lSL.js → composition-sources-bhWIz4Rp.js} +32 -5
- package/system/dist/{constants-DjsgCnZk.mjs → constants-CfAS4Qm6.mjs} +1 -1
- package/system/dist/{constants-Cc70YreG.js → constants-DZwpZY5J.js} +1 -1
- package/system/dist/{device-ca-CVP5h3u1.mjs → device-ca-CAbEBLyf.mjs} +1 -1
- package/system/dist/{device-ca-C6JqeFfK.js → device-ca-ksS811fC.js} +1 -1
- package/system/dist/{dist-OmrC_RZs.mjs → dist-ByiDJLen.mjs} +1081 -327
- package/system/dist/{dist-CLnTYKFn.js → dist-DlRUArVs.js} +1128 -338
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-identity-CKQVXf4o.mjs → hub-identity-Bh28ooQx.mjs} +1 -1
- package/system/dist/{hub-identity-TrZcnJkB.js → hub-identity-C-1NeWlr.js} +1 -1
- package/system/dist/{hub-mdns-ciao-ocg6suyX.js → hub-mdns-ciao-CL-Z9yMs.js} +2 -2
- package/system/dist/{hub-mdns-ciao-C8G0K1Z1.mjs → hub-mdns-ciao-OWO6Bw-X.mjs} +2 -2
- package/system/dist/index.js +16 -12
- package/system/dist/index.mjs +16 -12
- package/system/dist/{legacy-integration-rows-door-BPkJUGaX.mjs → legacy-integration-rows-door-Be_QKUlY.mjs} +1 -1
- package/system/dist/{legacy-integration-rows-door-b6CUxtXX.js → legacy-integration-rows-door-CDPH26e8.js} +1 -1
- package/system/dist/{rename-composition-block-N7lslQJK.js → rename-composition-block-Bs5KT3Gn.js} +1 -1
- package/system/dist/{rename-composition-block-DPlsP1xF.mjs → rename-composition-block-CncvFIHl.mjs} +1 -1
- package/system/dist/{restore-archive-CcuEoEtj.js → restore-archive-CHUKcl3T.js} +1 -1
- package/system/dist/{restore-archive-Btc3H-Fg.mjs → restore-archive-DX7kK3LQ.mjs} +1 -1
- package/system/dist/{wal-maintenance-g7yvxLMj.mjs → wal-maintenance-Fibm7rsM.mjs} +0 -0
- package/system/dist/{wal-maintenance-B2_uCEi5.js → wal-maintenance-GNE9Oqdu.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/composed-stable-id-
|
|
806
|
+
//#region ../types/dist/composed-stable-id-CPp3votu.mjs
|
|
807
807
|
/**
|
|
808
808
|
import { errMsg } from '@camstack/types'
|
|
809
809
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -822,12 +822,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
822
822
|
DeviceType["Siren"] = "siren";
|
|
823
823
|
DeviceType["Switch"] = "switch";
|
|
824
824
|
DeviceType["Sensor"] = "sensor";
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
* `climate-control`
|
|
828
|
-
*
|
|
829
|
-
*
|
|
830
|
-
*
|
|
825
|
+
/** Every climate device: an air conditioner, a room thermostat, a radiator
|
|
826
|
+
* valve, a floor-heating zone, a heat-pump circuit. They share one set of
|
|
827
|
+
* controls (`climate-control`), so they are one type; WHICH kind of climate
|
|
828
|
+
* device it is is its {@link DeviceRole} (`climate-*`), which the UI and the
|
|
829
|
+
* exports branch on. The retired `thermostat` type is read as this one
|
|
830
|
+
* (`canonicalStoredDeviceType`). */
|
|
831
831
|
DeviceType["Climate"] = "climate";
|
|
832
832
|
DeviceType["Button"] = "button";
|
|
833
833
|
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
@@ -918,10 +918,6 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
918
918
|
/** Washing machine. A plug-built one is running while its power stays
|
|
919
919
|
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
920
920
|
DeviceType["Washer"] = "washer";
|
|
921
|
-
/** A dumb plug-in stove or heater: a switch (and, with a meter, a power
|
|
922
|
-
* reading) that only runs while the plug is on. Built from a smart plug;
|
|
923
|
-
* the `timed-run` cap switches it off again after a chosen time. */
|
|
924
|
-
DeviceType["Heater"] = "heater";
|
|
925
921
|
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
926
922
|
DeviceType["Dryer"] = "dryer";
|
|
927
923
|
/** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
|
|
@@ -1150,6 +1146,27 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1150
1146
|
/** A smart plug: a `switch` whose source says it is an outlet (HA
|
|
1151
1147
|
* `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
|
|
1152
1148
|
DeviceRole["Outlet"] = "outlet";
|
|
1149
|
+
/** A dumb plug-in stove or heater behind a switch: it runs only while the
|
|
1150
|
+
* switch is on. Offered `timed-run`, which switches it off again after a
|
|
1151
|
+
* chosen time. */
|
|
1152
|
+
DeviceRole["SwitchHeater"] = "switch-heater";
|
|
1153
|
+
/** A plain fan behind a switch (a smart plug powering it): drawn as a fan,
|
|
1154
|
+
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
1155
|
+
* device also has a fan cap (D1033). */
|
|
1156
|
+
DeviceRole["SwitchFan"] = "switch-fan";
|
|
1157
|
+
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
1158
|
+
DeviceRole["ClimateAc"] = "climate-ac";
|
|
1159
|
+
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
1160
|
+
DeviceRole["ClimateThermostat"] = "climate-thermostat";
|
|
1161
|
+
/** Floor-heating zone actuator. */
|
|
1162
|
+
DeviceRole["ClimateFloor"] = "climate-floor";
|
|
1163
|
+
/** Radiator valve (thermostatic radiator head). */
|
|
1164
|
+
DeviceRole["ClimateRadiator"] = "climate-radiator";
|
|
1165
|
+
/** A heater with its own thermostat (stove, convector). */
|
|
1166
|
+
DeviceRole["ClimateHeater"] = "climate-heater";
|
|
1167
|
+
/** One heating/cooling circuit of a heat pump: a water loop with comfort /
|
|
1168
|
+
* eco setpoints and a heat/cool mode, no room sensor. */
|
|
1169
|
+
DeviceRole["ClimateHeatPumpCircuit"] = "climate-heat-pump-circuit";
|
|
1153
1170
|
/** Generic motion / occupancy / moving event source. Distinct from
|
|
1154
1171
|
* the camera accessory PirSensor role: that one is a camera child;
|
|
1155
1172
|
* this is a standalone HA / 3rd-party motion sensor. */
|
|
@@ -1226,7 +1243,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1226
1243
|
*/
|
|
1227
1244
|
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
1228
1245
|
//#endregion
|
|
1229
|
-
//#region ../types/dist/sleep-
|
|
1246
|
+
//#region ../types/dist/sleep-Bn346wCJ.mjs
|
|
1230
1247
|
/**
|
|
1231
1248
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1232
1249
|
* window to float samples (D455).
|
|
@@ -7772,6 +7789,50 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
7772
7789
|
value: false
|
|
7773
7790
|
},
|
|
7774
7791
|
args: { oscillating: false }
|
|
7792
|
+
},
|
|
7793
|
+
{
|
|
7794
|
+
id: "fan.horizontalOscillateOn",
|
|
7795
|
+
method: "setOscillationAxis",
|
|
7796
|
+
label: t("Horizontal oscillation on", "Oscillazione orizzontale attiva"),
|
|
7797
|
+
phrase: t("Start the horizontal oscillation of {device}", "Attiva l’oscillazione orizzontale di {device}"),
|
|
7798
|
+
icon: "move-horizontal",
|
|
7799
|
+
args: {
|
|
7800
|
+
axis: "horizontal",
|
|
7801
|
+
oscillating: true
|
|
7802
|
+
}
|
|
7803
|
+
},
|
|
7804
|
+
{
|
|
7805
|
+
id: "fan.horizontalOscillateOff",
|
|
7806
|
+
method: "setOscillationAxis",
|
|
7807
|
+
label: t("Horizontal oscillation off", "Oscillazione orizzontale spenta"),
|
|
7808
|
+
phrase: t("Stop the horizontal oscillation of {device}", "Ferma l’oscillazione orizzontale di {device}"),
|
|
7809
|
+
icon: "move-horizontal",
|
|
7810
|
+
args: {
|
|
7811
|
+
axis: "horizontal",
|
|
7812
|
+
oscillating: false
|
|
7813
|
+
}
|
|
7814
|
+
},
|
|
7815
|
+
{
|
|
7816
|
+
id: "fan.verticalOscillateOn",
|
|
7817
|
+
method: "setOscillationAxis",
|
|
7818
|
+
label: t("Vertical oscillation on", "Oscillazione verticale attiva"),
|
|
7819
|
+
phrase: t("Start the vertical oscillation of {device}", "Attiva l’oscillazione verticale di {device}"),
|
|
7820
|
+
icon: "move-vertical",
|
|
7821
|
+
args: {
|
|
7822
|
+
axis: "vertical",
|
|
7823
|
+
oscillating: true
|
|
7824
|
+
}
|
|
7825
|
+
},
|
|
7826
|
+
{
|
|
7827
|
+
id: "fan.verticalOscillateOff",
|
|
7828
|
+
method: "setOscillationAxis",
|
|
7829
|
+
label: t("Vertical oscillation off", "Oscillazione verticale spenta"),
|
|
7830
|
+
phrase: t("Stop the vertical oscillation of {device}", "Ferma l’oscillazione verticale di {device}"),
|
|
7831
|
+
icon: "move-vertical",
|
|
7832
|
+
args: {
|
|
7833
|
+
axis: "vertical",
|
|
7834
|
+
oscillating: false
|
|
7835
|
+
}
|
|
7775
7836
|
}
|
|
7776
7837
|
],
|
|
7777
7838
|
state: [{
|
|
@@ -13849,7 +13910,7 @@ function sleep(ms) {
|
|
|
13849
13910
|
return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
13850
13911
|
}
|
|
13851
13912
|
//#endregion
|
|
13852
|
-
//#region ../types/dist/implemented-methods-
|
|
13913
|
+
//#region ../types/dist/implemented-methods-5YMDeE3f.mjs
|
|
13853
13914
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
13854
13915
|
opus: "libopus",
|
|
13855
13916
|
aac: "aac",
|
|
@@ -42541,16 +42602,39 @@ function metaQuantity(schema) {
|
|
|
42541
42602
|
function quantityOfField(schema) {
|
|
42542
42603
|
return metaQuantity(schema) ?? metaQuantity(unwrapSchema(schema));
|
|
42543
42604
|
}
|
|
42605
|
+
function scalarKind(schema) {
|
|
42606
|
+
const s = unwrapSchema(schema);
|
|
42607
|
+
if (s instanceof zod.z.ZodNumber) return "number";
|
|
42608
|
+
if (s instanceof zod.z.ZodString) return "string";
|
|
42609
|
+
if (s instanceof zod.z.ZodBoolean) return "boolean";
|
|
42610
|
+
return null;
|
|
42611
|
+
}
|
|
42612
|
+
/** A union is a leaf only when EVERY member is a scalar; one object or array member keeps it out. */
|
|
42613
|
+
function unionMembersOf(s) {
|
|
42614
|
+
const members = [];
|
|
42615
|
+
for (const option of s.options) {
|
|
42616
|
+
if (!(option instanceof zod.z.ZodType)) return null;
|
|
42617
|
+
const kind = scalarKind(option);
|
|
42618
|
+
if (kind === null) return null;
|
|
42619
|
+
if (!members.includes(kind)) members.push(kind);
|
|
42620
|
+
}
|
|
42621
|
+
return members.length > 0 ? members : null;
|
|
42622
|
+
}
|
|
42544
42623
|
function leafKind(schema) {
|
|
42545
42624
|
const s = unwrapSchema(schema);
|
|
42546
42625
|
if (s instanceof zod.z.ZodEnum) return {
|
|
42547
42626
|
kind: "enum",
|
|
42548
42627
|
enumValues: s.options
|
|
42549
42628
|
};
|
|
42550
|
-
if (s instanceof zod.z.
|
|
42551
|
-
|
|
42552
|
-
|
|
42553
|
-
|
|
42629
|
+
if (s instanceof zod.z.ZodUnion) {
|
|
42630
|
+
const members = unionMembersOf(s);
|
|
42631
|
+
return members === null ? null : {
|
|
42632
|
+
kind: "union",
|
|
42633
|
+
unionMembers: members
|
|
42634
|
+
};
|
|
42635
|
+
}
|
|
42636
|
+
const scalar = scalarKind(s);
|
|
42637
|
+
return scalar === null ? null : { kind: scalar };
|
|
42554
42638
|
}
|
|
42555
42639
|
/** Walk a cap status schema into flat wireable leaf fields (dotted paths).
|
|
42556
42640
|
* Recurses into nested ZodObject (unwrapping nullable/optional/default first),
|
|
@@ -42575,6 +42659,7 @@ function enumerateSchemaFields(schema, prefix = "") {
|
|
|
42575
42659
|
path,
|
|
42576
42660
|
kind: leaf.kind,
|
|
42577
42661
|
...leaf.enumValues ? { enumValues: leaf.enumValues } : {},
|
|
42662
|
+
...leaf.unionMembers ? { unionMembers: leaf.unionMembers } : {},
|
|
42578
42663
|
...quantity !== void 0 ? { quantity } : {}
|
|
42579
42664
|
});
|
|
42580
42665
|
}
|
|
@@ -46419,7 +46504,7 @@ var accessoriesCapability = {
|
|
|
46419
46504
|
DeviceType.Switch,
|
|
46420
46505
|
DeviceType.Light,
|
|
46421
46506
|
DeviceType.Sensor,
|
|
46422
|
-
DeviceType.
|
|
46507
|
+
DeviceType.Climate,
|
|
46423
46508
|
DeviceType.Cover,
|
|
46424
46509
|
DeviceType.Lock,
|
|
46425
46510
|
DeviceType.Fan,
|
|
@@ -49457,7 +49542,7 @@ var BATTERY_DEVICE_TYPES = [
|
|
|
49457
49542
|
DeviceType.Switch,
|
|
49458
49543
|
DeviceType.PetFeeder,
|
|
49459
49544
|
DeviceType.Container,
|
|
49460
|
-
DeviceType.
|
|
49545
|
+
DeviceType.Climate,
|
|
49461
49546
|
DeviceType.EventEmitter
|
|
49462
49547
|
];
|
|
49463
49548
|
/** Generic Customize target for the percentage reading (D936). */
|
|
@@ -51653,7 +51738,14 @@ var climateControlCapability = {
|
|
|
51653
51738
|
scope: "device",
|
|
51654
51739
|
deviceNative: true,
|
|
51655
51740
|
mode: "singleton",
|
|
51656
|
-
deviceTypes: [DeviceType.
|
|
51741
|
+
deviceTypes: [DeviceType.Climate],
|
|
51742
|
+
power: {
|
|
51743
|
+
kind: "mode",
|
|
51744
|
+
field: "mode",
|
|
51745
|
+
offValue: "off",
|
|
51746
|
+
set: "setMode",
|
|
51747
|
+
lastField: "lastActiveMode"
|
|
51748
|
+
},
|
|
51657
51749
|
methods: {
|
|
51658
51750
|
setMode: method(zod.z.object({
|
|
51659
51751
|
deviceId: zod.z.number().int().nonnegative(),
|
|
@@ -52067,7 +52159,8 @@ function describeStateField(schema, path) {
|
|
|
52067
52159
|
kind: leaf.kind,
|
|
52068
52160
|
nullable: field.safeParse(null).success,
|
|
52069
52161
|
required: !field.safeParse(void 0).success,
|
|
52070
|
-
...leaf.enumValues === void 0 ? {} : { enumValues: leaf.enumValues }
|
|
52162
|
+
...leaf.enumValues === void 0 ? {} : { enumValues: leaf.enumValues },
|
|
52163
|
+
...leaf.unionMembers === void 0 ? {} : { unionMembers: leaf.unionMembers }
|
|
52071
52164
|
};
|
|
52072
52165
|
}
|
|
52073
52166
|
function describeTopLevelStateFields(schema) {
|
|
@@ -52185,6 +52278,7 @@ var CompositionProblemCodeSchema = zod.z.enum([
|
|
|
52185
52278
|
"nested-field",
|
|
52186
52279
|
"missing-field",
|
|
52187
52280
|
"kind-mismatch",
|
|
52281
|
+
"source-kind-mismatch",
|
|
52188
52282
|
"may-be-null",
|
|
52189
52283
|
"source-missing",
|
|
52190
52284
|
"source-unreadable",
|
|
@@ -52206,7 +52300,8 @@ var CompositionProblemCodeSchema = zod.z.enum([
|
|
|
52206
52300
|
"command-method-unknown",
|
|
52207
52301
|
"command-source-unknown",
|
|
52208
52302
|
"command-input-unknown",
|
|
52209
|
-
"command-input-missing"
|
|
52303
|
+
"command-input-missing",
|
|
52304
|
+
"power-source-is-actuator"
|
|
52210
52305
|
]);
|
|
52211
52306
|
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
|
|
52212
52307
|
var CompositionProblemSchema = zod.z.object({
|
|
@@ -53323,6 +53418,13 @@ var mediaPlayerCapability = {
|
|
|
53323
53418
|
deviceNative: true,
|
|
53324
53419
|
mode: "singleton",
|
|
53325
53420
|
deviceTypes: [DeviceType.MediaPlayer],
|
|
53421
|
+
power: {
|
|
53422
|
+
kind: "methods",
|
|
53423
|
+
field: "state",
|
|
53424
|
+
offValues: ["off", "standby"],
|
|
53425
|
+
on: "turnOn",
|
|
53426
|
+
off: "turnOff"
|
|
53427
|
+
},
|
|
53326
53428
|
methods: {
|
|
53327
53429
|
turnOn: optionalMethod(deviceOnly, zod.z.void(), {
|
|
53328
53430
|
kind: "mutation",
|
|
@@ -53455,7 +53557,7 @@ var mediaPlayerCapability = {
|
|
|
53455
53557
|
};
|
|
53456
53558
|
/**
|
|
53457
53559
|
* Customize catalog, projected from every `*.cap.ts` `customize` block.
|
|
53458
|
-
*
|
|
53560
|
+
* 11 caps. Field keys are `runtimeState` paths. No Zod.
|
|
53459
53561
|
*/
|
|
53460
53562
|
var CAP_CUSTOMIZE_CATALOG = {
|
|
53461
53563
|
"battery": {
|
|
@@ -53470,7 +53572,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53470
53572
|
DeviceType.Switch,
|
|
53471
53573
|
DeviceType.PetFeeder,
|
|
53472
53574
|
DeviceType.Container,
|
|
53473
|
-
DeviceType.
|
|
53575
|
+
DeviceType.Climate,
|
|
53474
53576
|
DeviceType.EventEmitter
|
|
53475
53577
|
],
|
|
53476
53578
|
apply: "add",
|
|
@@ -53526,7 +53628,6 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53526
53628
|
DeviceType.Siren,
|
|
53527
53629
|
DeviceType.Switch,
|
|
53528
53630
|
DeviceType.Sensor,
|
|
53529
|
-
DeviceType.Thermostat,
|
|
53530
53631
|
DeviceType.Climate,
|
|
53531
53632
|
DeviceType.Button,
|
|
53532
53633
|
DeviceType.EventEmitter,
|
|
@@ -53554,7 +53655,6 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53554
53655
|
DeviceType.PetFountain,
|
|
53555
53656
|
DeviceType.Dishwasher,
|
|
53556
53657
|
DeviceType.Washer,
|
|
53557
|
-
DeviceType.Heater,
|
|
53558
53658
|
DeviceType.Dryer,
|
|
53559
53659
|
DeviceType.Gateway,
|
|
53560
53660
|
DeviceType.HeatPump
|
|
@@ -53688,6 +53788,247 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53688
53788
|
debounceMs: 2e3
|
|
53689
53789
|
}]
|
|
53690
53790
|
},
|
|
53791
|
+
"fan-control": {
|
|
53792
|
+
version: 1,
|
|
53793
|
+
targets: [
|
|
53794
|
+
{
|
|
53795
|
+
id: "horizontal-oscillating",
|
|
53796
|
+
cardinality: "scalar",
|
|
53797
|
+
deviceTypes: [DeviceType.Fan],
|
|
53798
|
+
apply: "replace",
|
|
53799
|
+
vocabularyCap: "fan-control",
|
|
53800
|
+
vocabularyStateField: "oscillating",
|
|
53801
|
+
sources: [{
|
|
53802
|
+
kind: "switch",
|
|
53803
|
+
transformKinds: ["identity"],
|
|
53804
|
+
transforms: [{ kind: "identity" }]
|
|
53805
|
+
}],
|
|
53806
|
+
sourceReport: { status: "assignment-status" },
|
|
53807
|
+
advancedExpression: false,
|
|
53808
|
+
section: "oscillation-axes",
|
|
53809
|
+
path: "oscillationAxes.horizontal.oscillating",
|
|
53810
|
+
valueKind: "boolean",
|
|
53811
|
+
nullable: true
|
|
53812
|
+
},
|
|
53813
|
+
{
|
|
53814
|
+
id: "horizontal-angle",
|
|
53815
|
+
cardinality: "scalar",
|
|
53816
|
+
deviceTypes: [DeviceType.Fan],
|
|
53817
|
+
apply: "replace",
|
|
53818
|
+
vocabularyCap: "fan-control",
|
|
53819
|
+
sources: [{
|
|
53820
|
+
kind: "numeric",
|
|
53821
|
+
transformKinds: ["identity"],
|
|
53822
|
+
transforms: [{ kind: "identity" }]
|
|
53823
|
+
}],
|
|
53824
|
+
sourceReport: { status: "assignment-status" },
|
|
53825
|
+
advancedExpression: false,
|
|
53826
|
+
section: "oscillation-axes",
|
|
53827
|
+
path: "oscillationAxes.horizontal.angle",
|
|
53828
|
+
valueKind: "number",
|
|
53829
|
+
nullable: true,
|
|
53830
|
+
companions: [
|
|
53831
|
+
{
|
|
53832
|
+
kind: "source-field",
|
|
53833
|
+
path: "oscillationAxes.horizontal.min",
|
|
53834
|
+
field: "min"
|
|
53835
|
+
},
|
|
53836
|
+
{
|
|
53837
|
+
kind: "source-field",
|
|
53838
|
+
path: "oscillationAxes.horizontal.max",
|
|
53839
|
+
field: "max"
|
|
53840
|
+
},
|
|
53841
|
+
{
|
|
53842
|
+
kind: "source-field",
|
|
53843
|
+
path: "oscillationAxes.horizontal.step",
|
|
53844
|
+
field: "step"
|
|
53845
|
+
}
|
|
53846
|
+
]
|
|
53847
|
+
},
|
|
53848
|
+
{
|
|
53849
|
+
id: "horizontal-sweepFrom",
|
|
53850
|
+
cardinality: "scalar",
|
|
53851
|
+
deviceTypes: [DeviceType.Fan],
|
|
53852
|
+
apply: "replace",
|
|
53853
|
+
vocabularyCap: "fan-control",
|
|
53854
|
+
sources: [{
|
|
53855
|
+
kind: "numeric",
|
|
53856
|
+
transformKinds: ["identity"],
|
|
53857
|
+
transforms: [{ kind: "identity" }]
|
|
53858
|
+
}],
|
|
53859
|
+
sourceReport: { status: "assignment-status" },
|
|
53860
|
+
advancedExpression: false,
|
|
53861
|
+
section: "oscillation-axes",
|
|
53862
|
+
path: "oscillationAxes.horizontal.sweepFrom",
|
|
53863
|
+
valueKind: "number",
|
|
53864
|
+
nullable: true
|
|
53865
|
+
},
|
|
53866
|
+
{
|
|
53867
|
+
id: "horizontal-sweepTo",
|
|
53868
|
+
cardinality: "scalar",
|
|
53869
|
+
deviceTypes: [DeviceType.Fan],
|
|
53870
|
+
apply: "replace",
|
|
53871
|
+
vocabularyCap: "fan-control",
|
|
53872
|
+
sources: [{
|
|
53873
|
+
kind: "numeric",
|
|
53874
|
+
transformKinds: ["identity"],
|
|
53875
|
+
transforms: [{ kind: "identity" }]
|
|
53876
|
+
}],
|
|
53877
|
+
sourceReport: { status: "assignment-status" },
|
|
53878
|
+
advancedExpression: false,
|
|
53879
|
+
section: "oscillation-axes",
|
|
53880
|
+
path: "oscillationAxes.horizontal.sweepTo",
|
|
53881
|
+
valueKind: "number",
|
|
53882
|
+
nullable: true
|
|
53883
|
+
},
|
|
53884
|
+
{
|
|
53885
|
+
id: "vertical-oscillating",
|
|
53886
|
+
cardinality: "scalar",
|
|
53887
|
+
deviceTypes: [DeviceType.Fan],
|
|
53888
|
+
apply: "replace",
|
|
53889
|
+
vocabularyCap: "fan-control",
|
|
53890
|
+
vocabularyStateField: "oscillating",
|
|
53891
|
+
sources: [{
|
|
53892
|
+
kind: "switch",
|
|
53893
|
+
transformKinds: ["identity"],
|
|
53894
|
+
transforms: [{ kind: "identity" }]
|
|
53895
|
+
}],
|
|
53896
|
+
sourceReport: { status: "assignment-status" },
|
|
53897
|
+
advancedExpression: false,
|
|
53898
|
+
section: "oscillation-axes",
|
|
53899
|
+
path: "oscillationAxes.vertical.oscillating",
|
|
53900
|
+
valueKind: "boolean",
|
|
53901
|
+
nullable: true
|
|
53902
|
+
},
|
|
53903
|
+
{
|
|
53904
|
+
id: "vertical-angle",
|
|
53905
|
+
cardinality: "scalar",
|
|
53906
|
+
deviceTypes: [DeviceType.Fan],
|
|
53907
|
+
apply: "replace",
|
|
53908
|
+
vocabularyCap: "fan-control",
|
|
53909
|
+
sources: [{
|
|
53910
|
+
kind: "numeric",
|
|
53911
|
+
transformKinds: ["identity"],
|
|
53912
|
+
transforms: [{ kind: "identity" }]
|
|
53913
|
+
}],
|
|
53914
|
+
sourceReport: { status: "assignment-status" },
|
|
53915
|
+
advancedExpression: false,
|
|
53916
|
+
section: "oscillation-axes",
|
|
53917
|
+
path: "oscillationAxes.vertical.angle",
|
|
53918
|
+
valueKind: "number",
|
|
53919
|
+
nullable: true,
|
|
53920
|
+
companions: [
|
|
53921
|
+
{
|
|
53922
|
+
kind: "source-field",
|
|
53923
|
+
path: "oscillationAxes.vertical.min",
|
|
53924
|
+
field: "min"
|
|
53925
|
+
},
|
|
53926
|
+
{
|
|
53927
|
+
kind: "source-field",
|
|
53928
|
+
path: "oscillationAxes.vertical.max",
|
|
53929
|
+
field: "max"
|
|
53930
|
+
},
|
|
53931
|
+
{
|
|
53932
|
+
kind: "source-field",
|
|
53933
|
+
path: "oscillationAxes.vertical.step",
|
|
53934
|
+
field: "step"
|
|
53935
|
+
}
|
|
53936
|
+
]
|
|
53937
|
+
},
|
|
53938
|
+
{
|
|
53939
|
+
id: "vertical-sweepFrom",
|
|
53940
|
+
cardinality: "scalar",
|
|
53941
|
+
deviceTypes: [DeviceType.Fan],
|
|
53942
|
+
apply: "replace",
|
|
53943
|
+
vocabularyCap: "fan-control",
|
|
53944
|
+
sources: [{
|
|
53945
|
+
kind: "numeric",
|
|
53946
|
+
transformKinds: ["identity"],
|
|
53947
|
+
transforms: [{ kind: "identity" }]
|
|
53948
|
+
}],
|
|
53949
|
+
sourceReport: { status: "assignment-status" },
|
|
53950
|
+
advancedExpression: false,
|
|
53951
|
+
section: "oscillation-axes",
|
|
53952
|
+
path: "oscillationAxes.vertical.sweepFrom",
|
|
53953
|
+
valueKind: "number",
|
|
53954
|
+
nullable: true
|
|
53955
|
+
},
|
|
53956
|
+
{
|
|
53957
|
+
id: "vertical-sweepTo",
|
|
53958
|
+
cardinality: "scalar",
|
|
53959
|
+
deviceTypes: [DeviceType.Fan],
|
|
53960
|
+
apply: "replace",
|
|
53961
|
+
vocabularyCap: "fan-control",
|
|
53962
|
+
sources: [{
|
|
53963
|
+
kind: "numeric",
|
|
53964
|
+
transformKinds: ["identity"],
|
|
53965
|
+
transforms: [{ kind: "identity" }]
|
|
53966
|
+
}],
|
|
53967
|
+
sourceReport: { status: "assignment-status" },
|
|
53968
|
+
advancedExpression: false,
|
|
53969
|
+
section: "oscillation-axes",
|
|
53970
|
+
path: "oscillationAxes.vertical.sweepTo",
|
|
53971
|
+
valueKind: "number",
|
|
53972
|
+
nullable: true
|
|
53973
|
+
},
|
|
53974
|
+
{
|
|
53975
|
+
id: "preset",
|
|
53976
|
+
cardinality: "scalar",
|
|
53977
|
+
deviceTypes: [DeviceType.Fan],
|
|
53978
|
+
apply: "replace",
|
|
53979
|
+
vocabularyCap: "fan-control",
|
|
53980
|
+
sources: [{
|
|
53981
|
+
kind: "field",
|
|
53982
|
+
valueKinds: ["string"],
|
|
53983
|
+
transformKinds: ["identity"],
|
|
53984
|
+
transforms: [{ kind: "identity" }]
|
|
53985
|
+
}],
|
|
53986
|
+
sourceReport: { status: "assignment-status" },
|
|
53987
|
+
advancedExpression: false,
|
|
53988
|
+
path: "preset",
|
|
53989
|
+
valueKind: "string",
|
|
53990
|
+
nullable: false
|
|
53991
|
+
}
|
|
53992
|
+
],
|
|
53993
|
+
overridable: [
|
|
53994
|
+
{
|
|
53995
|
+
path: "oscillationAxes.horizontal.oscillating",
|
|
53996
|
+
by: "horizontal-oscillating"
|
|
53997
|
+
},
|
|
53998
|
+
{
|
|
53999
|
+
path: "oscillationAxes.horizontal.angle",
|
|
54000
|
+
by: "horizontal-angle"
|
|
54001
|
+
},
|
|
54002
|
+
{
|
|
54003
|
+
path: "oscillationAxes.horizontal.sweepFrom",
|
|
54004
|
+
by: "horizontal-sweepFrom"
|
|
54005
|
+
},
|
|
54006
|
+
{
|
|
54007
|
+
path: "oscillationAxes.horizontal.sweepTo",
|
|
54008
|
+
by: "horizontal-sweepTo"
|
|
54009
|
+
},
|
|
54010
|
+
{
|
|
54011
|
+
path: "oscillationAxes.vertical.oscillating",
|
|
54012
|
+
by: "vertical-oscillating"
|
|
54013
|
+
},
|
|
54014
|
+
{
|
|
54015
|
+
path: "oscillationAxes.vertical.angle",
|
|
54016
|
+
by: "vertical-angle"
|
|
54017
|
+
},
|
|
54018
|
+
{
|
|
54019
|
+
path: "oscillationAxes.vertical.sweepFrom",
|
|
54020
|
+
by: "vertical-sweepFrom"
|
|
54021
|
+
},
|
|
54022
|
+
{
|
|
54023
|
+
path: "oscillationAxes.vertical.sweepTo",
|
|
54024
|
+
by: "vertical-sweepTo"
|
|
54025
|
+
},
|
|
54026
|
+
{
|
|
54027
|
+
path: "preset",
|
|
54028
|
+
by: "preset"
|
|
54029
|
+
}
|
|
54030
|
+
]
|
|
54031
|
+
},
|
|
53691
54032
|
"fan-presets": {
|
|
53692
54033
|
version: 1,
|
|
53693
54034
|
targets: [{
|
|
@@ -53788,7 +54129,6 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53788
54129
|
DeviceType.Light,
|
|
53789
54130
|
DeviceType.Fan,
|
|
53790
54131
|
DeviceType.Climate,
|
|
53791
|
-
DeviceType.Thermostat,
|
|
53792
54132
|
DeviceType.Humidifier,
|
|
53793
54133
|
DeviceType.WaterHeater,
|
|
53794
54134
|
DeviceType.MediaPlayer,
|
|
@@ -53797,8 +54137,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53797
54137
|
DeviceType.Dishwasher,
|
|
53798
54138
|
DeviceType.Vacuum,
|
|
53799
54139
|
DeviceType.LawnMower,
|
|
53800
|
-
DeviceType.PetFeeder
|
|
53801
|
-
DeviceType.Heater
|
|
54140
|
+
DeviceType.PetFeeder
|
|
53802
54141
|
],
|
|
53803
54142
|
apply: "add",
|
|
53804
54143
|
vocabularyCap: "power-meter",
|
|
@@ -53828,7 +54167,6 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53828
54167
|
DeviceType.Light,
|
|
53829
54168
|
DeviceType.Fan,
|
|
53830
54169
|
DeviceType.Climate,
|
|
53831
|
-
DeviceType.Thermostat,
|
|
53832
54170
|
DeviceType.Humidifier,
|
|
53833
54171
|
DeviceType.WaterHeater,
|
|
53834
54172
|
DeviceType.MediaPlayer,
|
|
@@ -53837,8 +54175,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53837
54175
|
DeviceType.Dishwasher,
|
|
53838
54176
|
DeviceType.Vacuum,
|
|
53839
54177
|
DeviceType.LawnMower,
|
|
53840
|
-
DeviceType.PetFeeder
|
|
53841
|
-
DeviceType.Heater
|
|
54178
|
+
DeviceType.PetFeeder
|
|
53842
54179
|
],
|
|
53843
54180
|
apply: "add",
|
|
53844
54181
|
vocabularyCap: "power-meter",
|
|
@@ -53868,7 +54205,6 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53868
54205
|
DeviceType.Light,
|
|
53869
54206
|
DeviceType.Fan,
|
|
53870
54207
|
DeviceType.Climate,
|
|
53871
|
-
DeviceType.Thermostat,
|
|
53872
54208
|
DeviceType.Humidifier,
|
|
53873
54209
|
DeviceType.WaterHeater,
|
|
53874
54210
|
DeviceType.MediaPlayer,
|
|
@@ -53877,8 +54213,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53877
54213
|
DeviceType.Dishwasher,
|
|
53878
54214
|
DeviceType.Vacuum,
|
|
53879
54215
|
DeviceType.LawnMower,
|
|
53880
|
-
DeviceType.PetFeeder
|
|
53881
|
-
DeviceType.Heater
|
|
54216
|
+
DeviceType.PetFeeder
|
|
53882
54217
|
],
|
|
53883
54218
|
apply: "add",
|
|
53884
54219
|
vocabularyCap: "power-meter",
|
|
@@ -53908,7 +54243,6 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53908
54243
|
DeviceType.Light,
|
|
53909
54244
|
DeviceType.Fan,
|
|
53910
54245
|
DeviceType.Climate,
|
|
53911
|
-
DeviceType.Thermostat,
|
|
53912
54246
|
DeviceType.Humidifier,
|
|
53913
54247
|
DeviceType.WaterHeater,
|
|
53914
54248
|
DeviceType.MediaPlayer,
|
|
@@ -53917,8 +54251,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
53917
54251
|
DeviceType.Dishwasher,
|
|
53918
54252
|
DeviceType.Vacuum,
|
|
53919
54253
|
DeviceType.LawnMower,
|
|
53920
|
-
DeviceType.PetFeeder
|
|
53921
|
-
DeviceType.Heater
|
|
54254
|
+
DeviceType.PetFeeder
|
|
53922
54255
|
],
|
|
53923
54256
|
apply: "add",
|
|
53924
54257
|
vocabularyCap: "power-meter",
|
|
@@ -54020,9 +54353,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
54020
54353
|
DeviceType.Humidifier,
|
|
54021
54354
|
DeviceType.Fan,
|
|
54022
54355
|
DeviceType.Climate,
|
|
54023
|
-
DeviceType.
|
|
54024
|
-
DeviceType.PetFeeder,
|
|
54025
|
-
DeviceType.Heater
|
|
54356
|
+
DeviceType.PetFeeder
|
|
54026
54357
|
],
|
|
54027
54358
|
apply: "add",
|
|
54028
54359
|
vocabularyCap: "running-state",
|
|
@@ -54335,12 +54666,37 @@ function readKinds(read, lookupCap) {
|
|
|
54335
54666
|
code: "source-field-unknown",
|
|
54336
54667
|
message: `\`${read.cap}\` has no field \`${read.fieldPath}\``
|
|
54337
54668
|
};
|
|
54338
|
-
const
|
|
54669
|
+
const bases = field.kind === "union" ? field.unionMembers ?? [] : [field.kind === "enum" ? "string" : field.kind];
|
|
54339
54670
|
return {
|
|
54340
54671
|
ok: true,
|
|
54341
|
-
kinds: new Set(field.nullable ? [
|
|
54672
|
+
kinds: new Set(field.nullable ? [...bases, "null"] : bases)
|
|
54342
54673
|
};
|
|
54343
54674
|
}
|
|
54675
|
+
/** A union field is read as a source (D1034), never written: no single kind to check a source against. */
|
|
54676
|
+
function unionTargetProblem(cap, path, at) {
|
|
54677
|
+
return problem("kind-mismatch", at, `\`${cap}.${path}\` is a union — it is read as a source, never written`);
|
|
54678
|
+
}
|
|
54679
|
+
/** The one value kind a target field accepts. */
|
|
54680
|
+
function acceptedKind(target) {
|
|
54681
|
+
if (target.kind === "union") return null;
|
|
54682
|
+
return target.kind === "enum" ? "string" : target.kind;
|
|
54683
|
+
}
|
|
54684
|
+
/**
|
|
54685
|
+
* A direct read of a UNION source field (D1034) is judged by the member that
|
|
54686
|
+
* fits the target: when one does, the read produces that kind only (a reading
|
|
54687
|
+
* of another kind is UNAVAILABLE at read time, never a coerced value); when
|
|
54688
|
+
* none does, the kinds stay as they are and `compatibility` names the mismatch.
|
|
54689
|
+
*/
|
|
54690
|
+
function narrowUnionRead(source, target, kinds, lookupCap) {
|
|
54691
|
+
if (source.kind !== "from") return kinds;
|
|
54692
|
+
const def = lookupCap(source.cap);
|
|
54693
|
+
const schema = def?.runtimeState ?? def?.status?.schema;
|
|
54694
|
+
if (schema === void 0) return kinds;
|
|
54695
|
+
const field = describeStateField(schema, source.fieldPath);
|
|
54696
|
+
const accepted = acceptedKind(target);
|
|
54697
|
+
if (field?.kind !== "union" || accepted === null || !kinds.has(accepted)) return kinds;
|
|
54698
|
+
return new Set(kinds.has("null") ? [accepted, "null"] : [accepted]);
|
|
54699
|
+
}
|
|
54344
54700
|
function sourceKinds(source, lookupCap) {
|
|
54345
54701
|
if (source.kind === "from") return readKinds(source, lookupCap);
|
|
54346
54702
|
if (source.kind === "code") return {
|
|
@@ -54377,7 +54733,8 @@ function sourceKinds(source, lookupCap) {
|
|
|
54377
54733
|
};
|
|
54378
54734
|
}
|
|
54379
54735
|
function compatibility(cap, target, kinds, at) {
|
|
54380
|
-
const allowed = target
|
|
54736
|
+
const allowed = acceptedKind(target);
|
|
54737
|
+
if (allowed === null) return [unionTargetProblem(cap, target.path, at)];
|
|
54381
54738
|
const offending = [...kinds].filter((k) => k !== "null" && k !== allowed);
|
|
54382
54739
|
const problems = [];
|
|
54383
54740
|
if (offending.length > 0) problems.push(problem("kind-mismatch", at, `\`${cap}.${target.path}\` is a ${target.kind}; this source can produce ${offending.join(" or ")}`));
|
|
@@ -54486,6 +54843,7 @@ function planItemField(ctx, leaf) {
|
|
|
54486
54843
|
if (ctx.reserved.has(path)) return refused(problem("item-field-reserved", at, `\`${capName}.${itemArray.path}[].${path}\` is set by the composer itself — it takes no source`));
|
|
54487
54844
|
const tf = describeStateField(itemArray.itemSchema, path);
|
|
54488
54845
|
if (tf === null) return refused(problem("unknown-field", at, `a \`${capName}\` item has no field \`${path}\``));
|
|
54846
|
+
if (tf.kind === "union") return refused(unionTargetProblem(capName, path, at));
|
|
54489
54847
|
const kinds = sourceKinds(source, lookupCap);
|
|
54490
54848
|
if (!kinds.ok) return refused(problem(kinds.code, at, kinds.message));
|
|
54491
54849
|
const role = roleOf(source);
|
|
@@ -54511,7 +54869,7 @@ function planItemField(ctx, leaf) {
|
|
|
54511
54869
|
};
|
|
54512
54870
|
const enumProblem = enumLiteralProblem(capName, tf, source, at);
|
|
54513
54871
|
return {
|
|
54514
|
-
problems: [...compatibility(capName, tf, kinds.kinds, at), ...enumProblem === null ? [] : [enumProblem]],
|
|
54872
|
+
problems: [...compatibility(capName, tf, narrowUnionRead(source, tf, kinds.kinds, lookupCap), at), ...enumProblem === null ? [] : [enumProblem]],
|
|
54515
54873
|
fields: [plan],
|
|
54516
54874
|
features: [],
|
|
54517
54875
|
events: []
|
|
@@ -54728,7 +55086,7 @@ function numeric(input) {
|
|
|
54728
55086
|
}, ...alsoFrom === void 0 ? [] : [alsoFrom.accept]]
|
|
54729
55087
|
};
|
|
54730
55088
|
}
|
|
54731
|
-
var CLIMATE_DEVICES = [DeviceType.
|
|
55089
|
+
var CLIMATE_DEVICES = [DeviceType.Climate];
|
|
54732
55090
|
function binary(input) {
|
|
54733
55091
|
return {
|
|
54734
55092
|
...input,
|
|
@@ -55050,8 +55408,8 @@ var GROUP_TEMPLATES = [
|
|
|
55050
55408
|
actuator({
|
|
55051
55409
|
id: "climate",
|
|
55052
55410
|
summary: "Running when at least one thermostat or air conditioner is not off, or only when all of them are. Target temperature and fan are offered only when every device has them. A device that reports nothing is left out, never read as off.",
|
|
55053
|
-
deviceType: DeviceType.
|
|
55054
|
-
memberDeviceTypes: [DeviceType.
|
|
55411
|
+
deviceType: DeviceType.Climate,
|
|
55412
|
+
memberDeviceTypes: [DeviceType.Climate],
|
|
55055
55413
|
outputCap: "group-active",
|
|
55056
55414
|
outputField: "active",
|
|
55057
55415
|
member: {
|
|
@@ -56329,6 +56687,202 @@ function findCandidateCycles(candidate, stored) {
|
|
|
56329
56687
|
}];
|
|
56330
56688
|
});
|
|
56331
56689
|
}
|
|
56690
|
+
var PowerSourceRefusalReasonSchema = zod.z.enum([
|
|
56691
|
+
"no-power-source",
|
|
56692
|
+
"switch-missing",
|
|
56693
|
+
"switch-offline",
|
|
56694
|
+
"switch-unknown",
|
|
56695
|
+
"restart-in-progress",
|
|
56696
|
+
"switch-call-failed",
|
|
56697
|
+
"switch-is-actuator"
|
|
56698
|
+
]);
|
|
56699
|
+
var PowerSourceActionResultSchema = zod.z.discriminatedUnion("accepted", [zod.z.object({ accepted: zod.z.literal(true) }), zod.z.object({
|
|
56700
|
+
accepted: zod.z.literal(false),
|
|
56701
|
+
reason: PowerSourceRefusalReasonSchema,
|
|
56702
|
+
/** One line for the operator, naming the switch. */
|
|
56703
|
+
message: zod.z.string()
|
|
56704
|
+
})]);
|
|
56705
|
+
var PowerSourceInfoSchema = zod.z.object({
|
|
56706
|
+
/** False when the device has no power source linked; the rest is then empty. */
|
|
56707
|
+
linked: zod.z.boolean(),
|
|
56708
|
+
switchDeviceId: zod.z.number().nullable(),
|
|
56709
|
+
switchName: zod.z.string().nullable(),
|
|
56710
|
+
/** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
|
|
56711
|
+
switchOn: zod.z.boolean().nullable(),
|
|
56712
|
+
switchOnline: zod.z.boolean().nullable(),
|
|
56713
|
+
restartInProgress: zod.z.boolean(),
|
|
56714
|
+
offSeconds: zod.z.number().int()
|
|
56715
|
+
});
|
|
56716
|
+
/** The composed slice: the switch state the link mirrors, plus the stored off time. */
|
|
56717
|
+
var PowerSourceStateSchema = zod.z.object({
|
|
56718
|
+
/** Null while the switch has not reported: unknown is never `false` (D393). */
|
|
56719
|
+
switchOn: zod.z.boolean().nullable(),
|
|
56720
|
+
offSeconds: zod.z.number().int(),
|
|
56721
|
+
lastFetchedAt: zod.z.number()
|
|
56722
|
+
});
|
|
56723
|
+
var POWER_SOURCE_DEVICE_TYPES = [
|
|
56724
|
+
DeviceType.Gateway,
|
|
56725
|
+
DeviceType.Camera,
|
|
56726
|
+
DeviceType.Sensor,
|
|
56727
|
+
DeviceType.MediaPlayer,
|
|
56728
|
+
DeviceType.Vacuum,
|
|
56729
|
+
DeviceType.Generic,
|
|
56730
|
+
DeviceType.Washer,
|
|
56731
|
+
DeviceType.Dryer,
|
|
56732
|
+
DeviceType.Dishwasher,
|
|
56733
|
+
DeviceType.PetFountain,
|
|
56734
|
+
DeviceType.Fan,
|
|
56735
|
+
DeviceType.Humidifier,
|
|
56736
|
+
DeviceType.Climate,
|
|
56737
|
+
DeviceType.WaterHeater
|
|
56738
|
+
];
|
|
56739
|
+
var powerSourceCustomize = {
|
|
56740
|
+
version: 1,
|
|
56741
|
+
targets: [{
|
|
56742
|
+
id: "switch",
|
|
56743
|
+
cardinality: "scalar",
|
|
56744
|
+
vocabulary: {
|
|
56745
|
+
cap: "power-source",
|
|
56746
|
+
stateField: "switchOn"
|
|
56747
|
+
},
|
|
56748
|
+
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
56749
|
+
apply: "add",
|
|
56750
|
+
path: "switchOn",
|
|
56751
|
+
sources: [{
|
|
56752
|
+
kind: "switch",
|
|
56753
|
+
transforms: [{ kind: "identity" }]
|
|
56754
|
+
}],
|
|
56755
|
+
companions: [{
|
|
56756
|
+
kind: "constant",
|
|
56757
|
+
path: "offSeconds",
|
|
56758
|
+
value: 10,
|
|
56759
|
+
when: "add",
|
|
56760
|
+
formerValues: [0]
|
|
56761
|
+
}, {
|
|
56762
|
+
kind: "clock",
|
|
56763
|
+
path: "lastFetchedAt",
|
|
56764
|
+
when: "always"
|
|
56765
|
+
}],
|
|
56766
|
+
sourceReport: { status: "assignment-status" }
|
|
56767
|
+
}]
|
|
56768
|
+
};
|
|
56769
|
+
var deviceInput$2 = zod.z.object({ deviceId: zod.z.number().int().nonnegative() });
|
|
56770
|
+
var powerSourceCapability = {
|
|
56771
|
+
name: "power-source",
|
|
56772
|
+
scope: "device",
|
|
56773
|
+
mode: "singleton",
|
|
56774
|
+
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
56775
|
+
methods: {
|
|
56776
|
+
getStatus: systemMethod(deviceInput$2, PowerSourceInfoSchema, { auth: "protected" }),
|
|
56777
|
+
powerOn: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
|
|
56778
|
+
kind: "mutation",
|
|
56779
|
+
auth: "protected"
|
|
56780
|
+
}),
|
|
56781
|
+
powerOff: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
|
|
56782
|
+
kind: "mutation",
|
|
56783
|
+
auth: "protected"
|
|
56784
|
+
}),
|
|
56785
|
+
forceRestart: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
|
|
56786
|
+
kind: "mutation",
|
|
56787
|
+
auth: "protected"
|
|
56788
|
+
})
|
|
56789
|
+
},
|
|
56790
|
+
runtimeState: PowerSourceStateSchema,
|
|
56791
|
+
customize: powerSourceCustomize,
|
|
56792
|
+
/**
|
|
56793
|
+
* Runtime-state durability: **session** — mirrored from the linked switch on
|
|
56794
|
+
* its next report; a restored value would outlive the reading it names.
|
|
56795
|
+
*
|
|
56796
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
56797
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
56798
|
+
*/
|
|
56799
|
+
durability: "session",
|
|
56800
|
+
history: "none"
|
|
56801
|
+
};
|
|
56802
|
+
/**
|
|
56803
|
+
* Which smart switch powers a device (the `power-source` Customize extension):
|
|
56804
|
+
* the source its stored `power-source.switchOn` field reads, and the off time of
|
|
56805
|
+
* a forced restart stored beside it. Read from the STORED composition, never kept
|
|
56806
|
+
* as a second copy (D676). Shared by the hub (which acts on the switch) and the
|
|
56807
|
+
* admin UI (which shows it).
|
|
56808
|
+
*/
|
|
56809
|
+
/**
|
|
56810
|
+
* The stored off time, or the default when none is stored. A stored number out
|
|
56811
|
+
* of range is CLAMPED to the bounds (a hand-written value never refuses the
|
|
56812
|
+
* link, it just cannot cut power for an absurd time); a non-integer is rounded.
|
|
56813
|
+
*/
|
|
56814
|
+
function normalizeOffSeconds(value) {
|
|
56815
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return 10;
|
|
56816
|
+
return Math.min(120, Math.max(3, Math.round(value)));
|
|
56817
|
+
}
|
|
56818
|
+
/** The constant a stored `offSeconds` field carries, or undefined when it is not a literal number. */
|
|
56819
|
+
function storedOffSeconds(composition) {
|
|
56820
|
+
const feature = composition.features.find((f) => f.cap === "power-source");
|
|
56821
|
+
if (feature === void 0 || feature.kind !== "fields") return void 0;
|
|
56822
|
+
const field = feature.fields["offSeconds"];
|
|
56823
|
+
if (field === void 0 || field.kind !== "expression") return void 0;
|
|
56824
|
+
const n = Number(field.expr);
|
|
56825
|
+
return field.expr.trim() === "" || !Number.isFinite(n) ? void 0 : n;
|
|
56826
|
+
}
|
|
56827
|
+
/**
|
|
56828
|
+
* The link a composition stores. An `existing` target names its own device; a
|
|
56829
|
+
* `new` target (a composed device) is the composer's own device, so the caller
|
|
56830
|
+
* passes the block id and a new-target composition without one has no link.
|
|
56831
|
+
*/
|
|
56832
|
+
function powerSourceLinkOfComposition(composition, blockId) {
|
|
56833
|
+
if (composition === null) return null;
|
|
56834
|
+
let device;
|
|
56835
|
+
if (composition.target.kind === "existing") device = composition.target.device;
|
|
56836
|
+
else if (blockId !== void 0) device = composedDeviceRef(blockId);
|
|
56837
|
+
else return null;
|
|
56838
|
+
const feature = composition.features.find((f) => f.cap === "power-source");
|
|
56839
|
+
if (feature === void 0 || feature.kind !== "fields" || feature.enabled === false) return null;
|
|
56840
|
+
const field = feature.fields["switchOn"];
|
|
56841
|
+
if (field === void 0) return null;
|
|
56842
|
+
const read = fieldReads(field).find((r) => r.cap === "switch");
|
|
56843
|
+
if (read === void 0) return null;
|
|
56844
|
+
return {
|
|
56845
|
+
device,
|
|
56846
|
+
switch: read.source,
|
|
56847
|
+
offSeconds: normalizeOffSeconds(storedOffSeconds(composition))
|
|
56848
|
+
};
|
|
56849
|
+
}
|
|
56850
|
+
var ACTUATOR_CAP = "switch";
|
|
56851
|
+
/**
|
|
56852
|
+
* The devices that ACT for this composition: the device itself when it is an
|
|
56853
|
+
* existing one, and every source its own `switch` feature reads or forwards a
|
|
56854
|
+
* command to (a heater's plug, every member of a switch group).
|
|
56855
|
+
*/
|
|
56856
|
+
function actuatorKeys(composition) {
|
|
56857
|
+
const keys = /* @__PURE__ */ new Set();
|
|
56858
|
+
if (composition.target.kind === "existing") keys.add(compositionSourceKey(composition.target.device));
|
|
56859
|
+
composition.features.forEach((feature, index) => {
|
|
56860
|
+
if (feature.kind !== "fields" || feature.cap !== ACTUATOR_CAP) return;
|
|
56861
|
+
if (!compositionFeatureEnabled(feature)) return;
|
|
56862
|
+
for (const source of featureSources(feature)) for (const read of fieldReads(source)) keys.add(compositionSourceKey(read.source));
|
|
56863
|
+
for (const forward of featureForwards(feature, index)) keys.add(compositionSourceKey(forward.command.source));
|
|
56864
|
+
});
|
|
56865
|
+
return keys;
|
|
56866
|
+
}
|
|
56867
|
+
/**
|
|
56868
|
+
* The supply plug is never one of the device's own actuators (#462): cutting
|
|
56869
|
+
* power through the switch that IS the device's on/off leaves nothing to
|
|
56870
|
+
* restart, and makes "power off" and "turn off" the same press. Refused at save
|
|
56871
|
+
* time (`power-source-is-actuator`) and again by the power-source provider for a
|
|
56872
|
+
* link stored before this check existed (`switch-is-actuator`).
|
|
56873
|
+
*/
|
|
56874
|
+
function powerSourceActuatorConflicts(composition) {
|
|
56875
|
+
const index = composition.features.findIndex((f) => f.cap === "power-source");
|
|
56876
|
+
const feature = composition.features[index];
|
|
56877
|
+
if (feature === void 0 || feature.kind !== "fields" || feature.enabled === false) return [];
|
|
56878
|
+
const field = feature.fields["switchOn"];
|
|
56879
|
+
if (field === void 0) return [];
|
|
56880
|
+
const actuators = actuatorKeys(composition);
|
|
56881
|
+
return fieldReads(field).filter((read) => read.cap === ACTUATOR_CAP && actuators.has(compositionSourceKey(read.source))).map((read) => ({
|
|
56882
|
+
path: `features[${index}].fields.switchOn`,
|
|
56883
|
+
switch: read.source
|
|
56884
|
+
}));
|
|
56885
|
+
}
|
|
56332
56886
|
function buildCapabilityLookup(defs) {
|
|
56333
56887
|
const byName = new Map(defs.map((d) => [d.name, d]));
|
|
56334
56888
|
return (capName) => byName.get(capName) ?? null;
|
|
@@ -56387,12 +56941,25 @@ function builtCapProblems({ def, state, fields: targetFields }, feature, at, dev
|
|
|
56387
56941
|
}
|
|
56388
56942
|
return problems;
|
|
56389
56943
|
}
|
|
56390
|
-
|
|
56944
|
+
/**
|
|
56945
|
+
* A dotted leaf is planned only on a `replace` (D1034): the feature already
|
|
56946
|
+
* passed `overridesOnlyDeclared`, so the leaf is one the cap lists in its
|
|
56947
|
+
* `overridable`, and the hub sets it into the native object. Anywhere else a
|
|
56948
|
+
* nested field is still refused.
|
|
56949
|
+
*/
|
|
56950
|
+
function stateFieldOf({ fields, state }, path, mode) {
|
|
56951
|
+
if (!path.includes(".")) return fields.get(path);
|
|
56952
|
+
if (mode !== "replace") return "nested";
|
|
56953
|
+
return describeStateField(state, path) ?? void 0;
|
|
56954
|
+
}
|
|
56955
|
+
function planTopLevelField(cap, field, mode, lookupCap) {
|
|
56956
|
+
const { def } = cap;
|
|
56391
56957
|
const { featureIndex, path, source } = field;
|
|
56392
56958
|
const fieldAt = `features[${featureIndex}].fields.${path}`;
|
|
56393
|
-
|
|
56394
|
-
|
|
56959
|
+
const tf = stateFieldOf(cap, path, mode);
|
|
56960
|
+
if (tf === "nested") return refused(problem("nested-field", fieldAt, `\`${path}\` is nested — a nested field is planned only on a declared replace (D1034)`));
|
|
56395
56961
|
if (tf === void 0) return refused(problem("unknown-field", fieldAt, `\`${def.name}\` has no field \`${path}\``));
|
|
56962
|
+
if (tf.kind === "union") return refused(unionTargetProblem(def.name, path, fieldAt));
|
|
56396
56963
|
const kinds = sourceKinds(source, lookupCap);
|
|
56397
56964
|
if (!kinds.ok) return refused(problem(kinds.code, fieldAt, kinds.message));
|
|
56398
56965
|
const role = roleOf(source);
|
|
@@ -56413,7 +56980,7 @@ function planTopLevelField({ def, fields }, field, mode, lookupCap) {
|
|
|
56413
56980
|
};
|
|
56414
56981
|
const enumProblem = enumLiteralProblem(def.name, tf, source, fieldAt);
|
|
56415
56982
|
return {
|
|
56416
|
-
problems: [...compatibility(def.name, tf, kinds.kinds, fieldAt), ...enumProblem === null ? [] : [enumProblem]],
|
|
56983
|
+
problems: [...compatibility(def.name, tf, narrowUnionRead(source, tf, kinds.kinds, lookupCap), fieldAt), ...enumProblem === null ? [] : [enumProblem]],
|
|
56417
56984
|
fields: [plan],
|
|
56418
56985
|
features: [],
|
|
56419
56986
|
events: []
|
|
@@ -56516,7 +57083,7 @@ var customizeCatalog = CAP_CUSTOMIZE_CATALOG;
|
|
|
56516
57083
|
function overridesOnlyDeclared(feature) {
|
|
56517
57084
|
const entry = customizeCatalog[feature.cap];
|
|
56518
57085
|
const allowed = new Set((entry?.overridable ?? []).flatMap((o) => {
|
|
56519
|
-
const companions = ((entry?.targets.find((t) => t.id === o.by && t.path === o.path))?.companions ?? []).filter((c) => c.kind === "transition-time" || c.when === "always");
|
|
57086
|
+
const companions = ((entry?.targets.find((t) => t.id === o.by && t.path === o.path))?.companions ?? []).filter((c) => c.kind === "transition-time" || c.kind === "source-field" || c.when === "always");
|
|
56520
57087
|
return [o.path, ...companions.map((c) => c.path)];
|
|
56521
57088
|
}));
|
|
56522
57089
|
const paths = Object.keys(feature.fields);
|
|
@@ -56587,6 +57154,20 @@ function compositionSourceRefs(composition) {
|
|
|
56587
57154
|
return [...new Map([...refs, ...forwardSourceRefs(composition)].map((r) => [compositionSourceKey(r), r])).values()];
|
|
56588
57155
|
}
|
|
56589
57156
|
/**
|
|
57157
|
+
* Every DIRECT read (`from`) of a union source field (D1034): the reads whose
|
|
57158
|
+
* source's live kind a save looks up, so a numeric control is never linked to
|
|
57159
|
+
* a string field. A read inside an expression is judged by the expression.
|
|
57160
|
+
*/
|
|
57161
|
+
function compositionUnionReads(composition, lookupCap) {
|
|
57162
|
+
return composition.features.flatMap((f) => compositionFeatureEnabled(f) && f.kind === "fields" ? featureSources(f).flatMap((source) => {
|
|
57163
|
+
if (source.kind !== "from") return [];
|
|
57164
|
+
const def = lookupCap(source.cap);
|
|
57165
|
+
const schema = def?.runtimeState ?? def?.status?.schema;
|
|
57166
|
+
if (schema === void 0) return [];
|
|
57167
|
+
return describeStateField(schema, source.fieldPath)?.kind === "union" ? [source] : [];
|
|
57168
|
+
}) : []);
|
|
57169
|
+
}
|
|
57170
|
+
/**
|
|
56590
57171
|
* The candidate's device: the existing target itself, else `self`, else a
|
|
56591
57172
|
* placeholder that cannot collide with a stored target. An existing target is
|
|
56592
57173
|
* known even on create, so a second customization of it is refused on create too.
|
|
@@ -56620,6 +57201,18 @@ function selfReadProblems(read, at, fields, self) {
|
|
|
56620
57201
|
if (isNativeCap(self.native, read.cap)) return [];
|
|
56621
57202
|
return [problem("source-capability-missing", at, `the target device (device ${self.native.deviceId}) has no native \`${read.cap}\``)];
|
|
56622
57203
|
}
|
|
57204
|
+
/**
|
|
57205
|
+
* A direct read of a union field is judged by the source's LIVE kind when the
|
|
57206
|
+
* save knew it (D1034): a numeric control feeds only a number field, a select
|
|
57207
|
+
* only a string or enum one.
|
|
57208
|
+
*/
|
|
57209
|
+
function liveKindProblems(field, read, desc, at) {
|
|
57210
|
+
if (field.source.kind !== "from") return [];
|
|
57211
|
+
const live = desc.liveKinds?.get(`${read.cap}.${read.fieldPath}`);
|
|
57212
|
+
const accepted = field.kind === "enum" ? "string" : field.kind;
|
|
57213
|
+
if (live === void 0 || live === accepted) return [];
|
|
57214
|
+
return [problem("source-kind-mismatch", at, `\`${read.cap}.${read.fieldPath}\` of device ${desc.deviceId} reads a ${live} now; \`${field.cap}.${field.path}\` takes a ${accepted}`)];
|
|
57215
|
+
}
|
|
56623
57216
|
function sourceProblems(fields, ctx, self) {
|
|
56624
57217
|
const selfKey = compositionSourceKey(self.ref);
|
|
56625
57218
|
return fields.flatMap((field) => field.reads.flatMap((read) => {
|
|
@@ -56630,7 +57223,7 @@ function sourceProblems(fields, ctx, self) {
|
|
|
56630
57223
|
if (desc === void 0 || desc.kind === "unreadable") return [problem("source-unreadable", at, `could not read source \`${key}\` (${desc === void 0 ? "it was not read" : desc.error}) — the save is refused rather than stored unchecked`)];
|
|
56631
57224
|
if (desc.kind === "absent") return [problem("source-missing", at, `source \`${key}\` does not exist`)];
|
|
56632
57225
|
if (!desc.caps.has(read.cap)) return [problem("source-capability-missing", at, `source \`${key}\` (device ${desc.deviceId}) has no \`${read.cap}\``)];
|
|
56633
|
-
return
|
|
57226
|
+
return liveKindProblems(field, read, desc, at);
|
|
56634
57227
|
}));
|
|
56635
57228
|
}
|
|
56636
57229
|
/**
|
|
@@ -56722,7 +57315,8 @@ function validateComposition(composition, ctx) {
|
|
|
56722
57315
|
...sourceProblems(plan.fields, ctx, self),
|
|
56723
57316
|
...forwardSourceProblems(composition, ctx.sources),
|
|
56724
57317
|
...cycles,
|
|
56725
|
-
...helperSaveProblems(composition, facts)
|
|
57318
|
+
...helperSaveProblems(composition, facts),
|
|
57319
|
+
...powerSourceActuatorConflicts(composition).map((c) => problem("power-source-is-actuator", c.path, `the power source \`${c.switch.stableId}\` is one of this device's own switches — pick the plug that feeds it`))
|
|
56726
57320
|
];
|
|
56727
57321
|
return {
|
|
56728
57322
|
ok: problems.length === 0,
|
|
@@ -56782,13 +57376,13 @@ function describeComposableCaps(defs, deviceType) {
|
|
|
56782
57376
|
const itemArray = def.status?.itemArray;
|
|
56783
57377
|
return {
|
|
56784
57378
|
cap: def.name,
|
|
56785
|
-
fields: fields.
|
|
57379
|
+
fields: fields.flatMap((f) => f.kind === "union" ? [] : [{
|
|
56786
57380
|
path: f.path,
|
|
56787
57381
|
kind: f.kind,
|
|
56788
57382
|
nullable: f.nullable,
|
|
56789
57383
|
required: f.required,
|
|
56790
57384
|
...f.enumValues === void 0 ? {} : { enumValues: [...f.enumValues] }
|
|
56791
|
-
})
|
|
57385
|
+
}]),
|
|
56792
57386
|
...itemArray === void 0 ? {} : { itemArray: {
|
|
56793
57387
|
path: itemArray.path,
|
|
56794
57388
|
keyField: itemArray.keyField
|
|
@@ -60220,8 +60814,14 @@ var deviceManagerCapability = {
|
|
|
60220
60814
|
"string",
|
|
60221
60815
|
"number",
|
|
60222
60816
|
"boolean",
|
|
60223
|
-
"enum"
|
|
60817
|
+
"enum",
|
|
60818
|
+
"union"
|
|
60224
60819
|
]),
|
|
60820
|
+
unionMembers: zod.z.array(zod.z.enum([
|
|
60821
|
+
"string",
|
|
60822
|
+
"number",
|
|
60823
|
+
"boolean"
|
|
60824
|
+
])).optional(),
|
|
60225
60825
|
enumValues: zod.z.array(zod.z.string()).optional(),
|
|
60226
60826
|
item: zod.z.boolean().optional(),
|
|
60227
60827
|
quantity: ReadingQuantitySchema.optional()
|
|
@@ -63780,8 +64380,87 @@ list: method(zod.z.void(), zod.z.array(FailureContributionSchema).readonly()) },
|
|
|
63780
64380
|
* - `FanPreset` — preset selector
|
|
63781
64381
|
* - `FanDirection` — direction toggle (ceiling fans)
|
|
63782
64382
|
* - `FanOscillating` — oscillation toggle
|
|
64383
|
+
*
|
|
64384
|
+
* Per-axis oscillation (`oscillationAxes`, `setOscillationAxis`, D1034): an air
|
|
64385
|
+
* circulator sweeps horizontally and vertically, each axis with its own
|
|
64386
|
+
* switch, fixed angle, sweep bounds and limits. A provider may report them
|
|
64387
|
+
* natively; otherwise the OPERATOR links sibling devices to each field in
|
|
64388
|
+
* Customize (a `replace` over the fields listed in `overridable` — nothing is
|
|
64389
|
+
* linked or inferred by itself), and a write to a linked field is forwarded to
|
|
64390
|
+
* its source. `oscillating` stays the single summary flag: when axes exist it
|
|
64391
|
+
* means "any axis oscillates" (`anyAxisOscillating`).
|
|
63783
64392
|
*/
|
|
63784
64393
|
var FanDirectionSchema = zod.z.enum(["forward", "reverse"]);
|
|
64394
|
+
var FAN_OSCILLATION_AXES = ["horizontal", "vertical"];
|
|
64395
|
+
var FanOscillationAxisNameSchema = zod.z.enum(FAN_OSCILLATION_AXES);
|
|
64396
|
+
/** The fields of one axis a caller may set. */
|
|
64397
|
+
var FAN_OSCILLATION_AXIS_SETTABLE = [
|
|
64398
|
+
"oscillating",
|
|
64399
|
+
"angle",
|
|
64400
|
+
"sweepFrom",
|
|
64401
|
+
"sweepTo"
|
|
64402
|
+
];
|
|
64403
|
+
var FanOscillationAxisFieldSchema = zod.z.enum(FAN_OSCILLATION_AXIS_SETTABLE);
|
|
64404
|
+
/** The limits of one axis, read from the source that serves its angle. */
|
|
64405
|
+
var FAN_OSCILLATION_AXIS_LIMITS = [
|
|
64406
|
+
"min",
|
|
64407
|
+
"max",
|
|
64408
|
+
"step"
|
|
64409
|
+
];
|
|
64410
|
+
/**
|
|
64411
|
+
* One oscillation axis. Every reading the device has not reported is `null`,
|
|
64412
|
+
* never `0` (D393): `0°` is a real position. Each leaf defaults to `null`, so
|
|
64413
|
+
* a slice that names only the leaves it knows (a Customize link of one field)
|
|
64414
|
+
* is still a whole axis.
|
|
64415
|
+
*/
|
|
64416
|
+
var FanOscillationAxisSchema = zod.z.object({
|
|
64417
|
+
/** Whether the axis sweeps. */
|
|
64418
|
+
oscillating: zod.z.boolean().nullable().default(null),
|
|
64419
|
+
/** The fixed position (degrees) the axis holds when it does not sweep. */
|
|
64420
|
+
angle: zod.z.number().nullable().default(null),
|
|
64421
|
+
/** The sweep bounds (degrees): left → right, bottom → top. */
|
|
64422
|
+
sweepFrom: zod.z.number().nullable().default(null),
|
|
64423
|
+
sweepTo: zod.z.number().nullable().default(null),
|
|
64424
|
+
/** The angles the axis accepts. Null when the device states none. */
|
|
64425
|
+
min: zod.z.number().nullable().default(null),
|
|
64426
|
+
max: zod.z.number().nullable().default(null),
|
|
64427
|
+
step: zod.z.number().nullable().default(null)
|
|
64428
|
+
});
|
|
64429
|
+
/** Both axes; an axis the device does not have is `null`. */
|
|
64430
|
+
var FanOscillationAxesSchema = zod.z.object({
|
|
64431
|
+
horizontal: FanOscillationAxisSchema.nullable().default(null),
|
|
64432
|
+
vertical: FanOscillationAxisSchema.nullable().default(null)
|
|
64433
|
+
});
|
|
64434
|
+
var FanOscillationAxisRefusalSchema = zod.z.enum([
|
|
64435
|
+
"nothing-to-set",
|
|
64436
|
+
"axis-not-linked",
|
|
64437
|
+
"out-of-range",
|
|
64438
|
+
"source-gone",
|
|
64439
|
+
"source-unknown",
|
|
64440
|
+
"source-call-failed"
|
|
64441
|
+
]);
|
|
64442
|
+
var FanOscillationAxisResultSchema = zod.z.discriminatedUnion("status", [zod.z.object({ status: zod.z.literal("applied") }), zod.z.object({
|
|
64443
|
+
status: zod.z.literal("refused"),
|
|
64444
|
+
reason: FanOscillationAxisRefusalSchema,
|
|
64445
|
+
/** The field at fault, when one is. */
|
|
64446
|
+
field: FanOscillationAxisFieldSchema.optional(),
|
|
64447
|
+
/** One line for the operator, naming the axis, the field and the source. */
|
|
64448
|
+
detail: zod.z.string(),
|
|
64449
|
+
/** Fields that DID land before the refusal (writes run in order, stop at the first failure). */
|
|
64450
|
+
applied: zod.z.array(FanOscillationAxisFieldSchema)
|
|
64451
|
+
})]);
|
|
64452
|
+
var SetOscillationAxisInputSchema = zod.z.object({
|
|
64453
|
+
deviceId: zod.z.number().int().nonnegative(),
|
|
64454
|
+
axis: FanOscillationAxisNameSchema,
|
|
64455
|
+
oscillating: zod.z.boolean().optional(),
|
|
64456
|
+
angle: zod.z.number().optional(),
|
|
64457
|
+
sweepFrom: zod.z.number().optional(),
|
|
64458
|
+
sweepTo: zod.z.number().optional()
|
|
64459
|
+
});
|
|
64460
|
+
/** The state path of one axis field: `oscillationAxes.<axis>.<field>`. */
|
|
64461
|
+
function fanAxisPath(axis, field) {
|
|
64462
|
+
return `oscillationAxes.${axis}.${field}`;
|
|
64463
|
+
}
|
|
63785
64464
|
var FanControlStatusSchema = zod.z.object({
|
|
63786
64465
|
/** Active speed as 0..100 inclusive. Null when the device has no
|
|
63787
64466
|
* speed surface (single-speed fan). */
|
|
@@ -63800,9 +64479,102 @@ var FanControlStatusSchema = zod.z.object({
|
|
|
63800
64479
|
/** Oscillation toggle. Null when the device has no oscillation
|
|
63801
64480
|
* surface. */
|
|
63802
64481
|
oscillating: zod.z.boolean().nullable(),
|
|
64482
|
+
/**
|
|
64483
|
+
* Per-axis oscillation (air circulators). Absent when the device has no
|
|
64484
|
+
* per-axis surface and nothing is linked in Customize.
|
|
64485
|
+
*/
|
|
64486
|
+
oscillationAxes: FanOscillationAxesSchema.optional(),
|
|
63803
64487
|
/** Ms epoch when the slice was last updated. */
|
|
63804
64488
|
lastChangedAt: zod.z.number()
|
|
63805
64489
|
});
|
|
64490
|
+
var FAN_CUSTOMIZE_DEVICE_TYPES = [DeviceType.Fan];
|
|
64491
|
+
/** The Customize section the axis targets are listed under. */
|
|
64492
|
+
var AXES_SECTION = "oscillation-axes";
|
|
64493
|
+
function axisOscillatingTarget(axis) {
|
|
64494
|
+
return {
|
|
64495
|
+
id: `${axis}-oscillating`,
|
|
64496
|
+
cardinality: "scalar",
|
|
64497
|
+
vocabulary: {
|
|
64498
|
+
cap: "fan-control",
|
|
64499
|
+
stateField: "oscillating"
|
|
64500
|
+
},
|
|
64501
|
+
deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
|
|
64502
|
+
apply: "replace",
|
|
64503
|
+
section: AXES_SECTION,
|
|
64504
|
+
path: fanAxisPath(axis, "oscillating"),
|
|
64505
|
+
sources: [{
|
|
64506
|
+
kind: "switch",
|
|
64507
|
+
transforms: [{ kind: "identity" }]
|
|
64508
|
+
}],
|
|
64509
|
+
sourceReport: { status: "assignment-status" }
|
|
64510
|
+
};
|
|
64511
|
+
}
|
|
64512
|
+
/**
|
|
64513
|
+
* A numeric axis field. The `angle` link also carries the axis limits, read
|
|
64514
|
+
* from the SAME linked control's own range (`min`/`max`/`step`), so the limits
|
|
64515
|
+
* are the source's, never guessed.
|
|
64516
|
+
*/
|
|
64517
|
+
function axisNumericTarget(axis, field) {
|
|
64518
|
+
const base = {
|
|
64519
|
+
id: `${axis}-${field}`,
|
|
64520
|
+
cardinality: "scalar",
|
|
64521
|
+
vocabulary: { cap: "fan-control" },
|
|
64522
|
+
deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
|
|
64523
|
+
apply: "replace",
|
|
64524
|
+
section: AXES_SECTION,
|
|
64525
|
+
path: fanAxisPath(axis, field),
|
|
64526
|
+
sources: [{
|
|
64527
|
+
kind: "numeric",
|
|
64528
|
+
transforms: [{ kind: "identity" }]
|
|
64529
|
+
}],
|
|
64530
|
+
sourceReport: { status: "assignment-status" }
|
|
64531
|
+
};
|
|
64532
|
+
if (field !== "angle") return base;
|
|
64533
|
+
return {
|
|
64534
|
+
...base,
|
|
64535
|
+
companions: FAN_OSCILLATION_AXIS_LIMITS.map((limit) => ({
|
|
64536
|
+
kind: "source-field",
|
|
64537
|
+
path: fanAxisPath(axis, limit),
|
|
64538
|
+
field: limit
|
|
64539
|
+
}))
|
|
64540
|
+
};
|
|
64541
|
+
}
|
|
64542
|
+
var AXIS_TARGETS = FAN_OSCILLATION_AXES.flatMap((axis) => [
|
|
64543
|
+
axisOscillatingTarget(axis),
|
|
64544
|
+
axisNumericTarget(axis, "angle"),
|
|
64545
|
+
axisNumericTarget(axis, "sweepFrom"),
|
|
64546
|
+
axisNumericTarget(axis, "sweepTo")
|
|
64547
|
+
]);
|
|
64548
|
+
/** A select (an enum control) the operator links to the fan's `preset`. */
|
|
64549
|
+
var PRESET_TARGET = {
|
|
64550
|
+
id: "preset",
|
|
64551
|
+
cardinality: "scalar",
|
|
64552
|
+
vocabulary: { cap: "fan-control" },
|
|
64553
|
+
deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
|
|
64554
|
+
apply: "replace",
|
|
64555
|
+
path: "preset",
|
|
64556
|
+
sources: [{
|
|
64557
|
+
kind: "field",
|
|
64558
|
+
valueKinds: ["string"],
|
|
64559
|
+
transforms: [{ kind: "identity" }]
|
|
64560
|
+
}],
|
|
64561
|
+
sourceReport: { status: "assignment-status" }
|
|
64562
|
+
};
|
|
64563
|
+
var FAN_CONTROL_TARGETS = [...AXIS_TARGETS, PRESET_TARGET];
|
|
64564
|
+
/**
|
|
64565
|
+
* Customize (D1034): the fan already serves `fan-control` natively, so every
|
|
64566
|
+
* target is a `replace` over a field listed in `overridable` — the axis leaves
|
|
64567
|
+
* and `preset`, nothing else. Nothing is pre-linked: the operator picks each
|
|
64568
|
+
* source (D356).
|
|
64569
|
+
*/
|
|
64570
|
+
var fanControlCustomize = {
|
|
64571
|
+
version: 1,
|
|
64572
|
+
overridable: FAN_CONTROL_TARGETS.map((target) => ({
|
|
64573
|
+
path: target.path,
|
|
64574
|
+
by: target.id
|
|
64575
|
+
})),
|
|
64576
|
+
targets: FAN_CONTROL_TARGETS
|
|
64577
|
+
};
|
|
63806
64578
|
var fanControlCapability = {
|
|
63807
64579
|
name: "fan-control",
|
|
63808
64580
|
scope: "device",
|
|
@@ -63837,6 +64609,18 @@ var fanControlCapability = {
|
|
|
63837
64609
|
}), zod.z.void(), {
|
|
63838
64610
|
kind: "mutation",
|
|
63839
64611
|
auth: "protected"
|
|
64612
|
+
}),
|
|
64613
|
+
/**
|
|
64614
|
+
* Sets one oscillation axis: its switch, fixed angle and/or sweep bounds.
|
|
64615
|
+
* Fields left out are untouched. A field linked in Customize is forwarded
|
|
64616
|
+
* to its linked source (D1034); otherwise the native provider serves it;
|
|
64617
|
+
* neither → `axis-not-linked`. Ranges are checked against the axis limits
|
|
64618
|
+
* before anything is written; writes run in order and stop at the first
|
|
64619
|
+
* failure, which the result names.
|
|
64620
|
+
*/
|
|
64621
|
+
setOscillationAxis: optionalMethod(SetOscillationAxisInputSchema, FanOscillationAxisResultSchema, {
|
|
64622
|
+
kind: "mutation",
|
|
64623
|
+
auth: "protected"
|
|
63840
64624
|
})
|
|
63841
64625
|
},
|
|
63842
64626
|
status: {
|
|
@@ -63848,6 +64632,7 @@ var fanControlCapability = {
|
|
|
63848
64632
|
* sliders read `speed` for live updates.
|
|
63849
64633
|
*/
|
|
63850
64634
|
runtimeState: FanControlStatusSchema,
|
|
64635
|
+
customize: fanControlCustomize,
|
|
63851
64636
|
/**
|
|
63852
64637
|
* Runtime-state durability: **session** — as `brightness`.
|
|
63853
64638
|
*
|
|
@@ -63867,16 +64652,33 @@ var fanControlCapability = {
|
|
|
63867
64652
|
oscillating: { kind: "boolean" }
|
|
63868
64653
|
} }
|
|
63869
64654
|
};
|
|
64655
|
+
/** One axis as a preset wants it; an absent field is left as it is. */
|
|
64656
|
+
var FanPresetAxisSchema = zod.z.object({
|
|
64657
|
+
oscillating: zod.z.boolean().optional(),
|
|
64658
|
+
angle: zod.z.number().optional(),
|
|
64659
|
+
sweepFrom: zod.z.number().optional(),
|
|
64660
|
+
sweepTo: zod.z.number().optional()
|
|
64661
|
+
});
|
|
64662
|
+
/** The fan-control state a preset sets; an absent field is left as it is. */
|
|
64663
|
+
var FanPresetStateSchema = zod.z.object({
|
|
64664
|
+
speed: zod.z.number().min(0).max(100).optional(),
|
|
64665
|
+
/** The fan's own preset mode (or the linked select's option). */
|
|
64666
|
+
preset: zod.z.string().min(1).optional(),
|
|
64667
|
+
direction: FanDirectionSchema.optional(),
|
|
64668
|
+
oscillationAxes: zod.z.object({
|
|
64669
|
+
horizontal: FanPresetAxisSchema.optional(),
|
|
64670
|
+
vertical: FanPresetAxisSchema.optional()
|
|
64671
|
+
}).optional()
|
|
64672
|
+
});
|
|
63870
64673
|
var FanPresetSchema = zod.z.object({
|
|
63871
64674
|
/** Stable key; never reused after a delete within one device's list. */
|
|
63872
64675
|
id: zod.z.string().min(1).max(64),
|
|
63873
64676
|
/** What the operator and a voice assistant call it. */
|
|
63874
64677
|
name: zod.z.string().trim().min(1).max(40),
|
|
63875
|
-
|
|
64678
|
+
state: FanPresetStateSchema
|
|
63876
64679
|
});
|
|
63877
64680
|
var FanPresetsRefusalSchema = zod.z.enum([
|
|
63878
|
-
"
|
|
63879
|
-
"bad-target",
|
|
64681
|
+
"empty-state",
|
|
63880
64682
|
"duplicate-name",
|
|
63881
64683
|
"duplicate-id",
|
|
63882
64684
|
"too-many",
|
|
@@ -63888,64 +64690,50 @@ var FanPresetsSetResultSchema = zod.z.discriminatedUnion("status", [zod.z.object
|
|
|
63888
64690
|
}), zod.z.object({
|
|
63889
64691
|
status: zod.z.literal("refused"),
|
|
63890
64692
|
reason: FanPresetsRefusalSchema,
|
|
63891
|
-
/** Names the preset
|
|
64693
|
+
/** Names the preset at fault. */
|
|
63892
64694
|
detail: zod.z.string()
|
|
63893
64695
|
})]);
|
|
63894
|
-
var
|
|
63895
|
-
|
|
64696
|
+
var FanPresetFieldResultSchema = zod.z.object({
|
|
64697
|
+
/** The state path: `speed`, `preset`, `direction`, `oscillationAxes.horizontal.angle`. */
|
|
64698
|
+
field: zod.z.string(),
|
|
63896
64699
|
outcome: zod.z.enum([
|
|
63897
64700
|
"applied",
|
|
63898
64701
|
"failed",
|
|
63899
64702
|
"not-run",
|
|
63900
64703
|
"refused"
|
|
63901
64704
|
]),
|
|
63902
|
-
deviceId: zod.z.number().int().nonnegative().optional(),
|
|
63903
|
-
cap: zod.z.string().optional(),
|
|
63904
|
-
method: zod.z.string().optional(),
|
|
63905
64705
|
/** The cause, for every outcome but `applied`. */
|
|
63906
64706
|
message: zod.z.string().optional()
|
|
63907
64707
|
});
|
|
63908
64708
|
var FanPresetApplyResultSchema = zod.z.object({
|
|
63909
|
-
/** `applied`: every
|
|
64709
|
+
/** `applied`: every field landed. `partial`: some did, one did not. `refused`: nothing ran. */
|
|
63910
64710
|
status: zod.z.enum([
|
|
63911
64711
|
"applied",
|
|
63912
64712
|
"partial",
|
|
63913
64713
|
"refused"
|
|
63914
64714
|
]),
|
|
63915
|
-
|
|
64715
|
+
fields: zod.z.array(FanPresetFieldResultSchema)
|
|
63916
64716
|
});
|
|
63917
|
-
/** The fan
|
|
64717
|
+
/** The fan-control fields a capture may take. */
|
|
63918
64718
|
var FAN_CAPTURE_FIELDS = [
|
|
63919
64719
|
"speed",
|
|
63920
|
-
"oscillating",
|
|
63921
64720
|
"direction",
|
|
63922
|
-
"preset"
|
|
64721
|
+
"preset",
|
|
64722
|
+
"oscillationAxes"
|
|
63923
64723
|
];
|
|
63924
64724
|
var FanCaptureFieldSchema = zod.z.enum(FAN_CAPTURE_FIELDS);
|
|
63925
64725
|
var FanCaptureOmissionSchema = zod.z.object({
|
|
63926
|
-
/** A
|
|
64726
|
+
/** A state path (`speed`, `oscillationAxes.vertical.angle`). */
|
|
63927
64727
|
what: zod.z.string(),
|
|
63928
|
-
/** Why no value was taken: unknown reading
|
|
64728
|
+
/** Why no value was taken: an unknown reading is never stored as 0 (D393). */
|
|
63929
64729
|
reason: zod.z.string()
|
|
63930
64730
|
});
|
|
63931
|
-
var FanCaptureGroupSchema = zod.z.enum([
|
|
63932
|
-
"fan",
|
|
63933
|
-
"oscillation",
|
|
63934
|
-
"angles"
|
|
63935
|
-
]);
|
|
63936
|
-
var FanCaptureItemSchema = zod.z.object({
|
|
63937
|
-
group: FanCaptureGroupSchema,
|
|
63938
|
-
/** What the step sets, in the operator's words (a device name, a fan field). */
|
|
63939
|
-
label: zod.z.string()
|
|
63940
|
-
});
|
|
63941
64731
|
var FanPresetCaptureResultSchema = zod.z.object({
|
|
63942
|
-
/** The
|
|
63943
|
-
|
|
63944
|
-
/** One entry per step, same order: its review group and label. */
|
|
63945
|
-
items: zod.z.array(FanCaptureItemSchema),
|
|
64732
|
+
/** The fan's CURRENT fan-control state, as a preset; NOT saved. */
|
|
64733
|
+
state: FanPresetStateSchema,
|
|
63946
64734
|
omitted: zod.z.array(FanCaptureOmissionSchema)
|
|
63947
64735
|
});
|
|
63948
|
-
var deviceInput$
|
|
64736
|
+
var deviceInput$1 = zod.z.object({ deviceId: zod.z.number().int().nonnegative() });
|
|
63949
64737
|
var fanPresetsCustomize = {
|
|
63950
64738
|
version: 1,
|
|
63951
64739
|
targets: [{
|
|
@@ -63963,28 +64751,22 @@ var fanPresetsCapability = {
|
|
|
63963
64751
|
scope: "system",
|
|
63964
64752
|
mode: "singleton",
|
|
63965
64753
|
methods: {
|
|
63966
|
-
getPresets: method(deviceInput$
|
|
63967
|
-
setPresets: method(deviceInput$
|
|
64754
|
+
getPresets: method(deviceInput$1, zod.z.array(FanPresetSchema), { auth: "protected" }),
|
|
64755
|
+
setPresets: method(deviceInput$1.extend({ presets: zod.z.array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
|
|
63968
64756
|
kind: "mutation",
|
|
63969
64757
|
auth: "admin"
|
|
63970
64758
|
}),
|
|
63971
|
-
applyPreset: method(deviceInput$
|
|
64759
|
+
applyPreset: method(deviceInput$1.extend({ presetId: zod.z.string().min(1) }), FanPresetApplyResultSchema, {
|
|
63972
64760
|
kind: "mutation",
|
|
63973
64761
|
auth: "protected"
|
|
63974
64762
|
}),
|
|
63975
64763
|
/**
|
|
63976
|
-
*
|
|
63977
|
-
* `fields` (all when absent)
|
|
63978
|
-
*
|
|
63979
|
-
*
|
|
63980
|
-
* oscillation, fixed angles, fan fields, speed last. A reading that is
|
|
63981
|
-
* unknown is left out and named in `omitted`, never captured as 0. Nothing
|
|
63982
|
-
* is saved.
|
|
64764
|
+
* The fan's CURRENT fan-control state as a preset: the fields named in
|
|
64765
|
+
* `fields` (all when absent), read from its merged slice — a field linked
|
|
64766
|
+
* in Customize reads its link. A reading that is unknown is left out and
|
|
64767
|
+
* named in `omitted`, never captured as 0. Nothing is saved.
|
|
63983
64768
|
*/
|
|
63984
|
-
capturePreset: method(deviceInput$
|
|
63985
|
-
fields: zod.z.array(FanCaptureFieldSchema).optional(),
|
|
63986
|
-
steps: zod.z.array(ActionStepSchema).max(20).default([])
|
|
63987
|
-
}), FanPresetCaptureResultSchema, { auth: "protected" })
|
|
64769
|
+
capturePreset: method(deviceInput$1.extend({ fields: zod.z.array(FanCaptureFieldSchema).optional() }), FanPresetCaptureResultSchema, { auth: "protected" })
|
|
63988
64770
|
},
|
|
63989
64771
|
customize: fanPresetsCustomize
|
|
63990
64772
|
};
|
|
@@ -64212,8 +64994,7 @@ var groupActiveCapability = {
|
|
|
64212
64994
|
DeviceType.Valve,
|
|
64213
64995
|
DeviceType.Lock,
|
|
64214
64996
|
DeviceType.MediaPlayer,
|
|
64215
|
-
DeviceType.Climate
|
|
64216
|
-
DeviceType.Thermostat
|
|
64997
|
+
DeviceType.Climate
|
|
64217
64998
|
],
|
|
64218
64999
|
methods: {},
|
|
64219
65000
|
status: {
|
|
@@ -64262,7 +65043,6 @@ var groupCommandsCapability = {
|
|
|
64262
65043
|
DeviceType.Valve,
|
|
64263
65044
|
DeviceType.Lock,
|
|
64264
65045
|
DeviceType.MediaPlayer,
|
|
64265
|
-
DeviceType.Thermostat,
|
|
64266
65046
|
DeviceType.Climate
|
|
64267
65047
|
],
|
|
64268
65048
|
methods: {},
|
|
@@ -64318,7 +65098,6 @@ var groupStatusCapability = {
|
|
|
64318
65098
|
DeviceType.Valve,
|
|
64319
65099
|
DeviceType.Lock,
|
|
64320
65100
|
DeviceType.MediaPlayer,
|
|
64321
|
-
DeviceType.Thermostat,
|
|
64322
65101
|
DeviceType.Climate
|
|
64323
65102
|
],
|
|
64324
65103
|
methods: {},
|
|
@@ -64674,7 +65453,7 @@ var heatingValveCapability = {
|
|
|
64674
65453
|
scope: "device",
|
|
64675
65454
|
deviceNative: true,
|
|
64676
65455
|
mode: "singleton",
|
|
64677
|
-
deviceTypes: [DeviceType.
|
|
65456
|
+
deviceTypes: [DeviceType.Climate],
|
|
64678
65457
|
methods: {},
|
|
64679
65458
|
status: {
|
|
64680
65459
|
schema: HeatingValveStatusSchema,
|
|
@@ -64704,29 +65483,41 @@ var heatingValveCapability = {
|
|
|
64704
65483
|
* retried in a loop - D49); a future one is re-armed.
|
|
64705
65484
|
*
|
|
64706
65485
|
* What a device may be run for, and for how long at most, is per device type
|
|
64707
|
-
* ({@link
|
|
65486
|
+
* and role ({@link timedRunLimitOf}): the maximum is a safety bound, not a preference,
|
|
64708
65487
|
* so a request above it is REFUSED with a typed reason, never clamped.
|
|
64709
65488
|
*/
|
|
64710
65489
|
var TimedRunUnitSchema = zod.z.enum(["s", "min"]);
|
|
64711
65490
|
zod.z.enum(["switch", "pet-fountain"]);
|
|
64712
|
-
/**
|
|
64713
|
-
var
|
|
64714
|
-
|
|
64715
|
-
|
|
64716
|
-
|
|
64717
|
-
|
|
64718
|
-
quickRunDefault: 30
|
|
64719
|
-
},
|
|
64720
|
-
[DeviceType.PetFountain]: {
|
|
64721
|
-
actuator: "pet-fountain",
|
|
64722
|
-
maxSeconds: 300,
|
|
64723
|
-
unit: "s",
|
|
64724
|
-
quickRunDefault: 60
|
|
64725
|
-
}
|
|
65491
|
+
/** A plug-in heater (switch + `switch-heater`): up to 3 h, in minutes. */
|
|
65492
|
+
var TIMED_RUN_HEATER_LIMIT = {
|
|
65493
|
+
actuator: "switch",
|
|
65494
|
+
maxSeconds: 10800,
|
|
65495
|
+
unit: "min",
|
|
65496
|
+
quickRunDefault: 30
|
|
64726
65497
|
};
|
|
64727
|
-
|
|
64728
|
-
|
|
64729
|
-
|
|
65498
|
+
/** A pet fountain's pump: up to 5 min, in seconds. */
|
|
65499
|
+
var TIMED_RUN_PET_FOUNTAIN_LIMIT = {
|
|
65500
|
+
actuator: "pet-fountain",
|
|
65501
|
+
maxSeconds: 300,
|
|
65502
|
+
unit: "s",
|
|
65503
|
+
quickRunDefault: 60
|
|
65504
|
+
};
|
|
65505
|
+
/**
|
|
65506
|
+
* The device types `timed-run` may be offered on. A `switch` is narrowed by
|
|
65507
|
+
* role ({@link TIMED_RUN_DEVICE_ROLES}): only a plug-in heater runs on a timer.
|
|
65508
|
+
*/
|
|
65509
|
+
var TIMED_RUN_DEVICE_TYPES = [DeviceType.Switch, DeviceType.PetFountain];
|
|
65510
|
+
/** The roles that make a device of these types timed-run-able (D1033). */
|
|
65511
|
+
var TIMED_RUN_DEVICE_ROLES = { [DeviceType.Switch]: [DeviceRole.SwitchHeater] };
|
|
65512
|
+
/**
|
|
65513
|
+
* The longest run of a device, by its type AND role (D1033): a `switch` is a
|
|
65514
|
+
* heater only with role `switch-heater`, a pet fountain always is what it is.
|
|
65515
|
+
* `null` - the device is not offered `timed-run`.
|
|
65516
|
+
*/
|
|
65517
|
+
function timedRunLimitOf(deviceType, role) {
|
|
65518
|
+
if (deviceType === DeviceType.PetFountain) return TIMED_RUN_PET_FOUNTAIN_LIMIT;
|
|
65519
|
+
if (deviceType === DeviceType.Switch && role === DeviceRole.SwitchHeater) return TIMED_RUN_HEATER_LIMIT;
|
|
65520
|
+
return null;
|
|
64730
65521
|
}
|
|
64731
65522
|
var MS_PER_SECOND = 1e3;
|
|
64732
65523
|
var MS_PER_MINUTE = 6e4;
|
|
@@ -64808,6 +65599,7 @@ var timedRunCapability = {
|
|
|
64808
65599
|
kind: "wrapper",
|
|
64809
65600
|
defaultActive: true,
|
|
64810
65601
|
deviceTypes: TIMED_RUN_DEVICE_TYPES,
|
|
65602
|
+
deviceRoles: TIMED_RUN_DEVICE_ROLES,
|
|
64811
65603
|
deviceConfig: { ui: {
|
|
64812
65604
|
kind: "derived-form",
|
|
64813
65605
|
builderId: "timed-run",
|
|
@@ -64978,8 +65770,7 @@ var HERO_SCENE_BY_TYPE = {
|
|
|
64978
65770
|
[DeviceType.Siren]: "siren",
|
|
64979
65771
|
[DeviceType.Switch]: "plug",
|
|
64980
65772
|
[DeviceType.Sensor]: "sensor-sparkline",
|
|
64981
|
-
[DeviceType.
|
|
64982
|
-
[DeviceType.Climate]: "ac",
|
|
65773
|
+
[DeviceType.Climate]: "thermostat",
|
|
64983
65774
|
[DeviceType.Button]: "button",
|
|
64984
65775
|
[DeviceType.EventEmitter]: "event-stream",
|
|
64985
65776
|
[DeviceType.Update]: "update",
|
|
@@ -65007,7 +65798,6 @@ var HERO_SCENE_BY_TYPE = {
|
|
|
65007
65798
|
[DeviceType.PetFountain]: "pet-fountain",
|
|
65008
65799
|
[DeviceType.Dishwasher]: "dishwasher",
|
|
65009
65800
|
[DeviceType.Washer]: "washer",
|
|
65010
|
-
[DeviceType.Heater]: "heater",
|
|
65011
65801
|
[DeviceType.Dryer]: "dryer",
|
|
65012
65802
|
[DeviceType.Gateway]: "gateway"
|
|
65013
65803
|
};
|
|
@@ -65032,6 +65822,14 @@ var HERO_SCENE_BY_ROLE = {
|
|
|
65032
65822
|
[DeviceRole.CoverWindow]: "inherit",
|
|
65033
65823
|
[DeviceRole.BinaryHelper]: "inherit",
|
|
65034
65824
|
[DeviceRole.Outlet]: "plug",
|
|
65825
|
+
[DeviceRole.SwitchHeater]: "heater",
|
|
65826
|
+
[DeviceRole.SwitchFan]: "fan",
|
|
65827
|
+
[DeviceRole.ClimateAc]: "ac",
|
|
65828
|
+
[DeviceRole.ClimateThermostat]: "inherit",
|
|
65829
|
+
[DeviceRole.ClimateFloor]: "inherit",
|
|
65830
|
+
[DeviceRole.ClimateRadiator]: "inherit",
|
|
65831
|
+
[DeviceRole.ClimateHeater]: "inherit",
|
|
65832
|
+
[DeviceRole.ClimateHeatPumpCircuit]: "inherit",
|
|
65035
65833
|
[DeviceRole.MotionSensor]: "presence",
|
|
65036
65834
|
[DeviceRole.ContactSensor]: "contact",
|
|
65037
65835
|
[DeviceRole.LeakSensor]: "inherit",
|
|
@@ -65501,10 +66299,7 @@ function trailingOf(facts) {
|
|
|
65501
66299
|
* A type whose primary is a named control, not its power: a climate row is the mode
|
|
65502
66300
|
* (which carries "off") and the setpoint, with no power toggle.
|
|
65503
66301
|
*/
|
|
65504
|
-
var ROW_PRIMARY_BY_TYPE = {
|
|
65505
|
-
[DeviceType.Climate]: "climate.mode",
|
|
65506
|
-
[DeviceType.Thermostat]: "climate.mode"
|
|
65507
|
-
};
|
|
66302
|
+
var ROW_PRIMARY_BY_TYPE = { [DeviceType.Climate]: "climate.mode" };
|
|
65508
66303
|
function primaryOf(model) {
|
|
65509
66304
|
const named = ROW_PRIMARY_BY_TYPE[model.type];
|
|
65510
66305
|
if (named !== void 0) {
|
|
@@ -65537,7 +66332,6 @@ function primaryOf(model) {
|
|
|
65537
66332
|
*/
|
|
65538
66333
|
var ROW_EXTRAS_BY_TYPE = {
|
|
65539
66334
|
[DeviceType.Climate]: ["climate.target"],
|
|
65540
|
-
[DeviceType.Thermostat]: ["climate.target"],
|
|
65541
66335
|
[DeviceType.Vacuum]: ["vacuum.base"],
|
|
65542
66336
|
[DeviceType.LawnMower]: ["mower.dock"],
|
|
65543
66337
|
[DeviceType.MediaPlayer]: ["volume.level", REMOTE_OPEN_ACTION_ID]
|
|
@@ -65656,7 +66450,11 @@ var heroLayoutCapability = {
|
|
|
65656
66450
|
auth: "protected",
|
|
65657
66451
|
role: "viewer"
|
|
65658
66452
|
}),
|
|
65659
|
-
|
|
66453
|
+
/** The fixed rows of a kind: the type, refined by the role (D1033 — a heater is a switch). */
|
|
66454
|
+
getLayout: method(zod.z.object({
|
|
66455
|
+
deviceType: zod.z.string(),
|
|
66456
|
+
role: zod.z.string().nullable().optional()
|
|
66457
|
+
}), HeroLayoutRowsSchema, {
|
|
65660
66458
|
auth: "protected",
|
|
65661
66459
|
role: "viewer"
|
|
65662
66460
|
})
|
|
@@ -65705,6 +66503,11 @@ var humidifierCapability = {
|
|
|
65705
66503
|
deviceNative: true,
|
|
65706
66504
|
mode: "singleton",
|
|
65707
66505
|
deviceTypes: [DeviceType.Humidifier],
|
|
66506
|
+
power: {
|
|
66507
|
+
kind: "field",
|
|
66508
|
+
field: "on",
|
|
66509
|
+
set: "setOn"
|
|
66510
|
+
},
|
|
65708
66511
|
methods: {
|
|
65709
66512
|
setOn: method(zod.z.object({
|
|
65710
66513
|
deviceId: zod.z.number().int().nonnegative(),
|
|
@@ -65778,7 +66581,7 @@ var humiditySensorCapability = {
|
|
|
65778
66581
|
scope: "device",
|
|
65779
66582
|
deviceNative: true,
|
|
65780
66583
|
mode: "singleton",
|
|
65781
|
-
deviceTypes: [DeviceType.Sensor, DeviceType.
|
|
66584
|
+
deviceTypes: [DeviceType.Sensor, DeviceType.Climate],
|
|
65782
66585
|
methods: {},
|
|
65783
66586
|
status: {
|
|
65784
66587
|
schema: HumiditySensorStatusSchema,
|
|
@@ -82465,6 +83268,11 @@ var petFountainCapability = {
|
|
|
82465
83268
|
deviceNative: true,
|
|
82466
83269
|
mode: "singleton",
|
|
82467
83270
|
deviceTypes: [DeviceType.PetFountain],
|
|
83271
|
+
power: {
|
|
83272
|
+
kind: "field",
|
|
83273
|
+
field: "pumpRunning",
|
|
83274
|
+
set: "setPump"
|
|
83275
|
+
},
|
|
82468
83276
|
methods: {
|
|
82469
83277
|
/** Start or stop the pump. */
|
|
82470
83278
|
setPump: method(zod.z.object({
|
|
@@ -84579,7 +85387,6 @@ var POWER_METER_DEVICE_TYPES = [
|
|
|
84579
85387
|
DeviceType.Light,
|
|
84580
85388
|
DeviceType.Fan,
|
|
84581
85389
|
DeviceType.Climate,
|
|
84582
|
-
DeviceType.Thermostat,
|
|
84583
85390
|
DeviceType.Humidifier,
|
|
84584
85391
|
DeviceType.WaterHeater,
|
|
84585
85392
|
DeviceType.MediaPlayer,
|
|
@@ -84588,8 +85395,7 @@ var POWER_METER_DEVICE_TYPES = [
|
|
|
84588
85395
|
DeviceType.Dishwasher,
|
|
84589
85396
|
DeviceType.Vacuum,
|
|
84590
85397
|
DeviceType.LawnMower,
|
|
84591
|
-
DeviceType.PetFeeder
|
|
84592
|
-
DeviceType.Heater
|
|
85398
|
+
DeviceType.PetFeeder
|
|
84593
85399
|
];
|
|
84594
85400
|
/** Everything but a bare `Sensor`: a sensor that takes its reading from another sensor adds nothing. */
|
|
84595
85401
|
var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== DeviceType.Sensor);
|
|
@@ -84702,117 +85508,6 @@ var powerMeterCapability = {
|
|
|
84702
85508
|
volatileStateFields: ["lastFetchedAt"],
|
|
84703
85509
|
customize: powerMeterCustomize
|
|
84704
85510
|
};
|
|
84705
|
-
var PowerSourceRefusalReasonSchema = zod.z.enum([
|
|
84706
|
-
"no-power-source",
|
|
84707
|
-
"switch-missing",
|
|
84708
|
-
"switch-offline",
|
|
84709
|
-
"switch-unknown",
|
|
84710
|
-
"restart-in-progress",
|
|
84711
|
-
"switch-call-failed"
|
|
84712
|
-
]);
|
|
84713
|
-
var PowerSourceActionResultSchema = zod.z.discriminatedUnion("accepted", [zod.z.object({ accepted: zod.z.literal(true) }), zod.z.object({
|
|
84714
|
-
accepted: zod.z.literal(false),
|
|
84715
|
-
reason: PowerSourceRefusalReasonSchema,
|
|
84716
|
-
/** One line for the operator, naming the switch. */
|
|
84717
|
-
message: zod.z.string()
|
|
84718
|
-
})]);
|
|
84719
|
-
var PowerSourceInfoSchema = zod.z.object({
|
|
84720
|
-
/** False when the device has no power source linked; the rest is then empty. */
|
|
84721
|
-
linked: zod.z.boolean(),
|
|
84722
|
-
switchDeviceId: zod.z.number().nullable(),
|
|
84723
|
-
switchName: zod.z.string().nullable(),
|
|
84724
|
-
/** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
|
|
84725
|
-
switchOn: zod.z.boolean().nullable(),
|
|
84726
|
-
switchOnline: zod.z.boolean().nullable(),
|
|
84727
|
-
restartInProgress: zod.z.boolean(),
|
|
84728
|
-
offSeconds: zod.z.number().int()
|
|
84729
|
-
});
|
|
84730
|
-
/** The composed slice: the switch state the link mirrors, plus the stored off time. */
|
|
84731
|
-
var PowerSourceStateSchema = zod.z.object({
|
|
84732
|
-
/** Null while the switch has not reported: unknown is never `false` (D393). */
|
|
84733
|
-
switchOn: zod.z.boolean().nullable(),
|
|
84734
|
-
offSeconds: zod.z.number().int(),
|
|
84735
|
-
lastFetchedAt: zod.z.number()
|
|
84736
|
-
});
|
|
84737
|
-
var POWER_SOURCE_DEVICE_TYPES = [
|
|
84738
|
-
DeviceType.Gateway,
|
|
84739
|
-
DeviceType.Camera,
|
|
84740
|
-
DeviceType.Sensor,
|
|
84741
|
-
DeviceType.MediaPlayer,
|
|
84742
|
-
DeviceType.Vacuum,
|
|
84743
|
-
DeviceType.Generic,
|
|
84744
|
-
DeviceType.Washer,
|
|
84745
|
-
DeviceType.Dryer,
|
|
84746
|
-
DeviceType.Dishwasher,
|
|
84747
|
-
DeviceType.PetFountain,
|
|
84748
|
-
DeviceType.Fan,
|
|
84749
|
-
DeviceType.Humidifier,
|
|
84750
|
-
DeviceType.Climate,
|
|
84751
|
-
DeviceType.WaterHeater
|
|
84752
|
-
];
|
|
84753
|
-
var powerSourceCustomize = {
|
|
84754
|
-
version: 1,
|
|
84755
|
-
targets: [{
|
|
84756
|
-
id: "switch",
|
|
84757
|
-
cardinality: "scalar",
|
|
84758
|
-
vocabulary: {
|
|
84759
|
-
cap: "power-source",
|
|
84760
|
-
stateField: "switchOn"
|
|
84761
|
-
},
|
|
84762
|
-
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
84763
|
-
apply: "add",
|
|
84764
|
-
path: "switchOn",
|
|
84765
|
-
sources: [{
|
|
84766
|
-
kind: "switch",
|
|
84767
|
-
transforms: [{ kind: "identity" }]
|
|
84768
|
-
}],
|
|
84769
|
-
companions: [{
|
|
84770
|
-
kind: "constant",
|
|
84771
|
-
path: "offSeconds",
|
|
84772
|
-
value: 10,
|
|
84773
|
-
when: "add",
|
|
84774
|
-
formerValues: [0]
|
|
84775
|
-
}, {
|
|
84776
|
-
kind: "clock",
|
|
84777
|
-
path: "lastFetchedAt",
|
|
84778
|
-
when: "always"
|
|
84779
|
-
}],
|
|
84780
|
-
sourceReport: { status: "assignment-status" }
|
|
84781
|
-
}]
|
|
84782
|
-
};
|
|
84783
|
-
var deviceInput$1 = zod.z.object({ deviceId: zod.z.number().int().nonnegative() });
|
|
84784
|
-
var powerSourceCapability = {
|
|
84785
|
-
name: "power-source",
|
|
84786
|
-
scope: "device",
|
|
84787
|
-
mode: "singleton",
|
|
84788
|
-
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
84789
|
-
methods: {
|
|
84790
|
-
getStatus: systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "protected" }),
|
|
84791
|
-
powerOn: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
84792
|
-
kind: "mutation",
|
|
84793
|
-
auth: "protected"
|
|
84794
|
-
}),
|
|
84795
|
-
powerOff: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
84796
|
-
kind: "mutation",
|
|
84797
|
-
auth: "protected"
|
|
84798
|
-
}),
|
|
84799
|
-
forceRestart: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
84800
|
-
kind: "mutation",
|
|
84801
|
-
auth: "protected"
|
|
84802
|
-
})
|
|
84803
|
-
},
|
|
84804
|
-
runtimeState: PowerSourceStateSchema,
|
|
84805
|
-
customize: powerSourceCustomize,
|
|
84806
|
-
/**
|
|
84807
|
-
* Runtime-state durability: **session** — mirrored from the linked switch on
|
|
84808
|
-
* its next report; a restored value would outlive the reading it names.
|
|
84809
|
-
*
|
|
84810
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
84811
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
84812
|
-
*/
|
|
84813
|
-
durability: "session",
|
|
84814
|
-
history: "none"
|
|
84815
|
-
};
|
|
84816
85511
|
/**
|
|
84817
85512
|
* Presence cap. Models HA `person.*` and `device_tracker.*` entities
|
|
84818
85513
|
* on `DeviceType.Presence`. Read-only — no setters: presence is
|
|
@@ -89135,9 +89830,7 @@ var RUNNING_CUSTOMIZE_DEVICE_TYPES = [
|
|
|
89135
89830
|
DeviceType.Humidifier,
|
|
89136
89831
|
DeviceType.Fan,
|
|
89137
89832
|
DeviceType.Climate,
|
|
89138
|
-
DeviceType.
|
|
89139
|
-
DeviceType.PetFeeder,
|
|
89140
|
-
DeviceType.Heater
|
|
89833
|
+
DeviceType.PetFeeder
|
|
89141
89834
|
];
|
|
89142
89835
|
var runningStateCapability = {
|
|
89143
89836
|
name: "running-state",
|
|
@@ -91762,8 +92455,7 @@ var switchCapability = {
|
|
|
91762
92455
|
DeviceType.Switch,
|
|
91763
92456
|
DeviceType.Siren,
|
|
91764
92457
|
DeviceType.Light,
|
|
91765
|
-
DeviceType.Fan
|
|
91766
|
-
DeviceType.Heater
|
|
92458
|
+
DeviceType.Fan
|
|
91767
92459
|
],
|
|
91768
92460
|
methods: { setState: method(zod.z.object({
|
|
91769
92461
|
deviceId: zod.z.number(),
|
|
@@ -92589,7 +93281,7 @@ var temperatureSensorCapability = {
|
|
|
92589
93281
|
scope: "device",
|
|
92590
93282
|
deviceNative: true,
|
|
92591
93283
|
mode: "singleton",
|
|
92592
|
-
deviceTypes: [DeviceType.Sensor, DeviceType.
|
|
93284
|
+
deviceTypes: [DeviceType.Sensor, DeviceType.Climate],
|
|
92593
93285
|
methods: {},
|
|
92594
93286
|
status: {
|
|
92595
93287
|
schema: TemperatureSensorStatusSchema,
|
|
@@ -94573,6 +95265,13 @@ var waterHeaterCapability = {
|
|
|
94573
95265
|
deviceNative: true,
|
|
94574
95266
|
mode: "singleton",
|
|
94575
95267
|
deviceTypes: [DeviceType.WaterHeater],
|
|
95268
|
+
power: {
|
|
95269
|
+
kind: "mode",
|
|
95270
|
+
field: "operationMode",
|
|
95271
|
+
offValue: "off",
|
|
95272
|
+
set: "setOperationMode",
|
|
95273
|
+
lastField: "lastActiveMode"
|
|
95274
|
+
},
|
|
94576
95275
|
methods: {
|
|
94577
95276
|
setTargetTemp: method(zod.z.object({
|
|
94578
95277
|
deviceId: zod.z.number().int().nonnegative(),
|
|
@@ -97517,7 +98216,7 @@ function compileValue$1(input) {
|
|
|
97517
98216
|
const transform = input.draft.transform;
|
|
97518
98217
|
if (transform.kind === "identity" || transform.kind === "number") return {
|
|
97519
98218
|
ok: true,
|
|
97520
|
-
value: identityValue(read, input.sourceValueKind)
|
|
98219
|
+
value: identityValue(read, input.sourceValueKind, targetValueKind(input))
|
|
97521
98220
|
};
|
|
97522
98221
|
if (transform.kind === "invert") {
|
|
97523
98222
|
if (input.sourceValueKind !== "boolean") return fail$2("source-kind");
|
|
@@ -97530,8 +98229,16 @@ function compileValue$1(input) {
|
|
|
97530
98229
|
if (transform.kind === "linear") return linearValue$1(transform, read, input.sourceValueKind);
|
|
97531
98230
|
return fail$2("transform");
|
|
97532
98231
|
}
|
|
97533
|
-
|
|
97534
|
-
|
|
98232
|
+
/** The kind of the field a draft writes, from the catalog. */
|
|
98233
|
+
function targetValueKind(input) {
|
|
98234
|
+
return catalogTarget$4(input.draft.cap, input.draft.targetId)?.valueKind;
|
|
98235
|
+
}
|
|
98236
|
+
/**
|
|
98237
|
+
* A string reading feeds a NUMBER field through `number(x)`; a string field
|
|
98238
|
+
* (a fan `preset` linked to a select, D1034) takes the string as it is.
|
|
98239
|
+
*/
|
|
98240
|
+
function identityValue(read, valueKind, targetKind) {
|
|
98241
|
+
if (valueKind === "string" && targetKind !== "string" && targetKind !== "enum") return expression("number(x)", { x: read });
|
|
97535
98242
|
return read;
|
|
97536
98243
|
}
|
|
97537
98244
|
/**
|
|
@@ -97613,7 +98320,7 @@ function compileCompanions$1(input, target, value) {
|
|
|
97613
98320
|
});
|
|
97614
98321
|
}
|
|
97615
98322
|
function companionIncluded$1(companion, apply) {
|
|
97616
|
-
if (companion.kind === "transition-time") return true;
|
|
98323
|
+
if (companion.kind === "transition-time" || companion.kind === "source-field") return true;
|
|
97617
98324
|
return companion.when === "always" || apply === "add";
|
|
97618
98325
|
}
|
|
97619
98326
|
function companionField(input, path, companion, value) {
|
|
@@ -97629,6 +98336,10 @@ function companionField(input, path, companion, value) {
|
|
|
97629
98336
|
ok: true,
|
|
97630
98337
|
value: literal("now")
|
|
97631
98338
|
};
|
|
98339
|
+
if (companion.kind === "source-field") return {
|
|
98340
|
+
ok: true,
|
|
98341
|
+
value: fromRead(refOf$1(input.draft), input.draft.source.cap, companion.field)
|
|
98342
|
+
};
|
|
97632
98343
|
return transitionField(input, path, companion.sourceChangedAt, value);
|
|
97633
98344
|
}
|
|
97634
98345
|
function transitionField(input, path, sourceChangedAt, value) {
|
|
@@ -97782,7 +98493,12 @@ function describeRead(read) {
|
|
|
97782
98493
|
function isConfirmed(reading) {
|
|
97783
98494
|
return reading.fatal || reading.confirmed === true;
|
|
97784
98495
|
}
|
|
97785
|
-
|
|
98496
|
+
/** Whether a non-null value is of the kind a field of `kind` holds. */
|
|
98497
|
+
function valueFitsKind(value, kind) {
|
|
98498
|
+
if (value === null) return true;
|
|
98499
|
+
return typeof value === (kind === "enum" ? "string" : kind);
|
|
98500
|
+
}
|
|
98501
|
+
function fromReading(reading, read, targetKind) {
|
|
97786
98502
|
if (reading.state === "unavailable") return {
|
|
97787
98503
|
state: "unavailable",
|
|
97788
98504
|
value: null,
|
|
@@ -97790,6 +98506,13 @@ function fromReading(reading, read) {
|
|
|
97790
98506
|
fatal: reading.fatal,
|
|
97791
98507
|
confirmed: isConfirmed(reading)
|
|
97792
98508
|
};
|
|
98509
|
+
if (targetKind !== void 0 && !valueFitsKind(reading.value, targetKind)) return {
|
|
98510
|
+
state: "unavailable",
|
|
98511
|
+
value: null,
|
|
98512
|
+
reason: `${describeRead(read)}: source-kind-mismatch, it reads a ${typeof reading.value} and the field takes a ${targetKind}`,
|
|
98513
|
+
fatal: false,
|
|
98514
|
+
confirmed: true
|
|
98515
|
+
};
|
|
97793
98516
|
return {
|
|
97794
98517
|
state: reading.state,
|
|
97795
98518
|
value: reading.value,
|
|
@@ -97913,7 +98636,7 @@ function aggregateField(source, read) {
|
|
|
97913
98636
|
function evaluateCompositionField(input) {
|
|
97914
98637
|
const { source } = input;
|
|
97915
98638
|
switch (source.kind) {
|
|
97916
|
-
case "from": return fromReading(input.read(source), source);
|
|
98639
|
+
case "from": return fromReading(input.read(source), source, input.targetKind);
|
|
97917
98640
|
case "expression": return expressionOutcome(source, input.read, input.now, input.stateful);
|
|
97918
98641
|
case "aggregate": return aggregateField(source, input.read);
|
|
97919
98642
|
case "series": return {
|
|
@@ -97945,54 +98668,6 @@ function lockDoorLinkOfComposition(composition) {
|
|
|
97945
98668
|
sensor: x.source
|
|
97946
98669
|
};
|
|
97947
98670
|
}
|
|
97948
|
-
/**
|
|
97949
|
-
* Which smart switch powers a device (the `power-source` Customize extension):
|
|
97950
|
-
* the source its stored `power-source.switchOn` field reads, and the off time of
|
|
97951
|
-
* a forced restart stored beside it. Read from the STORED composition, never kept
|
|
97952
|
-
* as a second copy (D676). Shared by the hub (which acts on the switch) and the
|
|
97953
|
-
* admin UI (which shows it).
|
|
97954
|
-
*/
|
|
97955
|
-
/**
|
|
97956
|
-
* The stored off time, or the default when none is stored. A stored number out
|
|
97957
|
-
* of range is CLAMPED to the bounds (a hand-written value never refuses the
|
|
97958
|
-
* link, it just cannot cut power for an absurd time); a non-integer is rounded.
|
|
97959
|
-
*/
|
|
97960
|
-
function normalizeOffSeconds(value) {
|
|
97961
|
-
if (typeof value !== "number" || !Number.isFinite(value)) return 10;
|
|
97962
|
-
return Math.min(120, Math.max(3, Math.round(value)));
|
|
97963
|
-
}
|
|
97964
|
-
/** The constant a stored `offSeconds` field carries, or undefined when it is not a literal number. */
|
|
97965
|
-
function storedOffSeconds(composition) {
|
|
97966
|
-
const feature = composition.features.find((f) => f.cap === "power-source");
|
|
97967
|
-
if (feature === void 0 || feature.kind !== "fields") return void 0;
|
|
97968
|
-
const field = feature.fields["offSeconds"];
|
|
97969
|
-
if (field === void 0 || field.kind !== "expression") return void 0;
|
|
97970
|
-
const n = Number(field.expr);
|
|
97971
|
-
return field.expr.trim() === "" || !Number.isFinite(n) ? void 0 : n;
|
|
97972
|
-
}
|
|
97973
|
-
/**
|
|
97974
|
-
* The link a composition stores. An `existing` target names its own device; a
|
|
97975
|
-
* `new` target (a composed device) is the composer's own device, so the caller
|
|
97976
|
-
* passes the block id and a new-target composition without one has no link.
|
|
97977
|
-
*/
|
|
97978
|
-
function powerSourceLinkOfComposition(composition, blockId) {
|
|
97979
|
-
if (composition === null) return null;
|
|
97980
|
-
let device;
|
|
97981
|
-
if (composition.target.kind === "existing") device = composition.target.device;
|
|
97982
|
-
else if (blockId !== void 0) device = composedDeviceRef(blockId);
|
|
97983
|
-
else return null;
|
|
97984
|
-
const feature = composition.features.find((f) => f.cap === "power-source");
|
|
97985
|
-
if (feature === void 0 || feature.kind !== "fields" || feature.enabled === false) return null;
|
|
97986
|
-
const field = feature.fields["switchOn"];
|
|
97987
|
-
if (field === void 0) return null;
|
|
97988
|
-
const read = fieldReads(field).find((r) => r.cap === "switch");
|
|
97989
|
-
if (read === void 0) return null;
|
|
97990
|
-
return {
|
|
97991
|
-
device,
|
|
97992
|
-
switch: read.source,
|
|
97993
|
-
offSeconds: normalizeOffSeconds(storedOffSeconds(composition))
|
|
97994
|
-
};
|
|
97995
|
-
}
|
|
97996
98671
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
97997
98672
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
97998
98673
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
@@ -98998,7 +99673,6 @@ function applyPrimaryChildRule(rule, children) {
|
|
|
98998
99673
|
var CONTAINER_CHILD_PRIORITY = [
|
|
98999
99674
|
"media-player",
|
|
99000
99675
|
"alarm-panel",
|
|
99001
|
-
"thermostat",
|
|
99002
99676
|
"climate",
|
|
99003
99677
|
"humidifier",
|
|
99004
99678
|
"water-heater",
|
|
@@ -99488,7 +100162,72 @@ var DeclaredDevices = class {
|
|
|
99488
100162
|
return removed;
|
|
99489
100163
|
}
|
|
99490
100164
|
};
|
|
99491
|
-
|
|
100165
|
+
/**
|
|
100166
|
+
* A device's KIND is its type plus its role (D1033): the type is the set of
|
|
100167
|
+
* controls it has, the role says which thing it is among the devices that
|
|
100168
|
+
* share those controls. A plug-in heater is a `switch` with role
|
|
100169
|
+
* `switch-heater`; an air conditioner and a radiator valve are both `climate`,
|
|
100170
|
+
* told apart by their `climate-*` role.
|
|
100171
|
+
*/
|
|
100172
|
+
/**
|
|
100173
|
+
* Type values a persisted row may still carry after the type was retired, and
|
|
100174
|
+
* the type each one is read as. The row is rewritten by the next registration
|
|
100175
|
+
* of the device (its provider stamps the live type), so this is a read alias,
|
|
100176
|
+
* not a migration.
|
|
100177
|
+
*
|
|
100178
|
+
* `heater` is deliberately absent: the only heaters were composed devices the
|
|
100179
|
+
* operator deletes. Such a row stays an unknown type, which every reader
|
|
100180
|
+
* treats as a generic device.
|
|
100181
|
+
*/
|
|
100182
|
+
var RETIRED_DEVICE_TYPES = { thermostat: DeviceType.Climate };
|
|
100183
|
+
/** The live type a stored `type` value stands for (itself unless retired). */
|
|
100184
|
+
function canonicalStoredDeviceType(stored) {
|
|
100185
|
+
return RETIRED_DEVICE_TYPES[stored] ?? stored;
|
|
100186
|
+
}
|
|
100187
|
+
/** The `climate-*` roles, in the order the role picker lists them. */
|
|
100188
|
+
var CLIMATE_ROLES = [
|
|
100189
|
+
DeviceRole.ClimateThermostat,
|
|
100190
|
+
DeviceRole.ClimateAc,
|
|
100191
|
+
DeviceRole.ClimateRadiator,
|
|
100192
|
+
DeviceRole.ClimateFloor,
|
|
100193
|
+
DeviceRole.ClimateHeater,
|
|
100194
|
+
DeviceRole.ClimateHeatPumpCircuit
|
|
100195
|
+
];
|
|
100196
|
+
function isClimateRole(role) {
|
|
100197
|
+
return CLIMATE_ROLES.some((candidate) => candidate === role);
|
|
100198
|
+
}
|
|
100199
|
+
/**
|
|
100200
|
+
* Which climate device this is. A climate device with no role, or a role that
|
|
100201
|
+
* is not a climate one, is a room thermostat: that is what most of them are,
|
|
100202
|
+
* and it is the presentation a thermostat had before the types were folded.
|
|
100203
|
+
*/
|
|
100204
|
+
function climateRoleOf(role) {
|
|
100205
|
+
return role !== null && role !== void 0 && isClimateRole(role) ? role : DeviceRole.ClimateThermostat;
|
|
100206
|
+
}
|
|
100207
|
+
/** An air conditioner: exports present it as an AC unit, not a thermostat. */
|
|
100208
|
+
function isAirConditioner(type, role) {
|
|
100209
|
+
return type === DeviceType.Climate && climateRoleOf(role) === DeviceRole.ClimateAc;
|
|
100210
|
+
}
|
|
100211
|
+
/**
|
|
100212
|
+
* Is a capability offered on a device of this type and role?
|
|
100213
|
+
*
|
|
100214
|
+
* Fails open where the old type-only gate did: no `deviceTypes` (or an empty
|
|
100215
|
+
* list) applies to every device, and an unknown type never filters (a failed
|
|
100216
|
+
* meta read must not destroy work, D49). A type the cap's `deviceRoles` names
|
|
100217
|
+
* is offered only to the roles listed there; an unknown role is NOT one of
|
|
100218
|
+
* them, so a `switch` whose role could not be read is not a heater.
|
|
100219
|
+
*/
|
|
100220
|
+
function capAppliesToDeviceKind(gate, deviceType, role) {
|
|
100221
|
+
if (deviceType === void 0) return true;
|
|
100222
|
+
const types = gate?.deviceTypes;
|
|
100223
|
+
if (!types || types.length === 0) return true;
|
|
100224
|
+
const type = types.find((candidate) => candidate === deviceType);
|
|
100225
|
+
if (type === void 0) return false;
|
|
100226
|
+
const roles = gate?.deviceRoles?.[type];
|
|
100227
|
+
if (roles === void 0) return true;
|
|
100228
|
+
return role !== null && role !== void 0 && roles.some((candidate) => candidate === role);
|
|
100229
|
+
}
|
|
100230
|
+
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.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.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
99492
100231
|
new Set(Object.values(DeviceType));
|
|
99493
100232
|
/** True when a value is a navigable node: a plain object OR a tRPC v11 client
|
|
99494
100233
|
* proxy node (a callable `Proxy(noop)` → `typeof === 'function'`, NOT an
|
|
@@ -101700,9 +102439,6 @@ function durationText(seconds) {
|
|
|
101700
102439
|
const text = `${Math.floor(m / 60)} h ${String(m % 60).padStart(2, "0")}`;
|
|
101701
102440
|
return t(text, text);
|
|
101702
102441
|
}
|
|
101703
|
-
function deviceTypeOf(type) {
|
|
101704
|
-
return Object.values(DeviceType).find((t) => t === type);
|
|
101705
|
-
}
|
|
101706
102442
|
var switchContribution = contribution("switch", SwitchStatusSchema, (slice) => {
|
|
101707
102443
|
const on = slice?.on ?? null;
|
|
101708
102444
|
return {
|
|
@@ -101883,8 +102619,7 @@ function remainingWords(amount, unit) {
|
|
|
101883
102619
|
return t(`${amount} ${word}`, `${amount} ${word}`);
|
|
101884
102620
|
}
|
|
101885
102621
|
var timedRunContribution = contribution("timed-run", TimedRunStatusSchema, (slice, ctx) => {
|
|
101886
|
-
const
|
|
101887
|
-
const limit = type === void 0 ? null : timedRunLimitOf(type);
|
|
102622
|
+
const limit = timedRunLimitOf(ctx.type, ctx.role);
|
|
101888
102623
|
if (limit === null) return {};
|
|
101889
102624
|
const quickRun = slice?.quickRun ?? timedRunQuickRun(limit, null);
|
|
101890
102625
|
const activeUntil = slice?.activeUntil != null && slice.activeUntil > ctx.now ? slice.activeUntil : null;
|
|
@@ -102323,7 +103058,6 @@ var HERO_LAYOUT_BY_TYPE = {
|
|
|
102323
103058
|
[DeviceType.Siren]: HERO_LAYOUT_DEFAULT,
|
|
102324
103059
|
[DeviceType.Switch]: SWITCH_LAYOUT,
|
|
102325
103060
|
[DeviceType.Sensor]: HERO_LAYOUT_DEFAULT,
|
|
102326
|
-
[DeviceType.Thermostat]: CLIMATE_LAYOUT,
|
|
102327
103061
|
[DeviceType.Climate]: CLIMATE_LAYOUT,
|
|
102328
103062
|
[DeviceType.Button]: BUTTON_LAYOUT,
|
|
102329
103063
|
[DeviceType.EventEmitter]: HERO_LAYOUT_DEFAULT,
|
|
@@ -102352,7 +103086,6 @@ var HERO_LAYOUT_BY_TYPE = {
|
|
|
102352
103086
|
[DeviceType.PetFountain]: FOUNTAIN_LAYOUT,
|
|
102353
103087
|
[DeviceType.Dishwasher]: DISHWASHER_LAYOUT,
|
|
102354
103088
|
[DeviceType.Washer]: APPLIANCE_LAYOUT,
|
|
102355
|
-
[DeviceType.Heater]: HEATER_LAYOUT,
|
|
102356
103089
|
[DeviceType.Dryer]: APPLIANCE_LAYOUT,
|
|
102357
103090
|
[DeviceType.Gateway]: HERO_LAYOUT_DEFAULT
|
|
102358
103091
|
};
|
|
@@ -102360,7 +103093,8 @@ function isDeviceType$1(type) {
|
|
|
102360
103093
|
return Object.values(DeviceType).includes(type);
|
|
102361
103094
|
}
|
|
102362
103095
|
/** The layout of a type; a type this build does not know gets the default. */
|
|
102363
|
-
function resolveHeroLayout(type) {
|
|
103096
|
+
function resolveHeroLayout(type, role = null) {
|
|
103097
|
+
if (type === DeviceType.Switch && role === DeviceRole.SwitchHeater) return HEATER_LAYOUT;
|
|
102364
103098
|
return isDeviceType$1(type) ? HERO_LAYOUT_BY_TYPE[type] : HERO_LAYOUT_DEFAULT;
|
|
102365
103099
|
}
|
|
102366
103100
|
/**
|
|
@@ -103039,7 +103773,7 @@ var HERO_MODE_LOOK = {
|
|
|
103039
103773
|
open: null,
|
|
103040
103774
|
closed: null
|
|
103041
103775
|
};
|
|
103042
|
-
var MODE_LOOK_TYPES = [DeviceType.Climate
|
|
103776
|
+
var MODE_LOOK_TYPES = [DeviceType.Climate];
|
|
103043
103777
|
var HERO_LOOK_BY_TYPE = {
|
|
103044
103778
|
[DeviceType.Camera]: CAMERA_LOOK,
|
|
103045
103779
|
[DeviceType.Hub]: HERO_LOOK_DEFAULT,
|
|
@@ -103047,8 +103781,7 @@ var HERO_LOOK_BY_TYPE = {
|
|
|
103047
103781
|
[DeviceType.Siren]: HERO_LOOK_DEFAULT,
|
|
103048
103782
|
[DeviceType.Switch]: SWITCH_LOOK,
|
|
103049
103783
|
[DeviceType.Sensor]: READING_SENSOR_LOOK,
|
|
103050
|
-
[DeviceType.
|
|
103051
|
-
[DeviceType.Climate]: CLIMATE_LOOK,
|
|
103784
|
+
[DeviceType.Climate]: THERMOSTAT_LOOK,
|
|
103052
103785
|
[DeviceType.Button]: BUTTON_LOOK,
|
|
103053
103786
|
[DeviceType.EventEmitter]: EVENT_EMITTER_LOOK,
|
|
103054
103787
|
[DeviceType.Update]: UPDATE_LOOK,
|
|
@@ -103076,7 +103809,6 @@ var HERO_LOOK_BY_TYPE = {
|
|
|
103076
103809
|
[DeviceType.PetFountain]: FOUNTAIN_LOOK,
|
|
103077
103810
|
[DeviceType.Dishwasher]: DISHWASHER_LOOK,
|
|
103078
103811
|
[DeviceType.Washer]: WASHER_LOOK,
|
|
103079
|
-
[DeviceType.Heater]: HEATER_LOOK,
|
|
103080
103812
|
[DeviceType.Dryer]: DRYER_LOOK,
|
|
103081
103813
|
[DeviceType.Gateway]: HERO_LOOK_DEFAULT
|
|
103082
103814
|
};
|
|
@@ -103101,6 +103833,14 @@ var HERO_LOOK_BY_ROLE = {
|
|
|
103101
103833
|
[DeviceRole.CoverWindow]: "inherit",
|
|
103102
103834
|
[DeviceRole.BinaryHelper]: "inherit",
|
|
103103
103835
|
[DeviceRole.Outlet]: "inherit",
|
|
103836
|
+
[DeviceRole.SwitchHeater]: HEATER_LOOK,
|
|
103837
|
+
[DeviceRole.SwitchFan]: FAN_LOOK,
|
|
103838
|
+
[DeviceRole.ClimateAc]: "inherit",
|
|
103839
|
+
[DeviceRole.ClimateThermostat]: "inherit",
|
|
103840
|
+
[DeviceRole.ClimateFloor]: "inherit",
|
|
103841
|
+
[DeviceRole.ClimateRadiator]: "inherit",
|
|
103842
|
+
[DeviceRole.ClimateHeater]: "inherit",
|
|
103843
|
+
[DeviceRole.ClimateHeatPumpCircuit]: "inherit",
|
|
103104
103844
|
[DeviceRole.MotionSensor]: MOTION_LOOK,
|
|
103105
103845
|
[DeviceRole.ContactSensor]: "inherit",
|
|
103106
103846
|
[DeviceRole.LeakSensor]: LEAK_LOOK,
|
|
@@ -103158,6 +103898,7 @@ function resolveHeroLook(role, type, state, mode = null) {
|
|
|
103158
103898
|
const byMode = HERO_MODE_LOOK[mode];
|
|
103159
103899
|
if (byMode !== null) return byMode;
|
|
103160
103900
|
}
|
|
103901
|
+
if (isAirConditioner(type, role)) return CLIMATE_LOOK[state];
|
|
103161
103902
|
return ((isDeviceType(type) ? HERO_LOOK_BY_TYPE[type] : void 0) ?? HERO_LOOK_DEFAULT)[state];
|
|
103162
103903
|
}
|
|
103163
103904
|
/** The media player's offer outranks a bound switch: the player's own state is the device's. */
|
|
@@ -103328,6 +104069,7 @@ function buildHeroModel(input) {
|
|
|
103328
104069
|
const ctx = {
|
|
103329
104070
|
deviceId: device.id,
|
|
103330
104071
|
type: device.type,
|
|
104072
|
+
role: device.role,
|
|
103331
104073
|
features: input.features,
|
|
103332
104074
|
now: input.now,
|
|
103333
104075
|
running: runningOf(input),
|
|
@@ -103356,7 +104098,7 @@ function buildHeroModel(input) {
|
|
|
103356
104098
|
}
|
|
103357
104099
|
};
|
|
103358
104100
|
const allRows = fragments.flatMap((f) => f.rows ?? []);
|
|
103359
|
-
const rows = resolveHeroLayout(device.type).rows.flatMap((id) => {
|
|
104101
|
+
const rows = resolveHeroLayout(device.type, device.role).rows.flatMap((id) => {
|
|
103360
104102
|
return allRows.filter((r) => r.id === id).map((r) => HERO_SCENE_ROW_IDS.has(r.id) ? {
|
|
103361
104103
|
...r,
|
|
103362
104104
|
placement: "scene"
|
|
@@ -106812,6 +107554,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
106812
107554
|
access: "create",
|
|
106813
107555
|
role: "viewer"
|
|
106814
107556
|
},
|
|
107557
|
+
"fanControl.setOscillationAxis": {
|
|
107558
|
+
capName: "fan-control",
|
|
107559
|
+
capScope: "device",
|
|
107560
|
+
addonId: null,
|
|
107561
|
+
access: "create",
|
|
107562
|
+
role: "viewer"
|
|
107563
|
+
},
|
|
106815
107564
|
"fanControl.setPercentage": {
|
|
106816
107565
|
capName: "fan-control",
|
|
106817
107566
|
capScope: "device",
|
|
@@ -113833,7 +114582,7 @@ function projectAction(cap, action) {
|
|
|
113833
114582
|
};
|
|
113834
114583
|
}
|
|
113835
114584
|
Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
|
|
113836
|
-
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.
|
|
114585
|
+
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.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.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
113837
114586
|
DeviceFeature.BatteryOperated;
|
|
113838
114587
|
function bound(cap, methods = [], authority = "reported") {
|
|
113839
114588
|
return {
|
|
@@ -115131,6 +115880,11 @@ Object.freeze({
|
|
|
115131
115880
|
form: "single",
|
|
115132
115881
|
optional: false
|
|
115133
115882
|
}],
|
|
115883
|
+
"fanControl.setOscillationAxis": [{
|
|
115884
|
+
name: "deviceId",
|
|
115885
|
+
form: "single",
|
|
115886
|
+
optional: false
|
|
115887
|
+
}],
|
|
115134
115888
|
"fanControl.setPercentage": [{
|
|
115135
115889
|
name: "deviceId",
|
|
115136
115890
|
form: "single",
|
|
@@ -119617,12 +120371,6 @@ Object.defineProperty(exports, "ConsumableItemSchema", {
|
|
|
119617
120371
|
return ConsumableItemSchema;
|
|
119618
120372
|
}
|
|
119619
120373
|
});
|
|
119620
|
-
Object.defineProperty(exports, "ControlStatusSchema", {
|
|
119621
|
-
enumerable: true,
|
|
119622
|
-
get: function() {
|
|
119623
|
-
return ControlStatusSchema;
|
|
119624
|
-
}
|
|
119625
|
-
});
|
|
119626
120374
|
Object.defineProperty(exports, "CoreBlockSchema", {
|
|
119627
120375
|
enumerable: true,
|
|
119628
120376
|
get: function() {
|
|
@@ -119875,6 +120623,18 @@ Object.defineProperty(exports, "FAN_CAPTURE_FIELDS", {
|
|
|
119875
120623
|
return FAN_CAPTURE_FIELDS;
|
|
119876
120624
|
}
|
|
119877
120625
|
});
|
|
120626
|
+
Object.defineProperty(exports, "FAN_OSCILLATION_AXES", {
|
|
120627
|
+
enumerable: true,
|
|
120628
|
+
get: function() {
|
|
120629
|
+
return FAN_OSCILLATION_AXES;
|
|
120630
|
+
}
|
|
120631
|
+
});
|
|
120632
|
+
Object.defineProperty(exports, "FAN_OSCILLATION_AXIS_SETTABLE", {
|
|
120633
|
+
enumerable: true,
|
|
120634
|
+
get: function() {
|
|
120635
|
+
return FAN_OSCILLATION_AXIS_SETTABLE;
|
|
120636
|
+
}
|
|
120637
|
+
});
|
|
119878
120638
|
Object.defineProperty(exports, "FIRST_LEVEL_MACRO_CLASSES", {
|
|
119879
120639
|
enumerable: true,
|
|
119880
120640
|
get: function() {
|
|
@@ -120343,6 +121103,12 @@ Object.defineProperty(exports, "ServerNameSchema", {
|
|
|
120343
121103
|
return ServerNameSchema;
|
|
120344
121104
|
}
|
|
120345
121105
|
});
|
|
121106
|
+
Object.defineProperty(exports, "SetOscillationAxisInputSchema", {
|
|
121107
|
+
enumerable: true,
|
|
121108
|
+
get: function() {
|
|
121109
|
+
return SetOscillationAxisInputSchema;
|
|
121110
|
+
}
|
|
121111
|
+
});
|
|
120346
121112
|
Object.defineProperty(exports, "SsoBridgeClaimsSchema", {
|
|
120347
121113
|
enumerable: true,
|
|
120348
121114
|
get: function() {
|
|
@@ -120379,12 +121145,6 @@ Object.defineProperty(exports, "StoredRecordKindDeclarationSchema", {
|
|
|
120379
121145
|
return StoredRecordKindDeclarationSchema;
|
|
120380
121146
|
}
|
|
120381
121147
|
});
|
|
120382
|
-
Object.defineProperty(exports, "SwitchStatusSchema", {
|
|
120383
|
-
enumerable: true,
|
|
120384
|
-
get: function() {
|
|
120385
|
-
return SwitchStatusSchema;
|
|
120386
|
-
}
|
|
120387
|
-
});
|
|
120388
121148
|
Object.defineProperty(exports, "TemplateKindSchema", {
|
|
120389
121149
|
enumerable: true,
|
|
120390
121150
|
get: function() {
|
|
@@ -120643,6 +121403,18 @@ Object.defineProperty(exports, "canonicalIconKey", {
|
|
|
120643
121403
|
return canonicalIconKey;
|
|
120644
121404
|
}
|
|
120645
121405
|
});
|
|
121406
|
+
Object.defineProperty(exports, "canonicalStoredDeviceType", {
|
|
121407
|
+
enumerable: true,
|
|
121408
|
+
get: function() {
|
|
121409
|
+
return canonicalStoredDeviceType;
|
|
121410
|
+
}
|
|
121411
|
+
});
|
|
121412
|
+
Object.defineProperty(exports, "capAppliesToDeviceKind", {
|
|
121413
|
+
enumerable: true,
|
|
121414
|
+
get: function() {
|
|
121415
|
+
return capAppliesToDeviceKind;
|
|
121416
|
+
}
|
|
121417
|
+
});
|
|
120646
121418
|
Object.defineProperty(exports, "capUnitResolver", {
|
|
120647
121419
|
enumerable: true,
|
|
120648
121420
|
get: function() {
|
|
@@ -120805,6 +121577,12 @@ Object.defineProperty(exports, "compositionSourceRefs", {
|
|
|
120805
121577
|
return compositionSourceRefs;
|
|
120806
121578
|
}
|
|
120807
121579
|
});
|
|
121580
|
+
Object.defineProperty(exports, "compositionUnionReads", {
|
|
121581
|
+
enumerable: true,
|
|
121582
|
+
get: function() {
|
|
121583
|
+
return compositionUnionReads;
|
|
121584
|
+
}
|
|
121585
|
+
});
|
|
120808
121586
|
Object.defineProperty(exports, "consumablesCapability", {
|
|
120809
121587
|
enumerable: true,
|
|
120810
121588
|
get: function() {
|
|
@@ -121117,6 +121895,12 @@ Object.defineProperty(exports, "extractNestedAddonId", {
|
|
|
121117
121895
|
return extractNestedAddonId;
|
|
121118
121896
|
}
|
|
121119
121897
|
});
|
|
121898
|
+
Object.defineProperty(exports, "fanAxisPath", {
|
|
121899
|
+
enumerable: true,
|
|
121900
|
+
get: function() {
|
|
121901
|
+
return fanAxisPath;
|
|
121902
|
+
}
|
|
121903
|
+
});
|
|
121120
121904
|
Object.defineProperty(exports, "fanControlCapability", {
|
|
121121
121905
|
enumerable: true,
|
|
121122
121906
|
get: function() {
|
|
@@ -121795,6 +122579,12 @@ Object.defineProperty(exports, "platformProbeCapability", {
|
|
|
121795
122579
|
return platformProbeCapability;
|
|
121796
122580
|
}
|
|
121797
122581
|
});
|
|
122582
|
+
Object.defineProperty(exports, "powerSourceActuatorConflicts", {
|
|
122583
|
+
enumerable: true,
|
|
122584
|
+
get: function() {
|
|
122585
|
+
return powerSourceActuatorConflicts;
|
|
122586
|
+
}
|
|
122587
|
+
});
|
|
121798
122588
|
Object.defineProperty(exports, "powerSourceCapability", {
|
|
121799
122589
|
enumerable: true,
|
|
121800
122590
|
get: function() {
|