@camstack/types 1.2.434 → 1.2.435
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/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/air-quality-sensor.cap.d.ts +8 -8
- package/dist/capabilities/ambient-light-sensor.cap.d.ts +4 -4
- package/dist/capabilities/battery.cap.d.ts +14 -14
- package/dist/capabilities/brightness.cap.d.ts +7 -7
- package/dist/capabilities/capability-definition.d.ts +3 -3
- package/dist/capabilities/color.cap.d.ts +6 -6
- package/dist/capabilities/device-history.cap.d.ts +2 -2
- package/dist/capabilities/dishwasher.cap.d.ts +11 -11
- package/dist/capabilities/fan-control.cap.d.ts +6 -6
- package/dist/capabilities/humidity-sensor.cap.d.ts +4 -4
- package/dist/capabilities/lawn-mower-control.cap.d.ts +3 -3
- package/dist/capabilities/media-player.cap.d.ts +8 -8
- package/dist/capabilities/meter.cap.d.ts +1 -1
- package/dist/capabilities/network-link.cap.d.ts +13 -13
- package/dist/capabilities/power-meter.cap.d.ts +22 -22
- package/dist/capabilities/presence.cap.d.ts +1 -15
- package/dist/capabilities/pressure-sensor.cap.d.ts +4 -4
- package/dist/capabilities/temperature-sensor.cap.d.ts +4 -4
- package/dist/capabilities/vacuum-control.cap.d.ts +3 -3
- package/dist/client.js +1 -1
- package/dist/client.mjs +1 -1
- package/dist/composition/composition-report.d.ts +1 -1
- package/dist/composition/examples.d.ts +1 -1
- package/dist/composition/helpers/appliance.d.ts +1 -1
- package/dist/{composition-CpAc0YfQ.js → composition-BZf_gqG7.js} +2 -2
- package/dist/{composition-Bb8iwHEJ.mjs → composition-CZImLpOI.mjs} +2 -2
- package/dist/device/base-device.d.ts +2 -2
- package/dist/device/device-runtime-state.d.ts +1 -1
- package/dist/device/device-state-handle.d.ts +1 -1
- package/dist/device/system-mirror.d.ts +1 -1
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/customize-catalog.d.ts +15 -15
- package/dist/generated/history-catalog.d.ts +1 -1
- package/dist/index.js +182 -203
- package/dist/index.mjs +182 -203
- package/dist/interfaces/event-bus.d.ts +3 -3
- package/dist/node.js +1 -1
- package/dist/node.mjs +1 -1
- package/dist/{sleep-DFaVPxfm.mjs → sleep-Crlmu_tO.mjs} +26 -30
- package/dist/{sleep-CO61AfwW.js → sleep-DHitF_e4.js} +26 -30
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-DHitF_e4.js");
|
|
3
3
|
const require_event_category = require("./event-category-E17zaHjN.js");
|
|
4
|
-
const require_composition = require("./composition-
|
|
4
|
+
const require_composition = require("./composition-BZf_gqG7.js");
|
|
5
5
|
const require_node_color = require("./node-color.js");
|
|
6
6
|
const require_err_msg = require("./err-msg-U7lLUMNz.js");
|
|
7
7
|
const require_enums = require("./enums.js");
|
|
@@ -14905,7 +14905,7 @@ var CompositionProblemCodeSchema = zod.z.enum([
|
|
|
14905
14905
|
"member-constraint",
|
|
14906
14906
|
"retention"
|
|
14907
14907
|
]);
|
|
14908
|
-
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.
|
|
14908
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
|
|
14909
14909
|
var CompositionProblemSchema = zod.z.object({
|
|
14910
14910
|
code: CompositionProblemCodeSchema,
|
|
14911
14911
|
path: zod.z.string(),
|
|
@@ -15611,7 +15611,7 @@ var GROUP_TEMPLATES = [
|
|
|
15611
15611
|
summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
|
|
15612
15612
|
role: require_err_msg.DeviceRole.TemperatureSensor,
|
|
15613
15613
|
outputCap: "temperature-sensor",
|
|
15614
|
-
outputField: "
|
|
15614
|
+
outputField: "temperature",
|
|
15615
15615
|
quantity: "temperature",
|
|
15616
15616
|
defaultAggregate: "mean",
|
|
15617
15617
|
empty: "null",
|
|
@@ -15622,7 +15622,7 @@ var GROUP_TEMPLATES = [
|
|
|
15622
15622
|
summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
15623
15623
|
role: require_err_msg.DeviceRole.HumiditySensor,
|
|
15624
15624
|
outputCap: "humidity-sensor",
|
|
15625
|
-
outputField: "
|
|
15625
|
+
outputField: "humidity",
|
|
15626
15626
|
quantity: "humidity",
|
|
15627
15627
|
defaultAggregate: "mean",
|
|
15628
15628
|
empty: "null",
|
|
@@ -15633,7 +15633,7 @@ var GROUP_TEMPLATES = [
|
|
|
15633
15633
|
summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
|
|
15634
15634
|
role: require_err_msg.DeviceRole.PressureSensor,
|
|
15635
15635
|
outputCap: "pressure-sensor",
|
|
15636
|
-
outputField: "
|
|
15636
|
+
outputField: "pressure",
|
|
15637
15637
|
quantity: "pressure",
|
|
15638
15638
|
defaultAggregate: "mean",
|
|
15639
15639
|
empty: "null",
|
|
@@ -15644,7 +15644,7 @@ var GROUP_TEMPLATES = [
|
|
|
15644
15644
|
summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
|
|
15645
15645
|
role: require_err_msg.DeviceRole.AmbientLightSensor,
|
|
15646
15646
|
outputCap: "ambient-light-sensor",
|
|
15647
|
-
outputField: "
|
|
15647
|
+
outputField: "illuminance",
|
|
15648
15648
|
quantity: "illuminance",
|
|
15649
15649
|
defaultAggregate: "mean",
|
|
15650
15650
|
empty: "null",
|
|
@@ -15655,7 +15655,7 @@ var GROUP_TEMPLATES = [
|
|
|
15655
15655
|
summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
|
|
15656
15656
|
role: require_err_msg.DeviceRole.PowerSensor,
|
|
15657
15657
|
outputCap: "power-meter",
|
|
15658
|
-
outputField: "
|
|
15658
|
+
outputField: "power",
|
|
15659
15659
|
quantity: "power",
|
|
15660
15660
|
defaultAggregate: "sum",
|
|
15661
15661
|
empty: "omit",
|
|
@@ -15666,7 +15666,7 @@ var GROUP_TEMPLATES = [
|
|
|
15666
15666
|
summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
|
|
15667
15667
|
role: require_err_msg.DeviceRole.EnergySensor,
|
|
15668
15668
|
outputCap: "power-meter",
|
|
15669
|
-
outputField: "
|
|
15669
|
+
outputField: "energy",
|
|
15670
15670
|
quantity: "energy",
|
|
15671
15671
|
defaultAggregate: "sum",
|
|
15672
15672
|
empty: "omit",
|
|
@@ -15677,7 +15677,7 @@ var GROUP_TEMPLATES = [
|
|
|
15677
15677
|
summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
15678
15678
|
role: require_err_msg.DeviceRole.BatterySensor,
|
|
15679
15679
|
outputCap: "battery",
|
|
15680
|
-
outputField: "
|
|
15680
|
+
outputField: "level",
|
|
15681
15681
|
quantity: "percentage",
|
|
15682
15682
|
defaultAggregate: "mean",
|
|
15683
15683
|
empty: "null",
|
|
@@ -16131,17 +16131,17 @@ async function runFanOut(calls, invoke) {
|
|
|
16131
16131
|
//#region src/generated/history-catalog.ts
|
|
16132
16132
|
/**
|
|
16133
16133
|
* Cap history catalog, projected from every `*.cap.ts` `history` block.
|
|
16134
|
-
*
|
|
16134
|
+
* 41 caps with series (76 series), 34 caps answered `'none'`.
|
|
16135
16135
|
* Field keys are `runtimeState` paths (`a.b` into fixed objects only).
|
|
16136
16136
|
*/
|
|
16137
16137
|
var HISTORY_CATALOG = {
|
|
16138
16138
|
"air-quality-sensor": {
|
|
16139
|
-
"
|
|
16139
|
+
"co2": {
|
|
16140
16140
|
kind: "gauge",
|
|
16141
16141
|
unit: "ppm",
|
|
16142
16142
|
deadband: 5
|
|
16143
16143
|
},
|
|
16144
|
-
"
|
|
16144
|
+
"voc": {
|
|
16145
16145
|
kind: "gauge",
|
|
16146
16146
|
unit: "ppb",
|
|
16147
16147
|
deadband: 5
|
|
@@ -16177,24 +16177,24 @@ var HISTORY_CATALOG = {
|
|
|
16177
16177
|
"triggered"
|
|
16178
16178
|
]
|
|
16179
16179
|
} },
|
|
16180
|
-
"ambient-light-sensor": { "
|
|
16180
|
+
"ambient-light-sensor": { "illuminance": {
|
|
16181
16181
|
kind: "gauge",
|
|
16182
16182
|
unit: "lx",
|
|
16183
16183
|
deadbandPct: 10,
|
|
16184
16184
|
minIntervalMs: 6e4
|
|
16185
16185
|
} },
|
|
16186
16186
|
"battery": {
|
|
16187
|
-
"
|
|
16187
|
+
"level": {
|
|
16188
16188
|
kind: "gauge",
|
|
16189
16189
|
unit: "%"
|
|
16190
16190
|
},
|
|
16191
|
-
"
|
|
16191
|
+
"voltage": {
|
|
16192
16192
|
kind: "gauge",
|
|
16193
16193
|
unit: "V"
|
|
16194
16194
|
}
|
|
16195
16195
|
},
|
|
16196
16196
|
"binary": { "on": { kind: "boolean" } },
|
|
16197
|
-
"brightness": { "
|
|
16197
|
+
"brightness": { "level": {
|
|
16198
16198
|
kind: "gauge",
|
|
16199
16199
|
unit: "%",
|
|
16200
16200
|
minIntervalMs: 0
|
|
@@ -16236,7 +16236,7 @@ var HISTORY_CATALOG = {
|
|
|
16236
16236
|
} },
|
|
16237
16237
|
"device-status": { "online": { kind: "boolean" } },
|
|
16238
16238
|
"dishwasher": {
|
|
16239
|
-
"
|
|
16239
|
+
"progress": {
|
|
16240
16240
|
kind: "gauge",
|
|
16241
16241
|
unit: "%",
|
|
16242
16242
|
deadband: 2
|
|
@@ -16266,7 +16266,7 @@ var HISTORY_CATALOG = {
|
|
|
16266
16266
|
"Aborting"
|
|
16267
16267
|
]
|
|
16268
16268
|
},
|
|
16269
|
-
"
|
|
16269
|
+
"remaining": {
|
|
16270
16270
|
kind: "gauge",
|
|
16271
16271
|
unit: "s",
|
|
16272
16272
|
minIntervalMs: 6e4
|
|
@@ -16279,7 +16279,7 @@ var HISTORY_CATALOG = {
|
|
|
16279
16279
|
skipWhenSet: "timestamp"
|
|
16280
16280
|
} },
|
|
16281
16281
|
"fan-control": {
|
|
16282
|
-
"
|
|
16282
|
+
"speed": {
|
|
16283
16283
|
kind: "gauge",
|
|
16284
16284
|
unit: "%",
|
|
16285
16285
|
minIntervalMs: 0
|
|
@@ -16301,7 +16301,7 @@ var HISTORY_CATALOG = {
|
|
|
16301
16301
|
},
|
|
16302
16302
|
"on": { kind: "boolean" }
|
|
16303
16303
|
},
|
|
16304
|
-
"humidity-sensor": { "
|
|
16304
|
+
"humidity-sensor": { "humidity": {
|
|
16305
16305
|
kind: "gauge",
|
|
16306
16306
|
unit: "%",
|
|
16307
16307
|
deadband: .5
|
|
@@ -16339,13 +16339,13 @@ var HISTORY_CATALOG = {
|
|
|
16339
16339
|
excludeDeviceTypes: [require_err_msg.DeviceType.Camera]
|
|
16340
16340
|
} },
|
|
16341
16341
|
"network-link": {
|
|
16342
|
-
"
|
|
16342
|
+
"signal": {
|
|
16343
16343
|
kind: "gauge",
|
|
16344
16344
|
unit: "%",
|
|
16345
16345
|
deadband: 3,
|
|
16346
16346
|
minIntervalMs: 6e4
|
|
16347
16347
|
},
|
|
16348
|
-
"
|
|
16348
|
+
"rssi": {
|
|
16349
16349
|
kind: "gauge",
|
|
16350
16350
|
unit: "dBm",
|
|
16351
16351
|
deadband: 2,
|
|
@@ -16372,31 +16372,31 @@ var HISTORY_CATALOG = {
|
|
|
16372
16372
|
}
|
|
16373
16373
|
},
|
|
16374
16374
|
"power-meter": {
|
|
16375
|
-
"
|
|
16375
|
+
"power": {
|
|
16376
16376
|
kind: "gauge",
|
|
16377
16377
|
unit: "W",
|
|
16378
16378
|
deadband: 1,
|
|
16379
16379
|
minIntervalMs: 3e4
|
|
16380
16380
|
},
|
|
16381
|
-
"
|
|
16381
|
+
"energy": {
|
|
16382
16382
|
kind: "counter",
|
|
16383
16383
|
unit: "kWh",
|
|
16384
16384
|
deadband: .01,
|
|
16385
16385
|
minIntervalMs: 6e4
|
|
16386
16386
|
},
|
|
16387
|
-
"
|
|
16387
|
+
"voltage": {
|
|
16388
16388
|
kind: "gauge",
|
|
16389
16389
|
unit: "V",
|
|
16390
16390
|
deadband: 1,
|
|
16391
16391
|
minIntervalMs: 3e4
|
|
16392
16392
|
},
|
|
16393
|
-
"
|
|
16393
|
+
"current": {
|
|
16394
16394
|
kind: "gauge",
|
|
16395
16395
|
unit: "A",
|
|
16396
16396
|
deadband: .05,
|
|
16397
16397
|
minIntervalMs: 3e4
|
|
16398
16398
|
},
|
|
16399
|
-
"
|
|
16399
|
+
"apparentPower": {
|
|
16400
16400
|
kind: "gauge",
|
|
16401
16401
|
unit: "VA",
|
|
16402
16402
|
deadband: 1,
|
|
@@ -16409,12 +16409,7 @@ var HISTORY_CATALOG = {
|
|
|
16409
16409
|
minIntervalMs: 6e4
|
|
16410
16410
|
}
|
|
16411
16411
|
},
|
|
16412
|
-
"
|
|
16413
|
-
kind: "gauge",
|
|
16414
|
-
unit: "%",
|
|
16415
|
-
deadband: 1
|
|
16416
|
-
} },
|
|
16417
|
-
"pressure-sensor": { "hpa": {
|
|
16412
|
+
"pressure-sensor": { "pressure": {
|
|
16418
16413
|
kind: "gauge",
|
|
16419
16414
|
unit: "hPa",
|
|
16420
16415
|
deadband: .1
|
|
@@ -16441,7 +16436,7 @@ var HISTORY_CATALOG = {
|
|
|
16441
16436
|
},
|
|
16442
16437
|
"switch": { "on": { kind: "boolean" } },
|
|
16443
16438
|
"tamper": { "tampered": { kind: "boolean" } },
|
|
16444
|
-
"temperature-sensor": { "
|
|
16439
|
+
"temperature-sensor": { "temperature": {
|
|
16445
16440
|
kind: "gauge",
|
|
16446
16441
|
unit: "°C",
|
|
16447
16442
|
deadband: .1
|
|
@@ -16549,6 +16544,7 @@ var HISTORY_NONE_CAPS = [
|
|
|
16549
16544
|
"native-object-detection",
|
|
16550
16545
|
"navigation",
|
|
16551
16546
|
"notifier",
|
|
16547
|
+
"presence",
|
|
16552
16548
|
"privacy-mask",
|
|
16553
16549
|
"ptz-autotrack",
|
|
16554
16550
|
"recording-onboard",
|
|
@@ -16686,10 +16682,10 @@ function derivativeDraft(spec, retention = require_composition.DEFAULT_HISTORY_R
|
|
|
16686
16682
|
function integralDraft(spec, retention = require_composition.DEFAULT_HISTORY_RETENTION) {
|
|
16687
16683
|
const problems = [...historyProblems(spec.source)];
|
|
16688
16684
|
const kind = declaredSeriesKind(spec.source);
|
|
16689
|
-
const
|
|
16685
|
+
const isPower = spec.source.cap === "power-meter" && spec.source.fieldPath === "power";
|
|
16690
16686
|
if (kind === "counter" || kind === "boolean" || kind === "enum") problems.push(problem("kind-mismatch", "helper.source", "an integral reads an instantaneous gauge, not a counter or a state"));
|
|
16691
|
-
if (spec.output === "energy" && !
|
|
16692
|
-
if (spec.output === "meter" &&
|
|
16687
|
+
if (spec.output === "energy" && !isPower) problems.push(problem("kind-mismatch", "helper.output", "energy is the integral of power-meter.power; another reading uses the meter"));
|
|
16688
|
+
if (spec.output === "meter" && isPower) problems.push(problem("kind-mismatch", "helper.output", "power integrates to power-meter.energy, which energy dashboards already read"));
|
|
16693
16689
|
const tier = require_composition.planResetTier(spec.reset, retention);
|
|
16694
16690
|
if (!tier.ok) problems.push(problem("retention", "helper.reset", tier.reason));
|
|
16695
16691
|
const energy = spec.output === "energy";
|
|
@@ -16698,7 +16694,7 @@ function integralDraft(spec, retention = require_composition.DEFAULT_HISTORY_RET
|
|
|
16698
16694
|
draft: draft({
|
|
16699
16695
|
role: energy ? require_err_msg.DeviceRole.EnergySensor : require_err_msg.DeviceRole.NumericSensor,
|
|
16700
16696
|
cap: energy ? "power-meter" : "meter",
|
|
16701
|
-
field: energy ? "
|
|
16697
|
+
field: energy ? "energy" : "value",
|
|
16702
16698
|
empty: "offline",
|
|
16703
16699
|
spec,
|
|
16704
16700
|
member: spec.source
|
|
@@ -16957,9 +16953,9 @@ function expressionSource(expr, bindings = {}) {
|
|
|
16957
16953
|
}
|
|
16958
16954
|
function compileAppliance(spec) {
|
|
16959
16955
|
const member = spec.member;
|
|
16960
|
-
if (member.cap !== "power-meter" || member.fieldPath !== "
|
|
16956
|
+
if (member.cap !== "power-meter" || member.fieldPath !== "power") return {
|
|
16961
16957
|
ok: false,
|
|
16962
|
-
problems: [problem("member-constraint", "helper.member", "an appliance helper reads power-meter.
|
|
16958
|
+
problems: [problem("member-constraint", "helper.member", "an appliance helper reads power-meter.power")]
|
|
16963
16959
|
};
|
|
16964
16960
|
const threshold = unsignedToken(spec.thresholdWatts);
|
|
16965
16961
|
const start = unsignedToken(spec.startDwellMs);
|
|
@@ -17000,7 +16996,7 @@ function compileAppliance(spec) {
|
|
|
17000
16996
|
kind: "fields",
|
|
17001
16997
|
cap: "power-meter",
|
|
17002
16998
|
fields: {
|
|
17003
|
-
|
|
16999
|
+
power: read,
|
|
17004
17000
|
lastFetchedAt: clock
|
|
17005
17001
|
}
|
|
17006
17002
|
}]
|
|
@@ -19226,8 +19222,8 @@ var DeviceHistoryProducerKindSchema = zod.z.enum([
|
|
|
19226
19222
|
/**
|
|
19227
19223
|
* A key computed at READ time from stored series of the same device, never
|
|
19228
19224
|
* stored itself. Energy (kWh per bucket) comes from the power meter's
|
|
19229
|
-
* `
|
|
19230
|
-
* `
|
|
19225
|
+
* `energy` counter when the device has one, else from integrating its
|
|
19226
|
+
* `power` gauge over time.
|
|
19231
19227
|
*/
|
|
19232
19228
|
var DEVICE_HISTORY_ENERGY_KEY = "derived:energy.kwh";
|
|
19233
19229
|
var DeviceHistoryResolutionSchema = zod.z.enum([
|
|
@@ -64266,9 +64262,9 @@ var addonsCapability = {
|
|
|
64266
64262
|
*/
|
|
64267
64263
|
var AirQualitySensorStatusSchema = zod.z.object({
|
|
64268
64264
|
/** Carbon dioxide concentration in ppm. */
|
|
64269
|
-
|
|
64265
|
+
co2: zod.z.number().min(0).optional().meta(require_sleep.readingMeta("concentration-volume")),
|
|
64270
64266
|
/** Total volatile organic compounds in ppb. */
|
|
64271
|
-
|
|
64267
|
+
voc: zod.z.number().min(0).optional().meta(require_sleep.readingMeta("concentration-ppb")),
|
|
64272
64268
|
/** Particulate matter ≤ 2.5 μm in µg/m³. */
|
|
64273
64269
|
pm25: zod.z.number().min(0).optional().meta(require_sleep.readingMeta("concentration-mass")),
|
|
64274
64270
|
/** Particulate matter ≤ 10 μm in µg/m³. */
|
|
@@ -64301,12 +64297,12 @@ var airQualitySensorCapability = {
|
|
|
64301
64297
|
* History (D850): recorded series.
|
|
64302
64298
|
*/
|
|
64303
64299
|
history: { fields: {
|
|
64304
|
-
|
|
64300
|
+
co2: {
|
|
64305
64301
|
kind: "gauge",
|
|
64306
64302
|
unit: "ppm",
|
|
64307
64303
|
deadband: 5
|
|
64308
64304
|
},
|
|
64309
|
-
|
|
64305
|
+
voc: {
|
|
64310
64306
|
kind: "gauge",
|
|
64311
64307
|
unit: "ppb",
|
|
64312
64308
|
deadband: 5
|
|
@@ -64339,7 +64335,7 @@ var airQualitySensorCapability = {
|
|
|
64339
64335
|
*/
|
|
64340
64336
|
var AmbientLightSensorStatusSchema = zod.z.object({
|
|
64341
64337
|
/** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
|
|
64342
|
-
|
|
64338
|
+
illuminance: zod.z.number().min(0).nullable().meta(require_sleep.readingMeta("illuminance", {
|
|
64343
64339
|
precision: 0,
|
|
64344
64340
|
label: "Illuminance"
|
|
64345
64341
|
})),
|
|
@@ -64368,7 +64364,7 @@ var ambientLightSensorCapability = {
|
|
|
64368
64364
|
/**
|
|
64369
64365
|
* History (D850): recorded series. Wide range, so a RELATIVE deadband (10 %).
|
|
64370
64366
|
*/
|
|
64371
|
-
history: { fields: {
|
|
64367
|
+
history: { fields: { illuminance: {
|
|
64372
64368
|
kind: "gauge",
|
|
64373
64369
|
unit: "lx",
|
|
64374
64370
|
deadbandPct: 10,
|
|
@@ -64764,7 +64760,7 @@ var BatteryStatusSchema = zod.z.object({
|
|
|
64764
64760
|
* Consumers must SKIP a null rather than coerce it — `battery-band` already
|
|
64765
64761
|
* declines to band a non-finite reading, which is the correct shape.
|
|
64766
64762
|
*/
|
|
64767
|
-
|
|
64763
|
+
level: zod.z.number().min(0).max(100).nullable().meta(require_sleep.readingMeta("percentage", { label: "Charge" })),
|
|
64768
64764
|
/**
|
|
64769
64765
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
64770
64766
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
@@ -64774,7 +64770,7 @@ var BatteryStatusSchema = zod.z.object({
|
|
|
64774
64770
|
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
64775
64771
|
* power fields yet, or the firmware reported neither. Before it existed,
|
|
64776
64772
|
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
64777
|
-
* was drawn "on battery alone" — the same D315 defect `
|
|
64773
|
+
* was drawn "on battery alone" — the same D315 defect `level` closed
|
|
64778
64774
|
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
64779
64775
|
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
64780
64776
|
*/
|
|
@@ -64798,7 +64794,7 @@ var BatteryStatusSchema = zod.z.object({
|
|
|
64798
64794
|
* that only report charge. A second reading on this cap, not a second
|
|
64799
64795
|
* `numeric-sensor` on the same device.
|
|
64800
64796
|
*/
|
|
64801
|
-
|
|
64797
|
+
voltage: zod.z.number().nullable().optional().meta(require_sleep.readingMeta("voltage", { label: "Voltage" })),
|
|
64802
64798
|
/**
|
|
64803
64799
|
* Ms epoch of the last time the device PROVED it was reachable — a
|
|
64804
64800
|
* completed firmware round-trip, an observed wake, or an inbound push
|
|
@@ -64832,7 +64828,7 @@ var BatteryStatusSchema = zod.z.object({
|
|
|
64832
64828
|
/**
|
|
64833
64829
|
* True when the source is a BINARY low-battery indicator (HA
|
|
64834
64830
|
* `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
|
|
64835
|
-
* charge level — `
|
|
64831
|
+
* charge level — `level` is then a coarse stand-in (100 = normal,
|
|
64836
64832
|
* sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
|
|
64837
64833
|
* misleading exact percentage. Absent/false → genuine 0–100 % reading.
|
|
64838
64834
|
*/
|
|
@@ -64852,15 +64848,15 @@ var BATTERY_DEVICE_TYPES = [
|
|
|
64852
64848
|
var batteryCustomize = {
|
|
64853
64849
|
version: 1,
|
|
64854
64850
|
targets: [{
|
|
64855
|
-
id: "
|
|
64851
|
+
id: "level",
|
|
64856
64852
|
cardinality: "scalar",
|
|
64857
64853
|
vocabulary: {
|
|
64858
64854
|
cap: "battery",
|
|
64859
|
-
stateField: "
|
|
64855
|
+
stateField: "level"
|
|
64860
64856
|
},
|
|
64861
64857
|
deviceTypes: BATTERY_DEVICE_TYPES,
|
|
64862
64858
|
apply: "add",
|
|
64863
|
-
path: "
|
|
64859
|
+
path: "level",
|
|
64864
64860
|
sources: [{
|
|
64865
64861
|
kind: "field",
|
|
64866
64862
|
valueKinds: ["number", "string"],
|
|
@@ -64954,7 +64950,7 @@ onStatusChanged: { data: zod.z.object({
|
|
|
64954
64950
|
schema: BatteryStatusSchema,
|
|
64955
64951
|
kind: "push",
|
|
64956
64952
|
empty: {
|
|
64957
|
-
|
|
64953
|
+
level: null,
|
|
64958
64954
|
charging: "unknown",
|
|
64959
64955
|
sleeping: false,
|
|
64960
64956
|
lastUpdated: 0
|
|
@@ -64981,11 +64977,11 @@ onStatusChanged: { data: zod.z.object({
|
|
|
64981
64977
|
* History (D850): recorded series. The generic capture replaces the `battery` series of `pipeline-analytics:stats-5m`.
|
|
64982
64978
|
*/
|
|
64983
64979
|
history: { fields: {
|
|
64984
|
-
|
|
64980
|
+
level: {
|
|
64985
64981
|
kind: "gauge",
|
|
64986
64982
|
unit: "%"
|
|
64987
64983
|
},
|
|
64988
|
-
|
|
64984
|
+
voltage: {
|
|
64989
64985
|
kind: "gauge",
|
|
64990
64986
|
unit: "V"
|
|
64991
64987
|
}
|
|
@@ -65049,14 +65045,14 @@ var binaryCapability = {
|
|
|
65049
65045
|
* controls to this single-method surface.
|
|
65050
65046
|
*
|
|
65051
65047
|
* The cap is intentionally minimal: a single `setBrightness({deviceId,
|
|
65052
|
-
*
|
|
65048
|
+
* level})` mutation plus the auto-injected `getStatus`. Drivers
|
|
65053
65049
|
* that expose richer controls (color temperature, scenes, schedules)
|
|
65054
65050
|
* should surface those via the device's `getSettingsUISchema()`
|
|
65055
65051
|
* instead of bloating this cap.
|
|
65056
65052
|
*/
|
|
65057
65053
|
var BrightnessStatusSchema = zod.z.object({
|
|
65058
65054
|
/** Current level as 0..100 inclusive. Firmware-reported. */
|
|
65059
|
-
|
|
65055
|
+
level: zod.z.number().min(0).max(100).meta(require_sleep.readingMeta("percentage")),
|
|
65060
65056
|
/** Ms epoch of the last operator-driven change. Useful for UI freshness. */
|
|
65061
65057
|
lastChangedAt: zod.z.number()
|
|
65062
65058
|
});
|
|
@@ -65068,7 +65064,7 @@ var brightnessCapability = {
|
|
|
65068
65064
|
deviceTypes: [require_err_msg.DeviceType.Light],
|
|
65069
65065
|
methods: { setBrightness: require_sleep.method(zod.z.object({
|
|
65070
65066
|
deviceId: zod.z.number().int().nonnegative(),
|
|
65071
|
-
|
|
65067
|
+
level: zod.z.number().min(0).max(100)
|
|
65072
65068
|
}), zod.z.void(), {
|
|
65073
65069
|
kind: "mutation",
|
|
65074
65070
|
auth: "protected"
|
|
@@ -65081,7 +65077,7 @@ var brightnessCapability = {
|
|
|
65081
65077
|
*/
|
|
65082
65078
|
onBrightnessChanged: { data: zod.z.object({
|
|
65083
65079
|
deviceId: zod.z.number(),
|
|
65084
|
-
|
|
65080
|
+
level: zod.z.number().min(0).max(100),
|
|
65085
65081
|
lastChangedAt: zod.z.number()
|
|
65086
65082
|
}) } },
|
|
65087
65083
|
status: {
|
|
@@ -65104,7 +65100,7 @@ onBrightnessChanged: { data: zod.z.object({
|
|
|
65104
65100
|
/**
|
|
65105
65101
|
* History (D850): recorded series. Actuator tier: level keeps every change.
|
|
65106
65102
|
*/
|
|
65107
|
-
history: { fields: {
|
|
65103
|
+
history: { fields: { level: {
|
|
65108
65104
|
kind: "gauge",
|
|
65109
65105
|
unit: "%",
|
|
65110
65106
|
minIntervalMs: 0
|
|
@@ -65848,11 +65844,11 @@ var ColorInputSchema = zod.z.discriminatedUnion("mode", [
|
|
|
65848
65844
|
}),
|
|
65849
65845
|
zod.z.object({
|
|
65850
65846
|
mode: zod.z.literal("mired"),
|
|
65851
|
-
|
|
65847
|
+
colorTemperature: zod.z.number().int().min(50).max(1e3)
|
|
65852
65848
|
})
|
|
65853
65849
|
]);
|
|
65854
65850
|
var ColorStatusSchema = zod.z.object({
|
|
65855
|
-
/** Active color mode — which of `rgb` / `hsv` / `
|
|
65851
|
+
/** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
|
|
65856
65852
|
* the bulb's current state. */
|
|
65857
65853
|
mode: zod.z.enum([
|
|
65858
65854
|
"rgb",
|
|
@@ -65864,7 +65860,7 @@ var ColorStatusSchema = zod.z.object({
|
|
|
65864
65860
|
/** Populated when `mode === 'hsv'`. */
|
|
65865
65861
|
hsv: HsvTripletSchema.optional(),
|
|
65866
65862
|
/** Populated when `mode === 'mired'`. */
|
|
65867
|
-
|
|
65863
|
+
colorTemperature: zod.z.number().int().optional().meta(require_sleep.readingMeta("colour-temperature")),
|
|
65868
65864
|
/** Ms epoch of the last operator-driven change. */
|
|
65869
65865
|
lastChangedAt: zod.z.number()
|
|
65870
65866
|
});
|
|
@@ -65900,7 +65896,7 @@ onColorChanged: { data: zod.z.object({
|
|
|
65900
65896
|
]),
|
|
65901
65897
|
rgb: RgbTripletSchema.optional(),
|
|
65902
65898
|
hsv: HsvTripletSchema.optional(),
|
|
65903
|
-
|
|
65899
|
+
colorTemperature: zod.z.number().int().optional(),
|
|
65904
65900
|
lastChangedAt: zod.z.number()
|
|
65905
65901
|
}) } },
|
|
65906
65902
|
status: {
|
|
@@ -66933,11 +66929,11 @@ var DishwasherStatusSchema = zod.z.object({
|
|
|
66933
66929
|
/** Feature keys of the programs the appliance currently offers — drives the UI selector. */
|
|
66934
66930
|
availablePrograms: zod.z.array(zod.z.string()),
|
|
66935
66931
|
/** Seconds remaining on the active cycle, or null when not running / not known. */
|
|
66936
|
-
|
|
66932
|
+
remaining: zod.z.number().int().nonnegative().nullable().meta(require_sleep.readingMeta("duration")),
|
|
66937
66933
|
/** Seconds the delayed start is set to (time until the cycle starts), or null. */
|
|
66938
|
-
|
|
66934
|
+
delayedStart: zod.z.number().int().nonnegative().nullable().meta(require_sleep.readingMeta("duration")),
|
|
66939
66935
|
/** Cycle completion 0..100, or null when not applicable. */
|
|
66940
|
-
|
|
66936
|
+
progress: zod.z.number().min(0).max(100).nullable().meta(require_sleep.readingMeta("percentage")),
|
|
66941
66937
|
/** True when the door is reported open; null when the door state is not known. */
|
|
66942
66938
|
doorOpen: zod.z.boolean().nullable(),
|
|
66943
66939
|
/** True when the door is latched (locked) during a cycle; null when not reported. */
|
|
@@ -67156,14 +67152,14 @@ var dishwasherCapability = {
|
|
|
67156
67152
|
runtimeState: DishwasherStatusSchema,
|
|
67157
67153
|
durability: "session",
|
|
67158
67154
|
history: { fields: {
|
|
67159
|
-
|
|
67155
|
+
progress: {
|
|
67160
67156
|
kind: "gauge",
|
|
67161
67157
|
unit: "%",
|
|
67162
67158
|
deadband: 2
|
|
67163
67159
|
},
|
|
67164
67160
|
state: { kind: "enum" },
|
|
67165
67161
|
operationState: { kind: "enum" },
|
|
67166
|
-
|
|
67162
|
+
remaining: {
|
|
67167
67163
|
kind: "gauge",
|
|
67168
67164
|
unit: "s",
|
|
67169
67165
|
minIntervalMs: 6e4
|
|
@@ -67816,7 +67812,7 @@ var FanDirectionSchema = zod.z.enum(["forward", "reverse"]);
|
|
|
67816
67812
|
var FanControlStatusSchema = zod.z.object({
|
|
67817
67813
|
/** Active speed as 0..100 inclusive. Null when the device has no
|
|
67818
67814
|
* speed surface (single-speed fan). */
|
|
67819
|
-
|
|
67815
|
+
speed: zod.z.number().min(0).max(100).nullable().meta(require_sleep.readingMeta("percentage")),
|
|
67820
67816
|
/** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
|
|
67821
67817
|
* a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
|
|
67822
67818
|
percentageStep: zod.z.number().positive().optional().meta(require_sleep.readingMeta("percentage")),
|
|
@@ -67843,7 +67839,7 @@ var fanControlCapability = {
|
|
|
67843
67839
|
methods: {
|
|
67844
67840
|
setPercentage: require_sleep.method(zod.z.object({
|
|
67845
67841
|
deviceId: zod.z.number().int().nonnegative(),
|
|
67846
|
-
|
|
67842
|
+
speed: zod.z.number().min(0).max(100)
|
|
67847
67843
|
}), zod.z.void(), {
|
|
67848
67844
|
kind: "mutation",
|
|
67849
67845
|
auth: "protected"
|
|
@@ -67876,7 +67872,7 @@ var fanControlCapability = {
|
|
|
67876
67872
|
},
|
|
67877
67873
|
/**
|
|
67878
67874
|
* Runtime-state slice — mirrored by the kernel. UI fan speed
|
|
67879
|
-
* sliders read `
|
|
67875
|
+
* sliders read `speed` for live updates.
|
|
67880
67876
|
*/
|
|
67881
67877
|
runtimeState: FanControlStatusSchema,
|
|
67882
67878
|
/**
|
|
@@ -67890,7 +67886,7 @@ var fanControlCapability = {
|
|
|
67890
67886
|
* History (D850): recorded series. Actuator tier: speed keeps every change.
|
|
67891
67887
|
*/
|
|
67892
67888
|
history: { fields: {
|
|
67893
|
-
|
|
67889
|
+
speed: {
|
|
67894
67890
|
kind: "gauge",
|
|
67895
67891
|
unit: "%",
|
|
67896
67892
|
minIntervalMs: 0
|
|
@@ -68360,7 +68356,7 @@ var humidifierCapability = {
|
|
|
68360
68356
|
*/
|
|
68361
68357
|
var HumiditySensorStatusSchema = zod.z.object({
|
|
68362
68358
|
/** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
|
|
68363
|
-
|
|
68359
|
+
humidity: zod.z.number().min(0).max(100).nullable().meta(require_sleep.readingMeta("humidity", {
|
|
68364
68360
|
precision: 0,
|
|
68365
68361
|
label: "Humidity"
|
|
68366
68362
|
})),
|
|
@@ -68389,7 +68385,7 @@ var humiditySensorCapability = {
|
|
|
68389
68385
|
/**
|
|
68390
68386
|
* History (D850): recorded series.
|
|
68391
68387
|
*/
|
|
68392
|
-
history: { fields: {
|
|
68388
|
+
history: { fields: { humidity: {
|
|
68393
68389
|
kind: "gauge",
|
|
68394
68390
|
unit: "%",
|
|
68395
68391
|
deadband: .5
|
|
@@ -69057,7 +69053,7 @@ var LawnMowerControlStatusSchema = zod.z.object({
|
|
|
69057
69053
|
batteryLevel: zod.z.number().min(0).max(100).nullable().meta(require_sleep.readingMeta("percentage")),
|
|
69058
69054
|
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
69059
69055
|
* task is active / progress is unavailable. */
|
|
69060
|
-
|
|
69056
|
+
progress: zod.z.number().min(0).max(100).nullable().meta(require_sleep.readingMeta("percentage")),
|
|
69061
69057
|
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
69062
69058
|
* or null when unknown. */
|
|
69063
69059
|
currentCode: zod.z.number().nullable().meta(require_sleep.readingMeta("none")),
|
|
@@ -69754,7 +69750,7 @@ var lockControlCapability = {
|
|
|
69754
69750
|
//#endregion
|
|
69755
69751
|
//#region src/capabilities/meter.cap.ts
|
|
69756
69752
|
/**
|
|
69757
|
-
* A monotonic total between resets (D944). Energy uses `power-meter.
|
|
69753
|
+
* A monotonic total between resets (D944). Energy uses `power-meter.energy`
|
|
69758
69754
|
* so dashboards keep one series; every other instantaneous reading lands here.
|
|
69759
69755
|
* `value` is the time integral in the source quantity's accumulated base
|
|
69760
69756
|
* (base-unit seconds, or kWh on the power meter). `null` is a gap, never zero.
|
|
@@ -69850,10 +69846,10 @@ var MediaPlayerStatusSchema = zod.z.object({
|
|
|
69850
69846
|
currentMedia: MediaInfoSchema.nullable(),
|
|
69851
69847
|
/** Current playback position in ms. Null when not seekable or
|
|
69852
69848
|
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
69853
|
-
|
|
69849
|
+
position: zod.z.number().int().nonnegative().nullable().meta(require_sleep.readingMeta("duration-ms")),
|
|
69854
69850
|
/** Total duration of the current media in ms. Null when unknown
|
|
69855
69851
|
* (live stream) or nothing is playing. */
|
|
69856
|
-
|
|
69852
|
+
duration: zod.z.number().int().nonnegative().nullable().meta(require_sleep.readingMeta("duration-ms")),
|
|
69857
69853
|
/** Shuffle toggle. Null when no shuffle surface.
|
|
69858
69854
|
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
69859
69855
|
shuffle: zod.z.boolean().nullable(),
|
|
@@ -69892,7 +69888,7 @@ var mediaPlayerCapability = {
|
|
|
69892
69888
|
}),
|
|
69893
69889
|
seek: require_sleep.method(zod.z.object({
|
|
69894
69890
|
deviceId: zod.z.number().int().nonnegative(),
|
|
69895
|
-
|
|
69891
|
+
position: zod.z.number().int().nonnegative()
|
|
69896
69892
|
}), zod.z.void(), {
|
|
69897
69893
|
kind: "mutation",
|
|
69898
69894
|
auth: "protected"
|
|
@@ -69964,7 +69960,7 @@ var mediaPlayerCapability = {
|
|
|
69964
69960
|
/**
|
|
69965
69961
|
* History (D850): volume (a level an operator or an automation sets; the
|
|
69966
69962
|
* default 10 s floor folds a slider drag into its end value) and mute.
|
|
69967
|
-
* `
|
|
69963
|
+
* `position` is not recorded: it moves continuously while playing.
|
|
69968
69964
|
*/
|
|
69969
69965
|
history: { fields: {
|
|
69970
69966
|
volumeLevel: {
|
|
@@ -71189,9 +71185,9 @@ var NetworkLinkStatusSchema = zod.z.object({
|
|
|
71189
71185
|
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
71190
71186
|
* SKIP a null rather than coerce it.
|
|
71191
71187
|
*/
|
|
71192
|
-
|
|
71188
|
+
signal: zod.z.number().min(0).max(100).nullable().meta(require_sleep.readingMeta("percentage")),
|
|
71193
71189
|
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
71194
|
-
|
|
71190
|
+
rssi: zod.z.number().optional().meta(require_sleep.readingMeta("signal-level")),
|
|
71195
71191
|
/** Network name of a wireless link, when the firmware reports it. */
|
|
71196
71192
|
ssid: zod.z.string().optional(),
|
|
71197
71193
|
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
@@ -71200,7 +71196,7 @@ var NetworkLinkStatusSchema = zod.z.object({
|
|
|
71200
71196
|
/** The slice a provider seeds before its first read: nothing is known yet. */
|
|
71201
71197
|
var NETWORK_LINK_UNKNOWN = {
|
|
71202
71198
|
type: "unknown",
|
|
71203
|
-
|
|
71199
|
+
signal: null,
|
|
71204
71200
|
lastUpdated: 0
|
|
71205
71201
|
};
|
|
71206
71202
|
/**
|
|
@@ -71217,9 +71213,9 @@ function signalPercentFromBars(bars, maxBars) {
|
|
|
71217
71213
|
* below is 0 %, -50 dBm and above is 100 %, linear between. Non-finite or
|
|
71218
71214
|
* positive input is not an RSSI: `null`.
|
|
71219
71215
|
*/
|
|
71220
|
-
function signalPercentFromRssi(
|
|
71221
|
-
if (
|
|
71222
|
-
return Math.round((Math.min(-50, Math.max(-100,
|
|
71216
|
+
function signalPercentFromRssi(rssi) {
|
|
71217
|
+
if (rssi === void 0 || !Number.isFinite(rssi) || rssi > 0) return null;
|
|
71218
|
+
return Math.round((Math.min(-50, Math.max(-100, rssi)) + 100) * 2);
|
|
71223
71219
|
}
|
|
71224
71220
|
var networkLinkCapability = {
|
|
71225
71221
|
name: "network-link",
|
|
@@ -71270,13 +71266,13 @@ onStatusChanged: { data: zod.z.object({
|
|
|
71270
71266
|
* History (D850): recorded series.
|
|
71271
71267
|
*/
|
|
71272
71268
|
history: { fields: {
|
|
71273
|
-
|
|
71269
|
+
signal: {
|
|
71274
71270
|
kind: "gauge",
|
|
71275
71271
|
unit: "%",
|
|
71276
71272
|
deadband: 3,
|
|
71277
71273
|
minIntervalMs: 6e4
|
|
71278
71274
|
},
|
|
71279
|
-
|
|
71275
|
+
rssi: {
|
|
71280
71276
|
kind: "gauge",
|
|
71281
71277
|
unit: "dBm",
|
|
71282
71278
|
deadband: 2,
|
|
@@ -73639,16 +73635,16 @@ var platformProbeCapability = {
|
|
|
73639
73635
|
* in real-world devices.
|
|
73640
73636
|
*/
|
|
73641
73637
|
var PowerMeterStatusSchema = zod.z.object({
|
|
73642
|
-
/** Instantaneous power draw
|
|
73643
|
-
|
|
73638
|
+
/** Instantaneous power draw (watts). */
|
|
73639
|
+
power: zod.z.number().optional().meta(require_sleep.readingMeta("power", { label: "Power" })),
|
|
73644
73640
|
/** Cumulative energy in kilowatt-hours since the meter was reset. */
|
|
73645
|
-
|
|
73646
|
-
/** Voltage
|
|
73647
|
-
|
|
73641
|
+
energy: zod.z.number().optional().meta(require_sleep.readingMeta("energy", { label: "Energy" })),
|
|
73642
|
+
/** Voltage (volts). */
|
|
73643
|
+
voltage: zod.z.number().optional().meta(require_sleep.readingMeta("voltage", { label: "Voltage" })),
|
|
73648
73644
|
/** Current in amperes. */
|
|
73649
|
-
|
|
73645
|
+
current: zod.z.number().optional().meta(require_sleep.readingMeta("current", { label: "Current" })),
|
|
73650
73646
|
/** Apparent power in volt-amperes. */
|
|
73651
|
-
|
|
73647
|
+
apparentPower: zod.z.number().optional().meta(require_sleep.readingMeta("apparent-power")),
|
|
73652
73648
|
/** Power factor (0..1) if reported. */
|
|
73653
73649
|
powerFactor: zod.z.number().min(0).max(1).optional().meta(require_sleep.readingMeta("ratio")),
|
|
73654
73650
|
/** Ms epoch when the slice was last updated. */
|
|
@@ -73706,14 +73702,14 @@ function powerTarget(id, unit) {
|
|
|
73706
73702
|
advancedExpression: true
|
|
73707
73703
|
};
|
|
73708
73704
|
}
|
|
73709
|
-
/** "Power and energy" extension:
|
|
73705
|
+
/** "Power and energy" extension: power, energy, voltage and current from other devices (D951). */
|
|
73710
73706
|
var powerMeterCustomize = {
|
|
73711
73707
|
version: 1,
|
|
73712
73708
|
targets: [
|
|
73713
|
-
powerTarget("
|
|
73714
|
-
powerTarget("
|
|
73715
|
-
powerTarget("
|
|
73716
|
-
powerTarget("
|
|
73709
|
+
powerTarget("power", "W"),
|
|
73710
|
+
powerTarget("energy", "kWh"),
|
|
73711
|
+
powerTarget("voltage", "V"),
|
|
73712
|
+
powerTarget("current", "A")
|
|
73717
73713
|
]
|
|
73718
73714
|
};
|
|
73719
73715
|
var powerMeterCapability = {
|
|
@@ -73729,41 +73725,41 @@ var powerMeterCapability = {
|
|
|
73729
73725
|
},
|
|
73730
73726
|
runtimeState: PowerMeterStatusSchema,
|
|
73731
73727
|
/**
|
|
73732
|
-
* Runtime-state durability: **restored** — as `numeric-sensor`; `
|
|
73728
|
+
* Runtime-state durability: **restored** — as `numeric-sensor`; `energy` is an accumulator whose restored value is the baseline.
|
|
73733
73729
|
*
|
|
73734
73730
|
* See `RuntimeStateDurability`. Enforced by
|
|
73735
73731
|
* `scripts/check-runtime-state-durability.ts`.
|
|
73736
73732
|
*/
|
|
73737
73733
|
durability: "restored",
|
|
73738
73734
|
/**
|
|
73739
|
-
* History (D850): recorded series. Gauges are floored at 30 s; `
|
|
73735
|
+
* History (D850): recorded series. Gauges are floored at 30 s; `energy` is the one monotonic meter (counter).
|
|
73740
73736
|
*/
|
|
73741
73737
|
history: { fields: {
|
|
73742
|
-
|
|
73738
|
+
power: {
|
|
73743
73739
|
kind: "gauge",
|
|
73744
73740
|
unit: "W",
|
|
73745
73741
|
deadband: 1,
|
|
73746
73742
|
minIntervalMs: 3e4
|
|
73747
73743
|
},
|
|
73748
|
-
|
|
73744
|
+
energy: {
|
|
73749
73745
|
kind: "counter",
|
|
73750
73746
|
unit: "kWh",
|
|
73751
73747
|
deadband: .01,
|
|
73752
73748
|
minIntervalMs: 6e4
|
|
73753
73749
|
},
|
|
73754
|
-
|
|
73750
|
+
voltage: {
|
|
73755
73751
|
kind: "gauge",
|
|
73756
73752
|
unit: "V",
|
|
73757
73753
|
deadband: 1,
|
|
73758
73754
|
minIntervalMs: 3e4
|
|
73759
73755
|
},
|
|
73760
|
-
|
|
73756
|
+
current: {
|
|
73761
73757
|
kind: "gauge",
|
|
73762
73758
|
unit: "A",
|
|
73763
73759
|
deadband: .05,
|
|
73764
73760
|
minIntervalMs: 3e4
|
|
73765
73761
|
},
|
|
73766
|
-
|
|
73762
|
+
apparentPower: {
|
|
73767
73763
|
kind: "gauge",
|
|
73768
73764
|
unit: "VA",
|
|
73769
73765
|
deadband: 1,
|
|
@@ -73815,9 +73811,6 @@ var PresenceStatusSchema = zod.z.object({
|
|
|
73815
73811
|
location: zod.z.string().nullable(),
|
|
73816
73812
|
/** GPS coordinates when available. Null otherwise. */
|
|
73817
73813
|
gps: GpsLocationSchema.nullable(),
|
|
73818
|
-
/** Optional battery level of the tracking device (0..100). Null
|
|
73819
|
-
* when not reported. */
|
|
73820
|
-
batteryPercent: zod.z.number().min(0).max(100).nullable().meta(require_sleep.readingMeta("percentage")),
|
|
73821
73814
|
/** Ms epoch when the slice was last updated. */
|
|
73822
73815
|
lastChangedAt: zod.z.number()
|
|
73823
73816
|
});
|
|
@@ -73846,14 +73839,7 @@ var presenceCapability = {
|
|
|
73846
73839
|
* `scripts/check-runtime-state-durability.ts`.
|
|
73847
73840
|
*/
|
|
73848
73841
|
durability: "restored",
|
|
73849
|
-
|
|
73850
|
-
* History (D850): recorded series.
|
|
73851
|
-
*/
|
|
73852
|
-
history: { fields: { batteryPercent: {
|
|
73853
|
-
kind: "gauge",
|
|
73854
|
-
unit: "%",
|
|
73855
|
-
deadband: 1
|
|
73856
|
-
} } },
|
|
73842
|
+
history: "none",
|
|
73857
73843
|
/** Clock fields: written, but excluded from the compare that decides
|
|
73858
73844
|
* whether persisting is worth a SQLite commit. */
|
|
73859
73845
|
volatileStateFields: ["lastChangedAt"]
|
|
@@ -73870,7 +73856,7 @@ var presenceCapability = {
|
|
|
73870
73856
|
*/
|
|
73871
73857
|
var PressureSensorStatusSchema = zod.z.object({
|
|
73872
73858
|
/** Current pressure in hPa. `null` when the sample was refused (D393). */
|
|
73873
|
-
|
|
73859
|
+
pressure: zod.z.number().nullable().meta(require_sleep.readingMeta("pressure", { precision: 0 })),
|
|
73874
73860
|
/** Ms epoch when the slice was last updated. */
|
|
73875
73861
|
lastFetchedAt: zod.z.number()
|
|
73876
73862
|
});
|
|
@@ -73896,7 +73882,7 @@ var pressureSensorCapability = {
|
|
|
73896
73882
|
/**
|
|
73897
73883
|
* History (D850): recorded series.
|
|
73898
73884
|
*/
|
|
73899
|
-
history: { fields: {
|
|
73885
|
+
history: { fields: { pressure: {
|
|
73900
73886
|
kind: "gauge",
|
|
73901
73887
|
unit: "hPa",
|
|
73902
73888
|
deadband: .1
|
|
@@ -79123,7 +79109,7 @@ var tamperCapability = {
|
|
|
79123
79109
|
*/
|
|
79124
79110
|
var TemperatureSensorStatusSchema = zod.z.object({
|
|
79125
79111
|
/** Current temperature in Celsius. `null` when the sample was refused (D393). */
|
|
79126
|
-
|
|
79112
|
+
temperature: zod.z.number().nullable().meta(require_sleep.readingMeta("temperature", {
|
|
79127
79113
|
precision: 1,
|
|
79128
79114
|
label: "Temperature"
|
|
79129
79115
|
})),
|
|
@@ -79152,7 +79138,7 @@ var temperatureSensorCapability = {
|
|
|
79152
79138
|
/**
|
|
79153
79139
|
* History (D850): recorded series.
|
|
79154
79140
|
*/
|
|
79155
|
-
history: { fields: {
|
|
79141
|
+
history: { fields: { temperature: {
|
|
79156
79142
|
kind: "gauge",
|
|
79157
79143
|
unit: "°C",
|
|
79158
79144
|
deadband: .1
|
|
@@ -79520,7 +79506,7 @@ var VacuumControlStatusSchema = zod.z.object({
|
|
|
79520
79506
|
/** Speed tokens the hardware accepts — drives the UI selector. */
|
|
79521
79507
|
availableFanSpeeds: zod.z.array(zod.z.string()),
|
|
79522
79508
|
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
79523
|
-
|
|
79509
|
+
progress: zod.z.number().min(0).max(100).nullable().meta(require_sleep.readingMeta("percentage")),
|
|
79524
79510
|
/** Current error code (0 / null = no error). */
|
|
79525
79511
|
errorCode: zod.z.number().nullable().meta(require_sleep.readingMeta("none")),
|
|
79526
79512
|
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
@@ -82170,7 +82156,7 @@ function named(prefix, sources, cap, fieldPath) {
|
|
|
82170
82156
|
return Object.fromEntries(sources.map((s, i) => [`${prefix}${i + 1}`, from(s, cap, fieldPath)]));
|
|
82171
82157
|
}
|
|
82172
82158
|
function roomCompositionExample(input) {
|
|
82173
|
-
const t = named("t", input.temperatureSources, "temperature-sensor", "
|
|
82159
|
+
const t = named("t", input.temperatureSources, "temperature-sensor", "temperature");
|
|
82174
82160
|
const f = named("f", input.temperatureSources, "temperature-sensor", "lastFetchedAt");
|
|
82175
82161
|
const d = named("d", input.motionSources, "motion", "detected");
|
|
82176
82162
|
const m = named("m", input.motionSources, "motion", "lastDetectedAt");
|
|
@@ -82185,7 +82171,7 @@ function roomCompositionExample(input) {
|
|
|
82185
82171
|
kind: "fields",
|
|
82186
82172
|
cap: "temperature-sensor",
|
|
82187
82173
|
fields: {
|
|
82188
|
-
|
|
82174
|
+
temperature: {
|
|
82189
82175
|
kind: "expression",
|
|
82190
82176
|
expr: `round(avg(${Object.keys(t).join(", ")}), 1)`,
|
|
82191
82177
|
bindings: t
|
|
@@ -82231,7 +82217,7 @@ function roomCompositionExample(input) {
|
|
|
82231
82217
|
* an `enum-sensor` whose `value` is the raw STRING state — `number(d)` reads it,
|
|
82232
82218
|
* and anything that is not a number is `null`, never 0 (D393). The battery
|
|
82233
82219
|
* status sensor is an `enum-sensor` too (`unavailable` keeps its cold `''`, so
|
|
82234
|
-
* `
|
|
82220
|
+
* `level` is `null`). `charging` maps `battery_charging` off to
|
|
82235
82221
|
* `'unknown'`, never `'none'`: off does not prove "on battery alone" (the
|
|
82236
82222
|
* operator confirms the real semantics live).
|
|
82237
82223
|
*/
|
|
@@ -82300,7 +82286,7 @@ function feederCustomizationExample(sources) {
|
|
|
82300
82286
|
kind: "fields",
|
|
82301
82287
|
cap: "battery",
|
|
82302
82288
|
fields: {
|
|
82303
|
-
|
|
82289
|
+
level: {
|
|
82304
82290
|
kind: "expression",
|
|
82305
82291
|
expr: "s == \"low\" ? 15 : (s == \"normal\" ? 100 : null)",
|
|
82306
82292
|
bindings: { s: from(sources.batteryStatus, "enum-sensor", "value") }
|
|
@@ -82368,10 +82354,10 @@ function unitConstant(to) {
|
|
|
82368
82354
|
/** Primary numeric field that also publishes the cap's `unit` string. */
|
|
82369
82355
|
var UNIT_COMPANION_FIELD = {
|
|
82370
82356
|
"numeric-sensor": "value",
|
|
82371
|
-
"temperature-sensor": "
|
|
82372
|
-
"humidity-sensor": "
|
|
82373
|
-
"pressure-sensor": "
|
|
82374
|
-
"ambient-light-sensor": "
|
|
82357
|
+
"temperature-sensor": "temperature",
|
|
82358
|
+
"humidity-sensor": "humidity",
|
|
82359
|
+
"pressure-sensor": "pressure",
|
|
82360
|
+
"ambient-light-sensor": "illuminance"
|
|
82375
82361
|
};
|
|
82376
82362
|
/** `unit` when converting that cap's primary numeric field; otherwise none. */
|
|
82377
82363
|
function unitCompanionField(cap, fieldPath) {
|
|
@@ -82558,7 +82544,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82558
82544
|
"battery": {
|
|
82559
82545
|
version: 1,
|
|
82560
82546
|
targets: [{
|
|
82561
|
-
id: "
|
|
82547
|
+
id: "level",
|
|
82562
82548
|
cardinality: "scalar",
|
|
82563
82549
|
deviceTypes: [
|
|
82564
82550
|
require_err_msg.DeviceType.Camera,
|
|
@@ -82572,7 +82558,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82572
82558
|
],
|
|
82573
82559
|
apply: "add",
|
|
82574
82560
|
vocabularyCap: "battery",
|
|
82575
|
-
vocabularyStateField: "
|
|
82561
|
+
vocabularyStateField: "level",
|
|
82576
82562
|
sources: [{
|
|
82577
82563
|
kind: "field",
|
|
82578
82564
|
valueKinds: ["number", "string"],
|
|
@@ -82587,7 +82573,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82587
82573
|
}],
|
|
82588
82574
|
sourceReport: { status: "assignment-status" },
|
|
82589
82575
|
advancedExpression: true,
|
|
82590
|
-
path: "
|
|
82576
|
+
path: "level",
|
|
82591
82577
|
valueKind: "number",
|
|
82592
82578
|
nullable: true,
|
|
82593
82579
|
companions: [
|
|
@@ -82822,7 +82808,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82822
82808
|
version: 1,
|
|
82823
82809
|
targets: [
|
|
82824
82810
|
{
|
|
82825
|
-
id: "
|
|
82811
|
+
id: "power",
|
|
82826
82812
|
cardinality: "scalar",
|
|
82827
82813
|
deviceTypes: [
|
|
82828
82814
|
require_err_msg.DeviceType.Switch,
|
|
@@ -82842,7 +82828,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82842
82828
|
],
|
|
82843
82829
|
apply: "add",
|
|
82844
82830
|
vocabularyCap: "power-meter",
|
|
82845
|
-
vocabularyStateField: "
|
|
82831
|
+
vocabularyStateField: "power",
|
|
82846
82832
|
sources: [{
|
|
82847
82833
|
kind: "numeric",
|
|
82848
82834
|
requiredUnit: "W",
|
|
@@ -82851,7 +82837,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82851
82837
|
}],
|
|
82852
82838
|
sourceReport: { status: "assignment-status" },
|
|
82853
82839
|
advancedExpression: true,
|
|
82854
|
-
path: "
|
|
82840
|
+
path: "power",
|
|
82855
82841
|
valueKind: "number",
|
|
82856
82842
|
nullable: false,
|
|
82857
82843
|
companions: [{
|
|
@@ -82861,7 +82847,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82861
82847
|
}]
|
|
82862
82848
|
},
|
|
82863
82849
|
{
|
|
82864
|
-
id: "
|
|
82850
|
+
id: "energy",
|
|
82865
82851
|
cardinality: "scalar",
|
|
82866
82852
|
deviceTypes: [
|
|
82867
82853
|
require_err_msg.DeviceType.Switch,
|
|
@@ -82881,7 +82867,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82881
82867
|
],
|
|
82882
82868
|
apply: "add",
|
|
82883
82869
|
vocabularyCap: "power-meter",
|
|
82884
|
-
vocabularyStateField: "
|
|
82870
|
+
vocabularyStateField: "energy",
|
|
82885
82871
|
sources: [{
|
|
82886
82872
|
kind: "numeric",
|
|
82887
82873
|
requiredUnit: "kWh",
|
|
@@ -82890,7 +82876,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82890
82876
|
}],
|
|
82891
82877
|
sourceReport: { status: "assignment-status" },
|
|
82892
82878
|
advancedExpression: true,
|
|
82893
|
-
path: "
|
|
82879
|
+
path: "energy",
|
|
82894
82880
|
valueKind: "number",
|
|
82895
82881
|
nullable: false,
|
|
82896
82882
|
companions: [{
|
|
@@ -82900,7 +82886,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82900
82886
|
}]
|
|
82901
82887
|
},
|
|
82902
82888
|
{
|
|
82903
|
-
id: "
|
|
82889
|
+
id: "voltage",
|
|
82904
82890
|
cardinality: "scalar",
|
|
82905
82891
|
deviceTypes: [
|
|
82906
82892
|
require_err_msg.DeviceType.Switch,
|
|
@@ -82920,7 +82906,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82920
82906
|
],
|
|
82921
82907
|
apply: "add",
|
|
82922
82908
|
vocabularyCap: "power-meter",
|
|
82923
|
-
vocabularyStateField: "
|
|
82909
|
+
vocabularyStateField: "voltage",
|
|
82924
82910
|
sources: [{
|
|
82925
82911
|
kind: "numeric",
|
|
82926
82912
|
requiredUnit: "V",
|
|
@@ -82929,7 +82915,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82929
82915
|
}],
|
|
82930
82916
|
sourceReport: { status: "assignment-status" },
|
|
82931
82917
|
advancedExpression: true,
|
|
82932
|
-
path: "
|
|
82918
|
+
path: "voltage",
|
|
82933
82919
|
valueKind: "number",
|
|
82934
82920
|
nullable: false,
|
|
82935
82921
|
companions: [{
|
|
@@ -82939,7 +82925,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82939
82925
|
}]
|
|
82940
82926
|
},
|
|
82941
82927
|
{
|
|
82942
|
-
id: "
|
|
82928
|
+
id: "current",
|
|
82943
82929
|
cardinality: "scalar",
|
|
82944
82930
|
deviceTypes: [
|
|
82945
82931
|
require_err_msg.DeviceType.Switch,
|
|
@@ -82959,7 +82945,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82959
82945
|
],
|
|
82960
82946
|
apply: "add",
|
|
82961
82947
|
vocabularyCap: "power-meter",
|
|
82962
|
-
vocabularyStateField: "
|
|
82948
|
+
vocabularyStateField: "current",
|
|
82963
82949
|
sources: [{
|
|
82964
82950
|
kind: "numeric",
|
|
82965
82951
|
requiredUnit: "A",
|
|
@@ -82968,7 +82954,7 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
82968
82954
|
}],
|
|
82969
82955
|
sourceReport: { status: "assignment-status" },
|
|
82970
82956
|
advancedExpression: true,
|
|
82971
|
-
path: "
|
|
82957
|
+
path: "current",
|
|
82972
82958
|
valueKind: "number",
|
|
82973
82959
|
nullable: false,
|
|
82974
82960
|
companions: [{
|
|
@@ -83069,19 +83055,19 @@ var CAP_CUSTOMIZE_CATALOG = {
|
|
|
83069
83055
|
* it is not an override list (D944).
|
|
83070
83056
|
*/
|
|
83071
83057
|
var CAP_RUNTIME_FIELD_UNITS = {
|
|
83072
|
-
"ambient-light-sensor": {
|
|
83058
|
+
"ambient-light-sensor": { illuminance: "lx" },
|
|
83073
83059
|
"battery": {
|
|
83074
|
-
|
|
83075
|
-
|
|
83060
|
+
level: "%",
|
|
83061
|
+
voltage: "V"
|
|
83076
83062
|
},
|
|
83077
|
-
"humidity-sensor": {
|
|
83063
|
+
"humidity-sensor": { humidity: "%" },
|
|
83078
83064
|
"power-meter": {
|
|
83079
|
-
|
|
83080
|
-
|
|
83081
|
-
|
|
83082
|
-
|
|
83065
|
+
power: "W",
|
|
83066
|
+
energy: "kWh",
|
|
83067
|
+
voltage: "V",
|
|
83068
|
+
current: "A"
|
|
83083
83069
|
},
|
|
83084
|
-
"temperature-sensor": {
|
|
83070
|
+
"temperature-sensor": { temperature: "°C" }
|
|
83085
83071
|
};
|
|
83086
83072
|
//#endregion
|
|
83087
83073
|
//#region src/composition/customize/field-source.ts
|
|
@@ -85200,7 +85186,7 @@ var BaseDevice = class {
|
|
|
85200
85186
|
* `device-local-state.ts`. Drivers access via:
|
|
85201
85187
|
*
|
|
85202
85188
|
* `this.state.battery.sleeping = true` // patches the battery slice
|
|
85203
|
-
* `const pct = this.state.battery.
|
|
85189
|
+
* `const pct = this.state.battery.level` // reads the battery slice
|
|
85204
85190
|
* `this.state.deviceStatus.online = true` // mirrors `markOnline(true)`
|
|
85205
85191
|
*
|
|
85206
85192
|
* Adding a new cap with `runtimeState:` automatically extends this
|
|
@@ -85240,7 +85226,7 @@ var BaseDevice = class {
|
|
|
85240
85226
|
* shape; drivers don't redeclare it, they just write through.
|
|
85241
85227
|
*
|
|
85242
85228
|
* Read: `this.runtimeState.getCapState('battery')` →
|
|
85243
|
-
* `{
|
|
85229
|
+
* `{level, charging, sleeping, lastUpdated}` for any
|
|
85244
85230
|
* provider that registers `batteryCapability`.
|
|
85245
85231
|
* Write: `this.runtimeState.setCapState('battery', { … })`.
|
|
85246
85232
|
*
|
|
@@ -87205,17 +87191,17 @@ function pickAccessoryControl(device) {
|
|
|
87205
87191
|
var SENSOR_MAP = {
|
|
87206
87192
|
"temperature-sensor": {
|
|
87207
87193
|
capKey: "temperatureSensor",
|
|
87208
|
-
field: "
|
|
87194
|
+
field: "temperature",
|
|
87209
87195
|
fallbackUnit: "°C"
|
|
87210
87196
|
},
|
|
87211
87197
|
"humidity-sensor": {
|
|
87212
87198
|
capKey: "humiditySensor",
|
|
87213
|
-
field: "
|
|
87199
|
+
field: "humidity",
|
|
87214
87200
|
fallbackUnit: "%"
|
|
87215
87201
|
},
|
|
87216
87202
|
"ambient-light-sensor": {
|
|
87217
87203
|
capKey: "ambientLightSensor",
|
|
87218
|
-
field: "
|
|
87204
|
+
field: "illuminance",
|
|
87219
87205
|
fallbackUnit: "lx"
|
|
87220
87206
|
},
|
|
87221
87207
|
"numeric-sensor": {
|
|
@@ -97673,7 +97659,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
97673
97659
|
label: t("Full brightness", "Luminosità massima"),
|
|
97674
97660
|
phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
|
|
97675
97661
|
icon: "sun",
|
|
97676
|
-
args: {
|
|
97662
|
+
args: { level: 100 }
|
|
97677
97663
|
},
|
|
97678
97664
|
{
|
|
97679
97665
|
id: "brightness.half",
|
|
@@ -97681,7 +97667,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
97681
97667
|
label: t("Half brightness", "Luminosità a metà"),
|
|
97682
97668
|
phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
|
|
97683
97669
|
icon: "sun-dim",
|
|
97684
|
-
args: {
|
|
97670
|
+
args: { level: 50 }
|
|
97685
97671
|
},
|
|
97686
97672
|
{
|
|
97687
97673
|
id: "brightness.off",
|
|
@@ -97689,16 +97675,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
97689
97675
|
label: t("Brightness off", "Luminosità a zero"),
|
|
97690
97676
|
phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
|
|
97691
97677
|
icon: "lightbulb-off",
|
|
97692
|
-
args: {
|
|
97678
|
+
args: { level: 0 }
|
|
97693
97679
|
},
|
|
97694
97680
|
{
|
|
97695
97681
|
id: "brightness.set",
|
|
97696
97682
|
method: "setBrightness",
|
|
97697
97683
|
label: t("Set brightness", "Imposta la luminosità"),
|
|
97698
|
-
phrase: t("Set the brightness of {device} to {
|
|
97684
|
+
phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
|
|
97699
97685
|
icon: "sun-medium",
|
|
97700
97686
|
openArgs: [{
|
|
97701
|
-
key: "
|
|
97687
|
+
key: "level",
|
|
97702
97688
|
label: PERCENT,
|
|
97703
97689
|
offer: {
|
|
97704
97690
|
kind: "number",
|
|
@@ -97712,13 +97698,13 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
97712
97698
|
],
|
|
97713
97699
|
state: [{
|
|
97714
97700
|
kind: "numeric",
|
|
97715
|
-
field: "
|
|
97701
|
+
field: "level",
|
|
97716
97702
|
quantity: t("the brightness", "la luminosità"),
|
|
97717
97703
|
label: t("Brightness", "Luminosità"),
|
|
97718
97704
|
unit: "%",
|
|
97719
97705
|
icon: "sun"
|
|
97720
97706
|
}],
|
|
97721
|
-
events: { onBrightnessChanged: { notOperatorFacing: "the `
|
|
97707
|
+
events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
|
|
97722
97708
|
},
|
|
97723
97709
|
color: {
|
|
97724
97710
|
scope: "device",
|
|
@@ -97732,7 +97718,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
97732
97718
|
icon: "sun",
|
|
97733
97719
|
args: { color: {
|
|
97734
97720
|
mode: "mired",
|
|
97735
|
-
|
|
97721
|
+
colorTemperature: 370
|
|
97736
97722
|
} }
|
|
97737
97723
|
},
|
|
97738
97724
|
{
|
|
@@ -97743,7 +97729,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
97743
97729
|
icon: "snowflake",
|
|
97744
97730
|
args: { color: {
|
|
97745
97731
|
mode: "mired",
|
|
97746
|
-
|
|
97732
|
+
colorTemperature: 200
|
|
97747
97733
|
} }
|
|
97748
97734
|
},
|
|
97749
97735
|
{
|
|
@@ -98357,7 +98343,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
98357
98343
|
label: t("Fan off", "Ventilatore spento"),
|
|
98358
98344
|
phrase: t("Stop {device}", "Ferma {device}"),
|
|
98359
98345
|
icon: "power-off",
|
|
98360
|
-
args: {
|
|
98346
|
+
args: { speed: 0 }
|
|
98361
98347
|
},
|
|
98362
98348
|
{
|
|
98363
98349
|
id: "fan.full",
|
|
@@ -98365,16 +98351,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
98365
98351
|
label: t("Fan full", "Ventilatore al massimo"),
|
|
98366
98352
|
phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
|
|
98367
98353
|
icon: "fan",
|
|
98368
|
-
args: {
|
|
98354
|
+
args: { speed: 100 }
|
|
98369
98355
|
},
|
|
98370
98356
|
{
|
|
98371
98357
|
id: "fan.speed",
|
|
98372
98358
|
method: "setPercentage",
|
|
98373
98359
|
label: t("Set speed", "Imposta la velocità"),
|
|
98374
|
-
phrase: t("Set the speed of {device} to {
|
|
98360
|
+
phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
|
|
98375
98361
|
icon: "fan",
|
|
98376
98362
|
openArgs: [{
|
|
98377
|
-
key: "
|
|
98363
|
+
key: "speed",
|
|
98378
98364
|
label: t("Speed", "Velocità"),
|
|
98379
98365
|
offer: {
|
|
98380
98366
|
kind: "number",
|
|
@@ -98436,7 +98422,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
98436
98422
|
],
|
|
98437
98423
|
state: [{
|
|
98438
98424
|
kind: "numeric",
|
|
98439
|
-
field: "
|
|
98425
|
+
field: "speed",
|
|
98440
98426
|
quantity: t("the speed", "la velocità"),
|
|
98441
98427
|
label: t("Speed", "Velocità"),
|
|
98442
98428
|
unit: "%",
|
|
@@ -99236,7 +99222,7 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
99236
99222
|
},
|
|
99237
99223
|
{
|
|
99238
99224
|
kind: "numeric",
|
|
99239
|
-
field: "
|
|
99225
|
+
field: "progress",
|
|
99240
99226
|
quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
|
|
99241
99227
|
label: t("Progress", "Avanzamento"),
|
|
99242
99228
|
unit: "%",
|
|
@@ -99594,10 +99580,10 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
99594
99580
|
id: "media.seek",
|
|
99595
99581
|
method: "seek",
|
|
99596
99582
|
label: t("Seek", "Vai al punto"),
|
|
99597
|
-
phrase: t("Move {device} to {
|
|
99583
|
+
phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
|
|
99598
99584
|
icon: "fast-forward",
|
|
99599
99585
|
openArgs: [{
|
|
99600
|
-
key: "
|
|
99586
|
+
key: "position",
|
|
99601
99587
|
label: t("Position", "Posizione"),
|
|
99602
99588
|
offer: {
|
|
99603
99589
|
kind: "number",
|
|
@@ -100650,7 +100636,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
100650
100636
|
state: [
|
|
100651
100637
|
{
|
|
100652
100638
|
kind: "numeric",
|
|
100653
|
-
field: "
|
|
100639
|
+
field: "co2",
|
|
100654
100640
|
quantity: t("the CO₂", "la CO₂"),
|
|
100655
100641
|
label: t("CO₂", "CO₂"),
|
|
100656
100642
|
unit: "ppm",
|
|
@@ -100658,7 +100644,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
100658
100644
|
},
|
|
100659
100645
|
{
|
|
100660
100646
|
kind: "numeric",
|
|
100661
|
-
field: "
|
|
100647
|
+
field: "voc",
|
|
100662
100648
|
quantity: t("the VOC level", "il livello di COV"),
|
|
100663
100649
|
label: t("VOC", "COV"),
|
|
100664
100650
|
unit: "ppb",
|
|
@@ -100694,7 +100680,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
100694
100680
|
noun: t("Light level", "Luminosità ambiente"),
|
|
100695
100681
|
state: [{
|
|
100696
100682
|
kind: "numeric",
|
|
100697
|
-
field: "
|
|
100683
|
+
field: "illuminance",
|
|
100698
100684
|
quantity: t("the light level", "la luminosità"),
|
|
100699
100685
|
label: t("Illuminance", "Illuminamento"),
|
|
100700
100686
|
unit: "lx",
|
|
@@ -100897,7 +100883,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
100897
100883
|
noun: t("Humidity", "Umidità"),
|
|
100898
100884
|
state: [{
|
|
100899
100885
|
kind: "numeric",
|
|
100900
|
-
field: "
|
|
100886
|
+
field: "humidity",
|
|
100901
100887
|
quantity: t("the humidity", "l’umidità"),
|
|
100902
100888
|
label: t("Humidity", "Umidità"),
|
|
100903
100889
|
unit: "%",
|
|
@@ -100945,7 +100931,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
100945
100931
|
state: [
|
|
100946
100932
|
{
|
|
100947
100933
|
kind: "numeric",
|
|
100948
|
-
field: "
|
|
100934
|
+
field: "power",
|
|
100949
100935
|
quantity: t("the power draw", "il consumo"),
|
|
100950
100936
|
label: t("Power", "Potenza"),
|
|
100951
100937
|
unit: "W",
|
|
@@ -100953,7 +100939,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
100953
100939
|
},
|
|
100954
100940
|
{
|
|
100955
100941
|
kind: "numeric",
|
|
100956
|
-
field: "
|
|
100942
|
+
field: "energy",
|
|
100957
100943
|
quantity: t("the energy used", "l’energia consumata"),
|
|
100958
100944
|
label: t("Energy", "Energia"),
|
|
100959
100945
|
unit: "kWh",
|
|
@@ -100961,7 +100947,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
100961
100947
|
},
|
|
100962
100948
|
{
|
|
100963
100949
|
kind: "numeric",
|
|
100964
|
-
field: "
|
|
100950
|
+
field: "voltage",
|
|
100965
100951
|
quantity: t("the voltage", "la tensione"),
|
|
100966
100952
|
label: t("Voltage", "Tensione"),
|
|
100967
100953
|
unit: "V",
|
|
@@ -100969,7 +100955,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
100969
100955
|
},
|
|
100970
100956
|
{
|
|
100971
100957
|
kind: "numeric",
|
|
100972
|
-
field: "
|
|
100958
|
+
field: "current",
|
|
100973
100959
|
quantity: t("the current", "la corrente"),
|
|
100974
100960
|
label: t("Current", "Corrente"),
|
|
100975
100961
|
unit: "A",
|
|
@@ -100986,13 +100972,6 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
100986
100972
|
label: t("Where", "Posizione"),
|
|
100987
100973
|
phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
|
|
100988
100974
|
icon: "map-pin"
|
|
100989
|
-
}, {
|
|
100990
|
-
kind: "numeric",
|
|
100991
|
-
field: "batteryPercent",
|
|
100992
|
-
quantity: t("the phone battery", "la batteria del telefono"),
|
|
100993
|
-
label: t("Battery", "Batteria"),
|
|
100994
|
-
unit: "%",
|
|
100995
|
-
icon: "battery"
|
|
100996
100975
|
}]
|
|
100997
100976
|
},
|
|
100998
100977
|
"pressure-sensor": {
|
|
@@ -101000,7 +100979,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
101000
100979
|
noun: t("Pressure", "Pressione"),
|
|
101001
100980
|
state: [{
|
|
101002
100981
|
kind: "numeric",
|
|
101003
|
-
field: "
|
|
100982
|
+
field: "pressure",
|
|
101004
100983
|
quantity: t("the pressure", "la pressione"),
|
|
101005
100984
|
label: t("Pressure", "Pressione"),
|
|
101006
100985
|
unit: "hPa",
|
|
@@ -101036,7 +101015,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
101036
101015
|
noun: t("Temperature", "Temperatura"),
|
|
101037
101016
|
state: [{
|
|
101038
101017
|
kind: "numeric",
|
|
101039
|
-
field: "
|
|
101018
|
+
field: "temperature",
|
|
101040
101019
|
quantity: t("the temperature", "la temperatura"),
|
|
101041
101020
|
label: t("Temperature", "Temperatura"),
|
|
101042
101021
|
unit: "°C",
|
|
@@ -101107,7 +101086,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
101107
101086
|
state: [
|
|
101108
101087
|
{
|
|
101109
101088
|
kind: "numeric",
|
|
101110
|
-
field: "
|
|
101089
|
+
field: "level",
|
|
101111
101090
|
quantity: t("the battery level", "il livello della batteria"),
|
|
101112
101091
|
label: t("Battery", "Batteria"),
|
|
101113
101092
|
unit: "%",
|
|
@@ -101149,7 +101128,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
101149
101128
|
icon: "battery-charging"
|
|
101150
101129
|
}
|
|
101151
101130
|
],
|
|
101152
|
-
events: { onStatusChanged: { notOperatorFacing: "the
|
|
101131
|
+
events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
|
|
101153
101132
|
extraEvents: [{
|
|
101154
101133
|
category: require_event_category.EventCategory.DeviceAwake,
|
|
101155
101134
|
label: t("Woke up", "Risvegliato"),
|
|
@@ -101167,7 +101146,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
101167
101146
|
noun: t("Network link", "Collegamento di rete"),
|
|
101168
101147
|
state: [{
|
|
101169
101148
|
kind: "numeric",
|
|
101170
|
-
field: "
|
|
101149
|
+
field: "signal",
|
|
101171
101150
|
quantity: t("the signal strength", "l’intensità del segnale"),
|
|
101172
101151
|
label: t("Signal", "Segnale"),
|
|
101173
101152
|
unit: "%",
|