@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
|
@@ -34,7 +34,7 @@ let node_path = require("node:path");
|
|
|
34
34
|
node_path = __toESM(node_path, 1);
|
|
35
35
|
require("node:child_process");
|
|
36
36
|
require("node:zlib");
|
|
37
|
-
//#region ../types/dist/event-category-
|
|
37
|
+
//#region ../types/dist/event-category-DmZDPDf_.mjs
|
|
38
38
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
39
39
|
EventCategory["SystemBoot"] = "system.boot";
|
|
40
40
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -661,7 +661,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
661
661
|
* (a track was promoted to a stationary-registry entry) or departs (the
|
|
662
662
|
* object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
|
|
663
663
|
* the dedicated "Stationary" section — never the live event feed. Payload:
|
|
664
|
-
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp }`.
|
|
664
|
+
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
|
|
665
665
|
*/
|
|
666
666
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
667
667
|
/**
|
|
@@ -799,6 +799,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
799
799
|
*/
|
|
800
800
|
EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
|
|
801
801
|
/**
|
|
802
|
+
* An action run started or ended. Emitted by the `actions` surface.
|
|
803
|
+
* Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
|
|
804
|
+
*/
|
|
805
|
+
EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
|
|
806
|
+
/**
|
|
802
807
|
* Progress update from a running model conversion job.
|
|
803
808
|
* Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
|
|
804
809
|
* Emitted by `addon-model-studio` on the converting node.
|
|
@@ -5477,7 +5482,7 @@ var ZodIssueCode = {
|
|
|
5477
5482
|
var ZodFirstPartyTypeKind;
|
|
5478
5483
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5479
5484
|
//#endregion
|
|
5480
|
-
//#region ../types/dist/sleep-
|
|
5485
|
+
//#region ../types/dist/sleep-Crlmu_tO.mjs
|
|
5481
5486
|
/**
|
|
5482
5487
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5483
5488
|
* window to float samples (D455).
|
|
@@ -8548,6 +8553,8 @@ Object.freeze({ "doorbell": "lastPressedAt" });
|
|
|
8548
8553
|
/** Every capability name, so addon code can check a name without the schema graph. */
|
|
8549
8554
|
var CAP_NAMES = Object.freeze([
|
|
8550
8555
|
"accessories",
|
|
8556
|
+
"action-source",
|
|
8557
|
+
"actions",
|
|
8551
8558
|
"addon-pages",
|
|
8552
8559
|
"addon-pages-source",
|
|
8553
8560
|
"addon-routes",
|
|
@@ -8621,6 +8628,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8621
8628
|
"filesystem-browse",
|
|
8622
8629
|
"flood",
|
|
8623
8630
|
"gas",
|
|
8631
|
+
"group-active",
|
|
8624
8632
|
"group-commands",
|
|
8625
8633
|
"group-status",
|
|
8626
8634
|
"heating-valve",
|
|
@@ -8643,6 +8651,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8643
8651
|
"login-method",
|
|
8644
8652
|
"media-player",
|
|
8645
8653
|
"mesh-network",
|
|
8654
|
+
"meter",
|
|
8646
8655
|
"metrics-provider",
|
|
8647
8656
|
"model-convert",
|
|
8648
8657
|
"model-distributor",
|
|
@@ -8734,11 +8743,11 @@ var CAP_NAMES = Object.freeze([
|
|
|
8734
8743
|
Object.freeze({
|
|
8735
8744
|
"air-quality-sensor": [
|
|
8736
8745
|
{
|
|
8737
|
-
"path": "
|
|
8746
|
+
"path": "co2",
|
|
8738
8747
|
"valueType": "number"
|
|
8739
8748
|
},
|
|
8740
8749
|
{
|
|
8741
|
-
"path": "
|
|
8750
|
+
"path": "voc",
|
|
8742
8751
|
"valueType": "number"
|
|
8743
8752
|
},
|
|
8744
8753
|
{
|
|
@@ -8788,7 +8797,7 @@ Object.freeze({
|
|
|
8788
8797
|
}
|
|
8789
8798
|
],
|
|
8790
8799
|
"ambient-light-sensor": [{
|
|
8791
|
-
"path": "
|
|
8800
|
+
"path": "illuminance",
|
|
8792
8801
|
"valueType": "number"
|
|
8793
8802
|
}],
|
|
8794
8803
|
"audio-metrics": [
|
|
@@ -8849,7 +8858,7 @@ Object.freeze({
|
|
|
8849
8858
|
],
|
|
8850
8859
|
"battery": [
|
|
8851
8860
|
{
|
|
8852
|
-
"path": "
|
|
8861
|
+
"path": "level",
|
|
8853
8862
|
"valueType": "number"
|
|
8854
8863
|
},
|
|
8855
8864
|
{
|
|
@@ -8871,7 +8880,7 @@ Object.freeze({
|
|
|
8871
8880
|
"valueType": "number"
|
|
8872
8881
|
},
|
|
8873
8882
|
{
|
|
8874
|
-
"path": "
|
|
8883
|
+
"path": "voltage",
|
|
8875
8884
|
"valueType": "number"
|
|
8876
8885
|
},
|
|
8877
8886
|
{
|
|
@@ -8892,7 +8901,7 @@ Object.freeze({
|
|
|
8892
8901
|
"valueType": "boolean"
|
|
8893
8902
|
}],
|
|
8894
8903
|
"brightness": [{
|
|
8895
|
-
"path": "
|
|
8904
|
+
"path": "level",
|
|
8896
8905
|
"valueType": "number"
|
|
8897
8906
|
}],
|
|
8898
8907
|
"broker": [{
|
|
@@ -9093,7 +9102,7 @@ Object.freeze({
|
|
|
9093
9102
|
"valueType": "number"
|
|
9094
9103
|
},
|
|
9095
9104
|
{
|
|
9096
|
-
"path": "
|
|
9105
|
+
"path": "colorTemperature",
|
|
9097
9106
|
"valueType": "number"
|
|
9098
9107
|
}
|
|
9099
9108
|
],
|
|
@@ -9272,15 +9281,15 @@ Object.freeze({
|
|
|
9272
9281
|
"valueType": "string"
|
|
9273
9282
|
},
|
|
9274
9283
|
{
|
|
9275
|
-
"path": "
|
|
9284
|
+
"path": "remaining",
|
|
9276
9285
|
"valueType": "number"
|
|
9277
9286
|
},
|
|
9278
9287
|
{
|
|
9279
|
-
"path": "
|
|
9288
|
+
"path": "delayedStart",
|
|
9280
9289
|
"valueType": "number"
|
|
9281
9290
|
},
|
|
9282
9291
|
{
|
|
9283
|
-
"path": "
|
|
9292
|
+
"path": "progress",
|
|
9284
9293
|
"valueType": "number"
|
|
9285
9294
|
},
|
|
9286
9295
|
{
|
|
@@ -9394,7 +9403,7 @@ Object.freeze({
|
|
|
9394
9403
|
],
|
|
9395
9404
|
"fan-control": [
|
|
9396
9405
|
{
|
|
9397
|
-
"path": "
|
|
9406
|
+
"path": "speed",
|
|
9398
9407
|
"valueType": "number"
|
|
9399
9408
|
},
|
|
9400
9409
|
{
|
|
@@ -9441,6 +9450,10 @@ Object.freeze({
|
|
|
9441
9450
|
"path": "detected",
|
|
9442
9451
|
"valueType": "boolean"
|
|
9443
9452
|
}],
|
|
9453
|
+
"group-active": [{
|
|
9454
|
+
"path": "active",
|
|
9455
|
+
"valueType": "boolean"
|
|
9456
|
+
}],
|
|
9444
9457
|
"group-status": [
|
|
9445
9458
|
{
|
|
9446
9459
|
"path": "included",
|
|
@@ -9490,7 +9503,7 @@ Object.freeze({
|
|
|
9490
9503
|
}
|
|
9491
9504
|
],
|
|
9492
9505
|
"humidity-sensor": [{
|
|
9493
|
-
"path": "
|
|
9506
|
+
"path": "humidity",
|
|
9494
9507
|
"valueType": "number"
|
|
9495
9508
|
}],
|
|
9496
9509
|
"image": [{
|
|
@@ -9600,7 +9613,7 @@ Object.freeze({
|
|
|
9600
9613
|
"valueType": "number"
|
|
9601
9614
|
},
|
|
9602
9615
|
{
|
|
9603
|
-
"path": "
|
|
9616
|
+
"path": "progress",
|
|
9604
9617
|
"valueType": "number"
|
|
9605
9618
|
},
|
|
9606
9619
|
{
|
|
@@ -9679,11 +9692,11 @@ Object.freeze({
|
|
|
9679
9692
|
"valueType": "string"
|
|
9680
9693
|
},
|
|
9681
9694
|
{
|
|
9682
|
-
"path": "
|
|
9695
|
+
"path": "position",
|
|
9683
9696
|
"valueType": "number"
|
|
9684
9697
|
},
|
|
9685
9698
|
{
|
|
9686
|
-
"path": "
|
|
9699
|
+
"path": "duration",
|
|
9687
9700
|
"valueType": "number"
|
|
9688
9701
|
},
|
|
9689
9702
|
{
|
|
@@ -9700,6 +9713,10 @@ Object.freeze({
|
|
|
9700
9713
|
]
|
|
9701
9714
|
}
|
|
9702
9715
|
],
|
|
9716
|
+
"meter": [{
|
|
9717
|
+
"path": "value",
|
|
9718
|
+
"valueType": "number"
|
|
9719
|
+
}],
|
|
9703
9720
|
"motion": [
|
|
9704
9721
|
{
|
|
9705
9722
|
"path": "detected",
|
|
@@ -9781,11 +9798,11 @@ Object.freeze({
|
|
|
9781
9798
|
]
|
|
9782
9799
|
},
|
|
9783
9800
|
{
|
|
9784
|
-
"path": "
|
|
9801
|
+
"path": "signal",
|
|
9785
9802
|
"valueType": "number"
|
|
9786
9803
|
},
|
|
9787
9804
|
{
|
|
9788
|
-
"path": "
|
|
9805
|
+
"path": "rssi",
|
|
9789
9806
|
"valueType": "number"
|
|
9790
9807
|
},
|
|
9791
9808
|
{
|
|
@@ -9840,6 +9857,18 @@ Object.freeze({
|
|
|
9840
9857
|
"path": "foodLevel",
|
|
9841
9858
|
"valueType": "number"
|
|
9842
9859
|
},
|
|
9860
|
+
{
|
|
9861
|
+
"path": "bowlFood",
|
|
9862
|
+
"valueType": "number"
|
|
9863
|
+
},
|
|
9864
|
+
{
|
|
9865
|
+
"path": "eating",
|
|
9866
|
+
"valueType": "boolean"
|
|
9867
|
+
},
|
|
9868
|
+
{
|
|
9869
|
+
"path": "supportsMarkRefilled",
|
|
9870
|
+
"valueType": "boolean"
|
|
9871
|
+
},
|
|
9843
9872
|
{
|
|
9844
9873
|
"path": "food1",
|
|
9845
9874
|
"valueType": "number"
|
|
@@ -9904,23 +9933,23 @@ Object.freeze({
|
|
|
9904
9933
|
],
|
|
9905
9934
|
"power-meter": [
|
|
9906
9935
|
{
|
|
9907
|
-
"path": "
|
|
9936
|
+
"path": "power",
|
|
9908
9937
|
"valueType": "number"
|
|
9909
9938
|
},
|
|
9910
9939
|
{
|
|
9911
|
-
"path": "
|
|
9940
|
+
"path": "energy",
|
|
9912
9941
|
"valueType": "number"
|
|
9913
9942
|
},
|
|
9914
9943
|
{
|
|
9915
|
-
"path": "
|
|
9944
|
+
"path": "voltage",
|
|
9916
9945
|
"valueType": "number"
|
|
9917
9946
|
},
|
|
9918
9947
|
{
|
|
9919
|
-
"path": "
|
|
9948
|
+
"path": "current",
|
|
9920
9949
|
"valueType": "number"
|
|
9921
9950
|
},
|
|
9922
9951
|
{
|
|
9923
|
-
"path": "
|
|
9952
|
+
"path": "apparentPower",
|
|
9924
9953
|
"valueType": "number"
|
|
9925
9954
|
},
|
|
9926
9955
|
{
|
|
@@ -9948,14 +9977,10 @@ Object.freeze({
|
|
|
9948
9977
|
{
|
|
9949
9978
|
"path": "gps.accuracyMeters",
|
|
9950
9979
|
"valueType": "number"
|
|
9951
|
-
},
|
|
9952
|
-
{
|
|
9953
|
-
"path": "batteryPercent",
|
|
9954
|
-
"valueType": "number"
|
|
9955
9980
|
}
|
|
9956
9981
|
],
|
|
9957
9982
|
"pressure-sensor": [{
|
|
9958
|
-
"path": "
|
|
9983
|
+
"path": "pressure",
|
|
9959
9984
|
"valueType": "number"
|
|
9960
9985
|
}],
|
|
9961
9986
|
"privacy-mask": [{
|
|
@@ -10269,7 +10294,7 @@ Object.freeze({
|
|
|
10269
10294
|
"valueType": "boolean"
|
|
10270
10295
|
}],
|
|
10271
10296
|
"temperature-sensor": [{
|
|
10272
|
-
"path": "
|
|
10297
|
+
"path": "temperature",
|
|
10273
10298
|
"valueType": "number"
|
|
10274
10299
|
}],
|
|
10275
10300
|
"update": [
|
|
@@ -10317,7 +10342,7 @@ Object.freeze({
|
|
|
10317
10342
|
"valueType": "string"
|
|
10318
10343
|
},
|
|
10319
10344
|
{
|
|
10320
|
-
"path": "
|
|
10345
|
+
"path": "progress",
|
|
10321
10346
|
"valueType": "number"
|
|
10322
10347
|
},
|
|
10323
10348
|
{
|
|
@@ -10802,7 +10827,7 @@ function errMsg(err) {
|
|
|
10802
10827
|
return String(err);
|
|
10803
10828
|
}
|
|
10804
10829
|
//#endregion
|
|
10805
|
-
//#region ../types/dist/composition-
|
|
10830
|
+
//#region ../types/dist/composition-CZImLpOI.mjs
|
|
10806
10831
|
/**
|
|
10807
10832
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
10808
10833
|
*
|
|
@@ -11117,6 +11142,13 @@ var table = {
|
|
|
11117
11142
|
apply: () => {
|
|
11118
11143
|
throw new ExpressionEvalError("latchedAt: stateful evaluation context is required");
|
|
11119
11144
|
}
|
|
11145
|
+
},
|
|
11146
|
+
schmitt: {
|
|
11147
|
+
minArgs: 3,
|
|
11148
|
+
maxArgs: 5,
|
|
11149
|
+
apply: () => {
|
|
11150
|
+
throw new ExpressionEvalError("schmitt: stateful evaluation context is required");
|
|
11151
|
+
}
|
|
11120
11152
|
}
|
|
11121
11153
|
};
|
|
11122
11154
|
Object.freeze(Object.assign(Object.create(null), table));
|
|
@@ -11578,6 +11610,79 @@ var APPLIANCE_KINDS = [
|
|
|
11578
11610
|
];
|
|
11579
11611
|
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
11580
11612
|
/**
|
|
11613
|
+
* Statistics and integrals over a history read (D944).
|
|
11614
|
+
*
|
|
11615
|
+
* Pure: the same points always give the same answer, so a restart recomputes
|
|
11616
|
+
* rather than trusting a buffer. A gauge mean is time-weighted (value × ms),
|
|
11617
|
+
* never the mean of the samples. A hole with no held value is not integrated
|
|
11618
|
+
* as zero. A truncated read is not published.
|
|
11619
|
+
*/
|
|
11620
|
+
var STATISTIC_STATS = [
|
|
11621
|
+
"min",
|
|
11622
|
+
"max",
|
|
11623
|
+
"mean",
|
|
11624
|
+
"sum",
|
|
11625
|
+
"count",
|
|
11626
|
+
"change"
|
|
11627
|
+
];
|
|
11628
|
+
/**
|
|
11629
|
+
* The range a statistics or integral helper asks history for (D944).
|
|
11630
|
+
*
|
|
11631
|
+
* Calendar edges are the hub's timezone, never UTC midnight: a day is 23, 24
|
|
11632
|
+
* or 25 hours across a DST change. A tier is eligible only when its retention
|
|
11633
|
+
* is strictly longer than the longest that range can be. Forever qualifies.
|
|
11634
|
+
* Equal to a tier's retention is a refusal, not a short answer.
|
|
11635
|
+
*/
|
|
11636
|
+
var MINUTE_MS = 6e4;
|
|
11637
|
+
var HOUR_MS = 60 * MINUTE_MS;
|
|
11638
|
+
var DAY_MS = 24 * HOUR_MS;
|
|
11639
|
+
var ROLLING_SPANS = [
|
|
11640
|
+
"1h",
|
|
11641
|
+
"24h",
|
|
11642
|
+
"2d",
|
|
11643
|
+
"7d",
|
|
11644
|
+
"30d",
|
|
11645
|
+
"custom"
|
|
11646
|
+
];
|
|
11647
|
+
var CALENDAR_PERIODS = [
|
|
11648
|
+
"today",
|
|
11649
|
+
"yesterday",
|
|
11650
|
+
"this-week",
|
|
11651
|
+
"this-month"
|
|
11652
|
+
];
|
|
11653
|
+
var RESET_PERIODS = [
|
|
11654
|
+
"never",
|
|
11655
|
+
"daily",
|
|
11656
|
+
"weekly",
|
|
11657
|
+
"monthly"
|
|
11658
|
+
];
|
|
11659
|
+
5 * MINUTE_MS;
|
|
11660
|
+
24 * HOUR_MS, 2 * DAY_MS, 7 * DAY_MS, 30 * DAY_MS;
|
|
11661
|
+
7 * DAY_MS, 30 * DAY_MS, 365 * DAY_MS;
|
|
11662
|
+
var rollingWindowObject = object({
|
|
11663
|
+
kind: literal("rolling"),
|
|
11664
|
+
span: _enum(ROLLING_SPANS),
|
|
11665
|
+
customMinutes: number().int().min(5).optional()
|
|
11666
|
+
}).check((payload) => {
|
|
11667
|
+
if (payload.value.span === "custom" && payload.value.customMinutes === void 0) payload.issues.push({
|
|
11668
|
+
code: "custom",
|
|
11669
|
+
message: "a custom range needs a duration in minutes",
|
|
11670
|
+
path: ["customMinutes"],
|
|
11671
|
+
input: payload.value
|
|
11672
|
+
});
|
|
11673
|
+
if (payload.value.span !== "custom" && payload.value.customMinutes !== void 0) payload.issues.push({
|
|
11674
|
+
code: "custom",
|
|
11675
|
+
message: "only a custom range carries a duration",
|
|
11676
|
+
path: ["customMinutes"],
|
|
11677
|
+
input: payload.value
|
|
11678
|
+
});
|
|
11679
|
+
});
|
|
11680
|
+
var RollingWindowSchema = rollingWindowObject;
|
|
11681
|
+
var StatisticWindowSchema = discriminatedUnion("kind", [rollingWindowObject, object({
|
|
11682
|
+
kind: literal("calendar"),
|
|
11683
|
+
period: _enum(CALENDAR_PERIODS)
|
|
11684
|
+
})]);
|
|
11685
|
+
/**
|
|
11581
11686
|
* A composition source identity: `(addonId, stableId)`, never a numeric device
|
|
11582
11687
|
* id. Split out so helper schemas can name it without a cycle through
|
|
11583
11688
|
* `composition.ts` (D659).
|
|
@@ -11603,7 +11708,13 @@ var GROUP_TEMPLATE_IDS = [
|
|
|
11603
11708
|
"occupancy",
|
|
11604
11709
|
"binary",
|
|
11605
11710
|
"switch",
|
|
11606
|
-
"light"
|
|
11711
|
+
"light",
|
|
11712
|
+
"fan",
|
|
11713
|
+
"cover",
|
|
11714
|
+
"valve",
|
|
11715
|
+
"lock",
|
|
11716
|
+
"media-player",
|
|
11717
|
+
"climate"
|
|
11607
11718
|
];
|
|
11608
11719
|
var NUMERIC_AGGREGATES = [
|
|
11609
11720
|
"mean",
|
|
@@ -11633,22 +11744,73 @@ var HelperMemberSchema = object({
|
|
|
11633
11744
|
cap: string().min(1),
|
|
11634
11745
|
fieldPath: string().min(1)
|
|
11635
11746
|
});
|
|
11636
|
-
var HelperSpecSchema = discriminatedUnion("kind", [
|
|
11637
|
-
|
|
11638
|
-
|
|
11639
|
-
|
|
11640
|
-
|
|
11641
|
-
|
|
11642
|
-
|
|
11643
|
-
|
|
11644
|
-
|
|
11645
|
-
|
|
11646
|
-
|
|
11647
|
-
|
|
11648
|
-
|
|
11649
|
-
|
|
11650
|
-
|
|
11651
|
-
|
|
11747
|
+
var HelperSpecSchema = discriminatedUnion("kind", [
|
|
11748
|
+
object({
|
|
11749
|
+
kind: literal("group"),
|
|
11750
|
+
templateId: GroupTemplateIdSchema,
|
|
11751
|
+
aggregate: AggregateReducerSchema,
|
|
11752
|
+
members: array(HelperMemberSchema).min(1).max(64),
|
|
11753
|
+
/** Actuator groups only. Readings leave this unset. */
|
|
11754
|
+
active: ActiveCriterionSchema.optional()
|
|
11755
|
+
}),
|
|
11756
|
+
object({
|
|
11757
|
+
kind: literal("appliance"),
|
|
11758
|
+
templateId: literal(APPLIANCE_TEMPLATE_ID),
|
|
11759
|
+
appliance: _enum(APPLIANCE_KINDS),
|
|
11760
|
+
thresholdWatts: number().positive(),
|
|
11761
|
+
startDwellMs: number().int().nonnegative(),
|
|
11762
|
+
stopDwellMs: number().int().nonnegative(),
|
|
11763
|
+
member: HelperMemberSchema
|
|
11764
|
+
}),
|
|
11765
|
+
object({
|
|
11766
|
+
kind: literal("statistic"),
|
|
11767
|
+
stat: _enum(STATISTIC_STATS),
|
|
11768
|
+
window: StatisticWindowSchema,
|
|
11769
|
+
source: HelperMemberSchema
|
|
11770
|
+
}),
|
|
11771
|
+
object({
|
|
11772
|
+
kind: literal("integral"),
|
|
11773
|
+
reset: _enum(RESET_PERIODS),
|
|
11774
|
+
output: _enum(["energy", "meter"]),
|
|
11775
|
+
source: HelperMemberSchema
|
|
11776
|
+
}),
|
|
11777
|
+
object({
|
|
11778
|
+
kind: literal("threshold"),
|
|
11779
|
+
source: HelperMemberSchema,
|
|
11780
|
+
high: number(),
|
|
11781
|
+
low: number(),
|
|
11782
|
+
onForMs: number().int().nonnegative(),
|
|
11783
|
+
offForMs: number().int().nonnegative()
|
|
11784
|
+
}),
|
|
11785
|
+
object({
|
|
11786
|
+
kind: literal("arithmetic"),
|
|
11787
|
+
op: _enum([
|
|
11788
|
+
"sum",
|
|
11789
|
+
"difference",
|
|
11790
|
+
"ratio"
|
|
11791
|
+
]),
|
|
11792
|
+
inputs: array(HelperMemberSchema).min(2).max(64)
|
|
11793
|
+
}),
|
|
11794
|
+
object({
|
|
11795
|
+
kind: literal("expression"),
|
|
11796
|
+
expr: string().min(1),
|
|
11797
|
+
inputs: array(object({
|
|
11798
|
+
name: string().min(1),
|
|
11799
|
+
member: HelperMemberSchema
|
|
11800
|
+
})).min(1).max(64),
|
|
11801
|
+
output: _enum(["number", "boolean"])
|
|
11802
|
+
}),
|
|
11803
|
+
object({
|
|
11804
|
+
kind: literal("derivative"),
|
|
11805
|
+
window: RollingWindowSchema,
|
|
11806
|
+
per: _enum([
|
|
11807
|
+
"second",
|
|
11808
|
+
"minute",
|
|
11809
|
+
"hour"
|
|
11810
|
+
]),
|
|
11811
|
+
source: HelperMemberSchema
|
|
11812
|
+
})
|
|
11813
|
+
]);
|
|
11652
11814
|
/** A composed device's stableId is this prefix plus the block id. */
|
|
11653
11815
|
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
11654
11816
|
/** Longest snippet a `code` source may carry (slice 4). */
|
|
@@ -11709,6 +11871,12 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
|
|
|
11709
11871
|
"all"
|
|
11710
11872
|
]),
|
|
11711
11873
|
reads: array(CompositionFieldReadSchema).min(1).max(64),
|
|
11874
|
+
/**
|
|
11875
|
+
* Set when the reads are an enum state, not a yes/no: the listed states
|
|
11876
|
+
* count as active (a cover is `open`). A state outside the list is inactive;
|
|
11877
|
+
* a read that is not a state at all is left out. Only `any` / `all` use it.
|
|
11878
|
+
*/
|
|
11879
|
+
activeWhen: array(string().min(1)).min(1).optional(),
|
|
11712
11880
|
/** `value` is the reading; the others are the member counts. */
|
|
11713
11881
|
publish: _enum([
|
|
11714
11882
|
"value",
|
|
@@ -11722,6 +11890,26 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
|
|
|
11722
11890
|
"omit",
|
|
11723
11891
|
"offline"
|
|
11724
11892
|
])
|
|
11893
|
+
}),
|
|
11894
|
+
object({
|
|
11895
|
+
kind: literal("series"),
|
|
11896
|
+
read: CompositionFieldReadSchema,
|
|
11897
|
+
/** `value` is the statistic or the integral. The others are the gap counts. */
|
|
11898
|
+
publish: _enum([
|
|
11899
|
+
"value",
|
|
11900
|
+
"included",
|
|
11901
|
+
"excluded",
|
|
11902
|
+
"total"
|
|
11903
|
+
]),
|
|
11904
|
+
/**
|
|
11905
|
+
* What an unanswered `value` does. Counts ignore this. `offline` leaves the
|
|
11906
|
+
* device unseeded until history answers, so a restart cannot publish 0.
|
|
11907
|
+
*/
|
|
11908
|
+
empty: _enum([
|
|
11909
|
+
"null",
|
|
11910
|
+
"omit",
|
|
11911
|
+
"offline"
|
|
11912
|
+
])
|
|
11725
11913
|
})
|
|
11726
11914
|
]);
|
|
11727
11915
|
var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
|
|
@@ -15446,6 +15634,14 @@ var AutomationConditionLeafSchema = object({
|
|
|
15446
15634
|
array(union([string(), number()]))
|
|
15447
15635
|
])
|
|
15448
15636
|
});
|
|
15637
|
+
var AutomationConditionStationaryPresentSchema = object({
|
|
15638
|
+
kind: literal("stationary-present"),
|
|
15639
|
+
deviceId: number().int().nonnegative(),
|
|
15640
|
+
/** Class names; a macro class matches every raw class that maps to it. */
|
|
15641
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
15642
|
+
/** The parked object must be in at least one of these zones. */
|
|
15643
|
+
zones: array(string().min(1)).min(1).optional()
|
|
15644
|
+
});
|
|
15449
15645
|
/**
|
|
15450
15646
|
* The expression leaf, declared as a plain object rather than an intersection
|
|
15451
15647
|
* with {@link ExpressionSourceSchema}: a discriminated union has to be able to
|
|
@@ -15479,7 +15675,8 @@ var AutomationConditionSchema = lazy(() => discriminatedUnion("kind", [
|
|
|
15479
15675
|
child: AutomationConditionSchema
|
|
15480
15676
|
}),
|
|
15481
15677
|
AutomationConditionLeafSchema,
|
|
15482
|
-
AutomationConditionExpressionSchema
|
|
15678
|
+
AutomationConditionExpressionSchema,
|
|
15679
|
+
AutomationConditionStationaryPresentSchema
|
|
15483
15680
|
]));
|
|
15484
15681
|
/**
|
|
15485
15682
|
* What starts a run.
|
|
@@ -15520,7 +15717,34 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
15520
15717
|
kind: literal("schedule"),
|
|
15521
15718
|
cron: string().min(1).max(120)
|
|
15522
15719
|
}),
|
|
15523
|
-
object({ kind: literal("manual") })
|
|
15720
|
+
object({ kind: literal("manual") }),
|
|
15721
|
+
object({
|
|
15722
|
+
kind: literal("detection"),
|
|
15723
|
+
/** Class names. A macro class (`animal`, `vehicle`, `person`, `package`)
|
|
15724
|
+
* matches every raw class that maps to it; any other name matches
|
|
15725
|
+
* exactly. */
|
|
15726
|
+
classes: array(string().min(1)).min(1),
|
|
15727
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
15728
|
+
/** The track must have visited at least one of these zones. */
|
|
15729
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
15730
|
+
/** Best-so-far confidence the track must reach. */
|
|
15731
|
+
minScore: number().min(0).max(1).optional()
|
|
15732
|
+
}),
|
|
15733
|
+
object({
|
|
15734
|
+
kind: literal("stationary"),
|
|
15735
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
15736
|
+
/** Class names; a macro class matches like the detection trigger. */
|
|
15737
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
15738
|
+
/** The parked object must be in at least one of these zones. */
|
|
15739
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
15740
|
+
/** `appeared`: it became parked. `departed`: the registry retired it.
|
|
15741
|
+
* The vocabulary of `PipelineAnalyticsStationaryChanged`. */
|
|
15742
|
+
phase: _enum(["appeared", "departed"])
|
|
15743
|
+
}),
|
|
15744
|
+
object({
|
|
15745
|
+
kind: literal("interval"),
|
|
15746
|
+
minutes: number().int().min(1).max(1440)
|
|
15747
|
+
})
|
|
15524
15748
|
]);
|
|
15525
15749
|
/**
|
|
15526
15750
|
* One action step.
|
|
@@ -15540,28 +15764,47 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
15540
15764
|
* is called. The runner still receives a number and is untouched; the
|
|
15541
15765
|
* resolution is the recipe's job, not the runner's.
|
|
15542
15766
|
*/
|
|
15767
|
+
var AutomationWaitStepSchema = object({
|
|
15768
|
+
kind: literal("wait"),
|
|
15769
|
+
seconds: number().min(0).max(300)
|
|
15770
|
+
});
|
|
15771
|
+
var AutomationCapStepSchema = object({
|
|
15772
|
+
kind: literal("cap"),
|
|
15773
|
+
/**
|
|
15774
|
+
* One device, several same-family devices (locks / climate family / …),
|
|
15775
|
+
* or `{ $var }` for the device that triggered the run. An array is
|
|
15776
|
+
* fan-out at codegen — each id gets the same cap.method call.
|
|
15777
|
+
*/
|
|
15778
|
+
deviceId: union([
|
|
15779
|
+
number().int(),
|
|
15780
|
+
array(number().int()).min(1),
|
|
15781
|
+
object({ $var: string().min(1) })
|
|
15782
|
+
]),
|
|
15783
|
+
cap: string().min(1),
|
|
15784
|
+
method: string().min(1),
|
|
15785
|
+
/** Values may carry `{{vars.x}}` slots, or be exactly `{ $var: 'name' }`, which
|
|
15786
|
+
* SUBSTITUTE and do not evaluate (§3.2.3). Anything beyond substitution is
|
|
15787
|
+
* the expression leaf. */
|
|
15788
|
+
args: record(string(), unknown()).optional()
|
|
15789
|
+
});
|
|
15790
|
+
/**
|
|
15791
|
+
* The steps an internal Action may contain: cap and wait, and nothing that can
|
|
15792
|
+
* call back into an Action — so an Action can never reach itself (no cycles).
|
|
15793
|
+
*/
|
|
15794
|
+
var ActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
|
|
15543
15795
|
var AutomationActionSchema = discriminatedUnion("kind", [
|
|
15796
|
+
AutomationWaitStepSchema,
|
|
15797
|
+
AutomationCapStepSchema,
|
|
15544
15798
|
object({
|
|
15545
|
-
kind: literal("
|
|
15546
|
-
|
|
15547
|
-
|
|
15548
|
-
|
|
15549
|
-
|
|
15550
|
-
|
|
15551
|
-
|
|
15552
|
-
|
|
15553
|
-
|
|
15554
|
-
*/
|
|
15555
|
-
deviceId: union([
|
|
15556
|
-
number().int(),
|
|
15557
|
-
array(number().int()).min(1),
|
|
15558
|
-
object({ $var: string().min(1) })
|
|
15559
|
-
]),
|
|
15560
|
-
cap: string().min(1),
|
|
15561
|
-
method: string().min(1),
|
|
15562
|
-
/** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
|
|
15563
|
-
* evaluate (§3.2.3). Anything beyond substitution is the expression leaf. */
|
|
15564
|
-
args: record(string(), unknown()).optional()
|
|
15799
|
+
kind: literal("action"),
|
|
15800
|
+
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
15801
|
+
actionId: string().min(1),
|
|
15802
|
+
/** Values for the action's declared variables; the others take their default. */
|
|
15803
|
+
variables: record(string(), union([
|
|
15804
|
+
string(),
|
|
15805
|
+
number(),
|
|
15806
|
+
boolean()
|
|
15807
|
+
])).optional()
|
|
15565
15808
|
}),
|
|
15566
15809
|
object({
|
|
15567
15810
|
kind: literal("code"),
|
|
@@ -15570,10 +15813,357 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
15570
15813
|
code: string().min(1).max(2e4)
|
|
15571
15814
|
})
|
|
15572
15815
|
]);
|
|
15816
|
+
/**
|
|
15817
|
+
* How a trigger that arrives while the automation is busy (or cooling down) is
|
|
15818
|
+
* handled. One of the automation's execution modes, never a property of its
|
|
15819
|
+
* actions. Absent means `single`.
|
|
15820
|
+
*
|
|
15821
|
+
* - `single` — drop the trigger while a run is in progress (traced + logged).
|
|
15822
|
+
* - `restart` — abort the run in progress (at its next step boundary), start fresh.
|
|
15823
|
+
* - `queued` — queue up to `max` triggers, drop the rest (traced).
|
|
15824
|
+
* - `parallel` — up to `max` runs at once, drop the rest (traced).
|
|
15825
|
+
* - `cooldown` — `single`, and no new run until `minutes` after the last run
|
|
15826
|
+
* STARTED; persisted across a restart. A manual trigger bypasses only this
|
|
15827
|
+
* wait, never the single/queued limits.
|
|
15828
|
+
*/
|
|
15829
|
+
var AutomationRunModeSchema = discriminatedUnion("mode", [
|
|
15830
|
+
object({ mode: literal("single") }),
|
|
15831
|
+
object({ mode: literal("restart") }),
|
|
15832
|
+
object({
|
|
15833
|
+
mode: literal("queued"),
|
|
15834
|
+
max: number().int().min(1).max(10)
|
|
15835
|
+
}),
|
|
15836
|
+
object({
|
|
15837
|
+
mode: literal("parallel"),
|
|
15838
|
+
max: number().int().min(1).max(10)
|
|
15839
|
+
}),
|
|
15840
|
+
object({
|
|
15841
|
+
mode: literal("cooldown"),
|
|
15842
|
+
minutes: number().int().min(1).max(1440)
|
|
15843
|
+
})
|
|
15844
|
+
]);
|
|
15573
15845
|
var AutomationRecipeSchema = object({
|
|
15574
15846
|
triggers: array(AutomationTriggerSchema),
|
|
15575
15847
|
conditions: AutomationConditionSchema.optional(),
|
|
15576
|
-
actions: array(AutomationActionSchema)
|
|
15848
|
+
actions: array(AutomationActionSchema),
|
|
15849
|
+
runMode: AutomationRunModeSchema.optional(),
|
|
15850
|
+
/** How many run traces the automation keeps (default {@link DEFAULT_TRACE_KEEP}). */
|
|
15851
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
15852
|
+
});
|
|
15853
|
+
new Set([
|
|
15854
|
+
{
|
|
15855
|
+
id: "person",
|
|
15856
|
+
name: "Person"
|
|
15857
|
+
},
|
|
15858
|
+
{
|
|
15859
|
+
id: "vehicle",
|
|
15860
|
+
name: "Vehicle"
|
|
15861
|
+
},
|
|
15862
|
+
{
|
|
15863
|
+
id: "animal",
|
|
15864
|
+
name: "Animal"
|
|
15865
|
+
},
|
|
15866
|
+
{
|
|
15867
|
+
id: "package",
|
|
15868
|
+
name: "Package"
|
|
15869
|
+
}
|
|
15870
|
+
].map((l) => l.id));
|
|
15871
|
+
var COCO_TO_MACRO = {
|
|
15872
|
+
mapping: {
|
|
15873
|
+
person: "person",
|
|
15874
|
+
bicycle: "vehicle",
|
|
15875
|
+
car: "vehicle",
|
|
15876
|
+
motorcycle: "vehicle",
|
|
15877
|
+
airplane: "vehicle",
|
|
15878
|
+
bus: "vehicle",
|
|
15879
|
+
train: "vehicle",
|
|
15880
|
+
truck: "vehicle",
|
|
15881
|
+
boat: "vehicle",
|
|
15882
|
+
bird: "animal",
|
|
15883
|
+
cat: "animal",
|
|
15884
|
+
dog: "animal",
|
|
15885
|
+
horse: "animal",
|
|
15886
|
+
sheep: "animal",
|
|
15887
|
+
cow: "animal",
|
|
15888
|
+
elephant: "animal",
|
|
15889
|
+
bear: "animal",
|
|
15890
|
+
zebra: "animal",
|
|
15891
|
+
giraffe: "animal",
|
|
15892
|
+
suitcase: "package",
|
|
15893
|
+
backpack: "package",
|
|
15894
|
+
handbag: "package"
|
|
15895
|
+
},
|
|
15896
|
+
preserveOriginal: false
|
|
15897
|
+
};
|
|
15898
|
+
new Set(Object.values(COCO_TO_MACRO.mapping));
|
|
15899
|
+
/**
|
|
15900
|
+
* Run traces — what an automation (or, later, an Action run) DID, node by node,
|
|
15901
|
+
* so the editor can paint every block green or red with its reason.
|
|
15902
|
+
*
|
|
15903
|
+
* A trace is data, not a log: it covers the WHOLE tree — the trigger stage,
|
|
15904
|
+
* every condition node (containers and leaves, including the ones a
|
|
15905
|
+
* short-circuit never reached), the run-mode verdict and every action step —
|
|
15906
|
+
* each addressed by a stable path (`conditions.0.1`, `actions.2`, or `steps.N`
|
|
15907
|
+
* for an Action run). Skipped
|
|
15908
|
+
* evaluations are traced too, and identical consecutive skips collapse into a
|
|
15909
|
+
* repeat count so a trigger that fails every 5 minutes cannot flush real runs.
|
|
15910
|
+
*
|
|
15911
|
+
* {@link AutomationStepTraceSchema} is deliberately free of automation
|
|
15912
|
+
* vocabulary so an Action run records the same step shape.
|
|
15913
|
+
*/
|
|
15914
|
+
/** A value a trace may show: JSON primitives and short lists, nothing deeper. */
|
|
15915
|
+
var TraceValueSchema = union([
|
|
15916
|
+
string(),
|
|
15917
|
+
number(),
|
|
15918
|
+
boolean(),
|
|
15919
|
+
_null(),
|
|
15920
|
+
array(union([string(), number()]))
|
|
15921
|
+
]);
|
|
15922
|
+
var AutomationRunOutcomeSchema = _enum([
|
|
15923
|
+
"ran",
|
|
15924
|
+
"skipped-trigger",
|
|
15925
|
+
"skipped-conditions",
|
|
15926
|
+
"skipped-cooldown",
|
|
15927
|
+
"skipped-overlap",
|
|
15928
|
+
"failed",
|
|
15929
|
+
"aborted"
|
|
15930
|
+
]);
|
|
15931
|
+
/** `not-evaluated` = a short-circuit never reached the node. */
|
|
15932
|
+
var TraceNodeOutcomeSchema = _enum([
|
|
15933
|
+
"pass",
|
|
15934
|
+
"fail",
|
|
15935
|
+
"not-evaluated"
|
|
15936
|
+
]);
|
|
15937
|
+
var AutomationTriggerTraceSchema = object({
|
|
15938
|
+
kind: string().min(1),
|
|
15939
|
+
outcome: _enum(["pass", "fail"]),
|
|
15940
|
+
/** Why an event was rejected ("class person not in [dog]") or what fired. */
|
|
15941
|
+
reason: string(),
|
|
15942
|
+
/** deviceId, className, trackId, score … — only what the trigger exposes. */
|
|
15943
|
+
vars: record(string(), TraceValueSchema)
|
|
15944
|
+
});
|
|
15945
|
+
var AutomationConditionTraceNodeSchema = object({
|
|
15946
|
+
/** `conditions` for the root, `conditions.<i>` for its i-th child, … */
|
|
15947
|
+
path: string().min(1),
|
|
15948
|
+
kind: _enum([
|
|
15949
|
+
"all",
|
|
15950
|
+
"any",
|
|
15951
|
+
"not",
|
|
15952
|
+
"condition",
|
|
15953
|
+
"expression",
|
|
15954
|
+
"stationary-present"
|
|
15955
|
+
]),
|
|
15956
|
+
outcome: TraceNodeOutcomeSchema,
|
|
15957
|
+
reason: string(),
|
|
15958
|
+
deviceId: number().int().optional(),
|
|
15959
|
+
cap: string().optional(),
|
|
15960
|
+
fieldPath: string().optional(),
|
|
15961
|
+
operator: string().optional(),
|
|
15962
|
+
expected: TraceValueSchema.optional(),
|
|
15963
|
+
/** What the mirror held; `null` when it held nothing (unknown). */
|
|
15964
|
+
observed: TraceValueSchema.optional()
|
|
15965
|
+
});
|
|
15966
|
+
var AutomationRunVerdictSchema = object({
|
|
15967
|
+
mode: AutomationRunModeSchema,
|
|
15968
|
+
decision: _enum([
|
|
15969
|
+
"run",
|
|
15970
|
+
"queued",
|
|
15971
|
+
"restart",
|
|
15972
|
+
"drop",
|
|
15973
|
+
"cooldown",
|
|
15974
|
+
"bypass"
|
|
15975
|
+
]),
|
|
15976
|
+
reason: string()
|
|
15977
|
+
});
|
|
15978
|
+
/** One executed (or not-run) step — shared by automations and Action runs. */
|
|
15979
|
+
var AutomationStepTraceSchema = object({
|
|
15980
|
+
/** `actions.<i>` */
|
|
15981
|
+
path: string().min(1),
|
|
15982
|
+
kind: string().min(1),
|
|
15983
|
+
cap: string().optional(),
|
|
15984
|
+
method: string().optional(),
|
|
15985
|
+
deviceId: number().int().optional(),
|
|
15986
|
+
startedAt: number().optional(),
|
|
15987
|
+
endedAt: number().optional(),
|
|
15988
|
+
outcome: _enum([
|
|
15989
|
+
"ok",
|
|
15990
|
+
"error",
|
|
15991
|
+
"not-run"
|
|
15992
|
+
]),
|
|
15993
|
+
message: string().optional()
|
|
15994
|
+
});
|
|
15995
|
+
var AutomationRunTraceSchema = object({
|
|
15996
|
+
runId: string().min(1),
|
|
15997
|
+
startedAt: number(),
|
|
15998
|
+
endedAt: number(),
|
|
15999
|
+
trigger: AutomationTriggerTraceSchema,
|
|
16000
|
+
conditions: array(AutomationConditionTraceNodeSchema),
|
|
16001
|
+
verdict: AutomationRunVerdictSchema.optional(),
|
|
16002
|
+
steps: array(AutomationStepTraceSchema),
|
|
16003
|
+
outcome: AutomationRunOutcomeSchema,
|
|
16004
|
+
/** How many identical consecutive skips this trace stands for (>= 1). */
|
|
16005
|
+
repeat: number().int().min(1),
|
|
16006
|
+
/** When the latest of those repeats happened. */
|
|
16007
|
+
lastAt: number()
|
|
16008
|
+
});
|
|
16009
|
+
/**
|
|
16010
|
+
* What the hub's `runs` ledger holds for one owner (`automation:<blockId>` or
|
|
16011
|
+
* `action:<actionId>`): the cooldown stamp and the trace ring.
|
|
16012
|
+
*/
|
|
16013
|
+
var AutomationStateDocSchema = object({
|
|
16014
|
+
version: literal(1),
|
|
16015
|
+
lastRunStartedAt: number().nullable(),
|
|
16016
|
+
traces: array(AutomationRunTraceSchema)
|
|
16017
|
+
});
|
|
16018
|
+
/**
|
|
16019
|
+
* Actions — named, runnable things an operator (or an automation) can start,
|
|
16020
|
+
* declared as LIST ENTRIES, never as devices.
|
|
16021
|
+
*
|
|
16022
|
+
* An entry is either **internal** (a short list of cap/wait steps kept in the
|
|
16023
|
+
* hub's `actions` record kind) or declared by an addon through the
|
|
16024
|
+
* `action-source` collection (a Home Assistant script, a scene …). The one
|
|
16025
|
+
* surface the UI and automations talk to is the `actions` cap; it keeps no
|
|
16026
|
+
* catalog of its own (D3) — every `list` asks the providers live.
|
|
16027
|
+
*
|
|
16028
|
+
* This file is the data half: the entry schema, the variables an entry may
|
|
16029
|
+
* declare, and the pure resolution of the values a run was given. It holds no
|
|
16030
|
+
* runtime.
|
|
16031
|
+
*/
|
|
16032
|
+
/** What a variable's value is. `select` takes one of `options`. */
|
|
16033
|
+
var ActionVariableTypeSchema = _enum([
|
|
16034
|
+
"string",
|
|
16035
|
+
"number",
|
|
16036
|
+
"boolean",
|
|
16037
|
+
"select"
|
|
16038
|
+
]);
|
|
16039
|
+
var ACTION_VARIABLE_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
16040
|
+
var ActionVariableValueSchema = union([
|
|
16041
|
+
string(),
|
|
16042
|
+
number(),
|
|
16043
|
+
boolean()
|
|
16044
|
+
]);
|
|
16045
|
+
/**
|
|
16046
|
+
* One declared variable. Steps reference it as `{ $var: 'name' }` (the whole
|
|
16047
|
+
* value) or `{{vars.name}}` (inside a string) in their args.
|
|
16048
|
+
*/
|
|
16049
|
+
var ActionVariableSchema = object({
|
|
16050
|
+
name: string().regex(ACTION_VARIABLE_NAME_RE),
|
|
16051
|
+
label: string().min(1).max(120).optional(),
|
|
16052
|
+
type: ActionVariableTypeSchema,
|
|
16053
|
+
required: boolean().optional(),
|
|
16054
|
+
default: ActionVariableValueSchema.optional(),
|
|
16055
|
+
/** The allowed values of a `select`. */
|
|
16056
|
+
options: array(string().min(1)).min(1).optional()
|
|
16057
|
+
}).superRefine((v, ctx) => {
|
|
16058
|
+
if (v.type === "select" && v.options === void 0) ctx.addIssue({
|
|
16059
|
+
code: "custom",
|
|
16060
|
+
message: "a select variable needs options",
|
|
16061
|
+
path: ["options"]
|
|
16062
|
+
});
|
|
16063
|
+
if (v.default !== void 0 && variableValueError(v, v.default) !== null) ctx.addIssue({
|
|
16064
|
+
code: "custom",
|
|
16065
|
+
message: variableValueError(v, v.default) ?? "invalid default",
|
|
16066
|
+
path: ["default"]
|
|
16067
|
+
});
|
|
16068
|
+
});
|
|
16069
|
+
/** Why `value` is not a legal value for the variable, or null when it is. */
|
|
16070
|
+
function variableValueError(variable, value) {
|
|
16071
|
+
switch (variable.type) {
|
|
16072
|
+
case "string": return typeof value === "string" ? null : `variable "${variable.name}" must be a string`;
|
|
16073
|
+
case "number": return typeof value === "number" && Number.isFinite(value) ? null : `variable "${variable.name}" must be a number`;
|
|
16074
|
+
case "boolean": return typeof value === "boolean" ? null : `variable "${variable.name}" must be true or false`;
|
|
16075
|
+
case "select": return typeof value === "string" && (variable.options ?? []).includes(value) ? null : `variable "${variable.name}" must be one of ${(variable.options ?? []).join(", ")}`;
|
|
16076
|
+
}
|
|
16077
|
+
}
|
|
16078
|
+
var ActionSourceKindSchema = _enum(["internal", "addon"]);
|
|
16079
|
+
function isInternalActionId(actionId) {
|
|
16080
|
+
return actionId.startsWith("internal:") && actionId.length > 9;
|
|
16081
|
+
}
|
|
16082
|
+
/** The addon behind a `<addonId>:<localId>` id, or null for anything else (internal included). */
|
|
16083
|
+
function addonIdOfActionId(actionId) {
|
|
16084
|
+
if (isInternalActionId(actionId)) return null;
|
|
16085
|
+
const at = actionId.indexOf(":");
|
|
16086
|
+
return at > 0 && at < actionId.length - 1 ? actionId.slice(0, at) : null;
|
|
16087
|
+
}
|
|
16088
|
+
var ActionStatusSchema = object({
|
|
16089
|
+
isRunning: boolean(),
|
|
16090
|
+
/** Ms epoch the latest run STARTED; null when it never ran. */
|
|
16091
|
+
lastRunAt: number().nullable(),
|
|
16092
|
+
/** The latest run's failure; null on success or when it never ran. */
|
|
16093
|
+
lastError: string().nullable()
|
|
16094
|
+
});
|
|
16095
|
+
var ActionEntrySchema = object({
|
|
16096
|
+
/** `internal:<uuid>` or `<addonId>:<localId>`. */
|
|
16097
|
+
id: string().min(3),
|
|
16098
|
+
name: string().min(1).max(120),
|
|
16099
|
+
/** The addon that declared it; `core-blocks` for an internal one. */
|
|
16100
|
+
addonId: string().min(1),
|
|
16101
|
+
source: ActionSourceKindSchema,
|
|
16102
|
+
/** An addon-declared entry is edited where it was declared. */
|
|
16103
|
+
readOnly: boolean(),
|
|
16104
|
+
/** Internal only: cap and wait steps. No action-in-action, so no cycles. */
|
|
16105
|
+
steps: array(ActionStepSchema).min(1).max(50).optional(),
|
|
16106
|
+
variables: array(ActionVariableSchema).max(20).optional(),
|
|
16107
|
+
status: ActionStatusSchema
|
|
16108
|
+
}).superRefine((entry, ctx) => {
|
|
16109
|
+
if (entry.source === "internal") {
|
|
16110
|
+
if (!isInternalActionId(entry.id)) ctx.addIssue({
|
|
16111
|
+
code: "custom",
|
|
16112
|
+
message: "an internal action id is internal:<uuid>",
|
|
16113
|
+
path: ["id"]
|
|
16114
|
+
});
|
|
16115
|
+
return;
|
|
16116
|
+
}
|
|
16117
|
+
if (entry.steps !== void 0) ctx.addIssue({
|
|
16118
|
+
code: "custom",
|
|
16119
|
+
message: "only an internal action carries steps",
|
|
16120
|
+
path: ["steps"]
|
|
16121
|
+
});
|
|
16122
|
+
if (!entry.readOnly) ctx.addIssue({
|
|
16123
|
+
code: "custom",
|
|
16124
|
+
message: "an addon action is read-only here",
|
|
16125
|
+
path: ["readOnly"]
|
|
16126
|
+
});
|
|
16127
|
+
if (addonIdOfActionId(entry.id) === null) ctx.addIssue({
|
|
16128
|
+
code: "custom",
|
|
16129
|
+
message: "an addon action id is <addonId>:<localId>",
|
|
16130
|
+
path: ["id"]
|
|
16131
|
+
});
|
|
16132
|
+
});
|
|
16133
|
+
/** What an operator writes for an internal action. */
|
|
16134
|
+
var ActionInputSchema = object({
|
|
16135
|
+
name: string().min(1).max(120),
|
|
16136
|
+
steps: array(ActionStepSchema).min(1).max(50),
|
|
16137
|
+
variables: array(ActionVariableSchema).max(20).optional()
|
|
16138
|
+
});
|
|
16139
|
+
/** Who started a run. Absent = the operator pressed it. */
|
|
16140
|
+
var ActionRunOriginSchema = object({
|
|
16141
|
+
/** The automation block whose step started it. */
|
|
16142
|
+
blockId: string().min(1).optional() });
|
|
16143
|
+
/** `started` = the caller did not ask to wait. */
|
|
16144
|
+
var ActionRunOutcomeSchema = union([AutomationRunOutcomeSchema, literal("started")]);
|
|
16145
|
+
var ActionRunResultSchema = object({
|
|
16146
|
+
runId: string().min(1),
|
|
16147
|
+
outcome: ActionRunOutcomeSchema,
|
|
16148
|
+
/** Why it did not run, or what failed. */
|
|
16149
|
+
message: string().optional()
|
|
16150
|
+
});
|
|
16151
|
+
_enum([
|
|
16152
|
+
"not-found",
|
|
16153
|
+
"read-only",
|
|
16154
|
+
"invalid-variables",
|
|
16155
|
+
"invalid-steps",
|
|
16156
|
+
"not-linked",
|
|
16157
|
+
"busy"
|
|
16158
|
+
]);
|
|
16159
|
+
object({
|
|
16160
|
+
actionId: string(),
|
|
16161
|
+
runId: string(),
|
|
16162
|
+
isRunning: boolean(),
|
|
16163
|
+
/** Set when the run ended. */
|
|
16164
|
+
outcome: AutomationRunOutcomeSchema.optional(),
|
|
16165
|
+
lastRunAt: number().nullable(),
|
|
16166
|
+
lastError: string().nullable()
|
|
15577
16167
|
});
|
|
15578
16168
|
/**
|
|
15579
16169
|
* `addon-pages` — system-scoped singleton aggregator cap. Public-facing
|
|
@@ -17187,7 +17777,22 @@ var BrokerProviderInfoSchema = object({
|
|
|
17187
17777
|
*/
|
|
17188
17778
|
interactiveConnectPath: string().min(1).optional(),
|
|
17189
17779
|
/** Relative hub path to disconnect the linked account (same popup pattern). */
|
|
17190
|
-
interactiveDisconnectPath: string().min(1).optional()
|
|
17780
|
+
interactiveDisconnectPath: string().min(1).optional(),
|
|
17781
|
+
/**
|
|
17782
|
+
* The kind signs in through a server-held interactive session instead of
|
|
17783
|
+
* (or before) typed credentials. `basePath` is a hub-relative route set
|
|
17784
|
+
* served by the owning addon (`/addon/<id>/...`) speaking the sign-in
|
|
17785
|
+
* contract: `POST {basePath}/start` (body: the form's settings) answers
|
|
17786
|
+
* `{ sessionId, loginUrl }`; `GET {basePath}/status?sessionId=` answers
|
|
17787
|
+
* `{ phase: 'starting' | 'awaiting-login' | 'captured' | 'error' |
|
|
17788
|
+
* 'cancelled', loginUrl, error }`; `POST {basePath}/commit`
|
|
17789
|
+
* (`{ sessionId, name, brokerId? }`) stores the credentials on a new or
|
|
17790
|
+
* existing broker and answers `{ brokerId }`; `POST {basePath}/cancel`
|
|
17791
|
+
* (`{ sessionId }`) drops the session. The dialog that edits a broker
|
|
17792
|
+
* offers it as the default path; the fields the session fills are
|
|
17793
|
+
* marked `filledBySignIn` in the kind's settings schema.
|
|
17794
|
+
*/
|
|
17795
|
+
signIn: object({ basePath: string().min(1) }).optional()
|
|
17191
17796
|
}))
|
|
17192
17797
|
});
|
|
17193
17798
|
var ListInputSchema = object({
|
|
@@ -18158,7 +18763,7 @@ var CompositionEventPlanSchema = object({
|
|
|
18158
18763
|
stateField: string(),
|
|
18159
18764
|
fieldKey: string()
|
|
18160
18765
|
});
|
|
18161
|
-
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.
|
|
18766
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
|
|
18162
18767
|
var CompositionProblemSchema = object({
|
|
18163
18768
|
code: _enum([
|
|
18164
18769
|
"reserved-variant",
|
|
@@ -18186,7 +18791,8 @@ var CompositionProblemSchema = object({
|
|
|
18186
18791
|
"native-capability-replace",
|
|
18187
18792
|
"mixed-quantity",
|
|
18188
18793
|
"helper-mismatch",
|
|
18189
|
-
"member-constraint"
|
|
18794
|
+
"member-constraint",
|
|
18795
|
+
"retention"
|
|
18190
18796
|
]),
|
|
18191
18797
|
path: string(),
|
|
18192
18798
|
message: string()
|
|
@@ -18420,13 +19026,17 @@ Object.freeze({
|
|
|
18420
19026
|
latchedAt: {
|
|
18421
19027
|
kind: "fixed",
|
|
18422
19028
|
result: ["number", "null"]
|
|
19029
|
+
},
|
|
19030
|
+
schmitt: {
|
|
19031
|
+
kind: "fixed",
|
|
19032
|
+
result: ["boolean", "null"]
|
|
18423
19033
|
}
|
|
18424
19034
|
});
|
|
18425
19035
|
/**
|
|
18426
19036
|
* One catalog row per base reading a group helper can build (D944 §3).
|
|
18427
19037
|
* Data, not a form default written into the block.
|
|
18428
19038
|
*/
|
|
18429
|
-
var NOW = {
|
|
19039
|
+
var NOW$2 = {
|
|
18430
19040
|
fieldPath: "lastFetchedAt",
|
|
18431
19041
|
expr: "now"
|
|
18432
19042
|
};
|
|
@@ -18440,6 +19050,8 @@ function numeric(input) {
|
|
|
18440
19050
|
family: "numeric",
|
|
18441
19051
|
deviceType: DeviceType.Sensor,
|
|
18442
19052
|
memberDeviceType: DeviceType.Sensor,
|
|
19053
|
+
memberDeviceTypes: [DeviceType.Sensor],
|
|
19054
|
+
activeWhen: void 0,
|
|
18443
19055
|
commandCaps: [],
|
|
18444
19056
|
baseUnit: baseUnitOf(input.quantity),
|
|
18445
19057
|
aggregates: NUMERIC_AGGREGATES,
|
|
@@ -18455,6 +19067,8 @@ function binary(input) {
|
|
|
18455
19067
|
family: "binary",
|
|
18456
19068
|
deviceType: DeviceType.Sensor,
|
|
18457
19069
|
memberDeviceType: DeviceType.Sensor,
|
|
19070
|
+
memberDeviceTypes: [DeviceType.Sensor],
|
|
19071
|
+
activeWhen: void 0,
|
|
18458
19072
|
commandCaps: [],
|
|
18459
19073
|
quantity: "none",
|
|
18460
19074
|
baseUnit: void 0,
|
|
@@ -18468,73 +19082,73 @@ var GROUP_TEMPLATES = [
|
|
|
18468
19082
|
summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
|
|
18469
19083
|
role: DeviceRole.TemperatureSensor,
|
|
18470
19084
|
outputCap: "temperature-sensor",
|
|
18471
|
-
outputField: "
|
|
19085
|
+
outputField: "temperature",
|
|
18472
19086
|
quantity: "temperature",
|
|
18473
19087
|
defaultAggregate: "mean",
|
|
18474
19088
|
empty: "null",
|
|
18475
|
-
companions: [NOW]
|
|
19089
|
+
companions: [NOW$2]
|
|
18476
19090
|
}),
|
|
18477
19091
|
numeric({
|
|
18478
19092
|
id: "humidity",
|
|
18479
19093
|
summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
18480
19094
|
role: DeviceRole.HumiditySensor,
|
|
18481
19095
|
outputCap: "humidity-sensor",
|
|
18482
|
-
outputField: "
|
|
19096
|
+
outputField: "humidity",
|
|
18483
19097
|
quantity: "humidity",
|
|
18484
19098
|
defaultAggregate: "mean",
|
|
18485
19099
|
empty: "null",
|
|
18486
|
-
companions: [NOW]
|
|
19100
|
+
companions: [NOW$2]
|
|
18487
19101
|
}),
|
|
18488
19102
|
numeric({
|
|
18489
19103
|
id: "pressure",
|
|
18490
19104
|
summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
|
|
18491
19105
|
role: DeviceRole.PressureSensor,
|
|
18492
19106
|
outputCap: "pressure-sensor",
|
|
18493
|
-
outputField: "
|
|
19107
|
+
outputField: "pressure",
|
|
18494
19108
|
quantity: "pressure",
|
|
18495
19109
|
defaultAggregate: "mean",
|
|
18496
19110
|
empty: "null",
|
|
18497
|
-
companions: [NOW]
|
|
19111
|
+
companions: [NOW$2]
|
|
18498
19112
|
}),
|
|
18499
19113
|
numeric({
|
|
18500
19114
|
id: "illuminance",
|
|
18501
19115
|
summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
|
|
18502
19116
|
role: DeviceRole.AmbientLightSensor,
|
|
18503
19117
|
outputCap: "ambient-light-sensor",
|
|
18504
|
-
outputField: "
|
|
19118
|
+
outputField: "illuminance",
|
|
18505
19119
|
quantity: "illuminance",
|
|
18506
19120
|
defaultAggregate: "mean",
|
|
18507
19121
|
empty: "null",
|
|
18508
|
-
companions: [NOW]
|
|
19122
|
+
companions: [NOW$2]
|
|
18509
19123
|
}),
|
|
18510
19124
|
numeric({
|
|
18511
19125
|
id: "power",
|
|
18512
19126
|
summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
|
|
18513
19127
|
role: DeviceRole.PowerSensor,
|
|
18514
19128
|
outputCap: "power-meter",
|
|
18515
|
-
outputField: "
|
|
19129
|
+
outputField: "power",
|
|
18516
19130
|
quantity: "power",
|
|
18517
19131
|
defaultAggregate: "sum",
|
|
18518
19132
|
empty: "omit",
|
|
18519
|
-
companions: [NOW]
|
|
19133
|
+
companions: [NOW$2]
|
|
18520
19134
|
}),
|
|
18521
19135
|
numeric({
|
|
18522
19136
|
id: "energy",
|
|
18523
19137
|
summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
|
|
18524
19138
|
role: DeviceRole.EnergySensor,
|
|
18525
19139
|
outputCap: "power-meter",
|
|
18526
|
-
outputField: "
|
|
19140
|
+
outputField: "energy",
|
|
18527
19141
|
quantity: "energy",
|
|
18528
19142
|
defaultAggregate: "sum",
|
|
18529
19143
|
empty: "omit",
|
|
18530
|
-
companions: [NOW]
|
|
19144
|
+
companions: [NOW$2]
|
|
18531
19145
|
}),
|
|
18532
19146
|
numeric({
|
|
18533
19147
|
id: "battery",
|
|
18534
19148
|
summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
18535
19149
|
role: DeviceRole.BatterySensor,
|
|
18536
19150
|
outputCap: "battery",
|
|
18537
|
-
outputField: "
|
|
19151
|
+
outputField: "level",
|
|
18538
19152
|
quantity: "percentage",
|
|
18539
19153
|
defaultAggregate: "mean",
|
|
18540
19154
|
empty: "null",
|
|
@@ -18562,7 +19176,7 @@ var GROUP_TEMPLATES = [
|
|
|
18562
19176
|
quantity: "device",
|
|
18563
19177
|
defaultAggregate: "mean",
|
|
18564
19178
|
empty: "null",
|
|
18565
|
-
companions: [NOW]
|
|
19179
|
+
companions: [NOW$2]
|
|
18566
19180
|
}),
|
|
18567
19181
|
binary({
|
|
18568
19182
|
id: "motion",
|
|
@@ -18656,6 +19270,11 @@ var GROUP_TEMPLATES = [
|
|
|
18656
19270
|
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.",
|
|
18657
19271
|
deviceType: DeviceType.Switch,
|
|
18658
19272
|
outputCap: "switch",
|
|
19273
|
+
outputField: "on",
|
|
19274
|
+
member: {
|
|
19275
|
+
cap: "switch",
|
|
19276
|
+
fieldPath: "on"
|
|
19277
|
+
},
|
|
18659
19278
|
commandCaps: ["switch"]
|
|
18660
19279
|
}),
|
|
18661
19280
|
actuator({
|
|
@@ -18663,34 +19282,136 @@ var GROUP_TEMPLATES = [
|
|
|
18663
19282
|
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.",
|
|
18664
19283
|
deviceType: DeviceType.Light,
|
|
18665
19284
|
outputCap: "switch",
|
|
19285
|
+
outputField: "on",
|
|
19286
|
+
member: {
|
|
19287
|
+
cap: "switch",
|
|
19288
|
+
fieldPath: "on"
|
|
19289
|
+
},
|
|
18666
19290
|
commandCaps: [
|
|
18667
19291
|
"switch",
|
|
18668
19292
|
"brightness",
|
|
18669
19293
|
"color"
|
|
18670
19294
|
]
|
|
19295
|
+
}),
|
|
19296
|
+
actuator({
|
|
19297
|
+
id: "fan",
|
|
19298
|
+
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.",
|
|
19299
|
+
deviceType: DeviceType.Fan,
|
|
19300
|
+
outputCap: "switch",
|
|
19301
|
+
outputField: "on",
|
|
19302
|
+
member: {
|
|
19303
|
+
cap: "switch",
|
|
19304
|
+
fieldPath: "on"
|
|
19305
|
+
},
|
|
19306
|
+
commandCaps: ["switch", "fan-control"]
|
|
19307
|
+
}),
|
|
19308
|
+
actuator({
|
|
19309
|
+
id: "cover",
|
|
19310
|
+
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.",
|
|
19311
|
+
deviceType: DeviceType.Cover,
|
|
19312
|
+
outputCap: "group-active",
|
|
19313
|
+
outputField: "active",
|
|
19314
|
+
member: {
|
|
19315
|
+
cap: "cover",
|
|
19316
|
+
fieldPath: "state"
|
|
19317
|
+
},
|
|
19318
|
+
activeWhen: [
|
|
19319
|
+
"open",
|
|
19320
|
+
"opening",
|
|
19321
|
+
"stopped"
|
|
19322
|
+
],
|
|
19323
|
+
commandCaps: ["cover"]
|
|
19324
|
+
}),
|
|
19325
|
+
actuator({
|
|
19326
|
+
id: "valve",
|
|
19327
|
+
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.",
|
|
19328
|
+
deviceType: DeviceType.Valve,
|
|
19329
|
+
outputCap: "group-active",
|
|
19330
|
+
outputField: "active",
|
|
19331
|
+
member: {
|
|
19332
|
+
cap: "valve",
|
|
19333
|
+
fieldPath: "state"
|
|
19334
|
+
},
|
|
19335
|
+
activeWhen: [
|
|
19336
|
+
"open",
|
|
19337
|
+
"opening",
|
|
19338
|
+
"stopped"
|
|
19339
|
+
],
|
|
19340
|
+
commandCaps: ["valve"]
|
|
19341
|
+
}),
|
|
19342
|
+
actuator({
|
|
19343
|
+
id: "lock",
|
|
19344
|
+
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.",
|
|
19345
|
+
deviceType: DeviceType.Lock,
|
|
19346
|
+
outputCap: "group-active",
|
|
19347
|
+
outputField: "active",
|
|
19348
|
+
member: {
|
|
19349
|
+
cap: "lock-control",
|
|
19350
|
+
fieldPath: "state"
|
|
19351
|
+
},
|
|
19352
|
+
activeWhen: ["locked"],
|
|
19353
|
+
commandCaps: ["lock-control"]
|
|
19354
|
+
}),
|
|
19355
|
+
actuator({
|
|
19356
|
+
id: "media-player",
|
|
19357
|
+
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.",
|
|
19358
|
+
deviceType: DeviceType.MediaPlayer,
|
|
19359
|
+
outputCap: "group-active",
|
|
19360
|
+
outputField: "active",
|
|
19361
|
+
member: {
|
|
19362
|
+
cap: "media-player",
|
|
19363
|
+
fieldPath: "state"
|
|
19364
|
+
},
|
|
19365
|
+
activeWhen: ["playing", "buffering"],
|
|
19366
|
+
commandCaps: ["media-player"]
|
|
19367
|
+
}),
|
|
19368
|
+
actuator({
|
|
19369
|
+
id: "climate",
|
|
19370
|
+
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.",
|
|
19371
|
+
deviceType: DeviceType.Thermostat,
|
|
19372
|
+
memberDeviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
|
|
19373
|
+
outputCap: "group-active",
|
|
19374
|
+
outputField: "active",
|
|
19375
|
+
member: {
|
|
19376
|
+
cap: "climate-control",
|
|
19377
|
+
fieldPath: "mode"
|
|
19378
|
+
},
|
|
19379
|
+
activeWhen: [
|
|
19380
|
+
"heat",
|
|
19381
|
+
"cool",
|
|
19382
|
+
"auto",
|
|
19383
|
+
"heat_cool",
|
|
19384
|
+
"fan_only",
|
|
19385
|
+
"dry"
|
|
19386
|
+
],
|
|
19387
|
+
commandCaps: ["climate-control"]
|
|
18671
19388
|
})
|
|
18672
19389
|
];
|
|
18673
19390
|
function actuator(input) {
|
|
18674
19391
|
return {
|
|
18675
|
-
|
|
19392
|
+
id: input.id,
|
|
19393
|
+
summary: input.summary,
|
|
19394
|
+
deviceType: input.deviceType,
|
|
19395
|
+
outputCap: input.outputCap,
|
|
19396
|
+
outputField: input.outputField,
|
|
19397
|
+
commandCaps: input.commandCaps,
|
|
18676
19398
|
family: "actuator",
|
|
18677
19399
|
role: void 0,
|
|
18678
19400
|
memberDeviceType: input.deviceType,
|
|
18679
|
-
|
|
19401
|
+
memberDeviceTypes: input.memberDeviceTypes ?? [input.deviceType],
|
|
19402
|
+
activeWhen: input.activeWhen,
|
|
18680
19403
|
quantity: "none",
|
|
18681
19404
|
baseUnit: void 0,
|
|
18682
19405
|
aggregates: BINARY_AGGREGATES,
|
|
18683
19406
|
defaultAggregate: "any",
|
|
18684
19407
|
empty: "offline",
|
|
18685
|
-
accept: [
|
|
18686
|
-
cap: "switch",
|
|
18687
|
-
fieldPath: "on"
|
|
18688
|
-
}],
|
|
19408
|
+
accept: [input.member],
|
|
18689
19409
|
companions: [CHANGED]
|
|
18690
19410
|
};
|
|
18691
19411
|
}
|
|
18692
19412
|
new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
|
|
18693
19413
|
DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
|
|
19414
|
+
DeviceType.Camera;
|
|
18694
19415
|
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
18695
19416
|
/**
|
|
18696
19417
|
* What a composition may BUILD on a device type (G2, D676): the caps a new
|
|
@@ -19005,7 +19726,18 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
19005
19726
|
kind: "mutation",
|
|
19006
19727
|
auth: "admin",
|
|
19007
19728
|
access: "view"
|
|
19008
|
-
})
|
|
19729
|
+
}), method(object({
|
|
19730
|
+
blockId: string().min(1),
|
|
19731
|
+
trace: AutomationRunTraceSchema.optional(),
|
|
19732
|
+
runStartedAt: number().optional(),
|
|
19733
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
19734
|
+
}), _void(), {
|
|
19735
|
+
kind: "mutation",
|
|
19736
|
+
auth: "admin"
|
|
19737
|
+
}), method(object({ blockId: string().min(1) }), AutomationStateDocSchema, { auth: "admin" }), method(object({ blockId: string().min(1) }), object({
|
|
19738
|
+
traces: array(AutomationRunTraceSchema),
|
|
19739
|
+
lastError: string().nullable()
|
|
19740
|
+
}), { auth: "admin" });
|
|
19009
19741
|
/**
|
|
19010
19742
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
19011
19743
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -43730,7 +44462,7 @@ var NetworkAccessStatusSchema = object({
|
|
|
43730
44462
|
});
|
|
43731
44463
|
/**
|
|
43732
44464
|
* Optional, richer endpoint shape returned by providers that expose
|
|
43733
|
-
* MORE than one ingress concurrently (Tailscale
|
|
44465
|
+
* MORE than one ingress concurrently (Tailscale Funnel with mixed
|
|
43734
44466
|
* serve+funnel rules, future ngrok multi-tunnel, …). Each entry carries
|
|
43735
44467
|
* the originating provider config (mode + sourcePort) so the
|
|
43736
44468
|
* orchestrator UI can label rows distinctly. Providers that expose only
|
|
@@ -44123,51 +44855,6 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
|
|
|
44123
44855
|
kind: "mutation",
|
|
44124
44856
|
auth: "admin"
|
|
44125
44857
|
});
|
|
44126
|
-
new Set([
|
|
44127
|
-
{
|
|
44128
|
-
id: "person",
|
|
44129
|
-
name: "Person"
|
|
44130
|
-
},
|
|
44131
|
-
{
|
|
44132
|
-
id: "vehicle",
|
|
44133
|
-
name: "Vehicle"
|
|
44134
|
-
},
|
|
44135
|
-
{
|
|
44136
|
-
id: "animal",
|
|
44137
|
-
name: "Animal"
|
|
44138
|
-
},
|
|
44139
|
-
{
|
|
44140
|
-
id: "package",
|
|
44141
|
-
name: "Package"
|
|
44142
|
-
}
|
|
44143
|
-
].map((l) => l.id));
|
|
44144
|
-
var COCO_TO_MACRO = {
|
|
44145
|
-
mapping: {
|
|
44146
|
-
person: "person",
|
|
44147
|
-
bicycle: "vehicle",
|
|
44148
|
-
car: "vehicle",
|
|
44149
|
-
motorcycle: "vehicle",
|
|
44150
|
-
airplane: "vehicle",
|
|
44151
|
-
bus: "vehicle",
|
|
44152
|
-
train: "vehicle",
|
|
44153
|
-
truck: "vehicle",
|
|
44154
|
-
boat: "vehicle",
|
|
44155
|
-
bird: "animal",
|
|
44156
|
-
cat: "animal",
|
|
44157
|
-
dog: "animal",
|
|
44158
|
-
horse: "animal",
|
|
44159
|
-
sheep: "animal",
|
|
44160
|
-
cow: "animal",
|
|
44161
|
-
elephant: "animal",
|
|
44162
|
-
bear: "animal",
|
|
44163
|
-
zebra: "animal",
|
|
44164
|
-
giraffe: "animal",
|
|
44165
|
-
suitcase: "package",
|
|
44166
|
-
backpack: "package",
|
|
44167
|
-
handbag: "package"
|
|
44168
|
-
},
|
|
44169
|
-
preserveOriginal: false
|
|
44170
|
-
};
|
|
44171
44858
|
var AUDIO_MACRO_LABELS = [
|
|
44172
44859
|
{
|
|
44173
44860
|
id: "speech",
|
|
@@ -46373,7 +47060,20 @@ var NcRuleInputSchema = object({
|
|
|
46373
47060
|
* save by the hub's grouping guard). `.optional()`, never `.default()`: the addon cap
|
|
46374
47061
|
* path does not run Zod defaults.
|
|
46375
47062
|
*/
|
|
46376
|
-
groupingSec: number().int().min(5).max(60).optional()
|
|
47063
|
+
groupingSec: number().int().min(5).max(60).optional(),
|
|
47064
|
+
/**
|
|
47065
|
+
* ASK ME TO CONFIRM DETECTIONS (#243): a DETECTION notification of this rule
|
|
47066
|
+
* carries "Correct" / "Wrong" buttons (and, where the channel has room, a
|
|
47067
|
+
* "Wrong, it is a <class>" choice). A tap marks the track for retraining, the
|
|
47068
|
+
* same mark the Library writes, and records whose notification it was and
|
|
47069
|
+
* when. A channel with no buttons gets the same two choices as links.
|
|
47070
|
+
*
|
|
47071
|
+
* `.optional()`, never `.default()` (a Zod default does not run on the addon
|
|
47072
|
+
* cap path): absent and `false` both mean off, which is what every rule
|
|
47073
|
+
* authored before this field meant. An editor turns it off by writing
|
|
47074
|
+
* `false`, so it needs no `clear` key.
|
|
47075
|
+
*/
|
|
47076
|
+
askVerdict: boolean().optional()
|
|
46377
47077
|
});
|
|
46378
47078
|
/**
|
|
46379
47079
|
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
@@ -56607,9 +57307,9 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
|
|
|
56607
57307
|
}), LogStreamEntrySchema, { kind: "subscription" });
|
|
56608
57308
|
object({
|
|
56609
57309
|
/** Carbon dioxide concentration in ppm. */
|
|
56610
|
-
|
|
57310
|
+
co2: number().min(0).optional().meta(readingMeta("concentration-volume")),
|
|
56611
57311
|
/** Total volatile organic compounds in ppb. */
|
|
56612
|
-
|
|
57312
|
+
voc: number().min(0).optional().meta(readingMeta("concentration-ppb")),
|
|
56613
57313
|
/** Particulate matter ≤ 2.5 μm in µg/m³. */
|
|
56614
57314
|
pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
|
|
56615
57315
|
/** Particulate matter ≤ 10 μm in µg/m³. */
|
|
@@ -56622,7 +57322,7 @@ object({
|
|
|
56622
57322
|
DeviceType.Sensor;
|
|
56623
57323
|
object({
|
|
56624
57324
|
/** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
|
|
56625
|
-
|
|
57325
|
+
illuminance: number().min(0).nullable().meta(readingMeta("illuminance", {
|
|
56626
57326
|
precision: 0,
|
|
56627
57327
|
label: "Illuminance"
|
|
56628
57328
|
})),
|
|
@@ -56719,6 +57419,84 @@ DeviceType.Camera, method(object({ deviceId: number() }), AudioMetricsSnapshotSc
|
|
|
56719
57419
|
* would produce more than `maxPoints` samples. */
|
|
56720
57420
|
sampleEveryMs: number().int().positive().optional()
|
|
56721
57421
|
}), AudioMetricsHistorySchema);
|
|
57422
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
57423
|
+
actionId: string().min(1),
|
|
57424
|
+
variables: record(string(), ActionVariableValueSchema).optional()
|
|
57425
|
+
}), _void(), {
|
|
57426
|
+
kind: "mutation",
|
|
57427
|
+
auth: "admin"
|
|
57428
|
+
}), method(object({ actionId: string().min(1) }), _void(), {
|
|
57429
|
+
kind: "mutation",
|
|
57430
|
+
auth: "admin"
|
|
57431
|
+
});
|
|
57432
|
+
/**
|
|
57433
|
+
* actions — the ONE surface for runnable actions, for the UI and for
|
|
57434
|
+
* automations. Provided by the core-blocks builtin on the hub.
|
|
57435
|
+
*
|
|
57436
|
+
* An action is a LIST ENTRY, not a device (D883): either internal (cap and wait
|
|
57437
|
+
* steps, kept in the hub's `actions` record kind) or declared by an addon over
|
|
57438
|
+
* `action-source`. `list` asks every `action-source` provider LIVE and overlays
|
|
57439
|
+
* the run status from the hub's `runs` ledger; there is no catalog here to
|
|
57440
|
+
* drift (D3).
|
|
57441
|
+
*
|
|
57442
|
+
* **Permissions follow the camera, as linked devices do.** An action is linked
|
|
57443
|
+
* to cameras by the operator (`setLinks`, D356: nothing links itself). A
|
|
57444
|
+
* non-admin may `get` / `run` an action only through a camera they may see that
|
|
57445
|
+
* links it: they name the camera (`deviceId`, a top-level field so the scope
|
|
57446
|
+
* gate sees it) and the provider refuses an action that camera does not link.
|
|
57447
|
+
* An admin, and an in-process caller (an automation block), may run any action.
|
|
57448
|
+
* Every refusal is typed (`[not-linked] …`) and logged.
|
|
57449
|
+
*
|
|
57450
|
+
* A second `run` of an action that is already running is REFUSED — traced and
|
|
57451
|
+
* logged — never queued.
|
|
57452
|
+
*/
|
|
57453
|
+
var ActionIdInput = object({ actionId: string().min(1) });
|
|
57454
|
+
var ActionLinksSchema = object({
|
|
57455
|
+
deviceId: number().int().nonnegative(),
|
|
57456
|
+
actionIds: array(string().min(1)).max(100)
|
|
57457
|
+
});
|
|
57458
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
57459
|
+
actionId: string().min(1),
|
|
57460
|
+
deviceId: number().int().nonnegative().optional()
|
|
57461
|
+
}), object({ action: ActionEntrySchema.nullable() }), {
|
|
57462
|
+
role: "viewer",
|
|
57463
|
+
auth: "protected",
|
|
57464
|
+
kind: "query",
|
|
57465
|
+
caller: "required"
|
|
57466
|
+
}), method(object({
|
|
57467
|
+
actionId: string().min(1),
|
|
57468
|
+
variables: record(string(), ActionVariableValueSchema).optional(),
|
|
57469
|
+
wait: boolean().optional(),
|
|
57470
|
+
origin: ActionRunOriginSchema.optional(),
|
|
57471
|
+
deviceId: number().int().nonnegative().optional()
|
|
57472
|
+
}), ActionRunResultSchema, {
|
|
57473
|
+
role: "viewer",
|
|
57474
|
+
auth: "protected",
|
|
57475
|
+
kind: "mutation",
|
|
57476
|
+
caller: "required"
|
|
57477
|
+
}), method(ActionIdInput, _void(), {
|
|
57478
|
+
kind: "mutation",
|
|
57479
|
+
auth: "admin"
|
|
57480
|
+
}), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({ action: ActionEntrySchema }), {
|
|
57481
|
+
kind: "mutation",
|
|
57482
|
+
auth: "admin"
|
|
57483
|
+
}), method(object({
|
|
57484
|
+
actionId: string().min(1),
|
|
57485
|
+
action: ActionInputSchema.partial()
|
|
57486
|
+
}), object({ action: ActionEntrySchema }), {
|
|
57487
|
+
kind: "mutation",
|
|
57488
|
+
auth: "admin"
|
|
57489
|
+
}), method(ActionIdInput, _void(), {
|
|
57490
|
+
kind: "mutation",
|
|
57491
|
+
auth: "admin"
|
|
57492
|
+
}), method(object({ deviceId: number().int().nonnegative() }), array(ActionEntrySchema), {
|
|
57493
|
+
role: "viewer",
|
|
57494
|
+
auth: "protected",
|
|
57495
|
+
kind: "query"
|
|
57496
|
+
}), method(object({ deviceId: number().int().nonnegative() }), ActionLinksSchema, { auth: "admin" }), method(ActionLinksSchema, ActionLinksSchema, {
|
|
57497
|
+
kind: "mutation",
|
|
57498
|
+
auth: "admin"
|
|
57499
|
+
});
|
|
56722
57500
|
object({
|
|
56723
57501
|
/** Whether the automation is currently enabled. Disabled automations
|
|
56724
57502
|
* ignore their trigger block — manual `trigger` still works. */
|
|
@@ -56772,7 +57550,7 @@ var BatteryStatusSchema = object({
|
|
|
56772
57550
|
* Consumers must SKIP a null rather than coerce it — `battery-band` already
|
|
56773
57551
|
* declines to band a non-finite reading, which is the correct shape.
|
|
56774
57552
|
*/
|
|
56775
|
-
|
|
57553
|
+
level: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
|
|
56776
57554
|
/**
|
|
56777
57555
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
56778
57556
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
@@ -56782,7 +57560,7 @@ var BatteryStatusSchema = object({
|
|
|
56782
57560
|
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
56783
57561
|
* power fields yet, or the firmware reported neither. Before it existed,
|
|
56784
57562
|
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
56785
|
-
* was drawn "on battery alone" — the same D315 defect `
|
|
57563
|
+
* was drawn "on battery alone" — the same D315 defect `level` closed
|
|
56786
57564
|
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
56787
57565
|
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
56788
57566
|
*/
|
|
@@ -56806,7 +57584,7 @@ var BatteryStatusSchema = object({
|
|
|
56806
57584
|
* that only report charge. A second reading on this cap, not a second
|
|
56807
57585
|
* `numeric-sensor` on the same device.
|
|
56808
57586
|
*/
|
|
56809
|
-
|
|
57587
|
+
voltage: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
56810
57588
|
/**
|
|
56811
57589
|
* Ms epoch of the last time the device PROVED it was reachable — a
|
|
56812
57590
|
* completed firmware round-trip, an observed wake, or an inbound push
|
|
@@ -56840,13 +57618,13 @@ var BatteryStatusSchema = object({
|
|
|
56840
57618
|
/**
|
|
56841
57619
|
* True when the source is a BINARY low-battery indicator (HA
|
|
56842
57620
|
* `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
|
|
56843
|
-
* charge level — `
|
|
57621
|
+
* charge level — `level` is then a coarse stand-in (100 = normal,
|
|
56844
57622
|
* sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
|
|
56845
57623
|
* misleading exact percentage. Absent/false → genuine 0–100 % reading.
|
|
56846
57624
|
*/
|
|
56847
57625
|
binary: boolean().optional().meta({ label: "Binary indicator" })
|
|
56848
57626
|
});
|
|
56849
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat;
|
|
57627
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter;
|
|
56850
57628
|
method(object({
|
|
56851
57629
|
deviceId: number(),
|
|
56852
57630
|
/** Bound on the wait. Sensible range 3000–10000ms. */
|
|
@@ -56871,26 +57649,26 @@ DeviceType.Sensor;
|
|
|
56871
57649
|
* controls to this single-method surface.
|
|
56872
57650
|
*
|
|
56873
57651
|
* The cap is intentionally minimal: a single `setBrightness({deviceId,
|
|
56874
|
-
*
|
|
57652
|
+
* level})` mutation plus the auto-injected `getStatus`. Drivers
|
|
56875
57653
|
* that expose richer controls (color temperature, scenes, schedules)
|
|
56876
57654
|
* should surface those via the device's `getSettingsUISchema()`
|
|
56877
57655
|
* instead of bloating this cap.
|
|
56878
57656
|
*/
|
|
56879
57657
|
var BrightnessStatusSchema = object({
|
|
56880
57658
|
/** Current level as 0..100 inclusive. Firmware-reported. */
|
|
56881
|
-
|
|
57659
|
+
level: number().min(0).max(100).meta(readingMeta("percentage")),
|
|
56882
57660
|
/** Ms epoch of the last operator-driven change. Useful for UI freshness. */
|
|
56883
57661
|
lastChangedAt: number()
|
|
56884
57662
|
});
|
|
56885
57663
|
DeviceType.Light, method(object({
|
|
56886
57664
|
deviceId: number().int().nonnegative(),
|
|
56887
|
-
|
|
57665
|
+
level: number().min(0).max(100)
|
|
56888
57666
|
}), _void(), {
|
|
56889
57667
|
kind: "mutation",
|
|
56890
57668
|
auth: "protected"
|
|
56891
57669
|
}), object({
|
|
56892
57670
|
deviceId: number(),
|
|
56893
|
-
|
|
57671
|
+
level: number().min(0).max(100),
|
|
56894
57672
|
lastChangedAt: number()
|
|
56895
57673
|
});
|
|
56896
57674
|
DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
@@ -57391,11 +58169,11 @@ var ColorInputSchema = discriminatedUnion("mode", [
|
|
|
57391
58169
|
}),
|
|
57392
58170
|
object({
|
|
57393
58171
|
mode: literal("mired"),
|
|
57394
|
-
|
|
58172
|
+
colorTemperature: number().int().min(50).max(1e3)
|
|
57395
58173
|
})
|
|
57396
58174
|
]);
|
|
57397
58175
|
object({
|
|
57398
|
-
/** Active color mode — which of `rgb` / `hsv` / `
|
|
58176
|
+
/** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
|
|
57399
58177
|
* the bulb's current state. */
|
|
57400
58178
|
mode: _enum([
|
|
57401
58179
|
"rgb",
|
|
@@ -57407,7 +58185,7 @@ object({
|
|
|
57407
58185
|
/** Populated when `mode === 'hsv'`. */
|
|
57408
58186
|
hsv: HsvTripletSchema.optional(),
|
|
57409
58187
|
/** Populated when `mode === 'mired'`. */
|
|
57410
|
-
|
|
58188
|
+
colorTemperature: number().int().optional().meta(readingMeta("colour-temperature")),
|
|
57411
58189
|
/** Ms epoch of the last operator-driven change. */
|
|
57412
58190
|
lastChangedAt: number()
|
|
57413
58191
|
});
|
|
@@ -57426,7 +58204,7 @@ DeviceType.Light, method(object({
|
|
|
57426
58204
|
]),
|
|
57427
58205
|
rgb: RgbTripletSchema.optional(),
|
|
57428
58206
|
hsv: HsvTripletSchema.optional(),
|
|
57429
|
-
|
|
58207
|
+
colorTemperature: number().int().optional(),
|
|
57430
58208
|
lastChangedAt: number()
|
|
57431
58209
|
});
|
|
57432
58210
|
var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
|
|
@@ -57864,11 +58642,11 @@ object({
|
|
|
57864
58642
|
/** Feature keys of the programs the appliance currently offers — drives the UI selector. */
|
|
57865
58643
|
availablePrograms: array(string()),
|
|
57866
58644
|
/** Seconds remaining on the active cycle, or null when not running / not known. */
|
|
57867
|
-
|
|
58645
|
+
remaining: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
57868
58646
|
/** Seconds the delayed start is set to (time until the cycle starts), or null. */
|
|
57869
|
-
|
|
58647
|
+
delayedStart: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
57870
58648
|
/** Cycle completion 0..100, or null when not applicable. */
|
|
57871
|
-
|
|
58649
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
57872
58650
|
/** True when the door is reported open; null when the door state is not known. */
|
|
57873
58651
|
doorOpen: boolean().nullable(),
|
|
57874
58652
|
/** True when the door is latched (locked) during a cycle; null when not reported. */
|
|
@@ -58486,7 +59264,7 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
|
|
|
58486
59264
|
object({
|
|
58487
59265
|
/** Active speed as 0..100 inclusive. Null when the device has no
|
|
58488
59266
|
* speed surface (single-speed fan). */
|
|
58489
|
-
|
|
59267
|
+
speed: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
58490
59268
|
/** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
|
|
58491
59269
|
* a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
|
|
58492
59270
|
percentageStep: number().positive().optional().meta(readingMeta("percentage")),
|
|
@@ -58506,7 +59284,7 @@ object({
|
|
|
58506
59284
|
});
|
|
58507
59285
|
DeviceType.Fan, method(object({
|
|
58508
59286
|
deviceId: number().int().nonnegative(),
|
|
58509
|
-
|
|
59287
|
+
speed: number().min(0).max(100)
|
|
58510
59288
|
}), _void(), {
|
|
58511
59289
|
kind: "mutation",
|
|
58512
59290
|
auth: "protected"
|
|
@@ -58614,7 +59392,13 @@ results: array(object({
|
|
|
58614
59392
|
/** Ms epoch of the attempt. */
|
|
58615
59393
|
at: number()
|
|
58616
59394
|
})) });
|
|
58617
|
-
DeviceType.Switch, DeviceType.Light;
|
|
59395
|
+
DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Cover, DeviceType.Valve, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.Thermostat, DeviceType.Climate;
|
|
59396
|
+
object({
|
|
59397
|
+
active: boolean().meta({ label: "Active" }),
|
|
59398
|
+
/** Ms epoch when the slice was last updated. */
|
|
59399
|
+
lastChangedAt: number()
|
|
59400
|
+
});
|
|
59401
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.Climate, DeviceType.Thermostat;
|
|
58618
59402
|
object({
|
|
58619
59403
|
/** Members whose current value entered the aggregate. */
|
|
58620
59404
|
included: number().int().nonnegative().meta(readingMeta("count", {
|
|
@@ -58632,7 +59416,7 @@ object({
|
|
|
58632
59416
|
label: "Members"
|
|
58633
59417
|
}))
|
|
58634
59418
|
});
|
|
58635
|
-
DeviceType.Sensor, DeviceType.Switch, DeviceType.Light;
|
|
59419
|
+
DeviceType.Sensor, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Cover, DeviceType.Valve, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.Thermostat, DeviceType.Climate;
|
|
58636
59420
|
object({
|
|
58637
59421
|
/** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
|
|
58638
59422
|
position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
@@ -58691,7 +59475,7 @@ DeviceType.Humidifier, method(object({
|
|
|
58691
59475
|
*/
|
|
58692
59476
|
var HumiditySensorStatusSchema = object({
|
|
58693
59477
|
/** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
|
|
58694
|
-
|
|
59478
|
+
humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
|
|
58695
59479
|
precision: 0,
|
|
58696
59480
|
label: "Humidity"
|
|
58697
59481
|
})),
|
|
@@ -59134,7 +59918,7 @@ object({
|
|
|
59134
59918
|
batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
59135
59919
|
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
59136
59920
|
* task is active / progress is unavailable. */
|
|
59137
|
-
|
|
59921
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
59138
59922
|
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
59139
59923
|
* or null when unknown. */
|
|
59140
59924
|
currentCode: number().nullable().meta(readingMeta("none")),
|
|
@@ -59547,7 +60331,14 @@ DeviceType.Lock, method(object({
|
|
|
59547
60331
|
auth: "protected"
|
|
59548
60332
|
}), method(object({
|
|
59549
60333
|
deviceId: number().int().nonnegative(),
|
|
59550
|
-
code: string().min(1).optional()
|
|
60334
|
+
code: string().min(1).optional(),
|
|
60335
|
+
/**
|
|
60336
|
+
* Honoured by a helper lock GROUP only (D944): unlocking several doors
|
|
60337
|
+
* with one call is refused unless the caller says it was confirmed. A
|
|
60338
|
+
* single lock ignores it. The refusal lives in the callee, so no
|
|
60339
|
+
* automation or API caller reaches the doors by skipping a dialog.
|
|
60340
|
+
*/
|
|
60341
|
+
confirm: boolean().optional()
|
|
59551
60342
|
}), _void(), {
|
|
59552
60343
|
kind: "mutation",
|
|
59553
60344
|
auth: "protected"
|
|
@@ -59555,6 +60346,11 @@ DeviceType.Lock, method(object({
|
|
|
59555
60346
|
kind: "mutation",
|
|
59556
60347
|
auth: "protected"
|
|
59557
60348
|
});
|
|
60349
|
+
object({
|
|
60350
|
+
value: number().nullable().meta(readingMeta("device", { label: "Total" })),
|
|
60351
|
+
lastFetchedAt: number()
|
|
60352
|
+
});
|
|
60353
|
+
DeviceType.Sensor;
|
|
59558
60354
|
/**
|
|
59559
60355
|
* Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
|
|
59560
60356
|
* Apple TV, Spotify, Roku, generic OTT receivers, …) on
|
|
@@ -59612,10 +60408,10 @@ object({
|
|
|
59612
60408
|
currentMedia: MediaInfoSchema.nullable(),
|
|
59613
60409
|
/** Current playback position in ms. Null when not seekable or
|
|
59614
60410
|
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
59615
|
-
|
|
60411
|
+
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
59616
60412
|
/** Total duration of the current media in ms. Null when unknown
|
|
59617
60413
|
* (live stream) or nothing is playing. */
|
|
59618
|
-
|
|
60414
|
+
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
59619
60415
|
/** Shuffle toggle. Null when no shuffle surface.
|
|
59620
60416
|
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
59621
60417
|
shuffle: boolean().nullable(),
|
|
@@ -59642,7 +60438,7 @@ DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }
|
|
|
59642
60438
|
auth: "protected"
|
|
59643
60439
|
}), method(object({
|
|
59644
60440
|
deviceId: number().int().nonnegative(),
|
|
59645
|
-
|
|
60441
|
+
position: number().int().nonnegative()
|
|
59646
60442
|
}), _void(), {
|
|
59647
60443
|
kind: "mutation",
|
|
59648
60444
|
auth: "protected"
|
|
@@ -60315,9 +61111,9 @@ var NetworkLinkStatusSchema = object({
|
|
|
60315
61111
|
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
60316
61112
|
* SKIP a null rather than coerce it.
|
|
60317
61113
|
*/
|
|
60318
|
-
|
|
61114
|
+
signal: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
60319
61115
|
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
60320
|
-
|
|
61116
|
+
rssi: number().optional().meta(readingMeta("signal-level")),
|
|
60321
61117
|
/** Network name of a wireless link, when the firmware reports it. */
|
|
60322
61118
|
ssid: string().optional(),
|
|
60323
61119
|
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
@@ -60978,10 +61774,20 @@ var PetFeederDeviceStatusSchema = _enum([
|
|
|
60978
61774
|
]);
|
|
60979
61775
|
var gramsPortion = number().int().min(4).max(200);
|
|
60980
61776
|
object({
|
|
60981
|
-
/** Food
|
|
60982
|
-
*
|
|
60983
|
-
* bowl
|
|
61777
|
+
/** Food in the TANK (hopper), as the feeder's own sensor reports it
|
|
61778
|
+
* (`state.food`). A coarse level code, not grams — `0` is empty. The
|
|
61779
|
+
* amount in the bowl is `bowlFood`. On dual-hopper models this is the
|
|
61780
|
+
* combined reading; per-hopper levels live in `food1`/`food2`. Null when
|
|
61781
|
+
* the device has not reported yet. */
|
|
60984
61782
|
foodLevel: number().nullable().meta(readingMeta("none")),
|
|
61783
|
+
/** Food in the BOWL as the feeder reports it (`state.bowl`), in the
|
|
61784
|
+
* feeder's own units. Null when the model reports none. */
|
|
61785
|
+
bowlFood: number().nullable().meta(readingMeta("none")),
|
|
61786
|
+
/** True while the pet is eating (`state.eating`). */
|
|
61787
|
+
eating: boolean(),
|
|
61788
|
+
/** Whether `markFoodReplenished` does anything on this model. When false
|
|
61789
|
+
* the client must not offer it. */
|
|
61790
|
+
supportsMarkRefilled: boolean(),
|
|
60985
61791
|
/** Hopper-1 food level (grams) on dual-hopper feeders; null on
|
|
60986
61792
|
* single-hopper models. */
|
|
60987
61793
|
food1: number().nullable().meta(readingMeta("none")),
|
|
@@ -60989,8 +61795,8 @@ object({
|
|
|
60989
61795
|
* single-hopper models. */
|
|
60990
61796
|
food2: number().nullable().meta(readingMeta("none")),
|
|
60991
61797
|
/** Derived low-food flag — mirrors the HA `food_level` binary_sensor
|
|
60992
|
-
* (`device_class: problem`, on = low). True when the
|
|
60993
|
-
*
|
|
61798
|
+
* (`device_class: problem`, on = low). True when the tank reports empty,
|
|
61799
|
+
* or, on a dual-hopper model, when EITHER hopper is empty. */
|
|
60994
61800
|
lowFood: boolean(),
|
|
60995
61801
|
/** Battery charge 0..100 (%). Null on mains-powered models or when the
|
|
60996
61802
|
* device has no battery reading. */
|
|
@@ -61457,22 +62263,38 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
|
|
|
61457
62263
|
auth: "admin"
|
|
61458
62264
|
});
|
|
61459
62265
|
object({
|
|
61460
|
-
/** Instantaneous power draw
|
|
61461
|
-
|
|
62266
|
+
/** Instantaneous power draw (watts). */
|
|
62267
|
+
power: number().optional().meta(readingMeta("power", { label: "Power" })),
|
|
61462
62268
|
/** Cumulative energy in kilowatt-hours since the meter was reset. */
|
|
61463
|
-
|
|
61464
|
-
/** Voltage
|
|
61465
|
-
|
|
62269
|
+
energy: number().optional().meta(readingMeta("energy", { label: "Energy" })),
|
|
62270
|
+
/** Voltage (volts). */
|
|
62271
|
+
voltage: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
61466
62272
|
/** Current in amperes. */
|
|
61467
|
-
|
|
62273
|
+
current: number().optional().meta(readingMeta("current", { label: "Current" })),
|
|
61468
62274
|
/** Apparent power in volt-amperes. */
|
|
61469
|
-
|
|
62275
|
+
apparentPower: number().optional().meta(readingMeta("apparent-power")),
|
|
61470
62276
|
/** Power factor (0..1) if reported. */
|
|
61471
62277
|
powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
|
|
61472
62278
|
/** Ms epoch when the slice was last updated. */
|
|
61473
62279
|
lastFetchedAt: number()
|
|
61474
62280
|
});
|
|
61475
|
-
|
|
62281
|
+
[
|
|
62282
|
+
DeviceType.Sensor,
|
|
62283
|
+
DeviceType.Switch,
|
|
62284
|
+
DeviceType.Light,
|
|
62285
|
+
DeviceType.Fan,
|
|
62286
|
+
DeviceType.Climate,
|
|
62287
|
+
DeviceType.Thermostat,
|
|
62288
|
+
DeviceType.Humidifier,
|
|
62289
|
+
DeviceType.WaterHeater,
|
|
62290
|
+
DeviceType.MediaPlayer,
|
|
62291
|
+
DeviceType.Washer,
|
|
62292
|
+
DeviceType.Dryer,
|
|
62293
|
+
DeviceType.Dishwasher,
|
|
62294
|
+
DeviceType.Vacuum,
|
|
62295
|
+
DeviceType.LawnMower,
|
|
62296
|
+
DeviceType.PetFeeder
|
|
62297
|
+
].filter((type) => type !== DeviceType.Sensor);
|
|
61476
62298
|
/**
|
|
61477
62299
|
* Presence cap. Models HA `person.*` and `device_tracker.*` entities
|
|
61478
62300
|
* on `DeviceType.Presence`. Read-only — no setters: presence is
|
|
@@ -61505,16 +62327,13 @@ var PresenceStatusSchema = object({
|
|
|
61505
62327
|
location: string().nullable(),
|
|
61506
62328
|
/** GPS coordinates when available. Null otherwise. */
|
|
61507
62329
|
gps: GpsLocationSchema.nullable(),
|
|
61508
|
-
/** Optional battery level of the tracking device (0..100). Null
|
|
61509
|
-
* when not reported. */
|
|
61510
|
-
batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
61511
62330
|
/** Ms epoch when the slice was last updated. */
|
|
61512
62331
|
lastChangedAt: number()
|
|
61513
62332
|
});
|
|
61514
62333
|
DeviceType.Presence;
|
|
61515
62334
|
object({
|
|
61516
62335
|
/** Current pressure in hPa. `null` when the sample was refused (D393). */
|
|
61517
|
-
|
|
62336
|
+
pressure: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
|
|
61518
62337
|
/** Ms epoch when the slice was last updated. */
|
|
61519
62338
|
lastFetchedAt: number()
|
|
61520
62339
|
});
|
|
@@ -63965,7 +64784,7 @@ var SwitchStatusSchema = object({
|
|
|
63965
64784
|
/** Ms epoch of the last state change. Useful for UI "X minutes ago". */
|
|
63966
64785
|
lastChangedAt: number()
|
|
63967
64786
|
});
|
|
63968
|
-
DeviceType.Switch, DeviceType.Siren, DeviceType.Light, method(object({
|
|
64787
|
+
DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, method(object({
|
|
63969
64788
|
deviceId: number(),
|
|
63970
64789
|
on: boolean()
|
|
63971
64790
|
}), _void(), {
|
|
@@ -64536,7 +65355,7 @@ DeviceType.Sensor;
|
|
|
64536
65355
|
*/
|
|
64537
65356
|
var TemperatureSensorStatusSchema = object({
|
|
64538
65357
|
/** Current temperature in Celsius. `null` when the sample was refused (D393). */
|
|
64539
|
-
|
|
65358
|
+
temperature: number().nullable().meta(readingMeta("temperature", {
|
|
64540
65359
|
precision: 1,
|
|
64541
65360
|
label: "Temperature"
|
|
64542
65361
|
})),
|
|
@@ -64800,7 +65619,7 @@ object({
|
|
|
64800
65619
|
/** Speed tokens the hardware accepts — drives the UI selector. */
|
|
64801
65620
|
availableFanSpeeds: array(string()),
|
|
64802
65621
|
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
64803
|
-
|
|
65622
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
64804
65623
|
/** Current error code (0 / null = no error). */
|
|
64805
65624
|
errorCode: number().nullable().meta(readingMeta("none")),
|
|
64806
65625
|
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
@@ -65669,8 +66488,9 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
|
|
|
65669
66488
|
kind: "mutation",
|
|
65670
66489
|
auth: "admin"
|
|
65671
66490
|
});
|
|
66491
|
+
DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
|
|
65672
66492
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
65673
|
-
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;
|
|
66493
|
+
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;
|
|
65674
66494
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
65675
66495
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
65676
66496
|
new Set(CAP_NAMES);
|
|
@@ -65740,6 +66560,104 @@ Object.freeze({
|
|
|
65740
66560
|
access: "create",
|
|
65741
66561
|
role: "admin"
|
|
65742
66562
|
},
|
|
66563
|
+
"actions.create": {
|
|
66564
|
+
capName: "actions",
|
|
66565
|
+
capScope: "system",
|
|
66566
|
+
addonId: null,
|
|
66567
|
+
access: "create",
|
|
66568
|
+
role: "admin"
|
|
66569
|
+
},
|
|
66570
|
+
"actions.delete": {
|
|
66571
|
+
capName: "actions",
|
|
66572
|
+
capScope: "system",
|
|
66573
|
+
addonId: null,
|
|
66574
|
+
access: "delete",
|
|
66575
|
+
role: "admin"
|
|
66576
|
+
},
|
|
66577
|
+
"actions.get": {
|
|
66578
|
+
capName: "actions",
|
|
66579
|
+
capScope: "system",
|
|
66580
|
+
addonId: null,
|
|
66581
|
+
access: "view",
|
|
66582
|
+
role: "viewer"
|
|
66583
|
+
},
|
|
66584
|
+
"actions.getLinks": {
|
|
66585
|
+
capName: "actions",
|
|
66586
|
+
capScope: "system",
|
|
66587
|
+
addonId: null,
|
|
66588
|
+
access: "view",
|
|
66589
|
+
role: "admin"
|
|
66590
|
+
},
|
|
66591
|
+
"actions.getTraces": {
|
|
66592
|
+
capName: "actions",
|
|
66593
|
+
capScope: "system",
|
|
66594
|
+
addonId: null,
|
|
66595
|
+
access: "view",
|
|
66596
|
+
role: "admin"
|
|
66597
|
+
},
|
|
66598
|
+
"actions.list": {
|
|
66599
|
+
capName: "actions",
|
|
66600
|
+
capScope: "system",
|
|
66601
|
+
addonId: null,
|
|
66602
|
+
access: "view",
|
|
66603
|
+
role: "admin"
|
|
66604
|
+
},
|
|
66605
|
+
"actions.listForCamera": {
|
|
66606
|
+
capName: "actions",
|
|
66607
|
+
capScope: "system",
|
|
66608
|
+
addonId: null,
|
|
66609
|
+
access: "view",
|
|
66610
|
+
role: "viewer"
|
|
66611
|
+
},
|
|
66612
|
+
"actions.run": {
|
|
66613
|
+
capName: "actions",
|
|
66614
|
+
capScope: "system",
|
|
66615
|
+
addonId: null,
|
|
66616
|
+
access: "create",
|
|
66617
|
+
role: "viewer"
|
|
66618
|
+
},
|
|
66619
|
+
"actions.setLinks": {
|
|
66620
|
+
capName: "actions",
|
|
66621
|
+
capScope: "system",
|
|
66622
|
+
addonId: null,
|
|
66623
|
+
access: "create",
|
|
66624
|
+
role: "admin"
|
|
66625
|
+
},
|
|
66626
|
+
"actions.stop": {
|
|
66627
|
+
capName: "actions",
|
|
66628
|
+
capScope: "system",
|
|
66629
|
+
addonId: null,
|
|
66630
|
+
access: "create",
|
|
66631
|
+
role: "admin"
|
|
66632
|
+
},
|
|
66633
|
+
"actions.update": {
|
|
66634
|
+
capName: "actions",
|
|
66635
|
+
capScope: "system",
|
|
66636
|
+
addonId: null,
|
|
66637
|
+
access: "create",
|
|
66638
|
+
role: "admin"
|
|
66639
|
+
},
|
|
66640
|
+
"actionSource.listActions": {
|
|
66641
|
+
capName: "action-source",
|
|
66642
|
+
capScope: "system",
|
|
66643
|
+
addonId: null,
|
|
66644
|
+
access: "view",
|
|
66645
|
+
role: "admin"
|
|
66646
|
+
},
|
|
66647
|
+
"actionSource.runAction": {
|
|
66648
|
+
capName: "action-source",
|
|
66649
|
+
capScope: "system",
|
|
66650
|
+
addonId: null,
|
|
66651
|
+
access: "create",
|
|
66652
|
+
role: "admin"
|
|
66653
|
+
},
|
|
66654
|
+
"actionSource.stopAction": {
|
|
66655
|
+
capName: "action-source",
|
|
66656
|
+
capScope: "system",
|
|
66657
|
+
addonId: null,
|
|
66658
|
+
access: "create",
|
|
66659
|
+
role: "admin"
|
|
66660
|
+
},
|
|
65743
66661
|
"addonPages.listPages": {
|
|
65744
66662
|
capName: "addon-pages",
|
|
65745
66663
|
capScope: "system",
|
|
@@ -67021,6 +67939,13 @@ Object.freeze({
|
|
|
67021
67939
|
access: "view",
|
|
67022
67940
|
role: "admin"
|
|
67023
67941
|
},
|
|
67942
|
+
"coreBlocks.getAutomationRunState": {
|
|
67943
|
+
capName: "core-blocks",
|
|
67944
|
+
capScope: "system",
|
|
67945
|
+
addonId: null,
|
|
67946
|
+
access: "view",
|
|
67947
|
+
role: "admin"
|
|
67948
|
+
},
|
|
67024
67949
|
"coreBlocks.getBlockSettings": {
|
|
67025
67950
|
capName: "core-blocks",
|
|
67026
67951
|
capScope: "system",
|
|
@@ -67042,6 +67967,13 @@ Object.freeze({
|
|
|
67042
67967
|
access: "view",
|
|
67043
67968
|
role: "admin"
|
|
67044
67969
|
},
|
|
67970
|
+
"coreBlocks.getTraces": {
|
|
67971
|
+
capName: "core-blocks",
|
|
67972
|
+
capScope: "system",
|
|
67973
|
+
addonId: null,
|
|
67974
|
+
access: "view",
|
|
67975
|
+
role: "admin"
|
|
67976
|
+
},
|
|
67045
67977
|
"coreBlocks.getTypeDefs": {
|
|
67046
67978
|
capName: "core-blocks",
|
|
67047
67979
|
capScope: "system",
|
|
@@ -67077,6 +68009,13 @@ Object.freeze({
|
|
|
67077
68009
|
access: "create",
|
|
67078
68010
|
role: "admin"
|
|
67079
68011
|
},
|
|
68012
|
+
"coreBlocks.reportAutomationRun": {
|
|
68013
|
+
capName: "core-blocks",
|
|
68014
|
+
capScope: "system",
|
|
68015
|
+
addonId: null,
|
|
68016
|
+
access: "create",
|
|
68017
|
+
role: "admin"
|
|
68018
|
+
},
|
|
67080
68019
|
"coreBlocks.restart": {
|
|
67081
68020
|
capName: "core-blocks",
|
|
67082
68021
|
capScope: "system",
|
|
@@ -68946,6 +69885,13 @@ Object.freeze({
|
|
|
68946
69885
|
access: "view",
|
|
68947
69886
|
role: "viewer"
|
|
68948
69887
|
},
|
|
69888
|
+
"groupActive.getStatus": {
|
|
69889
|
+
capName: "group-active",
|
|
69890
|
+
capScope: "device",
|
|
69891
|
+
addonId: null,
|
|
69892
|
+
access: "view",
|
|
69893
|
+
role: "viewer"
|
|
69894
|
+
},
|
|
68949
69895
|
"groupCommands.getStatus": {
|
|
68950
69896
|
capName: "group-commands",
|
|
68951
69897
|
capScope: "device",
|
|
@@ -69912,6 +70858,13 @@ Object.freeze({
|
|
|
69912
70858
|
access: "create",
|
|
69913
70859
|
role: "admin"
|
|
69914
70860
|
},
|
|
70861
|
+
"meter.getStatus": {
|
|
70862
|
+
capName: "meter",
|
|
70863
|
+
capScope: "device",
|
|
70864
|
+
addonId: null,
|
|
70865
|
+
access: "view",
|
|
70866
|
+
role: "viewer"
|
|
70867
|
+
},
|
|
69915
70868
|
"metricsProvider.collectSnapshot": {
|
|
69916
70869
|
capName: "metrics-provider",
|
|
69917
70870
|
capScope: "system",
|
|
@@ -75636,7 +76589,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75636
76589
|
label: t("Full brightness", "Luminosità massima"),
|
|
75637
76590
|
phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
|
|
75638
76591
|
icon: "sun",
|
|
75639
|
-
args: {
|
|
76592
|
+
args: { level: 100 }
|
|
75640
76593
|
},
|
|
75641
76594
|
{
|
|
75642
76595
|
id: "brightness.half",
|
|
@@ -75644,7 +76597,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75644
76597
|
label: t("Half brightness", "Luminosità a metà"),
|
|
75645
76598
|
phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
|
|
75646
76599
|
icon: "sun-dim",
|
|
75647
|
-
args: {
|
|
76600
|
+
args: { level: 50 }
|
|
75648
76601
|
},
|
|
75649
76602
|
{
|
|
75650
76603
|
id: "brightness.off",
|
|
@@ -75652,16 +76605,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75652
76605
|
label: t("Brightness off", "Luminosità a zero"),
|
|
75653
76606
|
phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
|
|
75654
76607
|
icon: "lightbulb-off",
|
|
75655
|
-
args: {
|
|
76608
|
+
args: { level: 0 }
|
|
75656
76609
|
},
|
|
75657
76610
|
{
|
|
75658
76611
|
id: "brightness.set",
|
|
75659
76612
|
method: "setBrightness",
|
|
75660
76613
|
label: t("Set brightness", "Imposta la luminosità"),
|
|
75661
|
-
phrase: t("Set the brightness of {device} to {
|
|
76614
|
+
phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
|
|
75662
76615
|
icon: "sun-medium",
|
|
75663
76616
|
openArgs: [{
|
|
75664
|
-
key: "
|
|
76617
|
+
key: "level",
|
|
75665
76618
|
label: PERCENT,
|
|
75666
76619
|
offer: {
|
|
75667
76620
|
kind: "number",
|
|
@@ -75675,13 +76628,13 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75675
76628
|
],
|
|
75676
76629
|
state: [{
|
|
75677
76630
|
kind: "numeric",
|
|
75678
|
-
field: "
|
|
76631
|
+
field: "level",
|
|
75679
76632
|
quantity: t("the brightness", "la luminosità"),
|
|
75680
76633
|
label: t("Brightness", "Luminosità"),
|
|
75681
76634
|
unit: "%",
|
|
75682
76635
|
icon: "sun"
|
|
75683
76636
|
}],
|
|
75684
|
-
events: { onBrightnessChanged: { notOperatorFacing: "the `
|
|
76637
|
+
events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
|
|
75685
76638
|
},
|
|
75686
76639
|
color: {
|
|
75687
76640
|
scope: "device",
|
|
@@ -75695,7 +76648,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75695
76648
|
icon: "sun",
|
|
75696
76649
|
args: { color: {
|
|
75697
76650
|
mode: "mired",
|
|
75698
|
-
|
|
76651
|
+
colorTemperature: 370
|
|
75699
76652
|
} }
|
|
75700
76653
|
},
|
|
75701
76654
|
{
|
|
@@ -75706,7 +76659,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75706
76659
|
icon: "snowflake",
|
|
75707
76660
|
args: { color: {
|
|
75708
76661
|
mode: "mired",
|
|
75709
|
-
|
|
76662
|
+
colorTemperature: 200
|
|
75710
76663
|
} }
|
|
75711
76664
|
},
|
|
75712
76665
|
{
|
|
@@ -76320,7 +77273,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76320
77273
|
label: t("Fan off", "Ventilatore spento"),
|
|
76321
77274
|
phrase: t("Stop {device}", "Ferma {device}"),
|
|
76322
77275
|
icon: "power-off",
|
|
76323
|
-
args: {
|
|
77276
|
+
args: { speed: 0 }
|
|
76324
77277
|
},
|
|
76325
77278
|
{
|
|
76326
77279
|
id: "fan.full",
|
|
@@ -76328,16 +77281,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76328
77281
|
label: t("Fan full", "Ventilatore al massimo"),
|
|
76329
77282
|
phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
|
|
76330
77283
|
icon: "fan",
|
|
76331
|
-
args: {
|
|
77284
|
+
args: { speed: 100 }
|
|
76332
77285
|
},
|
|
76333
77286
|
{
|
|
76334
77287
|
id: "fan.speed",
|
|
76335
77288
|
method: "setPercentage",
|
|
76336
77289
|
label: t("Set speed", "Imposta la velocità"),
|
|
76337
|
-
phrase: t("Set the speed of {device} to {
|
|
77290
|
+
phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
|
|
76338
77291
|
icon: "fan",
|
|
76339
77292
|
openArgs: [{
|
|
76340
|
-
key: "
|
|
77293
|
+
key: "speed",
|
|
76341
77294
|
label: t("Speed", "Velocità"),
|
|
76342
77295
|
offer: {
|
|
76343
77296
|
kind: "number",
|
|
@@ -76399,7 +77352,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76399
77352
|
],
|
|
76400
77353
|
state: [{
|
|
76401
77354
|
kind: "numeric",
|
|
76402
|
-
field: "
|
|
77355
|
+
field: "speed",
|
|
76403
77356
|
quantity: t("the speed", "la velocità"),
|
|
76404
77357
|
label: t("Speed", "Velocità"),
|
|
76405
77358
|
unit: "%",
|
|
@@ -77197,7 +78150,7 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
77197
78150
|
},
|
|
77198
78151
|
{
|
|
77199
78152
|
kind: "numeric",
|
|
77200
|
-
field: "
|
|
78153
|
+
field: "progress",
|
|
77201
78154
|
quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
|
|
77202
78155
|
label: t("Progress", "Avanzamento"),
|
|
77203
78156
|
unit: "%",
|
|
@@ -77555,10 +78508,10 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
77555
78508
|
id: "media.seek",
|
|
77556
78509
|
method: "seek",
|
|
77557
78510
|
label: t("Seek", "Vai al punto"),
|
|
77558
|
-
phrase: t("Move {device} to {
|
|
78511
|
+
phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
|
|
77559
78512
|
icon: "fast-forward",
|
|
77560
78513
|
openArgs: [{
|
|
77561
|
-
key: "
|
|
78514
|
+
key: "position",
|
|
77562
78515
|
label: t("Position", "Posizione"),
|
|
77563
78516
|
offer: {
|
|
77564
78517
|
kind: "number",
|
|
@@ -78607,7 +79560,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78607
79560
|
state: [
|
|
78608
79561
|
{
|
|
78609
79562
|
kind: "numeric",
|
|
78610
|
-
field: "
|
|
79563
|
+
field: "co2",
|
|
78611
79564
|
quantity: t("the CO₂", "la CO₂"),
|
|
78612
79565
|
label: t("CO₂", "CO₂"),
|
|
78613
79566
|
unit: "ppm",
|
|
@@ -78615,7 +79568,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78615
79568
|
},
|
|
78616
79569
|
{
|
|
78617
79570
|
kind: "numeric",
|
|
78618
|
-
field: "
|
|
79571
|
+
field: "voc",
|
|
78619
79572
|
quantity: t("the VOC level", "il livello di COV"),
|
|
78620
79573
|
label: t("VOC", "COV"),
|
|
78621
79574
|
unit: "ppb",
|
|
@@ -78651,7 +79604,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78651
79604
|
noun: t("Light level", "Luminosità ambiente"),
|
|
78652
79605
|
state: [{
|
|
78653
79606
|
kind: "numeric",
|
|
78654
|
-
field: "
|
|
79607
|
+
field: "illuminance",
|
|
78655
79608
|
quantity: t("the light level", "la luminosità"),
|
|
78656
79609
|
label: t("Illuminance", "Illuminamento"),
|
|
78657
79610
|
unit: "lx",
|
|
@@ -78814,6 +79767,10 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78814
79767
|
icon: "flame"
|
|
78815
79768
|
}]
|
|
78816
79769
|
},
|
|
79770
|
+
"group-active": {
|
|
79771
|
+
scope: "device",
|
|
79772
|
+
noun: t("Group state", "Stato del gruppo")
|
|
79773
|
+
},
|
|
78817
79774
|
"group-commands": {
|
|
78818
79775
|
scope: "device",
|
|
78819
79776
|
noun: t("Group command", "Comando di gruppo")
|
|
@@ -78850,7 +79807,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78850
79807
|
noun: t("Humidity", "Umidità"),
|
|
78851
79808
|
state: [{
|
|
78852
79809
|
kind: "numeric",
|
|
78853
|
-
field: "
|
|
79810
|
+
field: "humidity",
|
|
78854
79811
|
quantity: t("the humidity", "l’umidità"),
|
|
78855
79812
|
label: t("Humidity", "Umidità"),
|
|
78856
79813
|
unit: "%",
|
|
@@ -78870,6 +79827,17 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78870
79827
|
}],
|
|
78871
79828
|
events: { onMotionChanged: { notOperatorFacing: "the `detected` state trigger phrases both edges, from the mirror that survives a dropped event (D49)" } }
|
|
78872
79829
|
},
|
|
79830
|
+
meter: {
|
|
79831
|
+
scope: "device",
|
|
79832
|
+
noun: t("Meter", "Contatore"),
|
|
79833
|
+
state: [{
|
|
79834
|
+
kind: "numeric",
|
|
79835
|
+
field: "value",
|
|
79836
|
+
quantity: t("the total", "il totale"),
|
|
79837
|
+
label: t("Total", "Totale"),
|
|
79838
|
+
icon: "gauge"
|
|
79839
|
+
}]
|
|
79840
|
+
},
|
|
78873
79841
|
"numeric-sensor": {
|
|
78874
79842
|
scope: "device",
|
|
78875
79843
|
noun: t("Sensor", "Sensore"),
|
|
@@ -78887,7 +79855,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78887
79855
|
state: [
|
|
78888
79856
|
{
|
|
78889
79857
|
kind: "numeric",
|
|
78890
|
-
field: "
|
|
79858
|
+
field: "power",
|
|
78891
79859
|
quantity: t("the power draw", "il consumo"),
|
|
78892
79860
|
label: t("Power", "Potenza"),
|
|
78893
79861
|
unit: "W",
|
|
@@ -78895,7 +79863,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78895
79863
|
},
|
|
78896
79864
|
{
|
|
78897
79865
|
kind: "numeric",
|
|
78898
|
-
field: "
|
|
79866
|
+
field: "energy",
|
|
78899
79867
|
quantity: t("the energy used", "l’energia consumata"),
|
|
78900
79868
|
label: t("Energy", "Energia"),
|
|
78901
79869
|
unit: "kWh",
|
|
@@ -78903,7 +79871,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78903
79871
|
},
|
|
78904
79872
|
{
|
|
78905
79873
|
kind: "numeric",
|
|
78906
|
-
field: "
|
|
79874
|
+
field: "voltage",
|
|
78907
79875
|
quantity: t("the voltage", "la tensione"),
|
|
78908
79876
|
label: t("Voltage", "Tensione"),
|
|
78909
79877
|
unit: "V",
|
|
@@ -78911,7 +79879,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78911
79879
|
},
|
|
78912
79880
|
{
|
|
78913
79881
|
kind: "numeric",
|
|
78914
|
-
field: "
|
|
79882
|
+
field: "current",
|
|
78915
79883
|
quantity: t("the current", "la corrente"),
|
|
78916
79884
|
label: t("Current", "Corrente"),
|
|
78917
79885
|
unit: "A",
|
|
@@ -78928,13 +79896,6 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78928
79896
|
label: t("Where", "Posizione"),
|
|
78929
79897
|
phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
|
|
78930
79898
|
icon: "map-pin"
|
|
78931
|
-
}, {
|
|
78932
|
-
kind: "numeric",
|
|
78933
|
-
field: "batteryPercent",
|
|
78934
|
-
quantity: t("the phone battery", "la batteria del telefono"),
|
|
78935
|
-
label: t("Battery", "Batteria"),
|
|
78936
|
-
unit: "%",
|
|
78937
|
-
icon: "battery"
|
|
78938
79899
|
}]
|
|
78939
79900
|
},
|
|
78940
79901
|
"pressure-sensor": {
|
|
@@ -78942,7 +79903,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78942
79903
|
noun: t("Pressure", "Pressione"),
|
|
78943
79904
|
state: [{
|
|
78944
79905
|
kind: "numeric",
|
|
78945
|
-
field: "
|
|
79906
|
+
field: "pressure",
|
|
78946
79907
|
quantity: t("the pressure", "la pressione"),
|
|
78947
79908
|
label: t("Pressure", "Pressione"),
|
|
78948
79909
|
unit: "hPa",
|
|
@@ -78978,7 +79939,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78978
79939
|
noun: t("Temperature", "Temperatura"),
|
|
78979
79940
|
state: [{
|
|
78980
79941
|
kind: "numeric",
|
|
78981
|
-
field: "
|
|
79942
|
+
field: "temperature",
|
|
78982
79943
|
quantity: t("the temperature", "la temperatura"),
|
|
78983
79944
|
label: t("Temperature", "Temperatura"),
|
|
78984
79945
|
unit: "°C",
|
|
@@ -79049,7 +80010,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79049
80010
|
state: [
|
|
79050
80011
|
{
|
|
79051
80012
|
kind: "numeric",
|
|
79052
|
-
field: "
|
|
80013
|
+
field: "level",
|
|
79053
80014
|
quantity: t("the battery level", "il livello della batteria"),
|
|
79054
80015
|
label: t("Battery", "Batteria"),
|
|
79055
80016
|
unit: "%",
|
|
@@ -79091,7 +80052,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79091
80052
|
icon: "battery-charging"
|
|
79092
80053
|
}
|
|
79093
80054
|
],
|
|
79094
|
-
events: { onStatusChanged: { notOperatorFacing: "the
|
|
80055
|
+
events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
|
|
79095
80056
|
extraEvents: [{
|
|
79096
80057
|
category: EventCategory.DeviceAwake,
|
|
79097
80058
|
label: t("Woke up", "Risvegliato"),
|
|
@@ -79109,7 +80070,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79109
80070
|
noun: t("Network link", "Collegamento di rete"),
|
|
79110
80071
|
state: [{
|
|
79111
80072
|
kind: "numeric",
|
|
79112
|
-
field: "
|
|
80073
|
+
field: "signal",
|
|
79113
80074
|
quantity: t("the signal strength", "l’intensità del segnale"),
|
|
79114
80075
|
label: t("Signal", "Segnale"),
|
|
79115
80076
|
unit: "%",
|
|
@@ -79202,6 +80163,8 @@ var ML = "model and training machinery — no device action";
|
|
|
79202
80163
|
var INTERNAL = "internal plumbing between addons — never operator-facing";
|
|
79203
80164
|
/** Every system-scoped cap, with why it is not a device's vocabulary. */
|
|
79204
80165
|
var SYSTEM_CAP_VOCABULARY = {
|
|
80166
|
+
"action-source": system(INTERNAL),
|
|
80167
|
+
actions: system("declared actions — run from the Actions page and from the cameras that link them"),
|
|
79205
80168
|
"addon-pages": system(UI_PLUMBING),
|
|
79206
80169
|
"addon-pages-source": system(UI_PLUMBING),
|
|
79207
80170
|
"addon-routes": system(UI_PLUMBING),
|
|
@@ -79423,6 +80386,31 @@ Object.freeze({
|
|
|
79423
80386
|
form: "single",
|
|
79424
80387
|
optional: false
|
|
79425
80388
|
}],
|
|
80389
|
+
"actions.get": [{
|
|
80390
|
+
name: "deviceId",
|
|
80391
|
+
form: "single",
|
|
80392
|
+
optional: true
|
|
80393
|
+
}],
|
|
80394
|
+
"actions.getLinks": [{
|
|
80395
|
+
name: "deviceId",
|
|
80396
|
+
form: "single",
|
|
80397
|
+
optional: false
|
|
80398
|
+
}],
|
|
80399
|
+
"actions.listForCamera": [{
|
|
80400
|
+
name: "deviceId",
|
|
80401
|
+
form: "single",
|
|
80402
|
+
optional: false
|
|
80403
|
+
}],
|
|
80404
|
+
"actions.run": [{
|
|
80405
|
+
name: "deviceId",
|
|
80406
|
+
form: "single",
|
|
80407
|
+
optional: true
|
|
80408
|
+
}],
|
|
80409
|
+
"actions.setLinks": [{
|
|
80410
|
+
name: "deviceId",
|
|
80411
|
+
form: "single",
|
|
80412
|
+
optional: false
|
|
80413
|
+
}],
|
|
79426
80414
|
"addonSettings.getDeviceSettings": [{
|
|
79427
80415
|
name: "deviceId",
|
|
79428
80416
|
form: "single",
|
|
@@ -80374,6 +81362,11 @@ Object.freeze({
|
|
|
80374
81362
|
form: "single",
|
|
80375
81363
|
optional: false
|
|
80376
81364
|
}],
|
|
81365
|
+
"groupActive.getStatus": [{
|
|
81366
|
+
name: "deviceId",
|
|
81367
|
+
form: "single",
|
|
81368
|
+
optional: false
|
|
81369
|
+
}],
|
|
80377
81370
|
"groupCommands.getStatus": [{
|
|
80378
81371
|
name: "deviceId",
|
|
80379
81372
|
form: "single",
|
|
@@ -80584,6 +81577,11 @@ Object.freeze({
|
|
|
80584
81577
|
form: "single",
|
|
80585
81578
|
optional: false
|
|
80586
81579
|
}],
|
|
81580
|
+
"meter.getStatus": [{
|
|
81581
|
+
name: "deviceId",
|
|
81582
|
+
form: "single",
|
|
81583
|
+
optional: false
|
|
81584
|
+
}],
|
|
80587
81585
|
"motion.getStatus": [{
|
|
80588
81586
|
name: "deviceId",
|
|
80589
81587
|
form: "single",
|
|
@@ -82191,7 +83189,6 @@ Object.freeze({
|
|
|
82191
83189
|
"network-access": "ingress",
|
|
82192
83190
|
"smtp-provider": "email"
|
|
82193
83191
|
});
|
|
82194
|
-
DeviceType.Camera;
|
|
82195
83192
|
/**
|
|
82196
83193
|
* A saved Customize assignment (D936). The schema is the type: callers use
|
|
82197
83194
|
* `z.infer`, they do not restate the shape.
|
|
@@ -83596,12 +84593,13 @@ function resolveGrantDeviceIds(scopes, fleet, access) {
|
|
|
83596
84593
|
}
|
|
83597
84594
|
return out;
|
|
83598
84595
|
}
|
|
84596
|
+
String.raw`(?<=^|["'(\s>,\[{])`;
|
|
83599
84597
|
var MB = 1024 * 1024;
|
|
83600
84598
|
1024 * MB, 3072 * MB;
|
|
83601
84599
|
//#endregion
|
|
83602
84600
|
//#region src/custom-actions.ts
|
|
83603
84601
|
/**
|
|
83604
|
-
* Alexa
|
|
84602
|
+
* Alexa Export — customActions catalog.
|
|
83605
84603
|
*
|
|
83606
84604
|
* The settings page drives these through
|
|
83607
84605
|
* `api.addons.custom.{query,mutate}({ addonId, action, input })`: every action
|
|
@@ -85317,13 +86315,13 @@ var temperatureAdapter = {
|
|
|
85317
86315
|
category: "TEMPERATURE_SENSOR"
|
|
85318
86316
|
}),
|
|
85319
86317
|
properties: (_cap, slice) => {
|
|
85320
|
-
const p = TemperatureSensorStatusSchema.pick({
|
|
85321
|
-
if (!p.success || p.data.
|
|
86318
|
+
const p = TemperatureSensorStatusSchema.pick({ temperature: true }).safeParse(slice);
|
|
86319
|
+
if (!p.success || p.data.temperature === null) return [];
|
|
85322
86320
|
return [{
|
|
85323
86321
|
namespace: "Alexa.TemperatureSensor",
|
|
85324
86322
|
name: "temperature",
|
|
85325
86323
|
value: {
|
|
85326
|
-
value: Math.round(p.data.
|
|
86324
|
+
value: Math.round(p.data.temperature * 10) / 10,
|
|
85327
86325
|
scale: "CELSIUS"
|
|
85328
86326
|
}
|
|
85329
86327
|
}];
|
|
@@ -86068,12 +87066,12 @@ var humidityAdapter = {
|
|
|
86068
87066
|
category: "TEMPERATURE_SENSOR"
|
|
86069
87067
|
}),
|
|
86070
87068
|
properties: (_cap, slice) => {
|
|
86071
|
-
const p = HumiditySensorStatusSchema.pick({
|
|
86072
|
-
if (!p.success || p.data.
|
|
87069
|
+
const p = HumiditySensorStatusSchema.pick({ humidity: true }).safeParse(slice);
|
|
87070
|
+
if (!p.success || p.data.humidity === null) return [];
|
|
86073
87071
|
return [{
|
|
86074
87072
|
namespace: "Alexa.HumiditySensor",
|
|
86075
87073
|
name: "relativeHumidity",
|
|
86076
|
-
value: { value: Math.max(0, Math.min(100, p.data.
|
|
87074
|
+
value: { value: Math.max(0, Math.min(100, p.data.humidity)) }
|
|
86077
87075
|
}];
|
|
86078
87076
|
},
|
|
86079
87077
|
directives: [],
|
|
@@ -86247,7 +87245,7 @@ async function handleSetBrightness(header, endpointRaw, payloadRaw, deps, _calle
|
|
|
86247
87245
|
try {
|
|
86248
87246
|
await api.brightness.setBrightness.mutate({
|
|
86249
87247
|
deviceId: targetDeviceId,
|
|
86250
|
-
percentage
|
|
87248
|
+
level: percentage
|
|
86251
87249
|
});
|
|
86252
87250
|
} catch (err) {
|
|
86253
87251
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -86391,11 +87389,11 @@ var GENERIC_ADAPTERS = [
|
|
|
86391
87389
|
},
|
|
86392
87390
|
properties: (capName, slice) => {
|
|
86393
87391
|
if (capName === "brightness") {
|
|
86394
|
-
const p = BrightnessStatusSchema.pick({
|
|
87392
|
+
const p = BrightnessStatusSchema.pick({ level: true }).safeParse(slice);
|
|
86395
87393
|
return p.success ? [{
|
|
86396
87394
|
namespace: "Alexa.BrightnessController",
|
|
86397
87395
|
name: "brightness",
|
|
86398
|
-
value: Math.max(0, Math.min(100, Math.round(p.data.
|
|
87396
|
+
value: Math.max(0, Math.min(100, Math.round(p.data.level)))
|
|
86399
87397
|
}] : [];
|
|
86400
87398
|
}
|
|
86401
87399
|
const p = SwitchStatusSchema.pick({ on: true }).safeParse(slice);
|
|
@@ -89445,7 +90443,7 @@ async function collectChildProperties(api, childDeviceId, properties, timeOfSamp
|
|
|
89445
90443
|
timeOfSample,
|
|
89446
90444
|
uncertaintyInMilliseconds: 0
|
|
89447
90445
|
});
|
|
89448
|
-
const level = numberField(await api.brightness.getStatus.query({ deviceId: childDeviceId }).catch(() => null), "
|
|
90446
|
+
const level = numberField(await api.brightness.getStatus.query({ deviceId: childDeviceId }).catch(() => null), "level");
|
|
89449
90447
|
if (level !== null) properties.push({
|
|
89450
90448
|
namespace: "Alexa.BrightnessController",
|
|
89451
90449
|
name: "brightness",
|
|
@@ -93328,7 +94326,7 @@ function indexByDrivingDevice(exported) {
|
|
|
93328
94326
|
}
|
|
93329
94327
|
var EnabledSchema = object({ enabled: boolean() });
|
|
93330
94328
|
var OnSchema = object({ on: boolean() });
|
|
93331
|
-
var PercentageSchema = object({
|
|
94329
|
+
var PercentageSchema = object({ level: number() });
|
|
93332
94330
|
var OnlineSchema = object({ online: boolean() });
|
|
93333
94331
|
function power(on) {
|
|
93334
94332
|
return {
|
|
@@ -93409,7 +94407,7 @@ function stateReportsFor(change, exported) {
|
|
|
93409
94407
|
case "brightness": {
|
|
93410
94408
|
const parsed = PercentageSchema.safeParse(change.slice);
|
|
93411
94409
|
if (!parsed.success) break;
|
|
93412
|
-
const value = Math.max(0, Math.min(100, Math.round(parsed.data.
|
|
94410
|
+
const value = Math.max(0, Math.min(100, Math.round(parsed.data.level)));
|
|
93413
94411
|
for (const e of of("child")) reports.push({
|
|
93414
94412
|
...e,
|
|
93415
94413
|
interfaceName: "Alexa.BrightnessController",
|