@camstack/addon-export-alexa 1.2.171 → 1.2.173
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 +16 -1
- package/README.md +16 -9
- package/dist/export-alexa.addon.js +1246 -248
- package/dist/export-alexa.addon.mjs +1246 -248
- package/package.json +3 -3
|
@@ -5,7 +5,7 @@ import "node:fs";
|
|
|
5
5
|
import "node:path";
|
|
6
6
|
import "node:child_process";
|
|
7
7
|
import "node:zlib";
|
|
8
|
-
//#region ../types/dist/event-category-
|
|
8
|
+
//#region ../types/dist/event-category-DmZDPDf_.mjs
|
|
9
9
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
10
10
|
EventCategory["SystemBoot"] = "system.boot";
|
|
11
11
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -632,7 +632,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
632
632
|
* (a track was promoted to a stationary-registry entry) or departs (the
|
|
633
633
|
* object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
|
|
634
634
|
* the dedicated "Stationary" section — never the live event feed. Payload:
|
|
635
|
-
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp }`.
|
|
635
|
+
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
|
|
636
636
|
*/
|
|
637
637
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
638
638
|
/**
|
|
@@ -770,6 +770,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
770
770
|
*/
|
|
771
771
|
EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
|
|
772
772
|
/**
|
|
773
|
+
* An action run started or ended. Emitted by the `actions` surface.
|
|
774
|
+
* Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
|
|
775
|
+
*/
|
|
776
|
+
EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
|
|
777
|
+
/**
|
|
773
778
|
* Progress update from a running model conversion job.
|
|
774
779
|
* Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
|
|
775
780
|
* Emitted by `addon-model-studio` on the converting node.
|
|
@@ -5448,7 +5453,7 @@ var ZodIssueCode = {
|
|
|
5448
5453
|
var ZodFirstPartyTypeKind;
|
|
5449
5454
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5450
5455
|
//#endregion
|
|
5451
|
-
//#region ../types/dist/sleep-
|
|
5456
|
+
//#region ../types/dist/sleep-Crlmu_tO.mjs
|
|
5452
5457
|
/**
|
|
5453
5458
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5454
5459
|
* window to float samples (D455).
|
|
@@ -8519,6 +8524,8 @@ Object.freeze({ "doorbell": "lastPressedAt" });
|
|
|
8519
8524
|
/** Every capability name, so addon code can check a name without the schema graph. */
|
|
8520
8525
|
var CAP_NAMES = Object.freeze([
|
|
8521
8526
|
"accessories",
|
|
8527
|
+
"action-source",
|
|
8528
|
+
"actions",
|
|
8522
8529
|
"addon-pages",
|
|
8523
8530
|
"addon-pages-source",
|
|
8524
8531
|
"addon-routes",
|
|
@@ -8592,6 +8599,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8592
8599
|
"filesystem-browse",
|
|
8593
8600
|
"flood",
|
|
8594
8601
|
"gas",
|
|
8602
|
+
"group-active",
|
|
8595
8603
|
"group-commands",
|
|
8596
8604
|
"group-status",
|
|
8597
8605
|
"heating-valve",
|
|
@@ -8614,6 +8622,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8614
8622
|
"login-method",
|
|
8615
8623
|
"media-player",
|
|
8616
8624
|
"mesh-network",
|
|
8625
|
+
"meter",
|
|
8617
8626
|
"metrics-provider",
|
|
8618
8627
|
"model-convert",
|
|
8619
8628
|
"model-distributor",
|
|
@@ -8705,11 +8714,11 @@ var CAP_NAMES = Object.freeze([
|
|
|
8705
8714
|
Object.freeze({
|
|
8706
8715
|
"air-quality-sensor": [
|
|
8707
8716
|
{
|
|
8708
|
-
"path": "
|
|
8717
|
+
"path": "co2",
|
|
8709
8718
|
"valueType": "number"
|
|
8710
8719
|
},
|
|
8711
8720
|
{
|
|
8712
|
-
"path": "
|
|
8721
|
+
"path": "voc",
|
|
8713
8722
|
"valueType": "number"
|
|
8714
8723
|
},
|
|
8715
8724
|
{
|
|
@@ -8759,7 +8768,7 @@ Object.freeze({
|
|
|
8759
8768
|
}
|
|
8760
8769
|
],
|
|
8761
8770
|
"ambient-light-sensor": [{
|
|
8762
|
-
"path": "
|
|
8771
|
+
"path": "illuminance",
|
|
8763
8772
|
"valueType": "number"
|
|
8764
8773
|
}],
|
|
8765
8774
|
"audio-metrics": [
|
|
@@ -8820,7 +8829,7 @@ Object.freeze({
|
|
|
8820
8829
|
],
|
|
8821
8830
|
"battery": [
|
|
8822
8831
|
{
|
|
8823
|
-
"path": "
|
|
8832
|
+
"path": "level",
|
|
8824
8833
|
"valueType": "number"
|
|
8825
8834
|
},
|
|
8826
8835
|
{
|
|
@@ -8842,7 +8851,7 @@ Object.freeze({
|
|
|
8842
8851
|
"valueType": "number"
|
|
8843
8852
|
},
|
|
8844
8853
|
{
|
|
8845
|
-
"path": "
|
|
8854
|
+
"path": "voltage",
|
|
8846
8855
|
"valueType": "number"
|
|
8847
8856
|
},
|
|
8848
8857
|
{
|
|
@@ -8863,7 +8872,7 @@ Object.freeze({
|
|
|
8863
8872
|
"valueType": "boolean"
|
|
8864
8873
|
}],
|
|
8865
8874
|
"brightness": [{
|
|
8866
|
-
"path": "
|
|
8875
|
+
"path": "level",
|
|
8867
8876
|
"valueType": "number"
|
|
8868
8877
|
}],
|
|
8869
8878
|
"broker": [{
|
|
@@ -9064,7 +9073,7 @@ Object.freeze({
|
|
|
9064
9073
|
"valueType": "number"
|
|
9065
9074
|
},
|
|
9066
9075
|
{
|
|
9067
|
-
"path": "
|
|
9076
|
+
"path": "colorTemperature",
|
|
9068
9077
|
"valueType": "number"
|
|
9069
9078
|
}
|
|
9070
9079
|
],
|
|
@@ -9243,15 +9252,15 @@ Object.freeze({
|
|
|
9243
9252
|
"valueType": "string"
|
|
9244
9253
|
},
|
|
9245
9254
|
{
|
|
9246
|
-
"path": "
|
|
9255
|
+
"path": "remaining",
|
|
9247
9256
|
"valueType": "number"
|
|
9248
9257
|
},
|
|
9249
9258
|
{
|
|
9250
|
-
"path": "
|
|
9259
|
+
"path": "delayedStart",
|
|
9251
9260
|
"valueType": "number"
|
|
9252
9261
|
},
|
|
9253
9262
|
{
|
|
9254
|
-
"path": "
|
|
9263
|
+
"path": "progress",
|
|
9255
9264
|
"valueType": "number"
|
|
9256
9265
|
},
|
|
9257
9266
|
{
|
|
@@ -9365,7 +9374,7 @@ Object.freeze({
|
|
|
9365
9374
|
],
|
|
9366
9375
|
"fan-control": [
|
|
9367
9376
|
{
|
|
9368
|
-
"path": "
|
|
9377
|
+
"path": "speed",
|
|
9369
9378
|
"valueType": "number"
|
|
9370
9379
|
},
|
|
9371
9380
|
{
|
|
@@ -9412,6 +9421,10 @@ Object.freeze({
|
|
|
9412
9421
|
"path": "detected",
|
|
9413
9422
|
"valueType": "boolean"
|
|
9414
9423
|
}],
|
|
9424
|
+
"group-active": [{
|
|
9425
|
+
"path": "active",
|
|
9426
|
+
"valueType": "boolean"
|
|
9427
|
+
}],
|
|
9415
9428
|
"group-status": [
|
|
9416
9429
|
{
|
|
9417
9430
|
"path": "included",
|
|
@@ -9461,7 +9474,7 @@ Object.freeze({
|
|
|
9461
9474
|
}
|
|
9462
9475
|
],
|
|
9463
9476
|
"humidity-sensor": [{
|
|
9464
|
-
"path": "
|
|
9477
|
+
"path": "humidity",
|
|
9465
9478
|
"valueType": "number"
|
|
9466
9479
|
}],
|
|
9467
9480
|
"image": [{
|
|
@@ -9571,7 +9584,7 @@ Object.freeze({
|
|
|
9571
9584
|
"valueType": "number"
|
|
9572
9585
|
},
|
|
9573
9586
|
{
|
|
9574
|
-
"path": "
|
|
9587
|
+
"path": "progress",
|
|
9575
9588
|
"valueType": "number"
|
|
9576
9589
|
},
|
|
9577
9590
|
{
|
|
@@ -9650,11 +9663,11 @@ Object.freeze({
|
|
|
9650
9663
|
"valueType": "string"
|
|
9651
9664
|
},
|
|
9652
9665
|
{
|
|
9653
|
-
"path": "
|
|
9666
|
+
"path": "position",
|
|
9654
9667
|
"valueType": "number"
|
|
9655
9668
|
},
|
|
9656
9669
|
{
|
|
9657
|
-
"path": "
|
|
9670
|
+
"path": "duration",
|
|
9658
9671
|
"valueType": "number"
|
|
9659
9672
|
},
|
|
9660
9673
|
{
|
|
@@ -9671,6 +9684,10 @@ Object.freeze({
|
|
|
9671
9684
|
]
|
|
9672
9685
|
}
|
|
9673
9686
|
],
|
|
9687
|
+
"meter": [{
|
|
9688
|
+
"path": "value",
|
|
9689
|
+
"valueType": "number"
|
|
9690
|
+
}],
|
|
9674
9691
|
"motion": [
|
|
9675
9692
|
{
|
|
9676
9693
|
"path": "detected",
|
|
@@ -9752,11 +9769,11 @@ Object.freeze({
|
|
|
9752
9769
|
]
|
|
9753
9770
|
},
|
|
9754
9771
|
{
|
|
9755
|
-
"path": "
|
|
9772
|
+
"path": "signal",
|
|
9756
9773
|
"valueType": "number"
|
|
9757
9774
|
},
|
|
9758
9775
|
{
|
|
9759
|
-
"path": "
|
|
9776
|
+
"path": "rssi",
|
|
9760
9777
|
"valueType": "number"
|
|
9761
9778
|
},
|
|
9762
9779
|
{
|
|
@@ -9811,6 +9828,18 @@ Object.freeze({
|
|
|
9811
9828
|
"path": "foodLevel",
|
|
9812
9829
|
"valueType": "number"
|
|
9813
9830
|
},
|
|
9831
|
+
{
|
|
9832
|
+
"path": "bowlFood",
|
|
9833
|
+
"valueType": "number"
|
|
9834
|
+
},
|
|
9835
|
+
{
|
|
9836
|
+
"path": "eating",
|
|
9837
|
+
"valueType": "boolean"
|
|
9838
|
+
},
|
|
9839
|
+
{
|
|
9840
|
+
"path": "supportsMarkRefilled",
|
|
9841
|
+
"valueType": "boolean"
|
|
9842
|
+
},
|
|
9814
9843
|
{
|
|
9815
9844
|
"path": "food1",
|
|
9816
9845
|
"valueType": "number"
|
|
@@ -9875,23 +9904,23 @@ Object.freeze({
|
|
|
9875
9904
|
],
|
|
9876
9905
|
"power-meter": [
|
|
9877
9906
|
{
|
|
9878
|
-
"path": "
|
|
9907
|
+
"path": "power",
|
|
9879
9908
|
"valueType": "number"
|
|
9880
9909
|
},
|
|
9881
9910
|
{
|
|
9882
|
-
"path": "
|
|
9911
|
+
"path": "energy",
|
|
9883
9912
|
"valueType": "number"
|
|
9884
9913
|
},
|
|
9885
9914
|
{
|
|
9886
|
-
"path": "
|
|
9915
|
+
"path": "voltage",
|
|
9887
9916
|
"valueType": "number"
|
|
9888
9917
|
},
|
|
9889
9918
|
{
|
|
9890
|
-
"path": "
|
|
9919
|
+
"path": "current",
|
|
9891
9920
|
"valueType": "number"
|
|
9892
9921
|
},
|
|
9893
9922
|
{
|
|
9894
|
-
"path": "
|
|
9923
|
+
"path": "apparentPower",
|
|
9895
9924
|
"valueType": "number"
|
|
9896
9925
|
},
|
|
9897
9926
|
{
|
|
@@ -9919,14 +9948,10 @@ Object.freeze({
|
|
|
9919
9948
|
{
|
|
9920
9949
|
"path": "gps.accuracyMeters",
|
|
9921
9950
|
"valueType": "number"
|
|
9922
|
-
},
|
|
9923
|
-
{
|
|
9924
|
-
"path": "batteryPercent",
|
|
9925
|
-
"valueType": "number"
|
|
9926
9951
|
}
|
|
9927
9952
|
],
|
|
9928
9953
|
"pressure-sensor": [{
|
|
9929
|
-
"path": "
|
|
9954
|
+
"path": "pressure",
|
|
9930
9955
|
"valueType": "number"
|
|
9931
9956
|
}],
|
|
9932
9957
|
"privacy-mask": [{
|
|
@@ -10240,7 +10265,7 @@ Object.freeze({
|
|
|
10240
10265
|
"valueType": "boolean"
|
|
10241
10266
|
}],
|
|
10242
10267
|
"temperature-sensor": [{
|
|
10243
|
-
"path": "
|
|
10268
|
+
"path": "temperature",
|
|
10244
10269
|
"valueType": "number"
|
|
10245
10270
|
}],
|
|
10246
10271
|
"update": [
|
|
@@ -10288,7 +10313,7 @@ Object.freeze({
|
|
|
10288
10313
|
"valueType": "string"
|
|
10289
10314
|
},
|
|
10290
10315
|
{
|
|
10291
|
-
"path": "
|
|
10316
|
+
"path": "progress",
|
|
10292
10317
|
"valueType": "number"
|
|
10293
10318
|
},
|
|
10294
10319
|
{
|
|
@@ -10773,7 +10798,7 @@ function errMsg(err) {
|
|
|
10773
10798
|
return String(err);
|
|
10774
10799
|
}
|
|
10775
10800
|
//#endregion
|
|
10776
|
-
//#region ../types/dist/composition-
|
|
10801
|
+
//#region ../types/dist/composition-CZImLpOI.mjs
|
|
10777
10802
|
/**
|
|
10778
10803
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
10779
10804
|
*
|
|
@@ -11088,6 +11113,13 @@ var table = {
|
|
|
11088
11113
|
apply: () => {
|
|
11089
11114
|
throw new ExpressionEvalError("latchedAt: stateful evaluation context is required");
|
|
11090
11115
|
}
|
|
11116
|
+
},
|
|
11117
|
+
schmitt: {
|
|
11118
|
+
minArgs: 3,
|
|
11119
|
+
maxArgs: 5,
|
|
11120
|
+
apply: () => {
|
|
11121
|
+
throw new ExpressionEvalError("schmitt: stateful evaluation context is required");
|
|
11122
|
+
}
|
|
11091
11123
|
}
|
|
11092
11124
|
};
|
|
11093
11125
|
Object.freeze(Object.assign(Object.create(null), table));
|
|
@@ -11549,6 +11581,79 @@ var APPLIANCE_KINDS = [
|
|
|
11549
11581
|
];
|
|
11550
11582
|
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
11551
11583
|
/**
|
|
11584
|
+
* Statistics and integrals over a history read (D944).
|
|
11585
|
+
*
|
|
11586
|
+
* Pure: the same points always give the same answer, so a restart recomputes
|
|
11587
|
+
* rather than trusting a buffer. A gauge mean is time-weighted (value × ms),
|
|
11588
|
+
* never the mean of the samples. A hole with no held value is not integrated
|
|
11589
|
+
* as zero. A truncated read is not published.
|
|
11590
|
+
*/
|
|
11591
|
+
var STATISTIC_STATS = [
|
|
11592
|
+
"min",
|
|
11593
|
+
"max",
|
|
11594
|
+
"mean",
|
|
11595
|
+
"sum",
|
|
11596
|
+
"count",
|
|
11597
|
+
"change"
|
|
11598
|
+
];
|
|
11599
|
+
/**
|
|
11600
|
+
* The range a statistics or integral helper asks history for (D944).
|
|
11601
|
+
*
|
|
11602
|
+
* Calendar edges are the hub's timezone, never UTC midnight: a day is 23, 24
|
|
11603
|
+
* or 25 hours across a DST change. A tier is eligible only when its retention
|
|
11604
|
+
* is strictly longer than the longest that range can be. Forever qualifies.
|
|
11605
|
+
* Equal to a tier's retention is a refusal, not a short answer.
|
|
11606
|
+
*/
|
|
11607
|
+
var MINUTE_MS = 6e4;
|
|
11608
|
+
var HOUR_MS = 60 * MINUTE_MS;
|
|
11609
|
+
var DAY_MS = 24 * HOUR_MS;
|
|
11610
|
+
var ROLLING_SPANS = [
|
|
11611
|
+
"1h",
|
|
11612
|
+
"24h",
|
|
11613
|
+
"2d",
|
|
11614
|
+
"7d",
|
|
11615
|
+
"30d",
|
|
11616
|
+
"custom"
|
|
11617
|
+
];
|
|
11618
|
+
var CALENDAR_PERIODS = [
|
|
11619
|
+
"today",
|
|
11620
|
+
"yesterday",
|
|
11621
|
+
"this-week",
|
|
11622
|
+
"this-month"
|
|
11623
|
+
];
|
|
11624
|
+
var RESET_PERIODS = [
|
|
11625
|
+
"never",
|
|
11626
|
+
"daily",
|
|
11627
|
+
"weekly",
|
|
11628
|
+
"monthly"
|
|
11629
|
+
];
|
|
11630
|
+
5 * MINUTE_MS;
|
|
11631
|
+
24 * HOUR_MS, 2 * DAY_MS, 7 * DAY_MS, 30 * DAY_MS;
|
|
11632
|
+
7 * DAY_MS, 30 * DAY_MS, 365 * DAY_MS;
|
|
11633
|
+
var rollingWindowObject = object({
|
|
11634
|
+
kind: literal("rolling"),
|
|
11635
|
+
span: _enum(ROLLING_SPANS),
|
|
11636
|
+
customMinutes: number().int().min(5).optional()
|
|
11637
|
+
}).check((payload) => {
|
|
11638
|
+
if (payload.value.span === "custom" && payload.value.customMinutes === void 0) payload.issues.push({
|
|
11639
|
+
code: "custom",
|
|
11640
|
+
message: "a custom range needs a duration in minutes",
|
|
11641
|
+
path: ["customMinutes"],
|
|
11642
|
+
input: payload.value
|
|
11643
|
+
});
|
|
11644
|
+
if (payload.value.span !== "custom" && payload.value.customMinutes !== void 0) payload.issues.push({
|
|
11645
|
+
code: "custom",
|
|
11646
|
+
message: "only a custom range carries a duration",
|
|
11647
|
+
path: ["customMinutes"],
|
|
11648
|
+
input: payload.value
|
|
11649
|
+
});
|
|
11650
|
+
});
|
|
11651
|
+
var RollingWindowSchema = rollingWindowObject;
|
|
11652
|
+
var StatisticWindowSchema = discriminatedUnion("kind", [rollingWindowObject, object({
|
|
11653
|
+
kind: literal("calendar"),
|
|
11654
|
+
period: _enum(CALENDAR_PERIODS)
|
|
11655
|
+
})]);
|
|
11656
|
+
/**
|
|
11552
11657
|
* A composition source identity: `(addonId, stableId)`, never a numeric device
|
|
11553
11658
|
* id. Split out so helper schemas can name it without a cycle through
|
|
11554
11659
|
* `composition.ts` (D659).
|
|
@@ -11574,7 +11679,13 @@ var GROUP_TEMPLATE_IDS = [
|
|
|
11574
11679
|
"occupancy",
|
|
11575
11680
|
"binary",
|
|
11576
11681
|
"switch",
|
|
11577
|
-
"light"
|
|
11682
|
+
"light",
|
|
11683
|
+
"fan",
|
|
11684
|
+
"cover",
|
|
11685
|
+
"valve",
|
|
11686
|
+
"lock",
|
|
11687
|
+
"media-player",
|
|
11688
|
+
"climate"
|
|
11578
11689
|
];
|
|
11579
11690
|
var NUMERIC_AGGREGATES = [
|
|
11580
11691
|
"mean",
|
|
@@ -11604,22 +11715,73 @@ var HelperMemberSchema = object({
|
|
|
11604
11715
|
cap: string().min(1),
|
|
11605
11716
|
fieldPath: string().min(1)
|
|
11606
11717
|
});
|
|
11607
|
-
var HelperSpecSchema = discriminatedUnion("kind", [
|
|
11608
|
-
|
|
11609
|
-
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
|
|
11613
|
-
|
|
11614
|
-
|
|
11615
|
-
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11718
|
+
var HelperSpecSchema = discriminatedUnion("kind", [
|
|
11719
|
+
object({
|
|
11720
|
+
kind: literal("group"),
|
|
11721
|
+
templateId: GroupTemplateIdSchema,
|
|
11722
|
+
aggregate: AggregateReducerSchema,
|
|
11723
|
+
members: array(HelperMemberSchema).min(1).max(64),
|
|
11724
|
+
/** Actuator groups only. Readings leave this unset. */
|
|
11725
|
+
active: ActiveCriterionSchema.optional()
|
|
11726
|
+
}),
|
|
11727
|
+
object({
|
|
11728
|
+
kind: literal("appliance"),
|
|
11729
|
+
templateId: literal(APPLIANCE_TEMPLATE_ID),
|
|
11730
|
+
appliance: _enum(APPLIANCE_KINDS),
|
|
11731
|
+
thresholdWatts: number().positive(),
|
|
11732
|
+
startDwellMs: number().int().nonnegative(),
|
|
11733
|
+
stopDwellMs: number().int().nonnegative(),
|
|
11734
|
+
member: HelperMemberSchema
|
|
11735
|
+
}),
|
|
11736
|
+
object({
|
|
11737
|
+
kind: literal("statistic"),
|
|
11738
|
+
stat: _enum(STATISTIC_STATS),
|
|
11739
|
+
window: StatisticWindowSchema,
|
|
11740
|
+
source: HelperMemberSchema
|
|
11741
|
+
}),
|
|
11742
|
+
object({
|
|
11743
|
+
kind: literal("integral"),
|
|
11744
|
+
reset: _enum(RESET_PERIODS),
|
|
11745
|
+
output: _enum(["energy", "meter"]),
|
|
11746
|
+
source: HelperMemberSchema
|
|
11747
|
+
}),
|
|
11748
|
+
object({
|
|
11749
|
+
kind: literal("threshold"),
|
|
11750
|
+
source: HelperMemberSchema,
|
|
11751
|
+
high: number(),
|
|
11752
|
+
low: number(),
|
|
11753
|
+
onForMs: number().int().nonnegative(),
|
|
11754
|
+
offForMs: number().int().nonnegative()
|
|
11755
|
+
}),
|
|
11756
|
+
object({
|
|
11757
|
+
kind: literal("arithmetic"),
|
|
11758
|
+
op: _enum([
|
|
11759
|
+
"sum",
|
|
11760
|
+
"difference",
|
|
11761
|
+
"ratio"
|
|
11762
|
+
]),
|
|
11763
|
+
inputs: array(HelperMemberSchema).min(2).max(64)
|
|
11764
|
+
}),
|
|
11765
|
+
object({
|
|
11766
|
+
kind: literal("expression"),
|
|
11767
|
+
expr: string().min(1),
|
|
11768
|
+
inputs: array(object({
|
|
11769
|
+
name: string().min(1),
|
|
11770
|
+
member: HelperMemberSchema
|
|
11771
|
+
})).min(1).max(64),
|
|
11772
|
+
output: _enum(["number", "boolean"])
|
|
11773
|
+
}),
|
|
11774
|
+
object({
|
|
11775
|
+
kind: literal("derivative"),
|
|
11776
|
+
window: RollingWindowSchema,
|
|
11777
|
+
per: _enum([
|
|
11778
|
+
"second",
|
|
11779
|
+
"minute",
|
|
11780
|
+
"hour"
|
|
11781
|
+
]),
|
|
11782
|
+
source: HelperMemberSchema
|
|
11783
|
+
})
|
|
11784
|
+
]);
|
|
11623
11785
|
/** A composed device's stableId is this prefix plus the block id. */
|
|
11624
11786
|
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
11625
11787
|
/** Longest snippet a `code` source may carry (slice 4). */
|
|
@@ -11680,6 +11842,12 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
|
|
|
11680
11842
|
"all"
|
|
11681
11843
|
]),
|
|
11682
11844
|
reads: array(CompositionFieldReadSchema).min(1).max(64),
|
|
11845
|
+
/**
|
|
11846
|
+
* Set when the reads are an enum state, not a yes/no: the listed states
|
|
11847
|
+
* count as active (a cover is `open`). A state outside the list is inactive;
|
|
11848
|
+
* a read that is not a state at all is left out. Only `any` / `all` use it.
|
|
11849
|
+
*/
|
|
11850
|
+
activeWhen: array(string().min(1)).min(1).optional(),
|
|
11683
11851
|
/** `value` is the reading; the others are the member counts. */
|
|
11684
11852
|
publish: _enum([
|
|
11685
11853
|
"value",
|
|
@@ -11693,6 +11861,26 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
|
|
|
11693
11861
|
"omit",
|
|
11694
11862
|
"offline"
|
|
11695
11863
|
])
|
|
11864
|
+
}),
|
|
11865
|
+
object({
|
|
11866
|
+
kind: literal("series"),
|
|
11867
|
+
read: CompositionFieldReadSchema,
|
|
11868
|
+
/** `value` is the statistic or the integral. The others are the gap counts. */
|
|
11869
|
+
publish: _enum([
|
|
11870
|
+
"value",
|
|
11871
|
+
"included",
|
|
11872
|
+
"excluded",
|
|
11873
|
+
"total"
|
|
11874
|
+
]),
|
|
11875
|
+
/**
|
|
11876
|
+
* What an unanswered `value` does. Counts ignore this. `offline` leaves the
|
|
11877
|
+
* device unseeded until history answers, so a restart cannot publish 0.
|
|
11878
|
+
*/
|
|
11879
|
+
empty: _enum([
|
|
11880
|
+
"null",
|
|
11881
|
+
"omit",
|
|
11882
|
+
"offline"
|
|
11883
|
+
])
|
|
11696
11884
|
})
|
|
11697
11885
|
]);
|
|
11698
11886
|
var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
|
|
@@ -15417,6 +15605,14 @@ var AutomationConditionLeafSchema = object({
|
|
|
15417
15605
|
array(union([string(), number()]))
|
|
15418
15606
|
])
|
|
15419
15607
|
});
|
|
15608
|
+
var AutomationConditionStationaryPresentSchema = object({
|
|
15609
|
+
kind: literal("stationary-present"),
|
|
15610
|
+
deviceId: number().int().nonnegative(),
|
|
15611
|
+
/** Class names; a macro class matches every raw class that maps to it. */
|
|
15612
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
15613
|
+
/** The parked object must be in at least one of these zones. */
|
|
15614
|
+
zones: array(string().min(1)).min(1).optional()
|
|
15615
|
+
});
|
|
15420
15616
|
/**
|
|
15421
15617
|
* The expression leaf, declared as a plain object rather than an intersection
|
|
15422
15618
|
* with {@link ExpressionSourceSchema}: a discriminated union has to be able to
|
|
@@ -15450,7 +15646,8 @@ var AutomationConditionSchema = lazy(() => discriminatedUnion("kind", [
|
|
|
15450
15646
|
child: AutomationConditionSchema
|
|
15451
15647
|
}),
|
|
15452
15648
|
AutomationConditionLeafSchema,
|
|
15453
|
-
AutomationConditionExpressionSchema
|
|
15649
|
+
AutomationConditionExpressionSchema,
|
|
15650
|
+
AutomationConditionStationaryPresentSchema
|
|
15454
15651
|
]));
|
|
15455
15652
|
/**
|
|
15456
15653
|
* What starts a run.
|
|
@@ -15491,7 +15688,34 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
15491
15688
|
kind: literal("schedule"),
|
|
15492
15689
|
cron: string().min(1).max(120)
|
|
15493
15690
|
}),
|
|
15494
|
-
object({ kind: literal("manual") })
|
|
15691
|
+
object({ kind: literal("manual") }),
|
|
15692
|
+
object({
|
|
15693
|
+
kind: literal("detection"),
|
|
15694
|
+
/** Class names. A macro class (`animal`, `vehicle`, `person`, `package`)
|
|
15695
|
+
* matches every raw class that maps to it; any other name matches
|
|
15696
|
+
* exactly. */
|
|
15697
|
+
classes: array(string().min(1)).min(1),
|
|
15698
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
15699
|
+
/** The track must have visited at least one of these zones. */
|
|
15700
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
15701
|
+
/** Best-so-far confidence the track must reach. */
|
|
15702
|
+
minScore: number().min(0).max(1).optional()
|
|
15703
|
+
}),
|
|
15704
|
+
object({
|
|
15705
|
+
kind: literal("stationary"),
|
|
15706
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
15707
|
+
/** Class names; a macro class matches like the detection trigger. */
|
|
15708
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
15709
|
+
/** The parked object must be in at least one of these zones. */
|
|
15710
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
15711
|
+
/** `appeared`: it became parked. `departed`: the registry retired it.
|
|
15712
|
+
* The vocabulary of `PipelineAnalyticsStationaryChanged`. */
|
|
15713
|
+
phase: _enum(["appeared", "departed"])
|
|
15714
|
+
}),
|
|
15715
|
+
object({
|
|
15716
|
+
kind: literal("interval"),
|
|
15717
|
+
minutes: number().int().min(1).max(1440)
|
|
15718
|
+
})
|
|
15495
15719
|
]);
|
|
15496
15720
|
/**
|
|
15497
15721
|
* One action step.
|
|
@@ -15511,28 +15735,47 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
15511
15735
|
* is called. The runner still receives a number and is untouched; the
|
|
15512
15736
|
* resolution is the recipe's job, not the runner's.
|
|
15513
15737
|
*/
|
|
15738
|
+
var AutomationWaitStepSchema = object({
|
|
15739
|
+
kind: literal("wait"),
|
|
15740
|
+
seconds: number().min(0).max(300)
|
|
15741
|
+
});
|
|
15742
|
+
var AutomationCapStepSchema = object({
|
|
15743
|
+
kind: literal("cap"),
|
|
15744
|
+
/**
|
|
15745
|
+
* One device, several same-family devices (locks / climate family / …),
|
|
15746
|
+
* or `{ $var }` for the device that triggered the run. An array is
|
|
15747
|
+
* fan-out at codegen — each id gets the same cap.method call.
|
|
15748
|
+
*/
|
|
15749
|
+
deviceId: union([
|
|
15750
|
+
number().int(),
|
|
15751
|
+
array(number().int()).min(1),
|
|
15752
|
+
object({ $var: string().min(1) })
|
|
15753
|
+
]),
|
|
15754
|
+
cap: string().min(1),
|
|
15755
|
+
method: string().min(1),
|
|
15756
|
+
/** Values may carry `{{vars.x}}` slots, or be exactly `{ $var: 'name' }`, which
|
|
15757
|
+
* SUBSTITUTE and do not evaluate (§3.2.3). Anything beyond substitution is
|
|
15758
|
+
* the expression leaf. */
|
|
15759
|
+
args: record(string(), unknown()).optional()
|
|
15760
|
+
});
|
|
15761
|
+
/**
|
|
15762
|
+
* The steps an internal Action may contain: cap and wait, and nothing that can
|
|
15763
|
+
* call back into an Action — so an Action can never reach itself (no cycles).
|
|
15764
|
+
*/
|
|
15765
|
+
var ActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
|
|
15514
15766
|
var AutomationActionSchema = discriminatedUnion("kind", [
|
|
15767
|
+
AutomationWaitStepSchema,
|
|
15768
|
+
AutomationCapStepSchema,
|
|
15515
15769
|
object({
|
|
15516
|
-
kind: literal("
|
|
15517
|
-
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
|
|
15521
|
-
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
|
|
15525
|
-
*/
|
|
15526
|
-
deviceId: union([
|
|
15527
|
-
number().int(),
|
|
15528
|
-
array(number().int()).min(1),
|
|
15529
|
-
object({ $var: string().min(1) })
|
|
15530
|
-
]),
|
|
15531
|
-
cap: string().min(1),
|
|
15532
|
-
method: string().min(1),
|
|
15533
|
-
/** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
|
|
15534
|
-
* evaluate (§3.2.3). Anything beyond substitution is the expression leaf. */
|
|
15535
|
-
args: record(string(), unknown()).optional()
|
|
15770
|
+
kind: literal("action"),
|
|
15771
|
+
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
15772
|
+
actionId: string().min(1),
|
|
15773
|
+
/** Values for the action's declared variables; the others take their default. */
|
|
15774
|
+
variables: record(string(), union([
|
|
15775
|
+
string(),
|
|
15776
|
+
number(),
|
|
15777
|
+
boolean()
|
|
15778
|
+
])).optional()
|
|
15536
15779
|
}),
|
|
15537
15780
|
object({
|
|
15538
15781
|
kind: literal("code"),
|
|
@@ -15541,10 +15784,357 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
15541
15784
|
code: string().min(1).max(2e4)
|
|
15542
15785
|
})
|
|
15543
15786
|
]);
|
|
15787
|
+
/**
|
|
15788
|
+
* How a trigger that arrives while the automation is busy (or cooling down) is
|
|
15789
|
+
* handled. One of the automation's execution modes, never a property of its
|
|
15790
|
+
* actions. Absent means `single`.
|
|
15791
|
+
*
|
|
15792
|
+
* - `single` — drop the trigger while a run is in progress (traced + logged).
|
|
15793
|
+
* - `restart` — abort the run in progress (at its next step boundary), start fresh.
|
|
15794
|
+
* - `queued` — queue up to `max` triggers, drop the rest (traced).
|
|
15795
|
+
* - `parallel` — up to `max` runs at once, drop the rest (traced).
|
|
15796
|
+
* - `cooldown` — `single`, and no new run until `minutes` after the last run
|
|
15797
|
+
* STARTED; persisted across a restart. A manual trigger bypasses only this
|
|
15798
|
+
* wait, never the single/queued limits.
|
|
15799
|
+
*/
|
|
15800
|
+
var AutomationRunModeSchema = discriminatedUnion("mode", [
|
|
15801
|
+
object({ mode: literal("single") }),
|
|
15802
|
+
object({ mode: literal("restart") }),
|
|
15803
|
+
object({
|
|
15804
|
+
mode: literal("queued"),
|
|
15805
|
+
max: number().int().min(1).max(10)
|
|
15806
|
+
}),
|
|
15807
|
+
object({
|
|
15808
|
+
mode: literal("parallel"),
|
|
15809
|
+
max: number().int().min(1).max(10)
|
|
15810
|
+
}),
|
|
15811
|
+
object({
|
|
15812
|
+
mode: literal("cooldown"),
|
|
15813
|
+
minutes: number().int().min(1).max(1440)
|
|
15814
|
+
})
|
|
15815
|
+
]);
|
|
15544
15816
|
var AutomationRecipeSchema = object({
|
|
15545
15817
|
triggers: array(AutomationTriggerSchema),
|
|
15546
15818
|
conditions: AutomationConditionSchema.optional(),
|
|
15547
|
-
actions: array(AutomationActionSchema)
|
|
15819
|
+
actions: array(AutomationActionSchema),
|
|
15820
|
+
runMode: AutomationRunModeSchema.optional(),
|
|
15821
|
+
/** How many run traces the automation keeps (default {@link DEFAULT_TRACE_KEEP}). */
|
|
15822
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
15823
|
+
});
|
|
15824
|
+
new Set([
|
|
15825
|
+
{
|
|
15826
|
+
id: "person",
|
|
15827
|
+
name: "Person"
|
|
15828
|
+
},
|
|
15829
|
+
{
|
|
15830
|
+
id: "vehicle",
|
|
15831
|
+
name: "Vehicle"
|
|
15832
|
+
},
|
|
15833
|
+
{
|
|
15834
|
+
id: "animal",
|
|
15835
|
+
name: "Animal"
|
|
15836
|
+
},
|
|
15837
|
+
{
|
|
15838
|
+
id: "package",
|
|
15839
|
+
name: "Package"
|
|
15840
|
+
}
|
|
15841
|
+
].map((l) => l.id));
|
|
15842
|
+
var COCO_TO_MACRO = {
|
|
15843
|
+
mapping: {
|
|
15844
|
+
person: "person",
|
|
15845
|
+
bicycle: "vehicle",
|
|
15846
|
+
car: "vehicle",
|
|
15847
|
+
motorcycle: "vehicle",
|
|
15848
|
+
airplane: "vehicle",
|
|
15849
|
+
bus: "vehicle",
|
|
15850
|
+
train: "vehicle",
|
|
15851
|
+
truck: "vehicle",
|
|
15852
|
+
boat: "vehicle",
|
|
15853
|
+
bird: "animal",
|
|
15854
|
+
cat: "animal",
|
|
15855
|
+
dog: "animal",
|
|
15856
|
+
horse: "animal",
|
|
15857
|
+
sheep: "animal",
|
|
15858
|
+
cow: "animal",
|
|
15859
|
+
elephant: "animal",
|
|
15860
|
+
bear: "animal",
|
|
15861
|
+
zebra: "animal",
|
|
15862
|
+
giraffe: "animal",
|
|
15863
|
+
suitcase: "package",
|
|
15864
|
+
backpack: "package",
|
|
15865
|
+
handbag: "package"
|
|
15866
|
+
},
|
|
15867
|
+
preserveOriginal: false
|
|
15868
|
+
};
|
|
15869
|
+
new Set(Object.values(COCO_TO_MACRO.mapping));
|
|
15870
|
+
/**
|
|
15871
|
+
* Run traces — what an automation (or, later, an Action run) DID, node by node,
|
|
15872
|
+
* so the editor can paint every block green or red with its reason.
|
|
15873
|
+
*
|
|
15874
|
+
* A trace is data, not a log: it covers the WHOLE tree — the trigger stage,
|
|
15875
|
+
* every condition node (containers and leaves, including the ones a
|
|
15876
|
+
* short-circuit never reached), the run-mode verdict and every action step —
|
|
15877
|
+
* each addressed by a stable path (`conditions.0.1`, `actions.2`, or `steps.N`
|
|
15878
|
+
* for an Action run). Skipped
|
|
15879
|
+
* evaluations are traced too, and identical consecutive skips collapse into a
|
|
15880
|
+
* repeat count so a trigger that fails every 5 minutes cannot flush real runs.
|
|
15881
|
+
*
|
|
15882
|
+
* {@link AutomationStepTraceSchema} is deliberately free of automation
|
|
15883
|
+
* vocabulary so an Action run records the same step shape.
|
|
15884
|
+
*/
|
|
15885
|
+
/** A value a trace may show: JSON primitives and short lists, nothing deeper. */
|
|
15886
|
+
var TraceValueSchema = union([
|
|
15887
|
+
string(),
|
|
15888
|
+
number(),
|
|
15889
|
+
boolean(),
|
|
15890
|
+
_null(),
|
|
15891
|
+
array(union([string(), number()]))
|
|
15892
|
+
]);
|
|
15893
|
+
var AutomationRunOutcomeSchema = _enum([
|
|
15894
|
+
"ran",
|
|
15895
|
+
"skipped-trigger",
|
|
15896
|
+
"skipped-conditions",
|
|
15897
|
+
"skipped-cooldown",
|
|
15898
|
+
"skipped-overlap",
|
|
15899
|
+
"failed",
|
|
15900
|
+
"aborted"
|
|
15901
|
+
]);
|
|
15902
|
+
/** `not-evaluated` = a short-circuit never reached the node. */
|
|
15903
|
+
var TraceNodeOutcomeSchema = _enum([
|
|
15904
|
+
"pass",
|
|
15905
|
+
"fail",
|
|
15906
|
+
"not-evaluated"
|
|
15907
|
+
]);
|
|
15908
|
+
var AutomationTriggerTraceSchema = object({
|
|
15909
|
+
kind: string().min(1),
|
|
15910
|
+
outcome: _enum(["pass", "fail"]),
|
|
15911
|
+
/** Why an event was rejected ("class person not in [dog]") or what fired. */
|
|
15912
|
+
reason: string(),
|
|
15913
|
+
/** deviceId, className, trackId, score … — only what the trigger exposes. */
|
|
15914
|
+
vars: record(string(), TraceValueSchema)
|
|
15915
|
+
});
|
|
15916
|
+
var AutomationConditionTraceNodeSchema = object({
|
|
15917
|
+
/** `conditions` for the root, `conditions.<i>` for its i-th child, … */
|
|
15918
|
+
path: string().min(1),
|
|
15919
|
+
kind: _enum([
|
|
15920
|
+
"all",
|
|
15921
|
+
"any",
|
|
15922
|
+
"not",
|
|
15923
|
+
"condition",
|
|
15924
|
+
"expression",
|
|
15925
|
+
"stationary-present"
|
|
15926
|
+
]),
|
|
15927
|
+
outcome: TraceNodeOutcomeSchema,
|
|
15928
|
+
reason: string(),
|
|
15929
|
+
deviceId: number().int().optional(),
|
|
15930
|
+
cap: string().optional(),
|
|
15931
|
+
fieldPath: string().optional(),
|
|
15932
|
+
operator: string().optional(),
|
|
15933
|
+
expected: TraceValueSchema.optional(),
|
|
15934
|
+
/** What the mirror held; `null` when it held nothing (unknown). */
|
|
15935
|
+
observed: TraceValueSchema.optional()
|
|
15936
|
+
});
|
|
15937
|
+
var AutomationRunVerdictSchema = object({
|
|
15938
|
+
mode: AutomationRunModeSchema,
|
|
15939
|
+
decision: _enum([
|
|
15940
|
+
"run",
|
|
15941
|
+
"queued",
|
|
15942
|
+
"restart",
|
|
15943
|
+
"drop",
|
|
15944
|
+
"cooldown",
|
|
15945
|
+
"bypass"
|
|
15946
|
+
]),
|
|
15947
|
+
reason: string()
|
|
15948
|
+
});
|
|
15949
|
+
/** One executed (or not-run) step — shared by automations and Action runs. */
|
|
15950
|
+
var AutomationStepTraceSchema = object({
|
|
15951
|
+
/** `actions.<i>` */
|
|
15952
|
+
path: string().min(1),
|
|
15953
|
+
kind: string().min(1),
|
|
15954
|
+
cap: string().optional(),
|
|
15955
|
+
method: string().optional(),
|
|
15956
|
+
deviceId: number().int().optional(),
|
|
15957
|
+
startedAt: number().optional(),
|
|
15958
|
+
endedAt: number().optional(),
|
|
15959
|
+
outcome: _enum([
|
|
15960
|
+
"ok",
|
|
15961
|
+
"error",
|
|
15962
|
+
"not-run"
|
|
15963
|
+
]),
|
|
15964
|
+
message: string().optional()
|
|
15965
|
+
});
|
|
15966
|
+
var AutomationRunTraceSchema = object({
|
|
15967
|
+
runId: string().min(1),
|
|
15968
|
+
startedAt: number(),
|
|
15969
|
+
endedAt: number(),
|
|
15970
|
+
trigger: AutomationTriggerTraceSchema,
|
|
15971
|
+
conditions: array(AutomationConditionTraceNodeSchema),
|
|
15972
|
+
verdict: AutomationRunVerdictSchema.optional(),
|
|
15973
|
+
steps: array(AutomationStepTraceSchema),
|
|
15974
|
+
outcome: AutomationRunOutcomeSchema,
|
|
15975
|
+
/** How many identical consecutive skips this trace stands for (>= 1). */
|
|
15976
|
+
repeat: number().int().min(1),
|
|
15977
|
+
/** When the latest of those repeats happened. */
|
|
15978
|
+
lastAt: number()
|
|
15979
|
+
});
|
|
15980
|
+
/**
|
|
15981
|
+
* What the hub's `runs` ledger holds for one owner (`automation:<blockId>` or
|
|
15982
|
+
* `action:<actionId>`): the cooldown stamp and the trace ring.
|
|
15983
|
+
*/
|
|
15984
|
+
var AutomationStateDocSchema = object({
|
|
15985
|
+
version: literal(1),
|
|
15986
|
+
lastRunStartedAt: number().nullable(),
|
|
15987
|
+
traces: array(AutomationRunTraceSchema)
|
|
15988
|
+
});
|
|
15989
|
+
/**
|
|
15990
|
+
* Actions — named, runnable things an operator (or an automation) can start,
|
|
15991
|
+
* declared as LIST ENTRIES, never as devices.
|
|
15992
|
+
*
|
|
15993
|
+
* An entry is either **internal** (a short list of cap/wait steps kept in the
|
|
15994
|
+
* hub's `actions` record kind) or declared by an addon through the
|
|
15995
|
+
* `action-source` collection (a Home Assistant script, a scene …). The one
|
|
15996
|
+
* surface the UI and automations talk to is the `actions` cap; it keeps no
|
|
15997
|
+
* catalog of its own (D3) — every `list` asks the providers live.
|
|
15998
|
+
*
|
|
15999
|
+
* This file is the data half: the entry schema, the variables an entry may
|
|
16000
|
+
* declare, and the pure resolution of the values a run was given. It holds no
|
|
16001
|
+
* runtime.
|
|
16002
|
+
*/
|
|
16003
|
+
/** What a variable's value is. `select` takes one of `options`. */
|
|
16004
|
+
var ActionVariableTypeSchema = _enum([
|
|
16005
|
+
"string",
|
|
16006
|
+
"number",
|
|
16007
|
+
"boolean",
|
|
16008
|
+
"select"
|
|
16009
|
+
]);
|
|
16010
|
+
var ACTION_VARIABLE_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
16011
|
+
var ActionVariableValueSchema = union([
|
|
16012
|
+
string(),
|
|
16013
|
+
number(),
|
|
16014
|
+
boolean()
|
|
16015
|
+
]);
|
|
16016
|
+
/**
|
|
16017
|
+
* One declared variable. Steps reference it as `{ $var: 'name' }` (the whole
|
|
16018
|
+
* value) or `{{vars.name}}` (inside a string) in their args.
|
|
16019
|
+
*/
|
|
16020
|
+
var ActionVariableSchema = object({
|
|
16021
|
+
name: string().regex(ACTION_VARIABLE_NAME_RE),
|
|
16022
|
+
label: string().min(1).max(120).optional(),
|
|
16023
|
+
type: ActionVariableTypeSchema,
|
|
16024
|
+
required: boolean().optional(),
|
|
16025
|
+
default: ActionVariableValueSchema.optional(),
|
|
16026
|
+
/** The allowed values of a `select`. */
|
|
16027
|
+
options: array(string().min(1)).min(1).optional()
|
|
16028
|
+
}).superRefine((v, ctx) => {
|
|
16029
|
+
if (v.type === "select" && v.options === void 0) ctx.addIssue({
|
|
16030
|
+
code: "custom",
|
|
16031
|
+
message: "a select variable needs options",
|
|
16032
|
+
path: ["options"]
|
|
16033
|
+
});
|
|
16034
|
+
if (v.default !== void 0 && variableValueError(v, v.default) !== null) ctx.addIssue({
|
|
16035
|
+
code: "custom",
|
|
16036
|
+
message: variableValueError(v, v.default) ?? "invalid default",
|
|
16037
|
+
path: ["default"]
|
|
16038
|
+
});
|
|
16039
|
+
});
|
|
16040
|
+
/** Why `value` is not a legal value for the variable, or null when it is. */
|
|
16041
|
+
function variableValueError(variable, value) {
|
|
16042
|
+
switch (variable.type) {
|
|
16043
|
+
case "string": return typeof value === "string" ? null : `variable "${variable.name}" must be a string`;
|
|
16044
|
+
case "number": return typeof value === "number" && Number.isFinite(value) ? null : `variable "${variable.name}" must be a number`;
|
|
16045
|
+
case "boolean": return typeof value === "boolean" ? null : `variable "${variable.name}" must be true or false`;
|
|
16046
|
+
case "select": return typeof value === "string" && (variable.options ?? []).includes(value) ? null : `variable "${variable.name}" must be one of ${(variable.options ?? []).join(", ")}`;
|
|
16047
|
+
}
|
|
16048
|
+
}
|
|
16049
|
+
var ActionSourceKindSchema = _enum(["internal", "addon"]);
|
|
16050
|
+
function isInternalActionId(actionId) {
|
|
16051
|
+
return actionId.startsWith("internal:") && actionId.length > 9;
|
|
16052
|
+
}
|
|
16053
|
+
/** The addon behind a `<addonId>:<localId>` id, or null for anything else (internal included). */
|
|
16054
|
+
function addonIdOfActionId(actionId) {
|
|
16055
|
+
if (isInternalActionId(actionId)) return null;
|
|
16056
|
+
const at = actionId.indexOf(":");
|
|
16057
|
+
return at > 0 && at < actionId.length - 1 ? actionId.slice(0, at) : null;
|
|
16058
|
+
}
|
|
16059
|
+
var ActionStatusSchema = object({
|
|
16060
|
+
isRunning: boolean(),
|
|
16061
|
+
/** Ms epoch the latest run STARTED; null when it never ran. */
|
|
16062
|
+
lastRunAt: number().nullable(),
|
|
16063
|
+
/** The latest run's failure; null on success or when it never ran. */
|
|
16064
|
+
lastError: string().nullable()
|
|
16065
|
+
});
|
|
16066
|
+
var ActionEntrySchema = object({
|
|
16067
|
+
/** `internal:<uuid>` or `<addonId>:<localId>`. */
|
|
16068
|
+
id: string().min(3),
|
|
16069
|
+
name: string().min(1).max(120),
|
|
16070
|
+
/** The addon that declared it; `core-blocks` for an internal one. */
|
|
16071
|
+
addonId: string().min(1),
|
|
16072
|
+
source: ActionSourceKindSchema,
|
|
16073
|
+
/** An addon-declared entry is edited where it was declared. */
|
|
16074
|
+
readOnly: boolean(),
|
|
16075
|
+
/** Internal only: cap and wait steps. No action-in-action, so no cycles. */
|
|
16076
|
+
steps: array(ActionStepSchema).min(1).max(50).optional(),
|
|
16077
|
+
variables: array(ActionVariableSchema).max(20).optional(),
|
|
16078
|
+
status: ActionStatusSchema
|
|
16079
|
+
}).superRefine((entry, ctx) => {
|
|
16080
|
+
if (entry.source === "internal") {
|
|
16081
|
+
if (!isInternalActionId(entry.id)) ctx.addIssue({
|
|
16082
|
+
code: "custom",
|
|
16083
|
+
message: "an internal action id is internal:<uuid>",
|
|
16084
|
+
path: ["id"]
|
|
16085
|
+
});
|
|
16086
|
+
return;
|
|
16087
|
+
}
|
|
16088
|
+
if (entry.steps !== void 0) ctx.addIssue({
|
|
16089
|
+
code: "custom",
|
|
16090
|
+
message: "only an internal action carries steps",
|
|
16091
|
+
path: ["steps"]
|
|
16092
|
+
});
|
|
16093
|
+
if (!entry.readOnly) ctx.addIssue({
|
|
16094
|
+
code: "custom",
|
|
16095
|
+
message: "an addon action is read-only here",
|
|
16096
|
+
path: ["readOnly"]
|
|
16097
|
+
});
|
|
16098
|
+
if (addonIdOfActionId(entry.id) === null) ctx.addIssue({
|
|
16099
|
+
code: "custom",
|
|
16100
|
+
message: "an addon action id is <addonId>:<localId>",
|
|
16101
|
+
path: ["id"]
|
|
16102
|
+
});
|
|
16103
|
+
});
|
|
16104
|
+
/** What an operator writes for an internal action. */
|
|
16105
|
+
var ActionInputSchema = object({
|
|
16106
|
+
name: string().min(1).max(120),
|
|
16107
|
+
steps: array(ActionStepSchema).min(1).max(50),
|
|
16108
|
+
variables: array(ActionVariableSchema).max(20).optional()
|
|
16109
|
+
});
|
|
16110
|
+
/** Who started a run. Absent = the operator pressed it. */
|
|
16111
|
+
var ActionRunOriginSchema = object({
|
|
16112
|
+
/** The automation block whose step started it. */
|
|
16113
|
+
blockId: string().min(1).optional() });
|
|
16114
|
+
/** `started` = the caller did not ask to wait. */
|
|
16115
|
+
var ActionRunOutcomeSchema = union([AutomationRunOutcomeSchema, literal("started")]);
|
|
16116
|
+
var ActionRunResultSchema = object({
|
|
16117
|
+
runId: string().min(1),
|
|
16118
|
+
outcome: ActionRunOutcomeSchema,
|
|
16119
|
+
/** Why it did not run, or what failed. */
|
|
16120
|
+
message: string().optional()
|
|
16121
|
+
});
|
|
16122
|
+
_enum([
|
|
16123
|
+
"not-found",
|
|
16124
|
+
"read-only",
|
|
16125
|
+
"invalid-variables",
|
|
16126
|
+
"invalid-steps",
|
|
16127
|
+
"not-linked",
|
|
16128
|
+
"busy"
|
|
16129
|
+
]);
|
|
16130
|
+
object({
|
|
16131
|
+
actionId: string(),
|
|
16132
|
+
runId: string(),
|
|
16133
|
+
isRunning: boolean(),
|
|
16134
|
+
/** Set when the run ended. */
|
|
16135
|
+
outcome: AutomationRunOutcomeSchema.optional(),
|
|
16136
|
+
lastRunAt: number().nullable(),
|
|
16137
|
+
lastError: string().nullable()
|
|
15548
16138
|
});
|
|
15549
16139
|
/**
|
|
15550
16140
|
* `addon-pages` — system-scoped singleton aggregator cap. Public-facing
|
|
@@ -17158,7 +17748,22 @@ var BrokerProviderInfoSchema = object({
|
|
|
17158
17748
|
*/
|
|
17159
17749
|
interactiveConnectPath: string().min(1).optional(),
|
|
17160
17750
|
/** Relative hub path to disconnect the linked account (same popup pattern). */
|
|
17161
|
-
interactiveDisconnectPath: string().min(1).optional()
|
|
17751
|
+
interactiveDisconnectPath: string().min(1).optional(),
|
|
17752
|
+
/**
|
|
17753
|
+
* The kind signs in through a server-held interactive session instead of
|
|
17754
|
+
* (or before) typed credentials. `basePath` is a hub-relative route set
|
|
17755
|
+
* served by the owning addon (`/addon/<id>/...`) speaking the sign-in
|
|
17756
|
+
* contract: `POST {basePath}/start` (body: the form's settings) answers
|
|
17757
|
+
* `{ sessionId, loginUrl }`; `GET {basePath}/status?sessionId=` answers
|
|
17758
|
+
* `{ phase: 'starting' | 'awaiting-login' | 'captured' | 'error' |
|
|
17759
|
+
* 'cancelled', loginUrl, error }`; `POST {basePath}/commit`
|
|
17760
|
+
* (`{ sessionId, name, brokerId? }`) stores the credentials on a new or
|
|
17761
|
+
* existing broker and answers `{ brokerId }`; `POST {basePath}/cancel`
|
|
17762
|
+
* (`{ sessionId }`) drops the session. The dialog that edits a broker
|
|
17763
|
+
* offers it as the default path; the fields the session fills are
|
|
17764
|
+
* marked `filledBySignIn` in the kind's settings schema.
|
|
17765
|
+
*/
|
|
17766
|
+
signIn: object({ basePath: string().min(1) }).optional()
|
|
17162
17767
|
}))
|
|
17163
17768
|
});
|
|
17164
17769
|
var ListInputSchema = object({
|
|
@@ -18129,7 +18734,7 @@ var CompositionEventPlanSchema = object({
|
|
|
18129
18734
|
stateField: string(),
|
|
18130
18735
|
fieldKey: string()
|
|
18131
18736
|
});
|
|
18132
|
-
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.
|
|
18737
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
|
|
18133
18738
|
var CompositionProblemSchema = object({
|
|
18134
18739
|
code: _enum([
|
|
18135
18740
|
"reserved-variant",
|
|
@@ -18157,7 +18762,8 @@ var CompositionProblemSchema = object({
|
|
|
18157
18762
|
"native-capability-replace",
|
|
18158
18763
|
"mixed-quantity",
|
|
18159
18764
|
"helper-mismatch",
|
|
18160
|
-
"member-constraint"
|
|
18765
|
+
"member-constraint",
|
|
18766
|
+
"retention"
|
|
18161
18767
|
]),
|
|
18162
18768
|
path: string(),
|
|
18163
18769
|
message: string()
|
|
@@ -18391,13 +18997,17 @@ Object.freeze({
|
|
|
18391
18997
|
latchedAt: {
|
|
18392
18998
|
kind: "fixed",
|
|
18393
18999
|
result: ["number", "null"]
|
|
19000
|
+
},
|
|
19001
|
+
schmitt: {
|
|
19002
|
+
kind: "fixed",
|
|
19003
|
+
result: ["boolean", "null"]
|
|
18394
19004
|
}
|
|
18395
19005
|
});
|
|
18396
19006
|
/**
|
|
18397
19007
|
* One catalog row per base reading a group helper can build (D944 §3).
|
|
18398
19008
|
* Data, not a form default written into the block.
|
|
18399
19009
|
*/
|
|
18400
|
-
var NOW = {
|
|
19010
|
+
var NOW$2 = {
|
|
18401
19011
|
fieldPath: "lastFetchedAt",
|
|
18402
19012
|
expr: "now"
|
|
18403
19013
|
};
|
|
@@ -18411,6 +19021,8 @@ function numeric(input) {
|
|
|
18411
19021
|
family: "numeric",
|
|
18412
19022
|
deviceType: DeviceType.Sensor,
|
|
18413
19023
|
memberDeviceType: DeviceType.Sensor,
|
|
19024
|
+
memberDeviceTypes: [DeviceType.Sensor],
|
|
19025
|
+
activeWhen: void 0,
|
|
18414
19026
|
commandCaps: [],
|
|
18415
19027
|
baseUnit: baseUnitOf(input.quantity),
|
|
18416
19028
|
aggregates: NUMERIC_AGGREGATES,
|
|
@@ -18426,6 +19038,8 @@ function binary(input) {
|
|
|
18426
19038
|
family: "binary",
|
|
18427
19039
|
deviceType: DeviceType.Sensor,
|
|
18428
19040
|
memberDeviceType: DeviceType.Sensor,
|
|
19041
|
+
memberDeviceTypes: [DeviceType.Sensor],
|
|
19042
|
+
activeWhen: void 0,
|
|
18429
19043
|
commandCaps: [],
|
|
18430
19044
|
quantity: "none",
|
|
18431
19045
|
baseUnit: void 0,
|
|
@@ -18439,73 +19053,73 @@ var GROUP_TEMPLATES = [
|
|
|
18439
19053
|
summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
|
|
18440
19054
|
role: DeviceRole.TemperatureSensor,
|
|
18441
19055
|
outputCap: "temperature-sensor",
|
|
18442
|
-
outputField: "
|
|
19056
|
+
outputField: "temperature",
|
|
18443
19057
|
quantity: "temperature",
|
|
18444
19058
|
defaultAggregate: "mean",
|
|
18445
19059
|
empty: "null",
|
|
18446
|
-
companions: [NOW]
|
|
19060
|
+
companions: [NOW$2]
|
|
18447
19061
|
}),
|
|
18448
19062
|
numeric({
|
|
18449
19063
|
id: "humidity",
|
|
18450
19064
|
summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
18451
19065
|
role: DeviceRole.HumiditySensor,
|
|
18452
19066
|
outputCap: "humidity-sensor",
|
|
18453
|
-
outputField: "
|
|
19067
|
+
outputField: "humidity",
|
|
18454
19068
|
quantity: "humidity",
|
|
18455
19069
|
defaultAggregate: "mean",
|
|
18456
19070
|
empty: "null",
|
|
18457
|
-
companions: [NOW]
|
|
19071
|
+
companions: [NOW$2]
|
|
18458
19072
|
}),
|
|
18459
19073
|
numeric({
|
|
18460
19074
|
id: "pressure",
|
|
18461
19075
|
summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
|
|
18462
19076
|
role: DeviceRole.PressureSensor,
|
|
18463
19077
|
outputCap: "pressure-sensor",
|
|
18464
|
-
outputField: "
|
|
19078
|
+
outputField: "pressure",
|
|
18465
19079
|
quantity: "pressure",
|
|
18466
19080
|
defaultAggregate: "mean",
|
|
18467
19081
|
empty: "null",
|
|
18468
|
-
companions: [NOW]
|
|
19082
|
+
companions: [NOW$2]
|
|
18469
19083
|
}),
|
|
18470
19084
|
numeric({
|
|
18471
19085
|
id: "illuminance",
|
|
18472
19086
|
summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
|
|
18473
19087
|
role: DeviceRole.AmbientLightSensor,
|
|
18474
19088
|
outputCap: "ambient-light-sensor",
|
|
18475
|
-
outputField: "
|
|
19089
|
+
outputField: "illuminance",
|
|
18476
19090
|
quantity: "illuminance",
|
|
18477
19091
|
defaultAggregate: "mean",
|
|
18478
19092
|
empty: "null",
|
|
18479
|
-
companions: [NOW]
|
|
19093
|
+
companions: [NOW$2]
|
|
18480
19094
|
}),
|
|
18481
19095
|
numeric({
|
|
18482
19096
|
id: "power",
|
|
18483
19097
|
summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
|
|
18484
19098
|
role: DeviceRole.PowerSensor,
|
|
18485
19099
|
outputCap: "power-meter",
|
|
18486
|
-
outputField: "
|
|
19100
|
+
outputField: "power",
|
|
18487
19101
|
quantity: "power",
|
|
18488
19102
|
defaultAggregate: "sum",
|
|
18489
19103
|
empty: "omit",
|
|
18490
|
-
companions: [NOW]
|
|
19104
|
+
companions: [NOW$2]
|
|
18491
19105
|
}),
|
|
18492
19106
|
numeric({
|
|
18493
19107
|
id: "energy",
|
|
18494
19108
|
summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
|
|
18495
19109
|
role: DeviceRole.EnergySensor,
|
|
18496
19110
|
outputCap: "power-meter",
|
|
18497
|
-
outputField: "
|
|
19111
|
+
outputField: "energy",
|
|
18498
19112
|
quantity: "energy",
|
|
18499
19113
|
defaultAggregate: "sum",
|
|
18500
19114
|
empty: "omit",
|
|
18501
|
-
companions: [NOW]
|
|
19115
|
+
companions: [NOW$2]
|
|
18502
19116
|
}),
|
|
18503
19117
|
numeric({
|
|
18504
19118
|
id: "battery",
|
|
18505
19119
|
summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
18506
19120
|
role: DeviceRole.BatterySensor,
|
|
18507
19121
|
outputCap: "battery",
|
|
18508
|
-
outputField: "
|
|
19122
|
+
outputField: "level",
|
|
18509
19123
|
quantity: "percentage",
|
|
18510
19124
|
defaultAggregate: "mean",
|
|
18511
19125
|
empty: "null",
|
|
@@ -18533,7 +19147,7 @@ var GROUP_TEMPLATES = [
|
|
|
18533
19147
|
quantity: "device",
|
|
18534
19148
|
defaultAggregate: "mean",
|
|
18535
19149
|
empty: "null",
|
|
18536
|
-
companions: [NOW]
|
|
19150
|
+
companions: [NOW$2]
|
|
18537
19151
|
}),
|
|
18538
19152
|
binary({
|
|
18539
19153
|
id: "motion",
|
|
@@ -18627,6 +19241,11 @@ var GROUP_TEMPLATES = [
|
|
|
18627
19241
|
summary: "On when at least one switch is on, or when all of them are. Offline and unknown members are left out of that decision, never read as off, and still receive the command.",
|
|
18628
19242
|
deviceType: DeviceType.Switch,
|
|
18629
19243
|
outputCap: "switch",
|
|
19244
|
+
outputField: "on",
|
|
19245
|
+
member: {
|
|
19246
|
+
cap: "switch",
|
|
19247
|
+
fieldPath: "on"
|
|
19248
|
+
},
|
|
18630
19249
|
commandCaps: ["switch"]
|
|
18631
19250
|
}),
|
|
18632
19251
|
actuator({
|
|
@@ -18634,34 +19253,136 @@ var GROUP_TEMPLATES = [
|
|
|
18634
19253
|
summary: "On when at least one light is on, or when all of them are. Brightness and colour are offered only when every member has them. A command is not sent to a member that lacks it.",
|
|
18635
19254
|
deviceType: DeviceType.Light,
|
|
18636
19255
|
outputCap: "switch",
|
|
19256
|
+
outputField: "on",
|
|
19257
|
+
member: {
|
|
19258
|
+
cap: "switch",
|
|
19259
|
+
fieldPath: "on"
|
|
19260
|
+
},
|
|
18637
19261
|
commandCaps: [
|
|
18638
19262
|
"switch",
|
|
18639
19263
|
"brightness",
|
|
18640
19264
|
"color"
|
|
18641
19265
|
]
|
|
19266
|
+
}),
|
|
19267
|
+
actuator({
|
|
19268
|
+
id: "fan",
|
|
19269
|
+
summary: "On when at least one fan is on, or when all of them are. Speed, preset, direction and oscillation are offered only when every fan has them. A command is not sent to a fan that lacks it.",
|
|
19270
|
+
deviceType: DeviceType.Fan,
|
|
19271
|
+
outputCap: "switch",
|
|
19272
|
+
outputField: "on",
|
|
19273
|
+
member: {
|
|
19274
|
+
cap: "switch",
|
|
19275
|
+
fieldPath: "on"
|
|
19276
|
+
},
|
|
19277
|
+
commandCaps: ["switch", "fan-control"]
|
|
19278
|
+
}),
|
|
19279
|
+
actuator({
|
|
19280
|
+
id: "cover",
|
|
19281
|
+
summary: "Open when at least one cover is open or part-open, or only when all of them are. Position and tilt are offered only when every cover has them. A cover that reports nothing is left out, never read as closed.",
|
|
19282
|
+
deviceType: DeviceType.Cover,
|
|
19283
|
+
outputCap: "group-active",
|
|
19284
|
+
outputField: "active",
|
|
19285
|
+
member: {
|
|
19286
|
+
cap: "cover",
|
|
19287
|
+
fieldPath: "state"
|
|
19288
|
+
},
|
|
19289
|
+
activeWhen: [
|
|
19290
|
+
"open",
|
|
19291
|
+
"opening",
|
|
19292
|
+
"stopped"
|
|
19293
|
+
],
|
|
19294
|
+
commandCaps: ["cover"]
|
|
19295
|
+
}),
|
|
19296
|
+
actuator({
|
|
19297
|
+
id: "valve",
|
|
19298
|
+
summary: "Open when at least one valve is open or part-open, or only when all of them are. Position is offered only when every valve has it. A valve that reports nothing is left out, never read as closed.",
|
|
19299
|
+
deviceType: DeviceType.Valve,
|
|
19300
|
+
outputCap: "group-active",
|
|
19301
|
+
outputField: "active",
|
|
19302
|
+
member: {
|
|
19303
|
+
cap: "valve",
|
|
19304
|
+
fieldPath: "state"
|
|
19305
|
+
},
|
|
19306
|
+
activeWhen: [
|
|
19307
|
+
"open",
|
|
19308
|
+
"opening",
|
|
19309
|
+
"stopped"
|
|
19310
|
+
],
|
|
19311
|
+
commandCaps: ["valve"]
|
|
19312
|
+
}),
|
|
19313
|
+
actuator({
|
|
19314
|
+
id: "lock",
|
|
19315
|
+
summary: "Locked when at least one lock is locked, or only when all of them are. A jammed or moving lock is not locked. Locking is one tap; unlocking the group needs a confirmation every time, and nothing is sent without it.",
|
|
19316
|
+
deviceType: DeviceType.Lock,
|
|
19317
|
+
outputCap: "group-active",
|
|
19318
|
+
outputField: "active",
|
|
19319
|
+
member: {
|
|
19320
|
+
cap: "lock-control",
|
|
19321
|
+
fieldPath: "state"
|
|
19322
|
+
},
|
|
19323
|
+
activeWhen: ["locked"],
|
|
19324
|
+
commandCaps: ["lock-control"]
|
|
19325
|
+
}),
|
|
19326
|
+
actuator({
|
|
19327
|
+
id: "media-player",
|
|
19328
|
+
summary: "Playing when at least one player is playing, or only when all of them are. Volume is offered only when every player has it. A player that reports nothing is left out, never read as stopped.",
|
|
19329
|
+
deviceType: DeviceType.MediaPlayer,
|
|
19330
|
+
outputCap: "group-active",
|
|
19331
|
+
outputField: "active",
|
|
19332
|
+
member: {
|
|
19333
|
+
cap: "media-player",
|
|
19334
|
+
fieldPath: "state"
|
|
19335
|
+
},
|
|
19336
|
+
activeWhen: ["playing", "buffering"],
|
|
19337
|
+
commandCaps: ["media-player"]
|
|
19338
|
+
}),
|
|
19339
|
+
actuator({
|
|
19340
|
+
id: "climate",
|
|
19341
|
+
summary: "Running when at least one thermostat or air conditioner is not off, or only when all of them are. Target temperature and fan are offered only when every device has them. A device that reports nothing is left out, never read as off.",
|
|
19342
|
+
deviceType: DeviceType.Thermostat,
|
|
19343
|
+
memberDeviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
|
|
19344
|
+
outputCap: "group-active",
|
|
19345
|
+
outputField: "active",
|
|
19346
|
+
member: {
|
|
19347
|
+
cap: "climate-control",
|
|
19348
|
+
fieldPath: "mode"
|
|
19349
|
+
},
|
|
19350
|
+
activeWhen: [
|
|
19351
|
+
"heat",
|
|
19352
|
+
"cool",
|
|
19353
|
+
"auto",
|
|
19354
|
+
"heat_cool",
|
|
19355
|
+
"fan_only",
|
|
19356
|
+
"dry"
|
|
19357
|
+
],
|
|
19358
|
+
commandCaps: ["climate-control"]
|
|
18642
19359
|
})
|
|
18643
19360
|
];
|
|
18644
19361
|
function actuator(input) {
|
|
18645
19362
|
return {
|
|
18646
|
-
|
|
19363
|
+
id: input.id,
|
|
19364
|
+
summary: input.summary,
|
|
19365
|
+
deviceType: input.deviceType,
|
|
19366
|
+
outputCap: input.outputCap,
|
|
19367
|
+
outputField: input.outputField,
|
|
19368
|
+
commandCaps: input.commandCaps,
|
|
18647
19369
|
family: "actuator",
|
|
18648
19370
|
role: void 0,
|
|
18649
19371
|
memberDeviceType: input.deviceType,
|
|
18650
|
-
|
|
19372
|
+
memberDeviceTypes: input.memberDeviceTypes ?? [input.deviceType],
|
|
19373
|
+
activeWhen: input.activeWhen,
|
|
18651
19374
|
quantity: "none",
|
|
18652
19375
|
baseUnit: void 0,
|
|
18653
19376
|
aggregates: BINARY_AGGREGATES,
|
|
18654
19377
|
defaultAggregate: "any",
|
|
18655
19378
|
empty: "offline",
|
|
18656
|
-
accept: [
|
|
18657
|
-
cap: "switch",
|
|
18658
|
-
fieldPath: "on"
|
|
18659
|
-
}],
|
|
19379
|
+
accept: [input.member],
|
|
18660
19380
|
companions: [CHANGED]
|
|
18661
19381
|
};
|
|
18662
19382
|
}
|
|
18663
19383
|
new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
|
|
18664
19384
|
DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
|
|
19385
|
+
DeviceType.Camera;
|
|
18665
19386
|
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
18666
19387
|
/**
|
|
18667
19388
|
* What a composition may BUILD on a device type (G2, D676): the caps a new
|
|
@@ -18976,7 +19697,18 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
18976
19697
|
kind: "mutation",
|
|
18977
19698
|
auth: "admin",
|
|
18978
19699
|
access: "view"
|
|
18979
|
-
})
|
|
19700
|
+
}), method(object({
|
|
19701
|
+
blockId: string().min(1),
|
|
19702
|
+
trace: AutomationRunTraceSchema.optional(),
|
|
19703
|
+
runStartedAt: number().optional(),
|
|
19704
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
19705
|
+
}), _void(), {
|
|
19706
|
+
kind: "mutation",
|
|
19707
|
+
auth: "admin"
|
|
19708
|
+
}), method(object({ blockId: string().min(1) }), AutomationStateDocSchema, { auth: "admin" }), method(object({ blockId: string().min(1) }), object({
|
|
19709
|
+
traces: array(AutomationRunTraceSchema),
|
|
19710
|
+
lastError: string().nullable()
|
|
19711
|
+
}), { auth: "admin" });
|
|
18980
19712
|
/**
|
|
18981
19713
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
18982
19714
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -43701,7 +44433,7 @@ var NetworkAccessStatusSchema = object({
|
|
|
43701
44433
|
});
|
|
43702
44434
|
/**
|
|
43703
44435
|
* Optional, richer endpoint shape returned by providers that expose
|
|
43704
|
-
* MORE than one ingress concurrently (Tailscale
|
|
44436
|
+
* MORE than one ingress concurrently (Tailscale Funnel with mixed
|
|
43705
44437
|
* serve+funnel rules, future ngrok multi-tunnel, …). Each entry carries
|
|
43706
44438
|
* the originating provider config (mode + sourcePort) so the
|
|
43707
44439
|
* orchestrator UI can label rows distinctly. Providers that expose only
|
|
@@ -44094,51 +44826,6 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
|
|
|
44094
44826
|
kind: "mutation",
|
|
44095
44827
|
auth: "admin"
|
|
44096
44828
|
});
|
|
44097
|
-
new Set([
|
|
44098
|
-
{
|
|
44099
|
-
id: "person",
|
|
44100
|
-
name: "Person"
|
|
44101
|
-
},
|
|
44102
|
-
{
|
|
44103
|
-
id: "vehicle",
|
|
44104
|
-
name: "Vehicle"
|
|
44105
|
-
},
|
|
44106
|
-
{
|
|
44107
|
-
id: "animal",
|
|
44108
|
-
name: "Animal"
|
|
44109
|
-
},
|
|
44110
|
-
{
|
|
44111
|
-
id: "package",
|
|
44112
|
-
name: "Package"
|
|
44113
|
-
}
|
|
44114
|
-
].map((l) => l.id));
|
|
44115
|
-
var COCO_TO_MACRO = {
|
|
44116
|
-
mapping: {
|
|
44117
|
-
person: "person",
|
|
44118
|
-
bicycle: "vehicle",
|
|
44119
|
-
car: "vehicle",
|
|
44120
|
-
motorcycle: "vehicle",
|
|
44121
|
-
airplane: "vehicle",
|
|
44122
|
-
bus: "vehicle",
|
|
44123
|
-
train: "vehicle",
|
|
44124
|
-
truck: "vehicle",
|
|
44125
|
-
boat: "vehicle",
|
|
44126
|
-
bird: "animal",
|
|
44127
|
-
cat: "animal",
|
|
44128
|
-
dog: "animal",
|
|
44129
|
-
horse: "animal",
|
|
44130
|
-
sheep: "animal",
|
|
44131
|
-
cow: "animal",
|
|
44132
|
-
elephant: "animal",
|
|
44133
|
-
bear: "animal",
|
|
44134
|
-
zebra: "animal",
|
|
44135
|
-
giraffe: "animal",
|
|
44136
|
-
suitcase: "package",
|
|
44137
|
-
backpack: "package",
|
|
44138
|
-
handbag: "package"
|
|
44139
|
-
},
|
|
44140
|
-
preserveOriginal: false
|
|
44141
|
-
};
|
|
44142
44829
|
var AUDIO_MACRO_LABELS = [
|
|
44143
44830
|
{
|
|
44144
44831
|
id: "speech",
|
|
@@ -46344,7 +47031,20 @@ var NcRuleInputSchema = object({
|
|
|
46344
47031
|
* save by the hub's grouping guard). `.optional()`, never `.default()`: the addon cap
|
|
46345
47032
|
* path does not run Zod defaults.
|
|
46346
47033
|
*/
|
|
46347
|
-
groupingSec: number().int().min(5).max(60).optional()
|
|
47034
|
+
groupingSec: number().int().min(5).max(60).optional(),
|
|
47035
|
+
/**
|
|
47036
|
+
* ASK ME TO CONFIRM DETECTIONS (#243): a DETECTION notification of this rule
|
|
47037
|
+
* carries "Correct" / "Wrong" buttons (and, where the channel has room, a
|
|
47038
|
+
* "Wrong, it is a <class>" choice). A tap marks the track for retraining, the
|
|
47039
|
+
* same mark the Library writes, and records whose notification it was and
|
|
47040
|
+
* when. A channel with no buttons gets the same two choices as links.
|
|
47041
|
+
*
|
|
47042
|
+
* `.optional()`, never `.default()` (a Zod default does not run on the addon
|
|
47043
|
+
* cap path): absent and `false` both mean off, which is what every rule
|
|
47044
|
+
* authored before this field meant. An editor turns it off by writing
|
|
47045
|
+
* `false`, so it needs no `clear` key.
|
|
47046
|
+
*/
|
|
47047
|
+
askVerdict: boolean().optional()
|
|
46348
47048
|
});
|
|
46349
47049
|
/**
|
|
46350
47050
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -56578,9 +57278,9 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
|
|
|
56578
57278
|
}), LogStreamEntrySchema, { kind: "subscription" });
|
|
56579
57279
|
object({
|
|
56580
57280
|
/** Carbon dioxide concentration in ppm. */
|
|
56581
|
-
|
|
57281
|
+
co2: number().min(0).optional().meta(readingMeta("concentration-volume")),
|
|
56582
57282
|
/** Total volatile organic compounds in ppb. */
|
|
56583
|
-
|
|
57283
|
+
voc: number().min(0).optional().meta(readingMeta("concentration-ppb")),
|
|
56584
57284
|
/** Particulate matter ≤ 2.5 μm in µg/m³. */
|
|
56585
57285
|
pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
|
|
56586
57286
|
/** Particulate matter ≤ 10 μm in µg/m³. */
|
|
@@ -56593,7 +57293,7 @@ object({
|
|
|
56593
57293
|
DeviceType.Sensor;
|
|
56594
57294
|
object({
|
|
56595
57295
|
/** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
|
|
56596
|
-
|
|
57296
|
+
illuminance: number().min(0).nullable().meta(readingMeta("illuminance", {
|
|
56597
57297
|
precision: 0,
|
|
56598
57298
|
label: "Illuminance"
|
|
56599
57299
|
})),
|
|
@@ -56690,6 +57390,84 @@ DeviceType.Camera, method(object({ deviceId: number() }), AudioMetricsSnapshotSc
|
|
|
56690
57390
|
* would produce more than `maxPoints` samples. */
|
|
56691
57391
|
sampleEveryMs: number().int().positive().optional()
|
|
56692
57392
|
}), AudioMetricsHistorySchema);
|
|
57393
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
57394
|
+
actionId: string().min(1),
|
|
57395
|
+
variables: record(string(), ActionVariableValueSchema).optional()
|
|
57396
|
+
}), _void(), {
|
|
57397
|
+
kind: "mutation",
|
|
57398
|
+
auth: "admin"
|
|
57399
|
+
}), method(object({ actionId: string().min(1) }), _void(), {
|
|
57400
|
+
kind: "mutation",
|
|
57401
|
+
auth: "admin"
|
|
57402
|
+
});
|
|
57403
|
+
/**
|
|
57404
|
+
* actions — the ONE surface for runnable actions, for the UI and for
|
|
57405
|
+
* automations. Provided by the core-blocks builtin on the hub.
|
|
57406
|
+
*
|
|
57407
|
+
* An action is a LIST ENTRY, not a device (D883): either internal (cap and wait
|
|
57408
|
+
* steps, kept in the hub's `actions` record kind) or declared by an addon over
|
|
57409
|
+
* `action-source`. `list` asks every `action-source` provider LIVE and overlays
|
|
57410
|
+
* the run status from the hub's `runs` ledger; there is no catalog here to
|
|
57411
|
+
* drift (D3).
|
|
57412
|
+
*
|
|
57413
|
+
* **Permissions follow the camera, as linked devices do.** An action is linked
|
|
57414
|
+
* to cameras by the operator (`setLinks`, D356: nothing links itself). A
|
|
57415
|
+
* non-admin may `get` / `run` an action only through a camera they may see that
|
|
57416
|
+
* links it: they name the camera (`deviceId`, a top-level field so the scope
|
|
57417
|
+
* gate sees it) and the provider refuses an action that camera does not link.
|
|
57418
|
+
* An admin, and an in-process caller (an automation block), may run any action.
|
|
57419
|
+
* Every refusal is typed (`[not-linked] …`) and logged.
|
|
57420
|
+
*
|
|
57421
|
+
* A second `run` of an action that is already running is REFUSED — traced and
|
|
57422
|
+
* logged — never queued.
|
|
57423
|
+
*/
|
|
57424
|
+
var ActionIdInput = object({ actionId: string().min(1) });
|
|
57425
|
+
var ActionLinksSchema = object({
|
|
57426
|
+
deviceId: number().int().nonnegative(),
|
|
57427
|
+
actionIds: array(string().min(1)).max(100)
|
|
57428
|
+
});
|
|
57429
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
57430
|
+
actionId: string().min(1),
|
|
57431
|
+
deviceId: number().int().nonnegative().optional()
|
|
57432
|
+
}), object({ action: ActionEntrySchema.nullable() }), {
|
|
57433
|
+
role: "viewer",
|
|
57434
|
+
auth: "protected",
|
|
57435
|
+
kind: "query",
|
|
57436
|
+
caller: "required"
|
|
57437
|
+
}), method(object({
|
|
57438
|
+
actionId: string().min(1),
|
|
57439
|
+
variables: record(string(), ActionVariableValueSchema).optional(),
|
|
57440
|
+
wait: boolean().optional(),
|
|
57441
|
+
origin: ActionRunOriginSchema.optional(),
|
|
57442
|
+
deviceId: number().int().nonnegative().optional()
|
|
57443
|
+
}), ActionRunResultSchema, {
|
|
57444
|
+
role: "viewer",
|
|
57445
|
+
auth: "protected",
|
|
57446
|
+
kind: "mutation",
|
|
57447
|
+
caller: "required"
|
|
57448
|
+
}), method(ActionIdInput, _void(), {
|
|
57449
|
+
kind: "mutation",
|
|
57450
|
+
auth: "admin"
|
|
57451
|
+
}), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({ action: ActionEntrySchema }), {
|
|
57452
|
+
kind: "mutation",
|
|
57453
|
+
auth: "admin"
|
|
57454
|
+
}), method(object({
|
|
57455
|
+
actionId: string().min(1),
|
|
57456
|
+
action: ActionInputSchema.partial()
|
|
57457
|
+
}), object({ action: ActionEntrySchema }), {
|
|
57458
|
+
kind: "mutation",
|
|
57459
|
+
auth: "admin"
|
|
57460
|
+
}), method(ActionIdInput, _void(), {
|
|
57461
|
+
kind: "mutation",
|
|
57462
|
+
auth: "admin"
|
|
57463
|
+
}), method(object({ deviceId: number().int().nonnegative() }), array(ActionEntrySchema), {
|
|
57464
|
+
role: "viewer",
|
|
57465
|
+
auth: "protected",
|
|
57466
|
+
kind: "query"
|
|
57467
|
+
}), method(object({ deviceId: number().int().nonnegative() }), ActionLinksSchema, { auth: "admin" }), method(ActionLinksSchema, ActionLinksSchema, {
|
|
57468
|
+
kind: "mutation",
|
|
57469
|
+
auth: "admin"
|
|
57470
|
+
});
|
|
56693
57471
|
object({
|
|
56694
57472
|
/** Whether the automation is currently enabled. Disabled automations
|
|
56695
57473
|
* ignore their trigger block — manual `trigger` still works. */
|
|
@@ -56743,7 +57521,7 @@ var BatteryStatusSchema = object({
|
|
|
56743
57521
|
* Consumers must SKIP a null rather than coerce it — `battery-band` already
|
|
56744
57522
|
* declines to band a non-finite reading, which is the correct shape.
|
|
56745
57523
|
*/
|
|
56746
|
-
|
|
57524
|
+
level: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
|
|
56747
57525
|
/**
|
|
56748
57526
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
56749
57527
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
@@ -56753,7 +57531,7 @@ var BatteryStatusSchema = object({
|
|
|
56753
57531
|
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
56754
57532
|
* power fields yet, or the firmware reported neither. Before it existed,
|
|
56755
57533
|
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
56756
|
-
* was drawn "on battery alone" — the same D315 defect `
|
|
57534
|
+
* was drawn "on battery alone" — the same D315 defect `level` closed
|
|
56757
57535
|
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
56758
57536
|
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
56759
57537
|
*/
|
|
@@ -56777,7 +57555,7 @@ var BatteryStatusSchema = object({
|
|
|
56777
57555
|
* that only report charge. A second reading on this cap, not a second
|
|
56778
57556
|
* `numeric-sensor` on the same device.
|
|
56779
57557
|
*/
|
|
56780
|
-
|
|
57558
|
+
voltage: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
56781
57559
|
/**
|
|
56782
57560
|
* Ms epoch of the last time the device PROVED it was reachable — a
|
|
56783
57561
|
* completed firmware round-trip, an observed wake, or an inbound push
|
|
@@ -56811,13 +57589,13 @@ var BatteryStatusSchema = object({
|
|
|
56811
57589
|
/**
|
|
56812
57590
|
* True when the source is a BINARY low-battery indicator (HA
|
|
56813
57591
|
* `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
|
|
56814
|
-
* charge level — `
|
|
57592
|
+
* charge level — `level` is then a coarse stand-in (100 = normal,
|
|
56815
57593
|
* sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
|
|
56816
57594
|
* misleading exact percentage. Absent/false → genuine 0–100 % reading.
|
|
56817
57595
|
*/
|
|
56818
57596
|
binary: boolean().optional().meta({ label: "Binary indicator" })
|
|
56819
57597
|
});
|
|
56820
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat;
|
|
57598
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter;
|
|
56821
57599
|
method(object({
|
|
56822
57600
|
deviceId: number(),
|
|
56823
57601
|
/** Bound on the wait. Sensible range 3000–10000ms. */
|
|
@@ -56842,26 +57620,26 @@ DeviceType.Sensor;
|
|
|
56842
57620
|
* controls to this single-method surface.
|
|
56843
57621
|
*
|
|
56844
57622
|
* The cap is intentionally minimal: a single `setBrightness({deviceId,
|
|
56845
|
-
*
|
|
57623
|
+
* level})` mutation plus the auto-injected `getStatus`. Drivers
|
|
56846
57624
|
* that expose richer controls (color temperature, scenes, schedules)
|
|
56847
57625
|
* should surface those via the device's `getSettingsUISchema()`
|
|
56848
57626
|
* instead of bloating this cap.
|
|
56849
57627
|
*/
|
|
56850
57628
|
var BrightnessStatusSchema = object({
|
|
56851
57629
|
/** Current level as 0..100 inclusive. Firmware-reported. */
|
|
56852
|
-
|
|
57630
|
+
level: number().min(0).max(100).meta(readingMeta("percentage")),
|
|
56853
57631
|
/** Ms epoch of the last operator-driven change. Useful for UI freshness. */
|
|
56854
57632
|
lastChangedAt: number()
|
|
56855
57633
|
});
|
|
56856
57634
|
DeviceType.Light, method(object({
|
|
56857
57635
|
deviceId: number().int().nonnegative(),
|
|
56858
|
-
|
|
57636
|
+
level: number().min(0).max(100)
|
|
56859
57637
|
}), _void(), {
|
|
56860
57638
|
kind: "mutation",
|
|
56861
57639
|
auth: "protected"
|
|
56862
57640
|
}), object({
|
|
56863
57641
|
deviceId: number(),
|
|
56864
|
-
|
|
57642
|
+
level: number().min(0).max(100),
|
|
56865
57643
|
lastChangedAt: number()
|
|
56866
57644
|
});
|
|
56867
57645
|
DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
@@ -57362,11 +58140,11 @@ var ColorInputSchema = discriminatedUnion("mode", [
|
|
|
57362
58140
|
}),
|
|
57363
58141
|
object({
|
|
57364
58142
|
mode: literal("mired"),
|
|
57365
|
-
|
|
58143
|
+
colorTemperature: number().int().min(50).max(1e3)
|
|
57366
58144
|
})
|
|
57367
58145
|
]);
|
|
57368
58146
|
object({
|
|
57369
|
-
/** Active color mode — which of `rgb` / `hsv` / `
|
|
58147
|
+
/** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
|
|
57370
58148
|
* the bulb's current state. */
|
|
57371
58149
|
mode: _enum([
|
|
57372
58150
|
"rgb",
|
|
@@ -57378,7 +58156,7 @@ object({
|
|
|
57378
58156
|
/** Populated when `mode === 'hsv'`. */
|
|
57379
58157
|
hsv: HsvTripletSchema.optional(),
|
|
57380
58158
|
/** Populated when `mode === 'mired'`. */
|
|
57381
|
-
|
|
58159
|
+
colorTemperature: number().int().optional().meta(readingMeta("colour-temperature")),
|
|
57382
58160
|
/** Ms epoch of the last operator-driven change. */
|
|
57383
58161
|
lastChangedAt: number()
|
|
57384
58162
|
});
|
|
@@ -57397,7 +58175,7 @@ DeviceType.Light, method(object({
|
|
|
57397
58175
|
]),
|
|
57398
58176
|
rgb: RgbTripletSchema.optional(),
|
|
57399
58177
|
hsv: HsvTripletSchema.optional(),
|
|
57400
|
-
|
|
58178
|
+
colorTemperature: number().int().optional(),
|
|
57401
58179
|
lastChangedAt: number()
|
|
57402
58180
|
});
|
|
57403
58181
|
var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
|
|
@@ -57835,11 +58613,11 @@ object({
|
|
|
57835
58613
|
/** Feature keys of the programs the appliance currently offers — drives the UI selector. */
|
|
57836
58614
|
availablePrograms: array(string()),
|
|
57837
58615
|
/** Seconds remaining on the active cycle, or null when not running / not known. */
|
|
57838
|
-
|
|
58616
|
+
remaining: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
57839
58617
|
/** Seconds the delayed start is set to (time until the cycle starts), or null. */
|
|
57840
|
-
|
|
58618
|
+
delayedStart: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
57841
58619
|
/** Cycle completion 0..100, or null when not applicable. */
|
|
57842
|
-
|
|
58620
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
57843
58621
|
/** True when the door is reported open; null when the door state is not known. */
|
|
57844
58622
|
doorOpen: boolean().nullable(),
|
|
57845
58623
|
/** True when the door is latched (locked) during a cycle; null when not reported. */
|
|
@@ -58457,7 +59235,7 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
|
|
|
58457
59235
|
object({
|
|
58458
59236
|
/** Active speed as 0..100 inclusive. Null when the device has no
|
|
58459
59237
|
* speed surface (single-speed fan). */
|
|
58460
|
-
|
|
59238
|
+
speed: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
58461
59239
|
/** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
|
|
58462
59240
|
* a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
|
|
58463
59241
|
percentageStep: number().positive().optional().meta(readingMeta("percentage")),
|
|
@@ -58477,7 +59255,7 @@ object({
|
|
|
58477
59255
|
});
|
|
58478
59256
|
DeviceType.Fan, method(object({
|
|
58479
59257
|
deviceId: number().int().nonnegative(),
|
|
58480
|
-
|
|
59258
|
+
speed: number().min(0).max(100)
|
|
58481
59259
|
}), _void(), {
|
|
58482
59260
|
kind: "mutation",
|
|
58483
59261
|
auth: "protected"
|
|
@@ -58585,7 +59363,13 @@ results: array(object({
|
|
|
58585
59363
|
/** Ms epoch of the attempt. */
|
|
58586
59364
|
at: number()
|
|
58587
59365
|
})) });
|
|
58588
|
-
DeviceType.Switch, DeviceType.Light;
|
|
59366
|
+
DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Cover, DeviceType.Valve, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.Thermostat, DeviceType.Climate;
|
|
59367
|
+
object({
|
|
59368
|
+
active: boolean().meta({ label: "Active" }),
|
|
59369
|
+
/** Ms epoch when the slice was last updated. */
|
|
59370
|
+
lastChangedAt: number()
|
|
59371
|
+
});
|
|
59372
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.Climate, DeviceType.Thermostat;
|
|
58589
59373
|
object({
|
|
58590
59374
|
/** Members whose current value entered the aggregate. */
|
|
58591
59375
|
included: number().int().nonnegative().meta(readingMeta("count", {
|
|
@@ -58603,7 +59387,7 @@ object({
|
|
|
58603
59387
|
label: "Members"
|
|
58604
59388
|
}))
|
|
58605
59389
|
});
|
|
58606
|
-
DeviceType.Sensor, DeviceType.Switch, DeviceType.Light;
|
|
59390
|
+
DeviceType.Sensor, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Cover, DeviceType.Valve, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.Thermostat, DeviceType.Climate;
|
|
58607
59391
|
object({
|
|
58608
59392
|
/** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
|
|
58609
59393
|
position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
@@ -58662,7 +59446,7 @@ DeviceType.Humidifier, method(object({
|
|
|
58662
59446
|
*/
|
|
58663
59447
|
var HumiditySensorStatusSchema = object({
|
|
58664
59448
|
/** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
|
|
58665
|
-
|
|
59449
|
+
humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
|
|
58666
59450
|
precision: 0,
|
|
58667
59451
|
label: "Humidity"
|
|
58668
59452
|
})),
|
|
@@ -59105,7 +59889,7 @@ object({
|
|
|
59105
59889
|
batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
59106
59890
|
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
59107
59891
|
* task is active / progress is unavailable. */
|
|
59108
|
-
|
|
59892
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
59109
59893
|
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
59110
59894
|
* or null when unknown. */
|
|
59111
59895
|
currentCode: number().nullable().meta(readingMeta("none")),
|
|
@@ -59518,7 +60302,14 @@ DeviceType.Lock, method(object({
|
|
|
59518
60302
|
auth: "protected"
|
|
59519
60303
|
}), method(object({
|
|
59520
60304
|
deviceId: number().int().nonnegative(),
|
|
59521
|
-
code: string().min(1).optional()
|
|
60305
|
+
code: string().min(1).optional(),
|
|
60306
|
+
/**
|
|
60307
|
+
* Honoured by a helper lock GROUP only (D944): unlocking several doors
|
|
60308
|
+
* with one call is refused unless the caller says it was confirmed. A
|
|
60309
|
+
* single lock ignores it. The refusal lives in the callee, so no
|
|
60310
|
+
* automation or API caller reaches the doors by skipping a dialog.
|
|
60311
|
+
*/
|
|
60312
|
+
confirm: boolean().optional()
|
|
59522
60313
|
}), _void(), {
|
|
59523
60314
|
kind: "mutation",
|
|
59524
60315
|
auth: "protected"
|
|
@@ -59526,6 +60317,11 @@ DeviceType.Lock, method(object({
|
|
|
59526
60317
|
kind: "mutation",
|
|
59527
60318
|
auth: "protected"
|
|
59528
60319
|
});
|
|
60320
|
+
object({
|
|
60321
|
+
value: number().nullable().meta(readingMeta("device", { label: "Total" })),
|
|
60322
|
+
lastFetchedAt: number()
|
|
60323
|
+
});
|
|
60324
|
+
DeviceType.Sensor;
|
|
59529
60325
|
/**
|
|
59530
60326
|
* Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
|
|
59531
60327
|
* Apple TV, Spotify, Roku, generic OTT receivers, …) on
|
|
@@ -59583,10 +60379,10 @@ object({
|
|
|
59583
60379
|
currentMedia: MediaInfoSchema.nullable(),
|
|
59584
60380
|
/** Current playback position in ms. Null when not seekable or
|
|
59585
60381
|
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
59586
|
-
|
|
60382
|
+
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
59587
60383
|
/** Total duration of the current media in ms. Null when unknown
|
|
59588
60384
|
* (live stream) or nothing is playing. */
|
|
59589
|
-
|
|
60385
|
+
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
59590
60386
|
/** Shuffle toggle. Null when no shuffle surface.
|
|
59591
60387
|
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
59592
60388
|
shuffle: boolean().nullable(),
|
|
@@ -59613,7 +60409,7 @@ DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }
|
|
|
59613
60409
|
auth: "protected"
|
|
59614
60410
|
}), method(object({
|
|
59615
60411
|
deviceId: number().int().nonnegative(),
|
|
59616
|
-
|
|
60412
|
+
position: number().int().nonnegative()
|
|
59617
60413
|
}), _void(), {
|
|
59618
60414
|
kind: "mutation",
|
|
59619
60415
|
auth: "protected"
|
|
@@ -60286,9 +61082,9 @@ var NetworkLinkStatusSchema = object({
|
|
|
60286
61082
|
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
60287
61083
|
* SKIP a null rather than coerce it.
|
|
60288
61084
|
*/
|
|
60289
|
-
|
|
61085
|
+
signal: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
60290
61086
|
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
60291
|
-
|
|
61087
|
+
rssi: number().optional().meta(readingMeta("signal-level")),
|
|
60292
61088
|
/** Network name of a wireless link, when the firmware reports it. */
|
|
60293
61089
|
ssid: string().optional(),
|
|
60294
61090
|
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
@@ -60949,10 +61745,20 @@ var PetFeederDeviceStatusSchema = _enum([
|
|
|
60949
61745
|
]);
|
|
60950
61746
|
var gramsPortion = number().int().min(4).max(200);
|
|
60951
61747
|
object({
|
|
60952
|
-
/** Food
|
|
60953
|
-
*
|
|
60954
|
-
* bowl
|
|
61748
|
+
/** Food in the TANK (hopper), as the feeder's own sensor reports it
|
|
61749
|
+
* (`state.food`). A coarse level code, not grams — `0` is empty. The
|
|
61750
|
+
* amount in the bowl is `bowlFood`. On dual-hopper models this is the
|
|
61751
|
+
* combined reading; per-hopper levels live in `food1`/`food2`. Null when
|
|
61752
|
+
* the device has not reported yet. */
|
|
60955
61753
|
foodLevel: number().nullable().meta(readingMeta("none")),
|
|
61754
|
+
/** Food in the BOWL as the feeder reports it (`state.bowl`), in the
|
|
61755
|
+
* feeder's own units. Null when the model reports none. */
|
|
61756
|
+
bowlFood: number().nullable().meta(readingMeta("none")),
|
|
61757
|
+
/** True while the pet is eating (`state.eating`). */
|
|
61758
|
+
eating: boolean(),
|
|
61759
|
+
/** Whether `markFoodReplenished` does anything on this model. When false
|
|
61760
|
+
* the client must not offer it. */
|
|
61761
|
+
supportsMarkRefilled: boolean(),
|
|
60956
61762
|
/** Hopper-1 food level (grams) on dual-hopper feeders; null on
|
|
60957
61763
|
* single-hopper models. */
|
|
60958
61764
|
food1: number().nullable().meta(readingMeta("none")),
|
|
@@ -60960,8 +61766,8 @@ object({
|
|
|
60960
61766
|
* single-hopper models. */
|
|
60961
61767
|
food2: number().nullable().meta(readingMeta("none")),
|
|
60962
61768
|
/** Derived low-food flag — mirrors the HA `food_level` binary_sensor
|
|
60963
|
-
* (`device_class: problem`, on = low). True when the
|
|
60964
|
-
*
|
|
61769
|
+
* (`device_class: problem`, on = low). True when the tank reports empty,
|
|
61770
|
+
* or, on a dual-hopper model, when EITHER hopper is empty. */
|
|
60965
61771
|
lowFood: boolean(),
|
|
60966
61772
|
/** Battery charge 0..100 (%). Null on mains-powered models or when the
|
|
60967
61773
|
* device has no battery reading. */
|
|
@@ -61428,22 +62234,38 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
|
|
|
61428
62234
|
auth: "admin"
|
|
61429
62235
|
});
|
|
61430
62236
|
object({
|
|
61431
|
-
/** Instantaneous power draw
|
|
61432
|
-
|
|
62237
|
+
/** Instantaneous power draw (watts). */
|
|
62238
|
+
power: number().optional().meta(readingMeta("power", { label: "Power" })),
|
|
61433
62239
|
/** Cumulative energy in kilowatt-hours since the meter was reset. */
|
|
61434
|
-
|
|
61435
|
-
/** Voltage
|
|
61436
|
-
|
|
62240
|
+
energy: number().optional().meta(readingMeta("energy", { label: "Energy" })),
|
|
62241
|
+
/** Voltage (volts). */
|
|
62242
|
+
voltage: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
61437
62243
|
/** Current in amperes. */
|
|
61438
|
-
|
|
62244
|
+
current: number().optional().meta(readingMeta("current", { label: "Current" })),
|
|
61439
62245
|
/** Apparent power in volt-amperes. */
|
|
61440
|
-
|
|
62246
|
+
apparentPower: number().optional().meta(readingMeta("apparent-power")),
|
|
61441
62247
|
/** Power factor (0..1) if reported. */
|
|
61442
62248
|
powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
|
|
61443
62249
|
/** Ms epoch when the slice was last updated. */
|
|
61444
62250
|
lastFetchedAt: number()
|
|
61445
62251
|
});
|
|
61446
|
-
|
|
62252
|
+
[
|
|
62253
|
+
DeviceType.Sensor,
|
|
62254
|
+
DeviceType.Switch,
|
|
62255
|
+
DeviceType.Light,
|
|
62256
|
+
DeviceType.Fan,
|
|
62257
|
+
DeviceType.Climate,
|
|
62258
|
+
DeviceType.Thermostat,
|
|
62259
|
+
DeviceType.Humidifier,
|
|
62260
|
+
DeviceType.WaterHeater,
|
|
62261
|
+
DeviceType.MediaPlayer,
|
|
62262
|
+
DeviceType.Washer,
|
|
62263
|
+
DeviceType.Dryer,
|
|
62264
|
+
DeviceType.Dishwasher,
|
|
62265
|
+
DeviceType.Vacuum,
|
|
62266
|
+
DeviceType.LawnMower,
|
|
62267
|
+
DeviceType.PetFeeder
|
|
62268
|
+
].filter((type) => type !== DeviceType.Sensor);
|
|
61447
62269
|
/**
|
|
61448
62270
|
* Presence cap. Models HA `person.*` and `device_tracker.*` entities
|
|
61449
62271
|
* on `DeviceType.Presence`. Read-only — no setters: presence is
|
|
@@ -61476,16 +62298,13 @@ var PresenceStatusSchema = object({
|
|
|
61476
62298
|
location: string().nullable(),
|
|
61477
62299
|
/** GPS coordinates when available. Null otherwise. */
|
|
61478
62300
|
gps: GpsLocationSchema.nullable(),
|
|
61479
|
-
/** Optional battery level of the tracking device (0..100). Null
|
|
61480
|
-
* when not reported. */
|
|
61481
|
-
batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
61482
62301
|
/** Ms epoch when the slice was last updated. */
|
|
61483
62302
|
lastChangedAt: number()
|
|
61484
62303
|
});
|
|
61485
62304
|
DeviceType.Presence;
|
|
61486
62305
|
object({
|
|
61487
62306
|
/** Current pressure in hPa. `null` when the sample was refused (D393). */
|
|
61488
|
-
|
|
62307
|
+
pressure: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
|
|
61489
62308
|
/** Ms epoch when the slice was last updated. */
|
|
61490
62309
|
lastFetchedAt: number()
|
|
61491
62310
|
});
|
|
@@ -63936,7 +64755,7 @@ var SwitchStatusSchema = object({
|
|
|
63936
64755
|
/** Ms epoch of the last state change. Useful for UI "X minutes ago". */
|
|
63937
64756
|
lastChangedAt: number()
|
|
63938
64757
|
});
|
|
63939
|
-
DeviceType.Switch, DeviceType.Siren, DeviceType.Light, method(object({
|
|
64758
|
+
DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, method(object({
|
|
63940
64759
|
deviceId: number(),
|
|
63941
64760
|
on: boolean()
|
|
63942
64761
|
}), _void(), {
|
|
@@ -64507,7 +65326,7 @@ DeviceType.Sensor;
|
|
|
64507
65326
|
*/
|
|
64508
65327
|
var TemperatureSensorStatusSchema = object({
|
|
64509
65328
|
/** Current temperature in Celsius. `null` when the sample was refused (D393). */
|
|
64510
|
-
|
|
65329
|
+
temperature: number().nullable().meta(readingMeta("temperature", {
|
|
64511
65330
|
precision: 1,
|
|
64512
65331
|
label: "Temperature"
|
|
64513
65332
|
})),
|
|
@@ -64771,7 +65590,7 @@ object({
|
|
|
64771
65590
|
/** Speed tokens the hardware accepts — drives the UI selector. */
|
|
64772
65591
|
availableFanSpeeds: array(string()),
|
|
64773
65592
|
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
64774
|
-
|
|
65593
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
64775
65594
|
/** Current error code (0 / null = no error). */
|
|
64776
65595
|
errorCode: number().nullable().meta(readingMeta("none")),
|
|
64777
65596
|
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
@@ -65640,8 +66459,9 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
|
|
|
65640
66459
|
kind: "mutation",
|
|
65641
66460
|
auth: "admin"
|
|
65642
66461
|
});
|
|
66462
|
+
DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
|
|
65643
66463
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
65644
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
66464
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
65645
66465
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
65646
66466
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
65647
66467
|
new Set(CAP_NAMES);
|
|
@@ -65711,6 +66531,104 @@ Object.freeze({
|
|
|
65711
66531
|
access: "create",
|
|
65712
66532
|
role: "admin"
|
|
65713
66533
|
},
|
|
66534
|
+
"actions.create": {
|
|
66535
|
+
capName: "actions",
|
|
66536
|
+
capScope: "system",
|
|
66537
|
+
addonId: null,
|
|
66538
|
+
access: "create",
|
|
66539
|
+
role: "admin"
|
|
66540
|
+
},
|
|
66541
|
+
"actions.delete": {
|
|
66542
|
+
capName: "actions",
|
|
66543
|
+
capScope: "system",
|
|
66544
|
+
addonId: null,
|
|
66545
|
+
access: "delete",
|
|
66546
|
+
role: "admin"
|
|
66547
|
+
},
|
|
66548
|
+
"actions.get": {
|
|
66549
|
+
capName: "actions",
|
|
66550
|
+
capScope: "system",
|
|
66551
|
+
addonId: null,
|
|
66552
|
+
access: "view",
|
|
66553
|
+
role: "viewer"
|
|
66554
|
+
},
|
|
66555
|
+
"actions.getLinks": {
|
|
66556
|
+
capName: "actions",
|
|
66557
|
+
capScope: "system",
|
|
66558
|
+
addonId: null,
|
|
66559
|
+
access: "view",
|
|
66560
|
+
role: "admin"
|
|
66561
|
+
},
|
|
66562
|
+
"actions.getTraces": {
|
|
66563
|
+
capName: "actions",
|
|
66564
|
+
capScope: "system",
|
|
66565
|
+
addonId: null,
|
|
66566
|
+
access: "view",
|
|
66567
|
+
role: "admin"
|
|
66568
|
+
},
|
|
66569
|
+
"actions.list": {
|
|
66570
|
+
capName: "actions",
|
|
66571
|
+
capScope: "system",
|
|
66572
|
+
addonId: null,
|
|
66573
|
+
access: "view",
|
|
66574
|
+
role: "admin"
|
|
66575
|
+
},
|
|
66576
|
+
"actions.listForCamera": {
|
|
66577
|
+
capName: "actions",
|
|
66578
|
+
capScope: "system",
|
|
66579
|
+
addonId: null,
|
|
66580
|
+
access: "view",
|
|
66581
|
+
role: "viewer"
|
|
66582
|
+
},
|
|
66583
|
+
"actions.run": {
|
|
66584
|
+
capName: "actions",
|
|
66585
|
+
capScope: "system",
|
|
66586
|
+
addonId: null,
|
|
66587
|
+
access: "create",
|
|
66588
|
+
role: "viewer"
|
|
66589
|
+
},
|
|
66590
|
+
"actions.setLinks": {
|
|
66591
|
+
capName: "actions",
|
|
66592
|
+
capScope: "system",
|
|
66593
|
+
addonId: null,
|
|
66594
|
+
access: "create",
|
|
66595
|
+
role: "admin"
|
|
66596
|
+
},
|
|
66597
|
+
"actions.stop": {
|
|
66598
|
+
capName: "actions",
|
|
66599
|
+
capScope: "system",
|
|
66600
|
+
addonId: null,
|
|
66601
|
+
access: "create",
|
|
66602
|
+
role: "admin"
|
|
66603
|
+
},
|
|
66604
|
+
"actions.update": {
|
|
66605
|
+
capName: "actions",
|
|
66606
|
+
capScope: "system",
|
|
66607
|
+
addonId: null,
|
|
66608
|
+
access: "create",
|
|
66609
|
+
role: "admin"
|
|
66610
|
+
},
|
|
66611
|
+
"actionSource.listActions": {
|
|
66612
|
+
capName: "action-source",
|
|
66613
|
+
capScope: "system",
|
|
66614
|
+
addonId: null,
|
|
66615
|
+
access: "view",
|
|
66616
|
+
role: "admin"
|
|
66617
|
+
},
|
|
66618
|
+
"actionSource.runAction": {
|
|
66619
|
+
capName: "action-source",
|
|
66620
|
+
capScope: "system",
|
|
66621
|
+
addonId: null,
|
|
66622
|
+
access: "create",
|
|
66623
|
+
role: "admin"
|
|
66624
|
+
},
|
|
66625
|
+
"actionSource.stopAction": {
|
|
66626
|
+
capName: "action-source",
|
|
66627
|
+
capScope: "system",
|
|
66628
|
+
addonId: null,
|
|
66629
|
+
access: "create",
|
|
66630
|
+
role: "admin"
|
|
66631
|
+
},
|
|
65714
66632
|
"addonPages.listPages": {
|
|
65715
66633
|
capName: "addon-pages",
|
|
65716
66634
|
capScope: "system",
|
|
@@ -66992,6 +67910,13 @@ Object.freeze({
|
|
|
66992
67910
|
access: "view",
|
|
66993
67911
|
role: "admin"
|
|
66994
67912
|
},
|
|
67913
|
+
"coreBlocks.getAutomationRunState": {
|
|
67914
|
+
capName: "core-blocks",
|
|
67915
|
+
capScope: "system",
|
|
67916
|
+
addonId: null,
|
|
67917
|
+
access: "view",
|
|
67918
|
+
role: "admin"
|
|
67919
|
+
},
|
|
66995
67920
|
"coreBlocks.getBlockSettings": {
|
|
66996
67921
|
capName: "core-blocks",
|
|
66997
67922
|
capScope: "system",
|
|
@@ -67013,6 +67938,13 @@ Object.freeze({
|
|
|
67013
67938
|
access: "view",
|
|
67014
67939
|
role: "admin"
|
|
67015
67940
|
},
|
|
67941
|
+
"coreBlocks.getTraces": {
|
|
67942
|
+
capName: "core-blocks",
|
|
67943
|
+
capScope: "system",
|
|
67944
|
+
addonId: null,
|
|
67945
|
+
access: "view",
|
|
67946
|
+
role: "admin"
|
|
67947
|
+
},
|
|
67016
67948
|
"coreBlocks.getTypeDefs": {
|
|
67017
67949
|
capName: "core-blocks",
|
|
67018
67950
|
capScope: "system",
|
|
@@ -67048,6 +67980,13 @@ Object.freeze({
|
|
|
67048
67980
|
access: "create",
|
|
67049
67981
|
role: "admin"
|
|
67050
67982
|
},
|
|
67983
|
+
"coreBlocks.reportAutomationRun": {
|
|
67984
|
+
capName: "core-blocks",
|
|
67985
|
+
capScope: "system",
|
|
67986
|
+
addonId: null,
|
|
67987
|
+
access: "create",
|
|
67988
|
+
role: "admin"
|
|
67989
|
+
},
|
|
67051
67990
|
"coreBlocks.restart": {
|
|
67052
67991
|
capName: "core-blocks",
|
|
67053
67992
|
capScope: "system",
|
|
@@ -68917,6 +69856,13 @@ Object.freeze({
|
|
|
68917
69856
|
access: "view",
|
|
68918
69857
|
role: "viewer"
|
|
68919
69858
|
},
|
|
69859
|
+
"groupActive.getStatus": {
|
|
69860
|
+
capName: "group-active",
|
|
69861
|
+
capScope: "device",
|
|
69862
|
+
addonId: null,
|
|
69863
|
+
access: "view",
|
|
69864
|
+
role: "viewer"
|
|
69865
|
+
},
|
|
68920
69866
|
"groupCommands.getStatus": {
|
|
68921
69867
|
capName: "group-commands",
|
|
68922
69868
|
capScope: "device",
|
|
@@ -69883,6 +70829,13 @@ Object.freeze({
|
|
|
69883
70829
|
access: "create",
|
|
69884
70830
|
role: "admin"
|
|
69885
70831
|
},
|
|
70832
|
+
"meter.getStatus": {
|
|
70833
|
+
capName: "meter",
|
|
70834
|
+
capScope: "device",
|
|
70835
|
+
addonId: null,
|
|
70836
|
+
access: "view",
|
|
70837
|
+
role: "viewer"
|
|
70838
|
+
},
|
|
69886
70839
|
"metricsProvider.collectSnapshot": {
|
|
69887
70840
|
capName: "metrics-provider",
|
|
69888
70841
|
capScope: "system",
|
|
@@ -75607,7 +76560,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75607
76560
|
label: t("Full brightness", "Luminosità massima"),
|
|
75608
76561
|
phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
|
|
75609
76562
|
icon: "sun",
|
|
75610
|
-
args: {
|
|
76563
|
+
args: { level: 100 }
|
|
75611
76564
|
},
|
|
75612
76565
|
{
|
|
75613
76566
|
id: "brightness.half",
|
|
@@ -75615,7 +76568,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75615
76568
|
label: t("Half brightness", "Luminosità a metà"),
|
|
75616
76569
|
phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
|
|
75617
76570
|
icon: "sun-dim",
|
|
75618
|
-
args: {
|
|
76571
|
+
args: { level: 50 }
|
|
75619
76572
|
},
|
|
75620
76573
|
{
|
|
75621
76574
|
id: "brightness.off",
|
|
@@ -75623,16 +76576,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75623
76576
|
label: t("Brightness off", "Luminosità a zero"),
|
|
75624
76577
|
phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
|
|
75625
76578
|
icon: "lightbulb-off",
|
|
75626
|
-
args: {
|
|
76579
|
+
args: { level: 0 }
|
|
75627
76580
|
},
|
|
75628
76581
|
{
|
|
75629
76582
|
id: "brightness.set",
|
|
75630
76583
|
method: "setBrightness",
|
|
75631
76584
|
label: t("Set brightness", "Imposta la luminosità"),
|
|
75632
|
-
phrase: t("Set the brightness of {device} to {
|
|
76585
|
+
phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
|
|
75633
76586
|
icon: "sun-medium",
|
|
75634
76587
|
openArgs: [{
|
|
75635
|
-
key: "
|
|
76588
|
+
key: "level",
|
|
75636
76589
|
label: PERCENT,
|
|
75637
76590
|
offer: {
|
|
75638
76591
|
kind: "number",
|
|
@@ -75646,13 +76599,13 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75646
76599
|
],
|
|
75647
76600
|
state: [{
|
|
75648
76601
|
kind: "numeric",
|
|
75649
|
-
field: "
|
|
76602
|
+
field: "level",
|
|
75650
76603
|
quantity: t("the brightness", "la luminosità"),
|
|
75651
76604
|
label: t("Brightness", "Luminosità"),
|
|
75652
76605
|
unit: "%",
|
|
75653
76606
|
icon: "sun"
|
|
75654
76607
|
}],
|
|
75655
|
-
events: { onBrightnessChanged: { notOperatorFacing: "the `
|
|
76608
|
+
events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
|
|
75656
76609
|
},
|
|
75657
76610
|
color: {
|
|
75658
76611
|
scope: "device",
|
|
@@ -75666,7 +76619,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75666
76619
|
icon: "sun",
|
|
75667
76620
|
args: { color: {
|
|
75668
76621
|
mode: "mired",
|
|
75669
|
-
|
|
76622
|
+
colorTemperature: 370
|
|
75670
76623
|
} }
|
|
75671
76624
|
},
|
|
75672
76625
|
{
|
|
@@ -75677,7 +76630,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75677
76630
|
icon: "snowflake",
|
|
75678
76631
|
args: { color: {
|
|
75679
76632
|
mode: "mired",
|
|
75680
|
-
|
|
76633
|
+
colorTemperature: 200
|
|
75681
76634
|
} }
|
|
75682
76635
|
},
|
|
75683
76636
|
{
|
|
@@ -76291,7 +77244,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76291
77244
|
label: t("Fan off", "Ventilatore spento"),
|
|
76292
77245
|
phrase: t("Stop {device}", "Ferma {device}"),
|
|
76293
77246
|
icon: "power-off",
|
|
76294
|
-
args: {
|
|
77247
|
+
args: { speed: 0 }
|
|
76295
77248
|
},
|
|
76296
77249
|
{
|
|
76297
77250
|
id: "fan.full",
|
|
@@ -76299,16 +77252,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76299
77252
|
label: t("Fan full", "Ventilatore al massimo"),
|
|
76300
77253
|
phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
|
|
76301
77254
|
icon: "fan",
|
|
76302
|
-
args: {
|
|
77255
|
+
args: { speed: 100 }
|
|
76303
77256
|
},
|
|
76304
77257
|
{
|
|
76305
77258
|
id: "fan.speed",
|
|
76306
77259
|
method: "setPercentage",
|
|
76307
77260
|
label: t("Set speed", "Imposta la velocità"),
|
|
76308
|
-
phrase: t("Set the speed of {device} to {
|
|
77261
|
+
phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
|
|
76309
77262
|
icon: "fan",
|
|
76310
77263
|
openArgs: [{
|
|
76311
|
-
key: "
|
|
77264
|
+
key: "speed",
|
|
76312
77265
|
label: t("Speed", "Velocità"),
|
|
76313
77266
|
offer: {
|
|
76314
77267
|
kind: "number",
|
|
@@ -76370,7 +77323,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76370
77323
|
],
|
|
76371
77324
|
state: [{
|
|
76372
77325
|
kind: "numeric",
|
|
76373
|
-
field: "
|
|
77326
|
+
field: "speed",
|
|
76374
77327
|
quantity: t("the speed", "la velocità"),
|
|
76375
77328
|
label: t("Speed", "Velocità"),
|
|
76376
77329
|
unit: "%",
|
|
@@ -77168,7 +78121,7 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
77168
78121
|
},
|
|
77169
78122
|
{
|
|
77170
78123
|
kind: "numeric",
|
|
77171
|
-
field: "
|
|
78124
|
+
field: "progress",
|
|
77172
78125
|
quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
|
|
77173
78126
|
label: t("Progress", "Avanzamento"),
|
|
77174
78127
|
unit: "%",
|
|
@@ -77526,10 +78479,10 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
77526
78479
|
id: "media.seek",
|
|
77527
78480
|
method: "seek",
|
|
77528
78481
|
label: t("Seek", "Vai al punto"),
|
|
77529
|
-
phrase: t("Move {device} to {
|
|
78482
|
+
phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
|
|
77530
78483
|
icon: "fast-forward",
|
|
77531
78484
|
openArgs: [{
|
|
77532
|
-
key: "
|
|
78485
|
+
key: "position",
|
|
77533
78486
|
label: t("Position", "Posizione"),
|
|
77534
78487
|
offer: {
|
|
77535
78488
|
kind: "number",
|
|
@@ -78578,7 +79531,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78578
79531
|
state: [
|
|
78579
79532
|
{
|
|
78580
79533
|
kind: "numeric",
|
|
78581
|
-
field: "
|
|
79534
|
+
field: "co2",
|
|
78582
79535
|
quantity: t("the CO₂", "la CO₂"),
|
|
78583
79536
|
label: t("CO₂", "CO₂"),
|
|
78584
79537
|
unit: "ppm",
|
|
@@ -78586,7 +79539,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78586
79539
|
},
|
|
78587
79540
|
{
|
|
78588
79541
|
kind: "numeric",
|
|
78589
|
-
field: "
|
|
79542
|
+
field: "voc",
|
|
78590
79543
|
quantity: t("the VOC level", "il livello di COV"),
|
|
78591
79544
|
label: t("VOC", "COV"),
|
|
78592
79545
|
unit: "ppb",
|
|
@@ -78622,7 +79575,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78622
79575
|
noun: t("Light level", "Luminosità ambiente"),
|
|
78623
79576
|
state: [{
|
|
78624
79577
|
kind: "numeric",
|
|
78625
|
-
field: "
|
|
79578
|
+
field: "illuminance",
|
|
78626
79579
|
quantity: t("the light level", "la luminosità"),
|
|
78627
79580
|
label: t("Illuminance", "Illuminamento"),
|
|
78628
79581
|
unit: "lx",
|
|
@@ -78785,6 +79738,10 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78785
79738
|
icon: "flame"
|
|
78786
79739
|
}]
|
|
78787
79740
|
},
|
|
79741
|
+
"group-active": {
|
|
79742
|
+
scope: "device",
|
|
79743
|
+
noun: t("Group state", "Stato del gruppo")
|
|
79744
|
+
},
|
|
78788
79745
|
"group-commands": {
|
|
78789
79746
|
scope: "device",
|
|
78790
79747
|
noun: t("Group command", "Comando di gruppo")
|
|
@@ -78821,7 +79778,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78821
79778
|
noun: t("Humidity", "Umidità"),
|
|
78822
79779
|
state: [{
|
|
78823
79780
|
kind: "numeric",
|
|
78824
|
-
field: "
|
|
79781
|
+
field: "humidity",
|
|
78825
79782
|
quantity: t("the humidity", "l’umidità"),
|
|
78826
79783
|
label: t("Humidity", "Umidità"),
|
|
78827
79784
|
unit: "%",
|
|
@@ -78841,6 +79798,17 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78841
79798
|
}],
|
|
78842
79799
|
events: { onMotionChanged: { notOperatorFacing: "the `detected` state trigger phrases both edges, from the mirror that survives a dropped event (D49)" } }
|
|
78843
79800
|
},
|
|
79801
|
+
meter: {
|
|
79802
|
+
scope: "device",
|
|
79803
|
+
noun: t("Meter", "Contatore"),
|
|
79804
|
+
state: [{
|
|
79805
|
+
kind: "numeric",
|
|
79806
|
+
field: "value",
|
|
79807
|
+
quantity: t("the total", "il totale"),
|
|
79808
|
+
label: t("Total", "Totale"),
|
|
79809
|
+
icon: "gauge"
|
|
79810
|
+
}]
|
|
79811
|
+
},
|
|
78844
79812
|
"numeric-sensor": {
|
|
78845
79813
|
scope: "device",
|
|
78846
79814
|
noun: t("Sensor", "Sensore"),
|
|
@@ -78858,7 +79826,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78858
79826
|
state: [
|
|
78859
79827
|
{
|
|
78860
79828
|
kind: "numeric",
|
|
78861
|
-
field: "
|
|
79829
|
+
field: "power",
|
|
78862
79830
|
quantity: t("the power draw", "il consumo"),
|
|
78863
79831
|
label: t("Power", "Potenza"),
|
|
78864
79832
|
unit: "W",
|
|
@@ -78866,7 +79834,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78866
79834
|
},
|
|
78867
79835
|
{
|
|
78868
79836
|
kind: "numeric",
|
|
78869
|
-
field: "
|
|
79837
|
+
field: "energy",
|
|
78870
79838
|
quantity: t("the energy used", "l’energia consumata"),
|
|
78871
79839
|
label: t("Energy", "Energia"),
|
|
78872
79840
|
unit: "kWh",
|
|
@@ -78874,7 +79842,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78874
79842
|
},
|
|
78875
79843
|
{
|
|
78876
79844
|
kind: "numeric",
|
|
78877
|
-
field: "
|
|
79845
|
+
field: "voltage",
|
|
78878
79846
|
quantity: t("the voltage", "la tensione"),
|
|
78879
79847
|
label: t("Voltage", "Tensione"),
|
|
78880
79848
|
unit: "V",
|
|
@@ -78882,7 +79850,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78882
79850
|
},
|
|
78883
79851
|
{
|
|
78884
79852
|
kind: "numeric",
|
|
78885
|
-
field: "
|
|
79853
|
+
field: "current",
|
|
78886
79854
|
quantity: t("the current", "la corrente"),
|
|
78887
79855
|
label: t("Current", "Corrente"),
|
|
78888
79856
|
unit: "A",
|
|
@@ -78899,13 +79867,6 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78899
79867
|
label: t("Where", "Posizione"),
|
|
78900
79868
|
phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
|
|
78901
79869
|
icon: "map-pin"
|
|
78902
|
-
}, {
|
|
78903
|
-
kind: "numeric",
|
|
78904
|
-
field: "batteryPercent",
|
|
78905
|
-
quantity: t("the phone battery", "la batteria del telefono"),
|
|
78906
|
-
label: t("Battery", "Batteria"),
|
|
78907
|
-
unit: "%",
|
|
78908
|
-
icon: "battery"
|
|
78909
79870
|
}]
|
|
78910
79871
|
},
|
|
78911
79872
|
"pressure-sensor": {
|
|
@@ -78913,7 +79874,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78913
79874
|
noun: t("Pressure", "Pressione"),
|
|
78914
79875
|
state: [{
|
|
78915
79876
|
kind: "numeric",
|
|
78916
|
-
field: "
|
|
79877
|
+
field: "pressure",
|
|
78917
79878
|
quantity: t("the pressure", "la pressione"),
|
|
78918
79879
|
label: t("Pressure", "Pressione"),
|
|
78919
79880
|
unit: "hPa",
|
|
@@ -78949,7 +79910,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78949
79910
|
noun: t("Temperature", "Temperatura"),
|
|
78950
79911
|
state: [{
|
|
78951
79912
|
kind: "numeric",
|
|
78952
|
-
field: "
|
|
79913
|
+
field: "temperature",
|
|
78953
79914
|
quantity: t("the temperature", "la temperatura"),
|
|
78954
79915
|
label: t("Temperature", "Temperatura"),
|
|
78955
79916
|
unit: "°C",
|
|
@@ -79020,7 +79981,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79020
79981
|
state: [
|
|
79021
79982
|
{
|
|
79022
79983
|
kind: "numeric",
|
|
79023
|
-
field: "
|
|
79984
|
+
field: "level",
|
|
79024
79985
|
quantity: t("the battery level", "il livello della batteria"),
|
|
79025
79986
|
label: t("Battery", "Batteria"),
|
|
79026
79987
|
unit: "%",
|
|
@@ -79062,7 +80023,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79062
80023
|
icon: "battery-charging"
|
|
79063
80024
|
}
|
|
79064
80025
|
],
|
|
79065
|
-
events: { onStatusChanged: { notOperatorFacing: "the
|
|
80026
|
+
events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
|
|
79066
80027
|
extraEvents: [{
|
|
79067
80028
|
category: EventCategory.DeviceAwake,
|
|
79068
80029
|
label: t("Woke up", "Risvegliato"),
|
|
@@ -79080,7 +80041,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79080
80041
|
noun: t("Network link", "Collegamento di rete"),
|
|
79081
80042
|
state: [{
|
|
79082
80043
|
kind: "numeric",
|
|
79083
|
-
field: "
|
|
80044
|
+
field: "signal",
|
|
79084
80045
|
quantity: t("the signal strength", "l’intensità del segnale"),
|
|
79085
80046
|
label: t("Signal", "Segnale"),
|
|
79086
80047
|
unit: "%",
|
|
@@ -79173,6 +80134,8 @@ var ML = "model and training machinery — no device action";
|
|
|
79173
80134
|
var INTERNAL = "internal plumbing between addons — never operator-facing";
|
|
79174
80135
|
/** Every system-scoped cap, with why it is not a device's vocabulary. */
|
|
79175
80136
|
var SYSTEM_CAP_VOCABULARY = {
|
|
80137
|
+
"action-source": system(INTERNAL),
|
|
80138
|
+
actions: system("declared actions — run from the Actions page and from the cameras that link them"),
|
|
79176
80139
|
"addon-pages": system(UI_PLUMBING),
|
|
79177
80140
|
"addon-pages-source": system(UI_PLUMBING),
|
|
79178
80141
|
"addon-routes": system(UI_PLUMBING),
|
|
@@ -79394,6 +80357,31 @@ Object.freeze({
|
|
|
79394
80357
|
form: "single",
|
|
79395
80358
|
optional: false
|
|
79396
80359
|
}],
|
|
80360
|
+
"actions.get": [{
|
|
80361
|
+
name: "deviceId",
|
|
80362
|
+
form: "single",
|
|
80363
|
+
optional: true
|
|
80364
|
+
}],
|
|
80365
|
+
"actions.getLinks": [{
|
|
80366
|
+
name: "deviceId",
|
|
80367
|
+
form: "single",
|
|
80368
|
+
optional: false
|
|
80369
|
+
}],
|
|
80370
|
+
"actions.listForCamera": [{
|
|
80371
|
+
name: "deviceId",
|
|
80372
|
+
form: "single",
|
|
80373
|
+
optional: false
|
|
80374
|
+
}],
|
|
80375
|
+
"actions.run": [{
|
|
80376
|
+
name: "deviceId",
|
|
80377
|
+
form: "single",
|
|
80378
|
+
optional: true
|
|
80379
|
+
}],
|
|
80380
|
+
"actions.setLinks": [{
|
|
80381
|
+
name: "deviceId",
|
|
80382
|
+
form: "single",
|
|
80383
|
+
optional: false
|
|
80384
|
+
}],
|
|
79397
80385
|
"addonSettings.getDeviceSettings": [{
|
|
79398
80386
|
name: "deviceId",
|
|
79399
80387
|
form: "single",
|
|
@@ -80345,6 +81333,11 @@ Object.freeze({
|
|
|
80345
81333
|
form: "single",
|
|
80346
81334
|
optional: false
|
|
80347
81335
|
}],
|
|
81336
|
+
"groupActive.getStatus": [{
|
|
81337
|
+
name: "deviceId",
|
|
81338
|
+
form: "single",
|
|
81339
|
+
optional: false
|
|
81340
|
+
}],
|
|
80348
81341
|
"groupCommands.getStatus": [{
|
|
80349
81342
|
name: "deviceId",
|
|
80350
81343
|
form: "single",
|
|
@@ -80555,6 +81548,11 @@ Object.freeze({
|
|
|
80555
81548
|
form: "single",
|
|
80556
81549
|
optional: false
|
|
80557
81550
|
}],
|
|
81551
|
+
"meter.getStatus": [{
|
|
81552
|
+
name: "deviceId",
|
|
81553
|
+
form: "single",
|
|
81554
|
+
optional: false
|
|
81555
|
+
}],
|
|
80558
81556
|
"motion.getStatus": [{
|
|
80559
81557
|
name: "deviceId",
|
|
80560
81558
|
form: "single",
|
|
@@ -82162,7 +83160,6 @@ Object.freeze({
|
|
|
82162
83160
|
"network-access": "ingress",
|
|
82163
83161
|
"smtp-provider": "email"
|
|
82164
83162
|
});
|
|
82165
|
-
DeviceType.Camera;
|
|
82166
83163
|
/**
|
|
82167
83164
|
* A saved Customize assignment (D936). The schema is the type: callers use
|
|
82168
83165
|
* `z.infer`, they do not restate the shape.
|
|
@@ -83567,12 +84564,13 @@ function resolveGrantDeviceIds(scopes, fleet, access) {
|
|
|
83567
84564
|
}
|
|
83568
84565
|
return out;
|
|
83569
84566
|
}
|
|
84567
|
+
String.raw`(?<=^|["'(\s>,\[{])`;
|
|
83570
84568
|
var MB = 1024 * 1024;
|
|
83571
84569
|
1024 * MB, 3072 * MB;
|
|
83572
84570
|
//#endregion
|
|
83573
84571
|
//#region src/custom-actions.ts
|
|
83574
84572
|
/**
|
|
83575
|
-
* Alexa
|
|
84573
|
+
* Alexa Export — customActions catalog.
|
|
83576
84574
|
*
|
|
83577
84575
|
* The settings page drives these through
|
|
83578
84576
|
* `api.addons.custom.{query,mutate}({ addonId, action, input })`: every action
|
|
@@ -85288,13 +86286,13 @@ var temperatureAdapter = {
|
|
|
85288
86286
|
category: "TEMPERATURE_SENSOR"
|
|
85289
86287
|
}),
|
|
85290
86288
|
properties: (_cap, slice) => {
|
|
85291
|
-
const p = TemperatureSensorStatusSchema.pick({
|
|
85292
|
-
if (!p.success || p.data.
|
|
86289
|
+
const p = TemperatureSensorStatusSchema.pick({ temperature: true }).safeParse(slice);
|
|
86290
|
+
if (!p.success || p.data.temperature === null) return [];
|
|
85293
86291
|
return [{
|
|
85294
86292
|
namespace: "Alexa.TemperatureSensor",
|
|
85295
86293
|
name: "temperature",
|
|
85296
86294
|
value: {
|
|
85297
|
-
value: Math.round(p.data.
|
|
86295
|
+
value: Math.round(p.data.temperature * 10) / 10,
|
|
85298
86296
|
scale: "CELSIUS"
|
|
85299
86297
|
}
|
|
85300
86298
|
}];
|
|
@@ -86039,12 +87037,12 @@ var humidityAdapter = {
|
|
|
86039
87037
|
category: "TEMPERATURE_SENSOR"
|
|
86040
87038
|
}),
|
|
86041
87039
|
properties: (_cap, slice) => {
|
|
86042
|
-
const p = HumiditySensorStatusSchema.pick({
|
|
86043
|
-
if (!p.success || p.data.
|
|
87040
|
+
const p = HumiditySensorStatusSchema.pick({ humidity: true }).safeParse(slice);
|
|
87041
|
+
if (!p.success || p.data.humidity === null) return [];
|
|
86044
87042
|
return [{
|
|
86045
87043
|
namespace: "Alexa.HumiditySensor",
|
|
86046
87044
|
name: "relativeHumidity",
|
|
86047
|
-
value: { value: Math.max(0, Math.min(100, p.data.
|
|
87045
|
+
value: { value: Math.max(0, Math.min(100, p.data.humidity)) }
|
|
86048
87046
|
}];
|
|
86049
87047
|
},
|
|
86050
87048
|
directives: [],
|
|
@@ -86218,7 +87216,7 @@ async function handleSetBrightness(header, endpointRaw, payloadRaw, deps, _calle
|
|
|
86218
87216
|
try {
|
|
86219
87217
|
await api.brightness.setBrightness.mutate({
|
|
86220
87218
|
deviceId: targetDeviceId,
|
|
86221
|
-
percentage
|
|
87219
|
+
level: percentage
|
|
86222
87220
|
});
|
|
86223
87221
|
} catch (err) {
|
|
86224
87222
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -86362,11 +87360,11 @@ var GENERIC_ADAPTERS = [
|
|
|
86362
87360
|
},
|
|
86363
87361
|
properties: (capName, slice) => {
|
|
86364
87362
|
if (capName === "brightness") {
|
|
86365
|
-
const p = BrightnessStatusSchema.pick({
|
|
87363
|
+
const p = BrightnessStatusSchema.pick({ level: true }).safeParse(slice);
|
|
86366
87364
|
return p.success ? [{
|
|
86367
87365
|
namespace: "Alexa.BrightnessController",
|
|
86368
87366
|
name: "brightness",
|
|
86369
|
-
value: Math.max(0, Math.min(100, Math.round(p.data.
|
|
87367
|
+
value: Math.max(0, Math.min(100, Math.round(p.data.level)))
|
|
86370
87368
|
}] : [];
|
|
86371
87369
|
}
|
|
86372
87370
|
const p = SwitchStatusSchema.pick({ on: true }).safeParse(slice);
|
|
@@ -89416,7 +90414,7 @@ async function collectChildProperties(api, childDeviceId, properties, timeOfSamp
|
|
|
89416
90414
|
timeOfSample,
|
|
89417
90415
|
uncertaintyInMilliseconds: 0
|
|
89418
90416
|
});
|
|
89419
|
-
const level = numberField(await api.brightness.getStatus.query({ deviceId: childDeviceId }).catch(() => null), "
|
|
90417
|
+
const level = numberField(await api.brightness.getStatus.query({ deviceId: childDeviceId }).catch(() => null), "level");
|
|
89420
90418
|
if (level !== null) properties.push({
|
|
89421
90419
|
namespace: "Alexa.BrightnessController",
|
|
89422
90420
|
name: "brightness",
|
|
@@ -93299,7 +94297,7 @@ function indexByDrivingDevice(exported) {
|
|
|
93299
94297
|
}
|
|
93300
94298
|
var EnabledSchema = object({ enabled: boolean() });
|
|
93301
94299
|
var OnSchema = object({ on: boolean() });
|
|
93302
|
-
var PercentageSchema = object({
|
|
94300
|
+
var PercentageSchema = object({ level: number() });
|
|
93303
94301
|
var OnlineSchema = object({ online: boolean() });
|
|
93304
94302
|
function power(on) {
|
|
93305
94303
|
return {
|
|
@@ -93380,7 +94378,7 @@ function stateReportsFor(change, exported) {
|
|
|
93380
94378
|
case "brightness": {
|
|
93381
94379
|
const parsed = PercentageSchema.safeParse(change.slice);
|
|
93382
94380
|
if (!parsed.success) break;
|
|
93383
|
-
const value = Math.max(0, Math.min(100, Math.round(parsed.data.
|
|
94381
|
+
const value = Math.max(0, Math.min(100, Math.round(parsed.data.level)));
|
|
93384
94382
|
for (const e of of("child")) reports.push({
|
|
93385
94383
|
...e,
|
|
93386
94384
|
interfaceName: "Alexa.BrightnessController",
|