@camstack/types 1.2.548 → 1.2.550
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/addon/addon-instance.d.ts +24 -0
- package/dist/addon/build-addon-route-provider.d.ts +2 -0
- package/dist/addon.js +5 -5
- package/dist/addon.mjs +5 -5
- package/dist/automation/index.d.ts +4 -3
- package/dist/automation/recipe.d.ts +12105 -604
- package/dist/automation/scheduler.d.ts +7 -0
- package/dist/automation/step-runner.d.ts +70 -0
- package/dist/automation/trace.d.ts +252 -145
- package/dist/automation/wait-until.d.ts +32 -0
- package/dist/automation/when-site.d.ts +1 -1
- package/dist/capabilities/accessories.cap.d.ts +1 -1
- package/dist/capabilities/actions.cap.d.ts +1 -178
- package/dist/capabilities/addon-routes.cap.d.ts +3 -0
- package/dist/capabilities/battery.cap.d.ts +2 -2
- package/dist/capabilities/capability-definition.d.ts +47 -1
- package/dist/capabilities/climate-control.cap.d.ts +8 -1
- package/dist/capabilities/core-blocks.cap.d.ts +119 -8723
- package/dist/capabilities/customize-catalog.d.ts +3 -1
- package/dist/capabilities/customize-spec.d.ts +26 -2
- package/dist/capabilities/device-manager.cap.d.ts +6 -0
- package/dist/capabilities/event-emitter.cap.d.ts +99 -3
- package/dist/capabilities/event-vocabulary.d.ts +99 -0
- package/dist/capabilities/fan-control.cap.d.ts +248 -0
- package/dist/capabilities/fan-presets.cap.d.ts +172 -536
- package/dist/capabilities/group-active.cap.d.ts +1 -1
- package/dist/capabilities/group-commands.cap.d.ts +1 -1
- package/dist/capabilities/group-status.cap.d.ts +1 -1
- package/dist/capabilities/heating-valve.cap.d.ts +1 -1
- package/dist/capabilities/hero-layout.cap.d.ts +2 -0
- package/dist/capabilities/humidifier.cap.d.ts +5 -0
- package/dist/capabilities/humidity-sensor.cap.d.ts +1 -1
- package/dist/capabilities/index.d.ts +5 -4
- package/dist/capabilities/media-player.cap.d.ts +7 -0
- package/dist/capabilities/oauth-integration.cap.d.ts +8 -0
- package/dist/capabilities/pet-fountain.cap.d.ts +5 -0
- package/dist/capabilities/power-meter.cap.d.ts +5 -5
- package/dist/capabilities/power-source.cap.d.ts +5 -0
- package/dist/capabilities/running-state.cap.d.ts +2 -2
- package/dist/capabilities/schedulers.cap.d.ts +1 -178
- package/dist/capabilities/sso-bridge.cap.d.ts +3 -0
- package/dist/capabilities/switch.cap.d.ts +1 -1
- package/dist/capabilities/temperature-sensor.cap.d.ts +1 -1
- package/dist/capabilities/timed-run.cap.d.ts +19 -5
- package/dist/capabilities/user-management.cap.d.ts +4 -0
- package/dist/capabilities/water-heater.cap.d.ts +7 -0
- package/dist/client.js +7 -11
- package/dist/client.mjs +7 -11
- package/dist/{composed-stable-id-DrGLxjVF.js → composed-stable-id-CDNLq7Y8.js} +27 -10
- package/dist/{composed-stable-id-DFNyOFzz.mjs → composed-stable-id-CPp3votu.mjs} +27 -10
- package/dist/composition/composition-report.d.ts +6 -0
- package/dist/composition/evaluate-field.d.ts +7 -0
- package/dist/composition/field-kinds.d.ts +12 -1
- package/dist/composition/helpers/index.d.ts +1 -1
- package/dist/composition/helpers/source-pick.d.ts +0 -5
- package/dist/composition/power-source-link.d.ts +15 -0
- package/dist/composition/state-fields.d.ts +2 -0
- package/dist/composition/validate-composition.d.ts +15 -1
- package/dist/device/base-device-provider.d.ts +13 -0
- package/dist/device/device-control-resolution.d.ts +1 -33
- package/dist/device/device-kind.d.ts +36 -0
- package/dist/device/device-management.d.ts +3 -0
- package/dist/device/device-type.d.ts +27 -10
- package/dist/device/hero/hero-fragment.d.ts +2 -0
- package/dist/device/hero/hero-layout.d.ts +1 -3
- package/dist/device/hero/hero-look.d.ts +18 -12
- package/dist/device/hero/hero-scene.d.ts +9 -3
- package/dist/device/index.d.ts +2 -1
- package/dist/device/power-switch.d.ts +82 -0
- package/dist/device/schema-fields.d.ts +10 -1
- package/dist/generated/addon-api.d.ts +7 -0
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/cap-input-defaults.d.ts +1 -1
- package/dist/generated/collection-array-methods.d.ts +1 -1
- package/dist/generated/customize-catalog.d.ts +257 -8
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/{implemented-methods-M5aguGon.mjs → implemented-methods-5YMDeE3f.mjs} +1 -1
- package/dist/{implemented-methods-8AU92riC.js → implemented-methods-Cj65uy2F.js} +1 -1
- package/dist/index.d.ts +11 -6
- package/dist/index.js +2386 -494
- package/dist/index.mjs +2312 -488
- package/dist/interfaces/addon-routes.d.ts +13 -0
- package/dist/interfaces/config-ui.d.ts +15 -24
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/{sleep-D_NpiLFP.mjs → sleep-D0roI_CZ.mjs} +50 -1
- package/dist/{sleep-vzHEmsrO.js → sleep-dcR4vBFG.js} +50 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -1108,12 +1108,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
1108
1108
|
DeviceType["Siren"] = "siren";
|
|
1109
1109
|
DeviceType["Switch"] = "switch";
|
|
1110
1110
|
DeviceType["Sensor"] = "sensor";
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
* `climate-control`
|
|
1114
|
-
*
|
|
1115
|
-
*
|
|
1116
|
-
*
|
|
1111
|
+
/** Every climate device: an air conditioner, a room thermostat, a radiator
|
|
1112
|
+
* valve, a floor-heating zone, a heat-pump circuit. They share one set of
|
|
1113
|
+
* controls (`climate-control`), so they are one type; WHICH kind of climate
|
|
1114
|
+
* device it is is its {@link DeviceRole} (`climate-*`), which the UI and the
|
|
1115
|
+
* exports branch on. The retired `thermostat` type is read as this one
|
|
1116
|
+
* (`canonicalStoredDeviceType`). */
|
|
1117
1117
|
DeviceType["Climate"] = "climate";
|
|
1118
1118
|
DeviceType["Button"] = "button";
|
|
1119
1119
|
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
@@ -1204,10 +1204,6 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
1204
1204
|
/** Washing machine. A plug-built one is running while its power stays
|
|
1205
1205
|
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
1206
1206
|
DeviceType["Washer"] = "washer";
|
|
1207
|
-
/** A dumb plug-in stove or heater: a switch (and, with a meter, a power
|
|
1208
|
-
* reading) that only runs while the plug is on. Built from a smart plug;
|
|
1209
|
-
* the `timed-run` cap switches it off again after a chosen time. */
|
|
1210
|
-
DeviceType["Heater"] = "heater";
|
|
1211
1207
|
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
1212
1208
|
DeviceType["Dryer"] = "dryer";
|
|
1213
1209
|
/** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
|
|
@@ -26656,7 +26652,6 @@ function applyPrimaryChildRule(rule, children) {
|
|
|
26656
26652
|
var CONTAINER_CHILD_PRIORITY = [
|
|
26657
26653
|
"media-player",
|
|
26658
26654
|
"alarm-panel",
|
|
26659
|
-
"thermostat",
|
|
26660
26655
|
"climate",
|
|
26661
26656
|
"humidifier",
|
|
26662
26657
|
"water-heater",
|
|
@@ -27214,6 +27209,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27214
27209
|
setPreset: (input) => dispatch("fan-control", "fanControl", "setPreset", "mutation", input),
|
|
27215
27210
|
setDirection: (input) => dispatch("fan-control", "fanControl", "setDirection", "mutation", input),
|
|
27216
27211
|
setOscillating: (input) => dispatch("fan-control", "fanControl", "setOscillating", "mutation", input),
|
|
27212
|
+
setOscillationAxis: (input) => dispatch("fan-control", "fanControl", "setOscillationAxis", "mutation", input),
|
|
27217
27213
|
getStatus: (input) => dispatch("fan-control", "fanControl", "getStatus", "query", input)
|
|
27218
27214
|
};
|
|
27219
27215
|
const featureProbeInterface = { getStatus: (input) => dispatch("feature-probe", "featureProbe", "getStatus", "query", input) };
|
package/dist/client.mjs
CHANGED
|
@@ -1107,12 +1107,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
1107
1107
|
DeviceType["Siren"] = "siren";
|
|
1108
1108
|
DeviceType["Switch"] = "switch";
|
|
1109
1109
|
DeviceType["Sensor"] = "sensor";
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
* `climate-control`
|
|
1113
|
-
*
|
|
1114
|
-
*
|
|
1115
|
-
*
|
|
1110
|
+
/** Every climate device: an air conditioner, a room thermostat, a radiator
|
|
1111
|
+
* valve, a floor-heating zone, a heat-pump circuit. They share one set of
|
|
1112
|
+
* controls (`climate-control`), so they are one type; WHICH kind of climate
|
|
1113
|
+
* device it is is its {@link DeviceRole} (`climate-*`), which the UI and the
|
|
1114
|
+
* exports branch on. The retired `thermostat` type is read as this one
|
|
1115
|
+
* (`canonicalStoredDeviceType`). */
|
|
1116
1116
|
DeviceType["Climate"] = "climate";
|
|
1117
1117
|
DeviceType["Button"] = "button";
|
|
1118
1118
|
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
@@ -1203,10 +1203,6 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
1203
1203
|
/** Washing machine. A plug-built one is running while its power stays
|
|
1204
1204
|
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
1205
1205
|
DeviceType["Washer"] = "washer";
|
|
1206
|
-
/** A dumb plug-in stove or heater: a switch (and, with a meter, a power
|
|
1207
|
-
* reading) that only runs while the plug is on. Built from a smart plug;
|
|
1208
|
-
* the `timed-run` cap switches it off again after a chosen time. */
|
|
1209
|
-
DeviceType["Heater"] = "heater";
|
|
1210
1206
|
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
1211
1207
|
DeviceType["Dryer"] = "dryer";
|
|
1212
1208
|
/** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
|
|
@@ -26655,7 +26651,6 @@ function applyPrimaryChildRule(rule, children) {
|
|
|
26655
26651
|
var CONTAINER_CHILD_PRIORITY = [
|
|
26656
26652
|
"media-player",
|
|
26657
26653
|
"alarm-panel",
|
|
26658
|
-
"thermostat",
|
|
26659
26654
|
"climate",
|
|
26660
26655
|
"humidifier",
|
|
26661
26656
|
"water-heater",
|
|
@@ -27213,6 +27208,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27213
27208
|
setPreset: (input) => dispatch("fan-control", "fanControl", "setPreset", "mutation", input),
|
|
27214
27209
|
setDirection: (input) => dispatch("fan-control", "fanControl", "setDirection", "mutation", input),
|
|
27215
27210
|
setOscillating: (input) => dispatch("fan-control", "fanControl", "setOscillating", "mutation", input),
|
|
27211
|
+
setOscillationAxis: (input) => dispatch("fan-control", "fanControl", "setOscillationAxis", "mutation", input),
|
|
27216
27212
|
getStatus: (input) => dispatch("fan-control", "fanControl", "getStatus", "query", input)
|
|
27217
27213
|
};
|
|
27218
27214
|
const featureProbeInterface = { getStatus: (input) => dispatch("feature-probe", "featureProbe", "getStatus", "query", input) };
|
|
@@ -19,12 +19,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
19
19
|
DeviceType["Siren"] = "siren";
|
|
20
20
|
DeviceType["Switch"] = "switch";
|
|
21
21
|
DeviceType["Sensor"] = "sensor";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* `climate-control`
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
22
|
+
/** Every climate device: an air conditioner, a room thermostat, a radiator
|
|
23
|
+
* valve, a floor-heating zone, a heat-pump circuit. They share one set of
|
|
24
|
+
* controls (`climate-control`), so they are one type; WHICH kind of climate
|
|
25
|
+
* device it is is its {@link DeviceRole} (`climate-*`), which the UI and the
|
|
26
|
+
* exports branch on. The retired `thermostat` type is read as this one
|
|
27
|
+
* (`canonicalStoredDeviceType`). */
|
|
28
28
|
DeviceType["Climate"] = "climate";
|
|
29
29
|
DeviceType["Button"] = "button";
|
|
30
30
|
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
@@ -115,10 +115,6 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
115
115
|
/** Washing machine. A plug-built one is running while its power stays
|
|
116
116
|
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
117
117
|
DeviceType["Washer"] = "washer";
|
|
118
|
-
/** A dumb plug-in stove or heater: a switch (and, with a meter, a power
|
|
119
|
-
* reading) that only runs while the plug is on. Built from a smart plug;
|
|
120
|
-
* the `timed-run` cap switches it off again after a chosen time. */
|
|
121
|
-
DeviceType["Heater"] = "heater";
|
|
122
118
|
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
123
119
|
DeviceType["Dryer"] = "dryer";
|
|
124
120
|
/** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
|
|
@@ -353,6 +349,27 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
353
349
|
/** A smart plug: a `switch` whose source says it is an outlet (HA
|
|
354
350
|
* `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
|
|
355
351
|
DeviceRole["Outlet"] = "outlet";
|
|
352
|
+
/** A dumb plug-in stove or heater behind a switch: it runs only while the
|
|
353
|
+
* switch is on. Offered `timed-run`, which switches it off again after a
|
|
354
|
+
* chosen time. */
|
|
355
|
+
DeviceRole["SwitchHeater"] = "switch-heater";
|
|
356
|
+
/** A plain fan behind a switch (a smart plug powering it): drawn as a fan,
|
|
357
|
+
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
358
|
+
* device also has a fan cap (D1033). */
|
|
359
|
+
DeviceRole["SwitchFan"] = "switch-fan";
|
|
360
|
+
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
361
|
+
DeviceRole["ClimateAc"] = "climate-ac";
|
|
362
|
+
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
363
|
+
DeviceRole["ClimateThermostat"] = "climate-thermostat";
|
|
364
|
+
/** Floor-heating zone actuator. */
|
|
365
|
+
DeviceRole["ClimateFloor"] = "climate-floor";
|
|
366
|
+
/** Radiator valve (thermostatic radiator head). */
|
|
367
|
+
DeviceRole["ClimateRadiator"] = "climate-radiator";
|
|
368
|
+
/** A heater with its own thermostat (stove, convector). */
|
|
369
|
+
DeviceRole["ClimateHeater"] = "climate-heater";
|
|
370
|
+
/** One heating/cooling circuit of a heat pump: a water loop with comfort /
|
|
371
|
+
* eco setpoints and a heat/cool mode, no room sensor. */
|
|
372
|
+
DeviceRole["ClimateHeatPumpCircuit"] = "climate-heat-pump-circuit";
|
|
356
373
|
/** Generic motion / occupancy / moving event source. Distinct from
|
|
357
374
|
* the camera accessory PirSensor role: that one is a camera child;
|
|
358
375
|
* this is a standalone HA / 3rd-party motion sensor. */
|
|
@@ -19,12 +19,12 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
19
19
|
DeviceType["Siren"] = "siren";
|
|
20
20
|
DeviceType["Switch"] = "switch";
|
|
21
21
|
DeviceType["Sensor"] = "sensor";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* `climate-control`
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
22
|
+
/** Every climate device: an air conditioner, a room thermostat, a radiator
|
|
23
|
+
* valve, a floor-heating zone, a heat-pump circuit. They share one set of
|
|
24
|
+
* controls (`climate-control`), so they are one type; WHICH kind of climate
|
|
25
|
+
* device it is is its {@link DeviceRole} (`climate-*`), which the UI and the
|
|
26
|
+
* exports branch on. The retired `thermostat` type is read as this one
|
|
27
|
+
* (`canonicalStoredDeviceType`). */
|
|
28
28
|
DeviceType["Climate"] = "climate";
|
|
29
29
|
DeviceType["Button"] = "button";
|
|
30
30
|
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
@@ -115,10 +115,6 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
115
115
|
/** Washing machine. A plug-built one is running while its power stays
|
|
116
116
|
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
117
117
|
DeviceType["Washer"] = "washer";
|
|
118
|
-
/** A dumb plug-in stove or heater: a switch (and, with a meter, a power
|
|
119
|
-
* reading) that only runs while the plug is on. Built from a smart plug;
|
|
120
|
-
* the `timed-run` cap switches it off again after a chosen time. */
|
|
121
|
-
DeviceType["Heater"] = "heater";
|
|
122
118
|
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
123
119
|
DeviceType["Dryer"] = "dryer";
|
|
124
120
|
/** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
|
|
@@ -353,6 +349,27 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
353
349
|
/** A smart plug: a `switch` whose source says it is an outlet (HA
|
|
354
350
|
* `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
|
|
355
351
|
DeviceRole["Outlet"] = "outlet";
|
|
352
|
+
/** A dumb plug-in stove or heater behind a switch: it runs only while the
|
|
353
|
+
* switch is on. Offered `timed-run`, which switches it off again after a
|
|
354
|
+
* chosen time. */
|
|
355
|
+
DeviceRole["SwitchHeater"] = "switch-heater";
|
|
356
|
+
/** A plain fan behind a switch (a smart plug powering it): drawn as a fan,
|
|
357
|
+
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
358
|
+
* device also has a fan cap (D1033). */
|
|
359
|
+
DeviceRole["SwitchFan"] = "switch-fan";
|
|
360
|
+
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
361
|
+
DeviceRole["ClimateAc"] = "climate-ac";
|
|
362
|
+
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
363
|
+
DeviceRole["ClimateThermostat"] = "climate-thermostat";
|
|
364
|
+
/** Floor-heating zone actuator. */
|
|
365
|
+
DeviceRole["ClimateFloor"] = "climate-floor";
|
|
366
|
+
/** Radiator valve (thermostatic radiator head). */
|
|
367
|
+
DeviceRole["ClimateRadiator"] = "climate-radiator";
|
|
368
|
+
/** A heater with its own thermostat (stove, convector). */
|
|
369
|
+
DeviceRole["ClimateHeater"] = "climate-heater";
|
|
370
|
+
/** One heating/cooling circuit of a heat pump: a water loop with comfort /
|
|
371
|
+
* eco setpoints and a heat/cool mode, no room sensor. */
|
|
372
|
+
DeviceRole["ClimateHeatPumpCircuit"] = "climate-heat-pump-circuit";
|
|
356
373
|
/** Generic motion / occupancy / moving event source. Distinct from
|
|
357
374
|
* the camera accessory PirSensor role: that one is a camera child;
|
|
358
375
|
* this is a standalone HA / 3rd-party motion sensor. */
|
|
@@ -24,10 +24,12 @@ export declare const CompositionProblemCodeSchema: z.ZodEnum<{
|
|
|
24
24
|
"not-composable": "not-composable";
|
|
25
25
|
"not-item-array": "not-item-array";
|
|
26
26
|
"not-replaceable": "not-replaceable";
|
|
27
|
+
"power-source-is-actuator": "power-source-is-actuator";
|
|
27
28
|
"reserved-variant": "reserved-variant";
|
|
28
29
|
retention: "retention";
|
|
29
30
|
"source-capability-missing": "source-capability-missing";
|
|
30
31
|
"source-field-unknown": "source-field-unknown";
|
|
32
|
+
"source-kind-mismatch": "source-kind-mismatch";
|
|
31
33
|
"source-missing": "source-missing";
|
|
32
34
|
"source-unreadable": "source-unreadable";
|
|
33
35
|
"target-missing": "target-missing";
|
|
@@ -60,10 +62,12 @@ export declare const CompositionProblemSchema: z.ZodObject<{
|
|
|
60
62
|
"not-composable": "not-composable";
|
|
61
63
|
"not-item-array": "not-item-array";
|
|
62
64
|
"not-replaceable": "not-replaceable";
|
|
65
|
+
"power-source-is-actuator": "power-source-is-actuator";
|
|
63
66
|
"reserved-variant": "reserved-variant";
|
|
64
67
|
retention: "retention";
|
|
65
68
|
"source-capability-missing": "source-capability-missing";
|
|
66
69
|
"source-field-unknown": "source-field-unknown";
|
|
70
|
+
"source-kind-mismatch": "source-kind-mismatch";
|
|
67
71
|
"source-missing": "source-missing";
|
|
68
72
|
"source-unreadable": "source-unreadable";
|
|
69
73
|
"target-missing": "target-missing";
|
|
@@ -286,10 +290,12 @@ export declare const CompositionValidationSchema: z.ZodObject<{
|
|
|
286
290
|
"not-composable": "not-composable";
|
|
287
291
|
"not-item-array": "not-item-array";
|
|
288
292
|
"not-replaceable": "not-replaceable";
|
|
293
|
+
"power-source-is-actuator": "power-source-is-actuator";
|
|
289
294
|
"reserved-variant": "reserved-variant";
|
|
290
295
|
retention: "retention";
|
|
291
296
|
"source-capability-missing": "source-capability-missing";
|
|
292
297
|
"source-field-unknown": "source-field-unknown";
|
|
298
|
+
"source-kind-mismatch": "source-kind-mismatch";
|
|
293
299
|
"source-missing": "source-missing";
|
|
294
300
|
"source-unreadable": "source-unreadable";
|
|
295
301
|
"target-missing": "target-missing";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ExpressionValue } from '../expression/ast.js';
|
|
2
2
|
import { type DwellTransition, type StatefulExpressionMemory } from '../expression/expression-source.js';
|
|
3
3
|
import { type CompositionFieldRead, type CompositionFieldSource } from './composition.js';
|
|
4
|
+
import type { CompositionFieldKind } from './composition-report.js';
|
|
4
5
|
export interface SourceFreshReading {
|
|
5
6
|
readonly state: 'fresh';
|
|
6
7
|
readonly value: ExpressionValue;
|
|
@@ -61,6 +62,12 @@ export interface EvaluateCompositionFieldInput {
|
|
|
61
62
|
readonly source: CompositionFieldSource;
|
|
62
63
|
readonly read: SourceReader;
|
|
63
64
|
readonly now: number;
|
|
65
|
+
/**
|
|
66
|
+
* The kind of the field written (the plan's `kind`). A direct read whose
|
|
67
|
+
* value is of another kind (a union source such as `control.value` whose
|
|
68
|
+
* device changed kind) is UNAVAILABLE, never coerced (D1034, D393).
|
|
69
|
+
*/
|
|
70
|
+
readonly targetKind?: CompositionFieldKind;
|
|
64
71
|
readonly stateful?: {
|
|
65
72
|
readonly currentOutput: unknown;
|
|
66
73
|
readonly expressionMemory: StatefulExpressionMemory;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CompositionFieldSource } from './composition.js';
|
|
2
2
|
import type { CompositionFeatureMode, CompositionFieldRole, CompositionProblem, CompositionProblemCode, CompositionUnavailableMode } from './composition-report.js';
|
|
3
|
-
import { type ExpressionKindSet } from './expression-kinds.js';
|
|
3
|
+
import { type ExpressionKindSet, type ExpressionValueKind } from './expression-kinds.js';
|
|
4
4
|
import { type StateFieldDescription } from './state-fields.js';
|
|
5
5
|
import type { CapabilityLookup } from './validate-composition.js';
|
|
6
6
|
interface KindsFound {
|
|
@@ -13,6 +13,17 @@ interface KindsRefused {
|
|
|
13
13
|
readonly message: string;
|
|
14
14
|
}
|
|
15
15
|
type KindsResult = KindsFound | KindsRefused;
|
|
16
|
+
/** A union field is read as a source (D1034), never written: no single kind to check a source against. */
|
|
17
|
+
export declare function unionTargetProblem(cap: string, path: string, at: string): CompositionProblem;
|
|
18
|
+
/** The one value kind a target field accepts. */
|
|
19
|
+
export declare function acceptedKind(target: StateFieldDescription): ExpressionValueKind | null;
|
|
20
|
+
/**
|
|
21
|
+
* A direct read of a UNION source field (D1034) is judged by the member that
|
|
22
|
+
* fits the target: when one does, the read produces that kind only (a reading
|
|
23
|
+
* of another kind is UNAVAILABLE at read time, never a coerced value); when
|
|
24
|
+
* none does, the kinds stay as they are and `compatibility` names the mismatch.
|
|
25
|
+
*/
|
|
26
|
+
export declare function narrowUnionRead(source: CompositionFieldSource, target: StateFieldDescription, kinds: ExpressionKindSet, lookupCap: CapabilityLookup): ExpressionKindSet;
|
|
16
27
|
export declare function sourceKinds(source: CompositionFieldSource, lookupCap: CapabilityLookup): KindsResult;
|
|
17
28
|
export declare function compatibility(cap: string, target: StateFieldDescription, kinds: ExpressionKindSet, at: string): readonly CompositionProblem[];
|
|
18
29
|
/**
|
|
@@ -9,5 +9,5 @@ export { KWH_PER_WATT_MS, wattMillisecondsToKwh } from './energy.js';
|
|
|
9
9
|
export { type HistoryValue, type IntegralScale, type SeriesBefore, type SeriesKind, type SeriesPoint, type SeriesRead, STATISTIC_STATS, SERIES_KINDS, evaluateDerivative, evaluateStatistic, integrateReading, } from './history-math.js';
|
|
10
10
|
export { type CalendarPeriod, type CalendarWindow, type HistoryRetention, type HistoryTier, type HistoryTierPlan, type OpenRange, type ResetPeriod, type RollingSpan, type RollingWindow, type StatisticWindow, CALENDAR_PERIODS, CalendarWindowSchema, DAY_MS, DEFAULT_HISTORY_RETENTION, historyRetentionFromSettings, HISTORY_FAST_MS, HISTORY_SLOW_MS, HISTORY_TIERS, HOUR_MS, MINUTE_MS, MIN_CUSTOM_MINUTES, RESET_PERIODS, ROLLING_SPANS, RollingWindowSchema, StatisticWindowSchema, integralCadenceMs, maxDurationMs, nextLocalMidnight, openReset, openStatistic, planResetTier, planStatisticTier, rollingDurationMs, statisticCadenceMs, } from './history-window.js';
|
|
11
11
|
export { type HelperMemberFact, helperSaveProblems, } from './save.js';
|
|
12
|
-
export { type SourcePick, type SourcePickAccept, type SourcePickFieldChoice, type SourcePickHistory, type SourcePickRequest, type MathSourceKind,
|
|
12
|
+
export { type SourcePick, type SourcePickAccept, type SourcePickFieldChoice, type SourcePickHistory, type SourcePickRequest, type MathSourceKind, sourcePickForHistory, sourcePickForMath, sourcePickForTemplate, } from './source-pick.js';
|
|
13
13
|
export { ACTIVE_CRITERIA, AGGREGATE_REDUCERS, ActiveCriterionSchema, AggregateReducerSchema, BINARY_AGGREGATES, GROUP_TEMPLATE_IDS, ARITHMETIC_OPS, ArithmeticHelperSpecSchema, DERIVATIVE_UNITS, DerivativeHelperSpecSchema, EXPRESSION_OUTPUTS, ExpressionHelperSpecSchema, ThresholdHelperSpecSchema, GroupHelperSpecSchema, GroupTemplateIdSchema, HelperMemberSchema, HelperSpecSchema, INTEGRAL_OUTPUTS, IntegralHelperSpecSchema, MAX_HELPER_MEMBERS, helperMembers, isHistoryHelper, NUMERIC_AGGREGATES, StatisticHelperSpecSchema, type ActiveCriterion, type AggregateReducer, type BinaryAggregate, type ArithmeticHelperSpec, type ArithmeticOp, type DerivativeHelperSpec, type DerivativeUnit, type ExpressionHelperSpec, type ExpressionInput, type ExpressionOutput, type ThresholdHelperSpec, type GroupHelperSpec, type GroupTemplateId, type HelperMember, type HelperSpec, type HistoryHelperSpec, type IntegralHelperSpec, type IntegralOutput, type NumericAggregate, type StatisticHelperSpec, type StatisticStat, } from './spec.js';
|
|
@@ -54,8 +54,3 @@ export type MathSourceKind = 'threshold' | 'sum' | 'difference' | 'ratio' | 'exp
|
|
|
54
54
|
* A derivative reads one historised number.
|
|
55
55
|
*/
|
|
56
56
|
export declare function sourcePickForMath(kind: MathSourceKind): SourcePickRequest;
|
|
57
|
-
/**
|
|
58
|
-
* The one thing a naked heater needs at creation (D1004 point 5): the plug it
|
|
59
|
-
* switches. On and off forward to that plug; no other facet is attached.
|
|
60
|
-
*/
|
|
61
|
-
export declare function sourcePickForHeaterPlug(): SourcePickRequest;
|
|
@@ -20,3 +20,18 @@ export declare function normalizeOffSeconds(value: unknown): number;
|
|
|
20
20
|
* passes the block id and a new-target composition without one has no link.
|
|
21
21
|
*/
|
|
22
22
|
export declare function powerSourceLinkOfComposition(composition: Composition | null, blockId?: string): PowerSourceLink | null;
|
|
23
|
+
/** A power-source link that names one of the device's own actuators: the field, and the switch it names. */
|
|
24
|
+
export interface PowerSourceActuatorConflict {
|
|
25
|
+
/** Where the link sits: `features[N].fields.switchOn`. */
|
|
26
|
+
readonly path: string;
|
|
27
|
+
/** The switch that is both the supply and an actuator (or the device itself). */
|
|
28
|
+
readonly switch: CompositionSourceRef;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The supply plug is never one of the device's own actuators (#462): cutting
|
|
32
|
+
* power through the switch that IS the device's on/off leaves nothing to
|
|
33
|
+
* restart, and makes "power off" and "turn off" the same press. Refused at save
|
|
34
|
+
* time (`power-source-is-actuator`) and again by the power-source provider for a
|
|
35
|
+
* link stored before this check existed (`switch-is-actuator`).
|
|
36
|
+
*/
|
|
37
|
+
export declare function powerSourceActuatorConflicts(composition: Composition): readonly PowerSourceActuatorConflict[];
|
|
@@ -12,6 +12,8 @@ export interface StateFieldDescription {
|
|
|
12
12
|
readonly required: boolean;
|
|
13
13
|
/** Present only when `kind === 'enum'` — the closed set of strings the field accepts. */
|
|
14
14
|
readonly enumValues?: readonly string[];
|
|
15
|
+
/** Present only when `kind === 'union'` — the scalar kinds the field may carry (D1034). */
|
|
16
|
+
readonly unionMembers?: WireableField['unionMembers'];
|
|
15
17
|
}
|
|
16
18
|
export declare function describeStateField(schema: z.ZodType, path: string): StateFieldDescription | null;
|
|
17
19
|
export declare function describeTopLevelStateFields(schema: z.ZodType): ReadonlyMap<string, StateFieldDescription>;
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
import type { CapabilityDefinition } from '../capabilities/capability-definition.js';
|
|
12
12
|
import type { DeviceType } from '../device/device-type.js';
|
|
13
13
|
import type { ReadingQuantity } from '../units/quantity.js';
|
|
14
|
-
import
|
|
14
|
+
import type { WireableScalarKind } from '../device/schema-fields.js';
|
|
15
|
+
import { type Composition, type CompositionFieldRead, type CompositionSourceRef } from './composition.js';
|
|
15
16
|
import { type CompositionPlanResult } from './plan-result.js';
|
|
16
17
|
import { type CompositionPeer } from './composition-graph.js';
|
|
17
18
|
import { type CompositionValidation } from './composition-report.js';
|
|
@@ -27,6 +28,13 @@ export interface CompositionSourceFound {
|
|
|
27
28
|
readonly deviceType?: DeviceType;
|
|
28
29
|
/** Present when the device declares one. Mixed quantities are refused. */
|
|
29
30
|
readonly quantity?: ReadingQuantity;
|
|
31
|
+
/**
|
|
32
|
+
* The LIVE kind of each union field the composition reads from this device,
|
|
33
|
+
* keyed `<cap>.<fieldPath>` (D1034): a numeric control's `control.value` is a
|
|
34
|
+
* number, a select's a string. Absent when the slice was not known at save
|
|
35
|
+
* time; the read-time guard still applies.
|
|
36
|
+
*/
|
|
37
|
+
readonly liveKinds?: ReadonlyMap<string, WireableScalarKind>;
|
|
30
38
|
}
|
|
31
39
|
export interface CompositionSourceAbsent {
|
|
32
40
|
readonly kind: 'absent';
|
|
@@ -78,6 +86,12 @@ export declare const PENDING_BLOCK_ID = "(unsaved)";
|
|
|
78
86
|
*/
|
|
79
87
|
export declare function planComposition(composition: Composition, lookupCap: CapabilityLookup, target?: CompositionTargetDescription): CompositionPlanResult;
|
|
80
88
|
export declare function compositionSourceRefs(composition: Composition): readonly CompositionSourceRef[];
|
|
89
|
+
/**
|
|
90
|
+
* Every DIRECT read (`from`) of a union source field (D1034): the reads whose
|
|
91
|
+
* source's live kind a save looks up, so a numeric control is never linked to
|
|
92
|
+
* a string field. A read inside an expression is judged by the expression.
|
|
93
|
+
*/
|
|
94
|
+
export declare function compositionUnionReads(composition: Composition, lookupCap: CapabilityLookup): readonly CompositionFieldRead[];
|
|
81
95
|
/**
|
|
82
96
|
* `compositionFieldKey` of every field a REPLACE feature of `plan` owns — the
|
|
83
97
|
* candidate's own, and a stored peer's `CompositionPeer.replaced` (D663): one
|
|
@@ -99,6 +99,12 @@ export interface FieldProbeResult {
|
|
|
99
99
|
* device-provider cap router. Shared across all providers.
|
|
100
100
|
*/
|
|
101
101
|
export declare function toDeviceSummary(device: IDevice, addonId: string): DeviceSummary;
|
|
102
|
+
/** What `deviceClassForRow` sees of a persisted row. */
|
|
103
|
+
export interface DeviceClassRow {
|
|
104
|
+
readonly type: string;
|
|
105
|
+
readonly stableId: string;
|
|
106
|
+
readonly config?: Record<string, unknown>;
|
|
107
|
+
}
|
|
102
108
|
/**
|
|
103
109
|
* Base class for device-provider addons (rtsp, onvif).
|
|
104
110
|
*
|
|
@@ -307,6 +313,13 @@ export declare abstract class BaseDeviceProvider<TConfig extends object = Record
|
|
|
307
313
|
* top-level type → class map only handles parent devices.
|
|
308
314
|
*/
|
|
309
315
|
protected abstract readonly deviceClasses: Partial<Record<DeviceType, DeviceConstructor<IDevice>>>;
|
|
316
|
+
/**
|
|
317
|
+
* The class a PERSISTED row is rebuilt with. Default: by type, from
|
|
318
|
+
* `deviceClasses`. A provider whose distinct devices share one type (D1033:
|
|
319
|
+
* a radiator valve and a room climate are both `climate`) overrides this
|
|
320
|
+
* and tells them apart by the row's stable id or config.
|
|
321
|
+
*/
|
|
322
|
+
protected deviceClassForRow(row: DeviceClassRow): DeviceConstructor<IDevice> | undefined;
|
|
310
323
|
/** Return the creation form schema for a given device type, or null if unsupported. */
|
|
311
324
|
protected abstract onGetCreationSchema(type: DeviceType, context?: CreationSchemaContext): Promise<ConfigUISchema | null>;
|
|
312
325
|
/**
|
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Device-control RESOLUTION LOGIC — the single, presentation-free source of
|
|
3
|
-
* truth for "given a device's `type` (+ its cap `features`), which control
|
|
4
|
-
* should render?".
|
|
5
|
-
*
|
|
6
|
-
* This module is deliberately framework-free: NO react / react-native / lucide
|
|
7
|
-
* imports, no JSX, no platform widgets. It encodes only the DECISION; each
|
|
8
|
-
* client (admin-ui's `@camstack/ui-library` web registry, the RN viewer's
|
|
9
|
-
* accessory registry) maps the returned control-KIND onto its own
|
|
10
|
-
* platform-specific components. That's the one duplication we remove — the
|
|
11
|
-
* presentational components stay platform-specific by necessity.
|
|
12
|
-
*
|
|
13
|
-
* Two decision surfaces live here, at two granularities:
|
|
14
|
-
*
|
|
15
|
-
* 1. `resolveDeviceControlKind(type)` — the BASE type → control-kind decision
|
|
16
|
-
* used by the admin-ui device list / device-detail hero. Exhaustive over
|
|
17
|
-
* every `DeviceType`; a light is a single `'light'` kind (dim-vs-plain is
|
|
18
|
-
* refined inside the light component).
|
|
19
|
-
*
|
|
20
|
-
* 2. `pickAccessoryControl({ type, features })` — the FINER accessory-row
|
|
21
|
-
* decision used by the viewer's per-camera accessory list. It refines a
|
|
22
|
-
* `light` into `'brightness'` vs `'switch'` and a `sensor`/`presence` into
|
|
23
|
-
* a specific sensor cap, because an accessory row renders ONE compact
|
|
24
|
-
* control chosen by priority.
|
|
25
|
-
*
|
|
26
|
-
* The two agree on every overlapping type EXCEPT `light` (see the notes on
|
|
27
|
-
* `pickAccessoryControl`): the base decision keeps a dedicated `'light'`
|
|
28
|
-
* control; the accessory decision collapses a non-dimmable light onto the
|
|
29
|
-
* generic `'switch'` control. That is a deliberate granularity difference, not
|
|
30
|
-
* a contradiction — the base kind is what the admin-ui renders, the accessory
|
|
31
|
-
* pick is what a compact camera-accessory row renders.
|
|
32
|
-
*/
|
|
33
1
|
import { DeviceType } from './device-type.js';
|
|
34
2
|
/**
|
|
35
3
|
* The abstract control-kind a `DeviceType` resolves to. Each client binds
|
|
@@ -52,7 +20,7 @@ export declare const DEVICE_TYPE_CONTROL_KIND: Record<DeviceType, DeviceControlK
|
|
|
52
20
|
* narrows the string to a `DeviceType` before indexing (documented enum-string
|
|
53
21
|
* boundary).
|
|
54
22
|
*/
|
|
55
|
-
export declare function resolveDeviceControlKind(type: string): DeviceControlKind | null;
|
|
23
|
+
export declare function resolveDeviceControlKind(type: string, role?: string | null): DeviceControlKind | null;
|
|
56
24
|
/** Identifier of the control kind an accessory row should render. `'none'` = no
|
|
57
25
|
* control. A subset of the surfaces the base decision covers, PLUS
|
|
58
26
|
* `'brightness'` (a dimmable light refined at the decision layer). */
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A device's KIND is its type plus its role (D1033): the type is the set of
|
|
3
|
+
* controls it has, the role says which thing it is among the devices that
|
|
4
|
+
* share those controls. A plug-in heater is a `switch` with role
|
|
5
|
+
* `switch-heater`; an air conditioner and a radiator valve are both `climate`,
|
|
6
|
+
* told apart by their `climate-*` role.
|
|
7
|
+
*/
|
|
8
|
+
import { DeviceRole, DeviceType } from './device-type.js';
|
|
9
|
+
/** The live type a stored `type` value stands for (itself unless retired). */
|
|
10
|
+
export declare function canonicalStoredDeviceType(stored: string): string;
|
|
11
|
+
/** The `climate-*` roles, in the order the role picker lists them. */
|
|
12
|
+
export declare const CLIMATE_ROLES: readonly DeviceRole[];
|
|
13
|
+
export type ClimateRole = DeviceRole.ClimateThermostat | DeviceRole.ClimateAc | DeviceRole.ClimateRadiator | DeviceRole.ClimateFloor | DeviceRole.ClimateHeater | DeviceRole.ClimateHeatPumpCircuit;
|
|
14
|
+
/**
|
|
15
|
+
* Which climate device this is. A climate device with no role, or a role that
|
|
16
|
+
* is not a climate one, is a room thermostat: that is what most of them are,
|
|
17
|
+
* and it is the presentation a thermostat had before the types were folded.
|
|
18
|
+
*/
|
|
19
|
+
export declare function climateRoleOf(role: string | null | undefined): ClimateRole;
|
|
20
|
+
/** An air conditioner: exports present it as an AC unit, not a thermostat. */
|
|
21
|
+
export declare function isAirConditioner(type: string, role: string | null | undefined): boolean;
|
|
22
|
+
/** The part of a capability definition that says which devices it is offered on. */
|
|
23
|
+
export interface DeviceKindGate {
|
|
24
|
+
readonly deviceTypes?: readonly DeviceType[];
|
|
25
|
+
readonly deviceRoles?: Readonly<Partial<Record<DeviceType, readonly DeviceRole[]>>>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Is a capability offered on a device of this type and role?
|
|
29
|
+
*
|
|
30
|
+
* Fails open where the old type-only gate did: no `deviceTypes` (or an empty
|
|
31
|
+
* list) applies to every device, and an unknown type never filters (a failed
|
|
32
|
+
* meta read must not destroy work, D49). A type the cap's `deviceRoles` names
|
|
33
|
+
* is offered only to the roles listed there; an unknown role is NOT one of
|
|
34
|
+
* them, so a `switch` whose role could not be read is not a heater.
|
|
35
|
+
*/
|
|
36
|
+
export declare function capAppliesToDeviceKind(gate: DeviceKindGate | undefined, deviceType: string | undefined, role: string | null | undefined): boolean;
|
|
@@ -190,6 +190,9 @@ export interface DeviceMeta {
|
|
|
190
190
|
* → canonical unit. Applied at RENDER time only — storage stays in source
|
|
191
191
|
* units. */
|
|
192
192
|
readonly display?: DeviceDisplayOverride;
|
|
193
|
+
/** Semantic role string (`DeviceRole`): with the type, which thing the device
|
|
194
|
+
* is (D1033). Absent / null ⇒ no role. */
|
|
195
|
+
readonly role?: string | null;
|
|
193
196
|
}
|
|
194
197
|
/**
|
|
195
198
|
* Initial meta a provider supplies on `onCreateDevice`. Differs
|
|
@@ -6,12 +6,12 @@ export declare enum DeviceType {
|
|
|
6
6
|
Siren = "siren",
|
|
7
7
|
Switch = "switch",
|
|
8
8
|
Sensor = "sensor",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* `climate-control`
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
/** Every climate device: an air conditioner, a room thermostat, a radiator
|
|
10
|
+
* valve, a floor-heating zone, a heat-pump circuit. They share one set of
|
|
11
|
+
* controls (`climate-control`), so they are one type; WHICH kind of climate
|
|
12
|
+
* device it is is its {@link DeviceRole} (`climate-*`), which the UI and the
|
|
13
|
+
* exports branch on. The retired `thermostat` type is read as this one
|
|
14
|
+
* (`canonicalStoredDeviceType`). */
|
|
15
15
|
Climate = "climate",
|
|
16
16
|
Button = "button",
|
|
17
17
|
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
@@ -102,10 +102,6 @@ export declare enum DeviceType {
|
|
|
102
102
|
/** Washing machine. A plug-built one is running while its power stays
|
|
103
103
|
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
104
104
|
Washer = "washer",
|
|
105
|
-
/** A dumb plug-in stove or heater: a switch (and, with a meter, a power
|
|
106
|
-
* reading) that only runs while the plug is on. Built from a smart plug;
|
|
107
|
-
* the `timed-run` cap switches it off again after a chosen time. */
|
|
108
|
-
Heater = "heater",
|
|
109
105
|
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
110
106
|
Dryer = "dryer",
|
|
111
107
|
/** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
|
|
@@ -335,6 +331,27 @@ export declare enum DeviceRole {
|
|
|
335
331
|
/** A smart plug: a `switch` whose source says it is an outlet (HA
|
|
336
332
|
* `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
|
|
337
333
|
Outlet = "outlet",
|
|
334
|
+
/** A dumb plug-in stove or heater behind a switch: it runs only while the
|
|
335
|
+
* switch is on. Offered `timed-run`, which switches it off again after a
|
|
336
|
+
* chosen time. */
|
|
337
|
+
SwitchHeater = "switch-heater",
|
|
338
|
+
/** A plain fan behind a switch (a smart plug powering it): drawn as a fan,
|
|
339
|
+
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
340
|
+
* device also has a fan cap (D1033). */
|
|
341
|
+
SwitchFan = "switch-fan",
|
|
342
|
+
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
343
|
+
ClimateAc = "climate-ac",
|
|
344
|
+
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
345
|
+
ClimateThermostat = "climate-thermostat",
|
|
346
|
+
/** Floor-heating zone actuator. */
|
|
347
|
+
ClimateFloor = "climate-floor",
|
|
348
|
+
/** Radiator valve (thermostatic radiator head). */
|
|
349
|
+
ClimateRadiator = "climate-radiator",
|
|
350
|
+
/** A heater with its own thermostat (stove, convector). */
|
|
351
|
+
ClimateHeater = "climate-heater",
|
|
352
|
+
/** One heating/cooling circuit of a heat pump: a water loop with comfort /
|
|
353
|
+
* eco setpoints and a heat/cool mode, no room sensor. */
|
|
354
|
+
ClimateHeatPumpCircuit = "climate-heat-pump-circuit",
|
|
338
355
|
/** Generic motion / occupancy / moving event source. Distinct from
|
|
339
356
|
* the camera accessory PirSensor role: that one is a camera child;
|
|
340
357
|
* this is a standalone HA / 3rd-party motion sensor. */
|
|
@@ -22,6 +22,8 @@ export interface StateReading {
|
|
|
22
22
|
export interface HeroContext {
|
|
23
23
|
readonly deviceId: number;
|
|
24
24
|
readonly type: string;
|
|
25
|
+
/** The device's role: with the type, which thing it is (D1033). */
|
|
26
|
+
readonly role: string | null;
|
|
25
27
|
readonly features: readonly string[];
|
|
26
28
|
readonly now: number;
|
|
27
29
|
/** The `running-state` reading: `undefined` = not bound or not answered, `null` = unknown. */
|
|
@@ -11,7 +11,6 @@ export declare const HERO_LAYOUT_BY_TYPE: {
|
|
|
11
11
|
readonly siren: HeroLayout;
|
|
12
12
|
readonly switch: HeroLayout;
|
|
13
13
|
readonly sensor: HeroLayout;
|
|
14
|
-
readonly thermostat: HeroLayout;
|
|
15
14
|
readonly climate: HeroLayout;
|
|
16
15
|
readonly button: HeroLayout;
|
|
17
16
|
readonly "event-emitter": HeroLayout;
|
|
@@ -40,9 +39,8 @@ export declare const HERO_LAYOUT_BY_TYPE: {
|
|
|
40
39
|
readonly "pet-fountain": HeroLayout;
|
|
41
40
|
readonly dishwasher: HeroLayout;
|
|
42
41
|
readonly washer: HeroLayout;
|
|
43
|
-
readonly heater: HeroLayout;
|
|
44
42
|
readonly dryer: HeroLayout;
|
|
45
43
|
readonly gateway: HeroLayout;
|
|
46
44
|
};
|
|
47
45
|
/** The layout of a type; a type this build does not know gets the default. */
|
|
48
|
-
export declare function resolveHeroLayout(type: string): HeroLayout;
|
|
46
|
+
export declare function resolveHeroLayout(type: string, role?: string | null): HeroLayout;
|