@camstack/addon-export-alexa 1.2.172 → 1.2.174
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 +12 -0
- package/dist/export-alexa.addon.js +1643 -252
- package/dist/export-alexa.addon.mjs +1643 -252
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import "node:fs";
|
|
|
5
5
|
import "node:path";
|
|
6
6
|
import "node:child_process";
|
|
7
7
|
import "node:zlib";
|
|
8
|
-
//#region ../types/dist/event-category-
|
|
8
|
+
//#region ../types/dist/event-category-DmZDPDf_.mjs
|
|
9
9
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
10
10
|
EventCategory["SystemBoot"] = "system.boot";
|
|
11
11
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -632,7 +632,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
632
632
|
* (a track was promoted to a stationary-registry entry) or departs (the
|
|
633
633
|
* object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
|
|
634
634
|
* the dedicated "Stationary" section — never the live event feed. Payload:
|
|
635
|
-
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp }`.
|
|
635
|
+
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
|
|
636
636
|
*/
|
|
637
637
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
638
638
|
/**
|
|
@@ -770,6 +770,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
770
770
|
*/
|
|
771
771
|
EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
|
|
772
772
|
/**
|
|
773
|
+
* An action run started or ended. Emitted by the `actions` surface.
|
|
774
|
+
* Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
|
|
775
|
+
*/
|
|
776
|
+
EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
|
|
777
|
+
/**
|
|
773
778
|
* Progress update from a running model conversion job.
|
|
774
779
|
* Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
|
|
775
780
|
* Emitted by `addon-model-studio` on the converting node.
|
|
@@ -5448,7 +5453,7 @@ var ZodIssueCode = {
|
|
|
5448
5453
|
var ZodFirstPartyTypeKind;
|
|
5449
5454
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5450
5455
|
//#endregion
|
|
5451
|
-
//#region ../types/dist/sleep
|
|
5456
|
+
//#region ../types/dist/sleep-DJws6ho7.mjs
|
|
5452
5457
|
/**
|
|
5453
5458
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5454
5459
|
* window to float samples (D455).
|
|
@@ -8519,6 +8524,8 @@ Object.freeze({ "doorbell": "lastPressedAt" });
|
|
|
8519
8524
|
/** Every capability name, so addon code can check a name without the schema graph. */
|
|
8520
8525
|
var CAP_NAMES = Object.freeze([
|
|
8521
8526
|
"accessories",
|
|
8527
|
+
"action-source",
|
|
8528
|
+
"actions",
|
|
8522
8529
|
"addon-pages",
|
|
8523
8530
|
"addon-pages-source",
|
|
8524
8531
|
"addon-routes",
|
|
@@ -8602,6 +8609,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8602
8609
|
"image-settings",
|
|
8603
8610
|
"integrations",
|
|
8604
8611
|
"intercom",
|
|
8612
|
+
"ir-transmitter",
|
|
8605
8613
|
"keychain",
|
|
8606
8614
|
"keychain-admin",
|
|
8607
8615
|
"lawn-mower-control",
|
|
@@ -8660,6 +8668,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8660
8668
|
"recording-onboard",
|
|
8661
8669
|
"recording-signal",
|
|
8662
8670
|
"records",
|
|
8671
|
+
"remote",
|
|
8663
8672
|
"running-state",
|
|
8664
8673
|
"scene-monitor",
|
|
8665
8674
|
"script-runner",
|
|
@@ -8683,6 +8692,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
8683
8692
|
"system",
|
|
8684
8693
|
"tamper",
|
|
8685
8694
|
"temperature-sensor",
|
|
8695
|
+
"template",
|
|
8686
8696
|
"terminal-session",
|
|
8687
8697
|
"toast",
|
|
8688
8698
|
"training",
|
|
@@ -8707,11 +8717,11 @@ var CAP_NAMES = Object.freeze([
|
|
|
8707
8717
|
Object.freeze({
|
|
8708
8718
|
"air-quality-sensor": [
|
|
8709
8719
|
{
|
|
8710
|
-
"path": "
|
|
8720
|
+
"path": "co2",
|
|
8711
8721
|
"valueType": "number"
|
|
8712
8722
|
},
|
|
8713
8723
|
{
|
|
8714
|
-
"path": "
|
|
8724
|
+
"path": "voc",
|
|
8715
8725
|
"valueType": "number"
|
|
8716
8726
|
},
|
|
8717
8727
|
{
|
|
@@ -8761,7 +8771,7 @@ Object.freeze({
|
|
|
8761
8771
|
}
|
|
8762
8772
|
],
|
|
8763
8773
|
"ambient-light-sensor": [{
|
|
8764
|
-
"path": "
|
|
8774
|
+
"path": "illuminance",
|
|
8765
8775
|
"valueType": "number"
|
|
8766
8776
|
}],
|
|
8767
8777
|
"audio-metrics": [
|
|
@@ -8822,7 +8832,7 @@ Object.freeze({
|
|
|
8822
8832
|
],
|
|
8823
8833
|
"battery": [
|
|
8824
8834
|
{
|
|
8825
|
-
"path": "
|
|
8835
|
+
"path": "level",
|
|
8826
8836
|
"valueType": "number"
|
|
8827
8837
|
},
|
|
8828
8838
|
{
|
|
@@ -8844,7 +8854,7 @@ Object.freeze({
|
|
|
8844
8854
|
"valueType": "number"
|
|
8845
8855
|
},
|
|
8846
8856
|
{
|
|
8847
|
-
"path": "
|
|
8857
|
+
"path": "voltage",
|
|
8848
8858
|
"valueType": "number"
|
|
8849
8859
|
},
|
|
8850
8860
|
{
|
|
@@ -8865,7 +8875,7 @@ Object.freeze({
|
|
|
8865
8875
|
"valueType": "boolean"
|
|
8866
8876
|
}],
|
|
8867
8877
|
"brightness": [{
|
|
8868
|
-
"path": "
|
|
8878
|
+
"path": "level",
|
|
8869
8879
|
"valueType": "number"
|
|
8870
8880
|
}],
|
|
8871
8881
|
"broker": [{
|
|
@@ -9066,7 +9076,7 @@ Object.freeze({
|
|
|
9066
9076
|
"valueType": "number"
|
|
9067
9077
|
},
|
|
9068
9078
|
{
|
|
9069
|
-
"path": "
|
|
9079
|
+
"path": "colorTemperature",
|
|
9070
9080
|
"valueType": "number"
|
|
9071
9081
|
}
|
|
9072
9082
|
],
|
|
@@ -9245,15 +9255,15 @@ Object.freeze({
|
|
|
9245
9255
|
"valueType": "string"
|
|
9246
9256
|
},
|
|
9247
9257
|
{
|
|
9248
|
-
"path": "
|
|
9258
|
+
"path": "remaining",
|
|
9249
9259
|
"valueType": "number"
|
|
9250
9260
|
},
|
|
9251
9261
|
{
|
|
9252
|
-
"path": "
|
|
9262
|
+
"path": "delayedStart",
|
|
9253
9263
|
"valueType": "number"
|
|
9254
9264
|
},
|
|
9255
9265
|
{
|
|
9256
|
-
"path": "
|
|
9266
|
+
"path": "progress",
|
|
9257
9267
|
"valueType": "number"
|
|
9258
9268
|
},
|
|
9259
9269
|
{
|
|
@@ -9367,7 +9377,7 @@ Object.freeze({
|
|
|
9367
9377
|
],
|
|
9368
9378
|
"fan-control": [
|
|
9369
9379
|
{
|
|
9370
|
-
"path": "
|
|
9380
|
+
"path": "speed",
|
|
9371
9381
|
"valueType": "number"
|
|
9372
9382
|
},
|
|
9373
9383
|
{
|
|
@@ -9467,7 +9477,7 @@ Object.freeze({
|
|
|
9467
9477
|
}
|
|
9468
9478
|
],
|
|
9469
9479
|
"humidity-sensor": [{
|
|
9470
|
-
"path": "
|
|
9480
|
+
"path": "humidity",
|
|
9471
9481
|
"valueType": "number"
|
|
9472
9482
|
}],
|
|
9473
9483
|
"image": [{
|
|
@@ -9577,7 +9587,7 @@ Object.freeze({
|
|
|
9577
9587
|
"valueType": "number"
|
|
9578
9588
|
},
|
|
9579
9589
|
{
|
|
9580
|
-
"path": "
|
|
9590
|
+
"path": "progress",
|
|
9581
9591
|
"valueType": "number"
|
|
9582
9592
|
},
|
|
9583
9593
|
{
|
|
@@ -9623,6 +9633,11 @@ Object.freeze({
|
|
|
9623
9633
|
"standby"
|
|
9624
9634
|
]
|
|
9625
9635
|
},
|
|
9636
|
+
{
|
|
9637
|
+
"path": "stateSource",
|
|
9638
|
+
"valueType": "enum",
|
|
9639
|
+
"enumValues": ["reported", "assumed"]
|
|
9640
|
+
},
|
|
9626
9641
|
{
|
|
9627
9642
|
"path": "volumeLevel",
|
|
9628
9643
|
"valueType": "number"
|
|
@@ -9656,11 +9671,11 @@ Object.freeze({
|
|
|
9656
9671
|
"valueType": "string"
|
|
9657
9672
|
},
|
|
9658
9673
|
{
|
|
9659
|
-
"path": "
|
|
9674
|
+
"path": "position",
|
|
9660
9675
|
"valueType": "number"
|
|
9661
9676
|
},
|
|
9662
9677
|
{
|
|
9663
|
-
"path": "
|
|
9678
|
+
"path": "duration",
|
|
9664
9679
|
"valueType": "number"
|
|
9665
9680
|
},
|
|
9666
9681
|
{
|
|
@@ -9762,11 +9777,11 @@ Object.freeze({
|
|
|
9762
9777
|
]
|
|
9763
9778
|
},
|
|
9764
9779
|
{
|
|
9765
|
-
"path": "
|
|
9780
|
+
"path": "signal",
|
|
9766
9781
|
"valueType": "number"
|
|
9767
9782
|
},
|
|
9768
9783
|
{
|
|
9769
|
-
"path": "
|
|
9784
|
+
"path": "rssi",
|
|
9770
9785
|
"valueType": "number"
|
|
9771
9786
|
},
|
|
9772
9787
|
{
|
|
@@ -9821,6 +9836,18 @@ Object.freeze({
|
|
|
9821
9836
|
"path": "foodLevel",
|
|
9822
9837
|
"valueType": "number"
|
|
9823
9838
|
},
|
|
9839
|
+
{
|
|
9840
|
+
"path": "bowlFood",
|
|
9841
|
+
"valueType": "number"
|
|
9842
|
+
},
|
|
9843
|
+
{
|
|
9844
|
+
"path": "eating",
|
|
9845
|
+
"valueType": "boolean"
|
|
9846
|
+
},
|
|
9847
|
+
{
|
|
9848
|
+
"path": "supportsMarkRefilled",
|
|
9849
|
+
"valueType": "boolean"
|
|
9850
|
+
},
|
|
9824
9851
|
{
|
|
9825
9852
|
"path": "food1",
|
|
9826
9853
|
"valueType": "number"
|
|
@@ -9837,6 +9864,11 @@ Object.freeze({
|
|
|
9837
9864
|
"path": "batteryPower",
|
|
9838
9865
|
"valueType": "number"
|
|
9839
9866
|
},
|
|
9867
|
+
{
|
|
9868
|
+
"path": "powerSource",
|
|
9869
|
+
"valueType": "enum",
|
|
9870
|
+
"enumValues": ["mains", "battery"]
|
|
9871
|
+
},
|
|
9840
9872
|
{
|
|
9841
9873
|
"path": "desiccantLeftDays",
|
|
9842
9874
|
"valueType": "number"
|
|
@@ -9881,27 +9913,39 @@ Object.freeze({
|
|
|
9881
9913
|
{
|
|
9882
9914
|
"path": "volume",
|
|
9883
9915
|
"valueType": "number"
|
|
9916
|
+
},
|
|
9917
|
+
{
|
|
9918
|
+
"path": "lastFeedGrams",
|
|
9919
|
+
"valueType": "number"
|
|
9920
|
+
},
|
|
9921
|
+
{
|
|
9922
|
+
"path": "lastFeedHopper1",
|
|
9923
|
+
"valueType": "number"
|
|
9924
|
+
},
|
|
9925
|
+
{
|
|
9926
|
+
"path": "lastFeedHopper2",
|
|
9927
|
+
"valueType": "number"
|
|
9884
9928
|
}
|
|
9885
9929
|
],
|
|
9886
9930
|
"power-meter": [
|
|
9887
9931
|
{
|
|
9888
|
-
"path": "
|
|
9932
|
+
"path": "power",
|
|
9889
9933
|
"valueType": "number"
|
|
9890
9934
|
},
|
|
9891
9935
|
{
|
|
9892
|
-
"path": "
|
|
9936
|
+
"path": "energy",
|
|
9893
9937
|
"valueType": "number"
|
|
9894
9938
|
},
|
|
9895
9939
|
{
|
|
9896
|
-
"path": "
|
|
9940
|
+
"path": "voltage",
|
|
9897
9941
|
"valueType": "number"
|
|
9898
9942
|
},
|
|
9899
9943
|
{
|
|
9900
|
-
"path": "
|
|
9944
|
+
"path": "current",
|
|
9901
9945
|
"valueType": "number"
|
|
9902
9946
|
},
|
|
9903
9947
|
{
|
|
9904
|
-
"path": "
|
|
9948
|
+
"path": "apparentPower",
|
|
9905
9949
|
"valueType": "number"
|
|
9906
9950
|
},
|
|
9907
9951
|
{
|
|
@@ -9929,14 +9973,10 @@ Object.freeze({
|
|
|
9929
9973
|
{
|
|
9930
9974
|
"path": "gps.accuracyMeters",
|
|
9931
9975
|
"valueType": "number"
|
|
9932
|
-
},
|
|
9933
|
-
{
|
|
9934
|
-
"path": "batteryPercent",
|
|
9935
|
-
"valueType": "number"
|
|
9936
9976
|
}
|
|
9937
9977
|
],
|
|
9938
9978
|
"pressure-sensor": [{
|
|
9939
|
-
"path": "
|
|
9979
|
+
"path": "pressure",
|
|
9940
9980
|
"valueType": "number"
|
|
9941
9981
|
}],
|
|
9942
9982
|
"privacy-mask": [{
|
|
@@ -10250,7 +10290,7 @@ Object.freeze({
|
|
|
10250
10290
|
"valueType": "boolean"
|
|
10251
10291
|
}],
|
|
10252
10292
|
"temperature-sensor": [{
|
|
10253
|
-
"path": "
|
|
10293
|
+
"path": "temperature",
|
|
10254
10294
|
"valueType": "number"
|
|
10255
10295
|
}],
|
|
10256
10296
|
"update": [
|
|
@@ -10298,7 +10338,7 @@ Object.freeze({
|
|
|
10298
10338
|
"valueType": "string"
|
|
10299
10339
|
},
|
|
10300
10340
|
{
|
|
10301
|
-
"path": "
|
|
10341
|
+
"path": "progress",
|
|
10302
10342
|
"valueType": "number"
|
|
10303
10343
|
},
|
|
10304
10344
|
{
|
|
@@ -10424,7 +10464,7 @@ object({
|
|
|
10424
10464
|
params: record(string(), union([string(), number()])).optional()
|
|
10425
10465
|
});
|
|
10426
10466
|
//#endregion
|
|
10427
|
-
//#region ../types/dist/err-msg-
|
|
10467
|
+
//#region ../types/dist/err-msg-BCdlR2Li.mjs
|
|
10428
10468
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
10429
10469
|
DeviceType["Camera"] = "camera";
|
|
10430
10470
|
DeviceType["Hub"] = "hub";
|
|
@@ -10770,6 +10810,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
10770
10810
|
/** Fallback when the notifier service name doesn't match a known
|
|
10771
10811
|
* pattern. */
|
|
10772
10812
|
DeviceRole["GenericNotifier"] = "generic-notifier";
|
|
10813
|
+
/** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
|
|
10814
|
+
* cap. A `DeviceType.Generic` device. */
|
|
10815
|
+
DeviceRole["IrTransmitter"] = "ir-transmitter";
|
|
10773
10816
|
return DeviceRole;
|
|
10774
10817
|
}({});
|
|
10775
10818
|
/**
|
|
@@ -10783,7 +10826,7 @@ function errMsg(err) {
|
|
|
10783
10826
|
return String(err);
|
|
10784
10827
|
}
|
|
10785
10828
|
//#endregion
|
|
10786
|
-
//#region ../types/dist/composition-
|
|
10829
|
+
//#region ../types/dist/composition-bIBW5_13.mjs
|
|
10787
10830
|
/**
|
|
10788
10831
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
10789
10832
|
*
|
|
@@ -15590,6 +15633,14 @@ var AutomationConditionLeafSchema = object({
|
|
|
15590
15633
|
array(union([string(), number()]))
|
|
15591
15634
|
])
|
|
15592
15635
|
});
|
|
15636
|
+
var AutomationConditionStationaryPresentSchema = object({
|
|
15637
|
+
kind: literal("stationary-present"),
|
|
15638
|
+
deviceId: number().int().nonnegative(),
|
|
15639
|
+
/** Class names; a macro class matches every raw class that maps to it. */
|
|
15640
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
15641
|
+
/** The parked object must be in at least one of these zones. */
|
|
15642
|
+
zones: array(string().min(1)).min(1).optional()
|
|
15643
|
+
});
|
|
15593
15644
|
/**
|
|
15594
15645
|
* The expression leaf, declared as a plain object rather than an intersection
|
|
15595
15646
|
* with {@link ExpressionSourceSchema}: a discriminated union has to be able to
|
|
@@ -15623,7 +15674,8 @@ var AutomationConditionSchema = lazy(() => discriminatedUnion("kind", [
|
|
|
15623
15674
|
child: AutomationConditionSchema
|
|
15624
15675
|
}),
|
|
15625
15676
|
AutomationConditionLeafSchema,
|
|
15626
|
-
AutomationConditionExpressionSchema
|
|
15677
|
+
AutomationConditionExpressionSchema,
|
|
15678
|
+
AutomationConditionStationaryPresentSchema
|
|
15627
15679
|
]));
|
|
15628
15680
|
/**
|
|
15629
15681
|
* What starts a run.
|
|
@@ -15664,7 +15716,34 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
15664
15716
|
kind: literal("schedule"),
|
|
15665
15717
|
cron: string().min(1).max(120)
|
|
15666
15718
|
}),
|
|
15667
|
-
object({ kind: literal("manual") })
|
|
15719
|
+
object({ kind: literal("manual") }),
|
|
15720
|
+
object({
|
|
15721
|
+
kind: literal("detection"),
|
|
15722
|
+
/** Class names. A macro class (`animal`, `vehicle`, `person`, `package`)
|
|
15723
|
+
* matches every raw class that maps to it; any other name matches
|
|
15724
|
+
* exactly. */
|
|
15725
|
+
classes: array(string().min(1)).min(1),
|
|
15726
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
15727
|
+
/** The track must have visited at least one of these zones. */
|
|
15728
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
15729
|
+
/** Best-so-far confidence the track must reach. */
|
|
15730
|
+
minScore: number().min(0).max(1).optional()
|
|
15731
|
+
}),
|
|
15732
|
+
object({
|
|
15733
|
+
kind: literal("stationary"),
|
|
15734
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
15735
|
+
/** Class names; a macro class matches like the detection trigger. */
|
|
15736
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
15737
|
+
/** The parked object must be in at least one of these zones. */
|
|
15738
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
15739
|
+
/** `appeared`: it became parked. `departed`: the registry retired it.
|
|
15740
|
+
* The vocabulary of `PipelineAnalyticsStationaryChanged`. */
|
|
15741
|
+
phase: _enum(["appeared", "departed"])
|
|
15742
|
+
}),
|
|
15743
|
+
object({
|
|
15744
|
+
kind: literal("interval"),
|
|
15745
|
+
minutes: number().int().min(1).max(1440)
|
|
15746
|
+
})
|
|
15668
15747
|
]);
|
|
15669
15748
|
/**
|
|
15670
15749
|
* One action step.
|
|
@@ -15684,28 +15763,47 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
15684
15763
|
* is called. The runner still receives a number and is untouched; the
|
|
15685
15764
|
* resolution is the recipe's job, not the runner's.
|
|
15686
15765
|
*/
|
|
15766
|
+
var AutomationWaitStepSchema = object({
|
|
15767
|
+
kind: literal("wait"),
|
|
15768
|
+
seconds: number().min(0).max(300)
|
|
15769
|
+
});
|
|
15770
|
+
var AutomationCapStepSchema = object({
|
|
15771
|
+
kind: literal("cap"),
|
|
15772
|
+
/**
|
|
15773
|
+
* One device, several same-family devices (locks / climate family / …),
|
|
15774
|
+
* or `{ $var }` for the device that triggered the run. An array is
|
|
15775
|
+
* fan-out at codegen — each id gets the same cap.method call.
|
|
15776
|
+
*/
|
|
15777
|
+
deviceId: union([
|
|
15778
|
+
number().int(),
|
|
15779
|
+
array(number().int()).min(1),
|
|
15780
|
+
object({ $var: string().min(1) })
|
|
15781
|
+
]),
|
|
15782
|
+
cap: string().min(1),
|
|
15783
|
+
method: string().min(1),
|
|
15784
|
+
/** Values may carry `{{vars.x}}` slots, or be exactly `{ $var: 'name' }`, which
|
|
15785
|
+
* SUBSTITUTE and do not evaluate (§3.2.3). Anything beyond substitution is
|
|
15786
|
+
* the expression leaf. */
|
|
15787
|
+
args: record(string(), unknown()).optional()
|
|
15788
|
+
});
|
|
15789
|
+
/**
|
|
15790
|
+
* The steps an internal Action may contain: cap and wait, and nothing that can
|
|
15791
|
+
* call back into an Action — so an Action can never reach itself (no cycles).
|
|
15792
|
+
*/
|
|
15793
|
+
var ActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
|
|
15687
15794
|
var AutomationActionSchema = discriminatedUnion("kind", [
|
|
15795
|
+
AutomationWaitStepSchema,
|
|
15796
|
+
AutomationCapStepSchema,
|
|
15688
15797
|
object({
|
|
15689
|
-
kind: literal("
|
|
15690
|
-
|
|
15691
|
-
|
|
15692
|
-
|
|
15693
|
-
|
|
15694
|
-
|
|
15695
|
-
|
|
15696
|
-
|
|
15697
|
-
|
|
15698
|
-
*/
|
|
15699
|
-
deviceId: union([
|
|
15700
|
-
number().int(),
|
|
15701
|
-
array(number().int()).min(1),
|
|
15702
|
-
object({ $var: string().min(1) })
|
|
15703
|
-
]),
|
|
15704
|
-
cap: string().min(1),
|
|
15705
|
-
method: string().min(1),
|
|
15706
|
-
/** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
|
|
15707
|
-
* evaluate (§3.2.3). Anything beyond substitution is the expression leaf. */
|
|
15708
|
-
args: record(string(), unknown()).optional()
|
|
15798
|
+
kind: literal("action"),
|
|
15799
|
+
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
15800
|
+
actionId: string().min(1),
|
|
15801
|
+
/** Values for the action's declared variables; the others take their default. */
|
|
15802
|
+
variables: record(string(), union([
|
|
15803
|
+
string(),
|
|
15804
|
+
number(),
|
|
15805
|
+
boolean()
|
|
15806
|
+
])).optional()
|
|
15709
15807
|
}),
|
|
15710
15808
|
object({
|
|
15711
15809
|
kind: literal("code"),
|
|
@@ -15714,10 +15812,357 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
15714
15812
|
code: string().min(1).max(2e4)
|
|
15715
15813
|
})
|
|
15716
15814
|
]);
|
|
15815
|
+
/**
|
|
15816
|
+
* How a trigger that arrives while the automation is busy (or cooling down) is
|
|
15817
|
+
* handled. One of the automation's execution modes, never a property of its
|
|
15818
|
+
* actions. Absent means `single`.
|
|
15819
|
+
*
|
|
15820
|
+
* - `single` — drop the trigger while a run is in progress (traced + logged).
|
|
15821
|
+
* - `restart` — abort the run in progress (at its next step boundary), start fresh.
|
|
15822
|
+
* - `queued` — queue up to `max` triggers, drop the rest (traced).
|
|
15823
|
+
* - `parallel` — up to `max` runs at once, drop the rest (traced).
|
|
15824
|
+
* - `cooldown` — `single`, and no new run until `minutes` after the last run
|
|
15825
|
+
* STARTED; persisted across a restart. A manual trigger bypasses only this
|
|
15826
|
+
* wait, never the single/queued limits.
|
|
15827
|
+
*/
|
|
15828
|
+
var AutomationRunModeSchema = discriminatedUnion("mode", [
|
|
15829
|
+
object({ mode: literal("single") }),
|
|
15830
|
+
object({ mode: literal("restart") }),
|
|
15831
|
+
object({
|
|
15832
|
+
mode: literal("queued"),
|
|
15833
|
+
max: number().int().min(1).max(10)
|
|
15834
|
+
}),
|
|
15835
|
+
object({
|
|
15836
|
+
mode: literal("parallel"),
|
|
15837
|
+
max: number().int().min(1).max(10)
|
|
15838
|
+
}),
|
|
15839
|
+
object({
|
|
15840
|
+
mode: literal("cooldown"),
|
|
15841
|
+
minutes: number().int().min(1).max(1440)
|
|
15842
|
+
})
|
|
15843
|
+
]);
|
|
15717
15844
|
var AutomationRecipeSchema = object({
|
|
15718
15845
|
triggers: array(AutomationTriggerSchema),
|
|
15719
15846
|
conditions: AutomationConditionSchema.optional(),
|
|
15720
|
-
actions: array(AutomationActionSchema)
|
|
15847
|
+
actions: array(AutomationActionSchema),
|
|
15848
|
+
runMode: AutomationRunModeSchema.optional(),
|
|
15849
|
+
/** How many run traces the automation keeps (default {@link DEFAULT_TRACE_KEEP}). */
|
|
15850
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
15851
|
+
});
|
|
15852
|
+
new Set([
|
|
15853
|
+
{
|
|
15854
|
+
id: "person",
|
|
15855
|
+
name: "Person"
|
|
15856
|
+
},
|
|
15857
|
+
{
|
|
15858
|
+
id: "vehicle",
|
|
15859
|
+
name: "Vehicle"
|
|
15860
|
+
},
|
|
15861
|
+
{
|
|
15862
|
+
id: "animal",
|
|
15863
|
+
name: "Animal"
|
|
15864
|
+
},
|
|
15865
|
+
{
|
|
15866
|
+
id: "package",
|
|
15867
|
+
name: "Package"
|
|
15868
|
+
}
|
|
15869
|
+
].map((l) => l.id));
|
|
15870
|
+
var COCO_TO_MACRO = {
|
|
15871
|
+
mapping: {
|
|
15872
|
+
person: "person",
|
|
15873
|
+
bicycle: "vehicle",
|
|
15874
|
+
car: "vehicle",
|
|
15875
|
+
motorcycle: "vehicle",
|
|
15876
|
+
airplane: "vehicle",
|
|
15877
|
+
bus: "vehicle",
|
|
15878
|
+
train: "vehicle",
|
|
15879
|
+
truck: "vehicle",
|
|
15880
|
+
boat: "vehicle",
|
|
15881
|
+
bird: "animal",
|
|
15882
|
+
cat: "animal",
|
|
15883
|
+
dog: "animal",
|
|
15884
|
+
horse: "animal",
|
|
15885
|
+
sheep: "animal",
|
|
15886
|
+
cow: "animal",
|
|
15887
|
+
elephant: "animal",
|
|
15888
|
+
bear: "animal",
|
|
15889
|
+
zebra: "animal",
|
|
15890
|
+
giraffe: "animal",
|
|
15891
|
+
suitcase: "package",
|
|
15892
|
+
backpack: "package",
|
|
15893
|
+
handbag: "package"
|
|
15894
|
+
},
|
|
15895
|
+
preserveOriginal: false
|
|
15896
|
+
};
|
|
15897
|
+
new Set(Object.values(COCO_TO_MACRO.mapping));
|
|
15898
|
+
/**
|
|
15899
|
+
* Run traces — what an automation (or, later, an Action run) DID, node by node,
|
|
15900
|
+
* so the editor can paint every block green or red with its reason.
|
|
15901
|
+
*
|
|
15902
|
+
* A trace is data, not a log: it covers the WHOLE tree — the trigger stage,
|
|
15903
|
+
* every condition node (containers and leaves, including the ones a
|
|
15904
|
+
* short-circuit never reached), the run-mode verdict and every action step —
|
|
15905
|
+
* each addressed by a stable path (`conditions.0.1`, `actions.2`, or `steps.N`
|
|
15906
|
+
* for an Action run). Skipped
|
|
15907
|
+
* evaluations are traced too, and identical consecutive skips collapse into a
|
|
15908
|
+
* repeat count so a trigger that fails every 5 minutes cannot flush real runs.
|
|
15909
|
+
*
|
|
15910
|
+
* {@link AutomationStepTraceSchema} is deliberately free of automation
|
|
15911
|
+
* vocabulary so an Action run records the same step shape.
|
|
15912
|
+
*/
|
|
15913
|
+
/** A value a trace may show: JSON primitives and short lists, nothing deeper. */
|
|
15914
|
+
var TraceValueSchema = union([
|
|
15915
|
+
string(),
|
|
15916
|
+
number(),
|
|
15917
|
+
boolean(),
|
|
15918
|
+
_null(),
|
|
15919
|
+
array(union([string(), number()]))
|
|
15920
|
+
]);
|
|
15921
|
+
var AutomationRunOutcomeSchema = _enum([
|
|
15922
|
+
"ran",
|
|
15923
|
+
"skipped-trigger",
|
|
15924
|
+
"skipped-conditions",
|
|
15925
|
+
"skipped-cooldown",
|
|
15926
|
+
"skipped-overlap",
|
|
15927
|
+
"failed",
|
|
15928
|
+
"aborted"
|
|
15929
|
+
]);
|
|
15930
|
+
/** `not-evaluated` = a short-circuit never reached the node. */
|
|
15931
|
+
var TraceNodeOutcomeSchema = _enum([
|
|
15932
|
+
"pass",
|
|
15933
|
+
"fail",
|
|
15934
|
+
"not-evaluated"
|
|
15935
|
+
]);
|
|
15936
|
+
var AutomationTriggerTraceSchema = object({
|
|
15937
|
+
kind: string().min(1),
|
|
15938
|
+
outcome: _enum(["pass", "fail"]),
|
|
15939
|
+
/** Why an event was rejected ("class person not in [dog]") or what fired. */
|
|
15940
|
+
reason: string(),
|
|
15941
|
+
/** deviceId, className, trackId, score … — only what the trigger exposes. */
|
|
15942
|
+
vars: record(string(), TraceValueSchema)
|
|
15943
|
+
});
|
|
15944
|
+
var AutomationConditionTraceNodeSchema = object({
|
|
15945
|
+
/** `conditions` for the root, `conditions.<i>` for its i-th child, … */
|
|
15946
|
+
path: string().min(1),
|
|
15947
|
+
kind: _enum([
|
|
15948
|
+
"all",
|
|
15949
|
+
"any",
|
|
15950
|
+
"not",
|
|
15951
|
+
"condition",
|
|
15952
|
+
"expression",
|
|
15953
|
+
"stationary-present"
|
|
15954
|
+
]),
|
|
15955
|
+
outcome: TraceNodeOutcomeSchema,
|
|
15956
|
+
reason: string(),
|
|
15957
|
+
deviceId: number().int().optional(),
|
|
15958
|
+
cap: string().optional(),
|
|
15959
|
+
fieldPath: string().optional(),
|
|
15960
|
+
operator: string().optional(),
|
|
15961
|
+
expected: TraceValueSchema.optional(),
|
|
15962
|
+
/** What the mirror held; `null` when it held nothing (unknown). */
|
|
15963
|
+
observed: TraceValueSchema.optional()
|
|
15964
|
+
});
|
|
15965
|
+
var AutomationRunVerdictSchema = object({
|
|
15966
|
+
mode: AutomationRunModeSchema,
|
|
15967
|
+
decision: _enum([
|
|
15968
|
+
"run",
|
|
15969
|
+
"queued",
|
|
15970
|
+
"restart",
|
|
15971
|
+
"drop",
|
|
15972
|
+
"cooldown",
|
|
15973
|
+
"bypass"
|
|
15974
|
+
]),
|
|
15975
|
+
reason: string()
|
|
15976
|
+
});
|
|
15977
|
+
/** One executed (or not-run) step — shared by automations and Action runs. */
|
|
15978
|
+
var AutomationStepTraceSchema = object({
|
|
15979
|
+
/** `actions.<i>` */
|
|
15980
|
+
path: string().min(1),
|
|
15981
|
+
kind: string().min(1),
|
|
15982
|
+
cap: string().optional(),
|
|
15983
|
+
method: string().optional(),
|
|
15984
|
+
deviceId: number().int().optional(),
|
|
15985
|
+
startedAt: number().optional(),
|
|
15986
|
+
endedAt: number().optional(),
|
|
15987
|
+
outcome: _enum([
|
|
15988
|
+
"ok",
|
|
15989
|
+
"error",
|
|
15990
|
+
"not-run"
|
|
15991
|
+
]),
|
|
15992
|
+
message: string().optional()
|
|
15993
|
+
});
|
|
15994
|
+
var AutomationRunTraceSchema = object({
|
|
15995
|
+
runId: string().min(1),
|
|
15996
|
+
startedAt: number(),
|
|
15997
|
+
endedAt: number(),
|
|
15998
|
+
trigger: AutomationTriggerTraceSchema,
|
|
15999
|
+
conditions: array(AutomationConditionTraceNodeSchema),
|
|
16000
|
+
verdict: AutomationRunVerdictSchema.optional(),
|
|
16001
|
+
steps: array(AutomationStepTraceSchema),
|
|
16002
|
+
outcome: AutomationRunOutcomeSchema,
|
|
16003
|
+
/** How many identical consecutive skips this trace stands for (>= 1). */
|
|
16004
|
+
repeat: number().int().min(1),
|
|
16005
|
+
/** When the latest of those repeats happened. */
|
|
16006
|
+
lastAt: number()
|
|
16007
|
+
});
|
|
16008
|
+
/**
|
|
16009
|
+
* What the hub's `runs` ledger holds for one owner (`automation:<blockId>` or
|
|
16010
|
+
* `action:<actionId>`): the cooldown stamp and the trace ring.
|
|
16011
|
+
*/
|
|
16012
|
+
var AutomationStateDocSchema = object({
|
|
16013
|
+
version: literal(1),
|
|
16014
|
+
lastRunStartedAt: number().nullable(),
|
|
16015
|
+
traces: array(AutomationRunTraceSchema)
|
|
16016
|
+
});
|
|
16017
|
+
/**
|
|
16018
|
+
* Actions — named, runnable things an operator (or an automation) can start,
|
|
16019
|
+
* declared as LIST ENTRIES, never as devices.
|
|
16020
|
+
*
|
|
16021
|
+
* An entry is either **internal** (a short list of cap/wait steps kept in the
|
|
16022
|
+
* hub's `actions` record kind) or declared by an addon through the
|
|
16023
|
+
* `action-source` collection (a Home Assistant script, a scene …). The one
|
|
16024
|
+
* surface the UI and automations talk to is the `actions` cap; it keeps no
|
|
16025
|
+
* catalog of its own (D3) — every `list` asks the providers live.
|
|
16026
|
+
*
|
|
16027
|
+
* This file is the data half: the entry schema, the variables an entry may
|
|
16028
|
+
* declare, and the pure resolution of the values a run was given. It holds no
|
|
16029
|
+
* runtime.
|
|
16030
|
+
*/
|
|
16031
|
+
/** What a variable's value is. `select` takes one of `options`. */
|
|
16032
|
+
var ActionVariableTypeSchema = _enum([
|
|
16033
|
+
"string",
|
|
16034
|
+
"number",
|
|
16035
|
+
"boolean",
|
|
16036
|
+
"select"
|
|
16037
|
+
]);
|
|
16038
|
+
var ACTION_VARIABLE_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
16039
|
+
var ActionVariableValueSchema = union([
|
|
16040
|
+
string(),
|
|
16041
|
+
number(),
|
|
16042
|
+
boolean()
|
|
16043
|
+
]);
|
|
16044
|
+
/**
|
|
16045
|
+
* One declared variable. Steps reference it as `{ $var: 'name' }` (the whole
|
|
16046
|
+
* value) or `{{vars.name}}` (inside a string) in their args.
|
|
16047
|
+
*/
|
|
16048
|
+
var ActionVariableSchema = object({
|
|
16049
|
+
name: string().regex(ACTION_VARIABLE_NAME_RE),
|
|
16050
|
+
label: string().min(1).max(120).optional(),
|
|
16051
|
+
type: ActionVariableTypeSchema,
|
|
16052
|
+
required: boolean().optional(),
|
|
16053
|
+
default: ActionVariableValueSchema.optional(),
|
|
16054
|
+
/** The allowed values of a `select`. */
|
|
16055
|
+
options: array(string().min(1)).min(1).optional()
|
|
16056
|
+
}).superRefine((v, ctx) => {
|
|
16057
|
+
if (v.type === "select" && v.options === void 0) ctx.addIssue({
|
|
16058
|
+
code: "custom",
|
|
16059
|
+
message: "a select variable needs options",
|
|
16060
|
+
path: ["options"]
|
|
16061
|
+
});
|
|
16062
|
+
if (v.default !== void 0 && variableValueError(v, v.default) !== null) ctx.addIssue({
|
|
16063
|
+
code: "custom",
|
|
16064
|
+
message: variableValueError(v, v.default) ?? "invalid default",
|
|
16065
|
+
path: ["default"]
|
|
16066
|
+
});
|
|
16067
|
+
});
|
|
16068
|
+
/** Why `value` is not a legal value for the variable, or null when it is. */
|
|
16069
|
+
function variableValueError(variable, value) {
|
|
16070
|
+
switch (variable.type) {
|
|
16071
|
+
case "string": return typeof value === "string" ? null : `variable "${variable.name}" must be a string`;
|
|
16072
|
+
case "number": return typeof value === "number" && Number.isFinite(value) ? null : `variable "${variable.name}" must be a number`;
|
|
16073
|
+
case "boolean": return typeof value === "boolean" ? null : `variable "${variable.name}" must be true or false`;
|
|
16074
|
+
case "select": return typeof value === "string" && (variable.options ?? []).includes(value) ? null : `variable "${variable.name}" must be one of ${(variable.options ?? []).join(", ")}`;
|
|
16075
|
+
}
|
|
16076
|
+
}
|
|
16077
|
+
var ActionSourceKindSchema = _enum(["internal", "addon"]);
|
|
16078
|
+
function isInternalActionId(actionId) {
|
|
16079
|
+
return actionId.startsWith("internal:") && actionId.length > 9;
|
|
16080
|
+
}
|
|
16081
|
+
/** The addon behind a `<addonId>:<localId>` id, or null for anything else (internal included). */
|
|
16082
|
+
function addonIdOfActionId(actionId) {
|
|
16083
|
+
if (isInternalActionId(actionId)) return null;
|
|
16084
|
+
const at = actionId.indexOf(":");
|
|
16085
|
+
return at > 0 && at < actionId.length - 1 ? actionId.slice(0, at) : null;
|
|
16086
|
+
}
|
|
16087
|
+
var ActionStatusSchema = object({
|
|
16088
|
+
isRunning: boolean(),
|
|
16089
|
+
/** Ms epoch the latest run STARTED; null when it never ran. */
|
|
16090
|
+
lastRunAt: number().nullable(),
|
|
16091
|
+
/** The latest run's failure; null on success or when it never ran. */
|
|
16092
|
+
lastError: string().nullable()
|
|
16093
|
+
});
|
|
16094
|
+
var ActionEntrySchema = object({
|
|
16095
|
+
/** `internal:<uuid>` or `<addonId>:<localId>`. */
|
|
16096
|
+
id: string().min(3),
|
|
16097
|
+
name: string().min(1).max(120),
|
|
16098
|
+
/** The addon that declared it; `core-blocks` for an internal one. */
|
|
16099
|
+
addonId: string().min(1),
|
|
16100
|
+
source: ActionSourceKindSchema,
|
|
16101
|
+
/** An addon-declared entry is edited where it was declared. */
|
|
16102
|
+
readOnly: boolean(),
|
|
16103
|
+
/** Internal only: cap and wait steps. No action-in-action, so no cycles. */
|
|
16104
|
+
steps: array(ActionStepSchema).min(1).max(50).optional(),
|
|
16105
|
+
variables: array(ActionVariableSchema).max(20).optional(),
|
|
16106
|
+
status: ActionStatusSchema
|
|
16107
|
+
}).superRefine((entry, ctx) => {
|
|
16108
|
+
if (entry.source === "internal") {
|
|
16109
|
+
if (!isInternalActionId(entry.id)) ctx.addIssue({
|
|
16110
|
+
code: "custom",
|
|
16111
|
+
message: "an internal action id is internal:<uuid>",
|
|
16112
|
+
path: ["id"]
|
|
16113
|
+
});
|
|
16114
|
+
return;
|
|
16115
|
+
}
|
|
16116
|
+
if (entry.steps !== void 0) ctx.addIssue({
|
|
16117
|
+
code: "custom",
|
|
16118
|
+
message: "only an internal action carries steps",
|
|
16119
|
+
path: ["steps"]
|
|
16120
|
+
});
|
|
16121
|
+
if (!entry.readOnly) ctx.addIssue({
|
|
16122
|
+
code: "custom",
|
|
16123
|
+
message: "an addon action is read-only here",
|
|
16124
|
+
path: ["readOnly"]
|
|
16125
|
+
});
|
|
16126
|
+
if (addonIdOfActionId(entry.id) === null) ctx.addIssue({
|
|
16127
|
+
code: "custom",
|
|
16128
|
+
message: "an addon action id is <addonId>:<localId>",
|
|
16129
|
+
path: ["id"]
|
|
16130
|
+
});
|
|
16131
|
+
});
|
|
16132
|
+
/** What an operator writes for an internal action. */
|
|
16133
|
+
var ActionInputSchema = object({
|
|
16134
|
+
name: string().min(1).max(120),
|
|
16135
|
+
steps: array(ActionStepSchema).min(1).max(50),
|
|
16136
|
+
variables: array(ActionVariableSchema).max(20).optional()
|
|
16137
|
+
});
|
|
16138
|
+
/** Who started a run. Absent = the operator pressed it. */
|
|
16139
|
+
var ActionRunOriginSchema = object({
|
|
16140
|
+
/** The automation block whose step started it. */
|
|
16141
|
+
blockId: string().min(1).optional() });
|
|
16142
|
+
/** `started` = the caller did not ask to wait. */
|
|
16143
|
+
var ActionRunOutcomeSchema = union([AutomationRunOutcomeSchema, literal("started")]);
|
|
16144
|
+
var ActionRunResultSchema = object({
|
|
16145
|
+
runId: string().min(1),
|
|
16146
|
+
outcome: ActionRunOutcomeSchema,
|
|
16147
|
+
/** Why it did not run, or what failed. */
|
|
16148
|
+
message: string().optional()
|
|
16149
|
+
});
|
|
16150
|
+
_enum([
|
|
16151
|
+
"not-found",
|
|
16152
|
+
"read-only",
|
|
16153
|
+
"invalid-variables",
|
|
16154
|
+
"invalid-steps",
|
|
16155
|
+
"not-linked",
|
|
16156
|
+
"busy"
|
|
16157
|
+
]);
|
|
16158
|
+
object({
|
|
16159
|
+
actionId: string(),
|
|
16160
|
+
runId: string(),
|
|
16161
|
+
isRunning: boolean(),
|
|
16162
|
+
/** Set when the run ended. */
|
|
16163
|
+
outcome: AutomationRunOutcomeSchema.optional(),
|
|
16164
|
+
lastRunAt: number().nullable(),
|
|
16165
|
+
lastError: string().nullable()
|
|
15721
16166
|
});
|
|
15722
16167
|
/**
|
|
15723
16168
|
* `addon-pages` — system-scoped singleton aggregator cap. Public-facing
|
|
@@ -16097,9 +16542,21 @@ var AlertSeveritySchema = _enum([
|
|
|
16097
16542
|
"error",
|
|
16098
16543
|
"critical"
|
|
16099
16544
|
]);
|
|
16545
|
+
/**
|
|
16546
|
+
* An action that RUNS something instead of going somewhere: the admin UI calls
|
|
16547
|
+
* the addon's custom action (`addons.custom`) with exactly these fields. The
|
|
16548
|
+
* producer owns the meaning; the UI knows nothing about the addon or the kind.
|
|
16549
|
+
*/
|
|
16550
|
+
var AlertActionInvokeSchema = object({
|
|
16551
|
+
addonId: string().min(1),
|
|
16552
|
+
action: string().min(1),
|
|
16553
|
+
input: record(string(), unknown()).optional()
|
|
16554
|
+
});
|
|
16555
|
+
/** An action has `href` (a link) OR `invoke` (a button that runs a custom action). */
|
|
16100
16556
|
var AlertActionSchema = object({
|
|
16101
16557
|
label: string(),
|
|
16102
16558
|
href: string().optional(),
|
|
16559
|
+
invoke: AlertActionInvokeSchema.optional(),
|
|
16103
16560
|
/**
|
|
16104
16561
|
* How `href` is followed. Absent / `app`: an admin-ui route (client-side).
|
|
16105
16562
|
* `server`: a route the HUB serves (an addon HTTP route such as an OAuth
|
|
@@ -18317,7 +18774,7 @@ var CompositionEventPlanSchema = object({
|
|
|
18317
18774
|
stateField: string(),
|
|
18318
18775
|
fieldKey: string()
|
|
18319
18776
|
});
|
|
18320
|
-
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.
|
|
18777
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
|
|
18321
18778
|
var CompositionProblemSchema = object({
|
|
18322
18779
|
code: _enum([
|
|
18323
18780
|
"reserved-variant",
|
|
@@ -18599,12 +19056,13 @@ var CHANGED = {
|
|
|
18599
19056
|
expr: "now"
|
|
18600
19057
|
};
|
|
18601
19058
|
function numeric(input) {
|
|
19059
|
+
const { alsoFrom, ...base } = input;
|
|
18602
19060
|
return {
|
|
18603
|
-
...
|
|
19061
|
+
...base,
|
|
18604
19062
|
family: "numeric",
|
|
18605
19063
|
deviceType: DeviceType.Sensor,
|
|
18606
19064
|
memberDeviceType: DeviceType.Sensor,
|
|
18607
|
-
memberDeviceTypes: [DeviceType.Sensor],
|
|
19065
|
+
memberDeviceTypes: [DeviceType.Sensor, ...alsoFrom?.deviceTypes ?? []],
|
|
18608
19066
|
activeWhen: void 0,
|
|
18609
19067
|
commandCaps: [],
|
|
18610
19068
|
baseUnit: baseUnitOf(input.quantity),
|
|
@@ -18612,9 +19070,10 @@ function numeric(input) {
|
|
|
18612
19070
|
accept: [{
|
|
18613
19071
|
cap: input.outputCap,
|
|
18614
19072
|
fieldPath: input.outputField
|
|
18615
|
-
}]
|
|
19073
|
+
}, ...alsoFrom === void 0 ? [] : [alsoFrom.accept]]
|
|
18616
19074
|
};
|
|
18617
19075
|
}
|
|
19076
|
+
var CLIMATE_DEVICES = [DeviceType.Thermostat, DeviceType.Climate];
|
|
18618
19077
|
function binary(input) {
|
|
18619
19078
|
return {
|
|
18620
19079
|
...input,
|
|
@@ -18636,29 +19095,43 @@ var GROUP_TEMPLATES = [
|
|
|
18636
19095
|
summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
|
|
18637
19096
|
role: DeviceRole.TemperatureSensor,
|
|
18638
19097
|
outputCap: "temperature-sensor",
|
|
18639
|
-
outputField: "
|
|
19098
|
+
outputField: "temperature",
|
|
18640
19099
|
quantity: "temperature",
|
|
18641
19100
|
defaultAggregate: "mean",
|
|
18642
19101
|
empty: "null",
|
|
18643
|
-
companions: [NOW$2]
|
|
19102
|
+
companions: [NOW$2],
|
|
19103
|
+
alsoFrom: {
|
|
19104
|
+
deviceTypes: CLIMATE_DEVICES,
|
|
19105
|
+
accept: {
|
|
19106
|
+
cap: "climate-control",
|
|
19107
|
+
fieldPath: "currentTemp"
|
|
19108
|
+
}
|
|
19109
|
+
}
|
|
18644
19110
|
}),
|
|
18645
19111
|
numeric({
|
|
18646
19112
|
id: "humidity",
|
|
18647
19113
|
summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
18648
19114
|
role: DeviceRole.HumiditySensor,
|
|
18649
19115
|
outputCap: "humidity-sensor",
|
|
18650
|
-
outputField: "
|
|
19116
|
+
outputField: "humidity",
|
|
18651
19117
|
quantity: "humidity",
|
|
18652
19118
|
defaultAggregate: "mean",
|
|
18653
19119
|
empty: "null",
|
|
18654
|
-
companions: [NOW$2]
|
|
19120
|
+
companions: [NOW$2],
|
|
19121
|
+
alsoFrom: {
|
|
19122
|
+
deviceTypes: CLIMATE_DEVICES,
|
|
19123
|
+
accept: {
|
|
19124
|
+
cap: "climate-control",
|
|
19125
|
+
fieldPath: "currentHumidity"
|
|
19126
|
+
}
|
|
19127
|
+
}
|
|
18655
19128
|
}),
|
|
18656
19129
|
numeric({
|
|
18657
19130
|
id: "pressure",
|
|
18658
19131
|
summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
|
|
18659
19132
|
role: DeviceRole.PressureSensor,
|
|
18660
19133
|
outputCap: "pressure-sensor",
|
|
18661
|
-
outputField: "
|
|
19134
|
+
outputField: "pressure",
|
|
18662
19135
|
quantity: "pressure",
|
|
18663
19136
|
defaultAggregate: "mean",
|
|
18664
19137
|
empty: "null",
|
|
@@ -18669,7 +19142,7 @@ var GROUP_TEMPLATES = [
|
|
|
18669
19142
|
summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
|
|
18670
19143
|
role: DeviceRole.AmbientLightSensor,
|
|
18671
19144
|
outputCap: "ambient-light-sensor",
|
|
18672
|
-
outputField: "
|
|
19145
|
+
outputField: "illuminance",
|
|
18673
19146
|
quantity: "illuminance",
|
|
18674
19147
|
defaultAggregate: "mean",
|
|
18675
19148
|
empty: "null",
|
|
@@ -18680,7 +19153,7 @@ var GROUP_TEMPLATES = [
|
|
|
18680
19153
|
summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
|
|
18681
19154
|
role: DeviceRole.PowerSensor,
|
|
18682
19155
|
outputCap: "power-meter",
|
|
18683
|
-
outputField: "
|
|
19156
|
+
outputField: "power",
|
|
18684
19157
|
quantity: "power",
|
|
18685
19158
|
defaultAggregate: "sum",
|
|
18686
19159
|
empty: "omit",
|
|
@@ -18691,7 +19164,7 @@ var GROUP_TEMPLATES = [
|
|
|
18691
19164
|
summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
|
|
18692
19165
|
role: DeviceRole.EnergySensor,
|
|
18693
19166
|
outputCap: "power-meter",
|
|
18694
|
-
outputField: "
|
|
19167
|
+
outputField: "energy",
|
|
18695
19168
|
quantity: "energy",
|
|
18696
19169
|
defaultAggregate: "sum",
|
|
18697
19170
|
empty: "omit",
|
|
@@ -18702,7 +19175,7 @@ var GROUP_TEMPLATES = [
|
|
|
18702
19175
|
summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
18703
19176
|
role: DeviceRole.BatterySensor,
|
|
18704
19177
|
outputCap: "battery",
|
|
18705
|
-
outputField: "
|
|
19178
|
+
outputField: "level",
|
|
18706
19179
|
quantity: "percentage",
|
|
18707
19180
|
defaultAggregate: "mean",
|
|
18708
19181
|
empty: "null",
|
|
@@ -19280,7 +19753,18 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
19280
19753
|
kind: "mutation",
|
|
19281
19754
|
auth: "admin",
|
|
19282
19755
|
access: "view"
|
|
19283
|
-
})
|
|
19756
|
+
}), method(object({
|
|
19757
|
+
blockId: string().min(1),
|
|
19758
|
+
trace: AutomationRunTraceSchema.optional(),
|
|
19759
|
+
runStartedAt: number().optional(),
|
|
19760
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
19761
|
+
}), _void(), {
|
|
19762
|
+
kind: "mutation",
|
|
19763
|
+
auth: "admin"
|
|
19764
|
+
}), method(object({ blockId: string().min(1) }), AutomationStateDocSchema, { auth: "admin" }), method(object({ blockId: string().min(1) }), object({
|
|
19765
|
+
traces: array(AutomationRunTraceSchema),
|
|
19766
|
+
lastError: string().nullable()
|
|
19767
|
+
}), { auth: "admin" });
|
|
19284
19768
|
/**
|
|
19285
19769
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
19286
19770
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -42883,6 +43367,17 @@ var LlmProfileSchema = object({
|
|
|
42883
43367
|
* field in its editor only when its descriptor lists it in `profileFields`. */
|
|
42884
43368
|
topK: number().int().positive().optional(),
|
|
42885
43369
|
maxTokens: number().int().positive().optional(),
|
|
43370
|
+
/** How hard the model "thinks" before it answers. Omitted = the model's own
|
|
43371
|
+
* default. `off` matters for structured output: a thinking model can spend
|
|
43372
|
+
* the whole completion on reasoning and return an empty `content`. Carried
|
|
43373
|
+
* only by the wires that have it — a kind offers the field in its editor
|
|
43374
|
+
* only when its descriptor lists it in `profileFields`. */
|
|
43375
|
+
reasoningEffort: _enum([
|
|
43376
|
+
"off",
|
|
43377
|
+
"low",
|
|
43378
|
+
"medium",
|
|
43379
|
+
"high"
|
|
43380
|
+
]).optional(),
|
|
42886
43381
|
/** Prompt context window. Advisory for cloud kinds (they enforce their own). */
|
|
42887
43382
|
contextLength: number().int().positive().optional(),
|
|
42888
43383
|
/** Default system prompt. A caller's `system` REPLACES it (never appends —
|
|
@@ -42921,6 +43416,7 @@ var LlmProfileFieldSchema = _enum([
|
|
|
42921
43416
|
"topP",
|
|
42922
43417
|
"topK",
|
|
42923
43418
|
"maxTokens",
|
|
43419
|
+
"reasoningEffort",
|
|
42924
43420
|
"contextLength",
|
|
42925
43421
|
"systemPrompt",
|
|
42926
43422
|
"timeoutMs",
|
|
@@ -44171,6 +44667,43 @@ var NotificationActionSchema = object({
|
|
|
44171
44667
|
*/
|
|
44172
44668
|
mode: _enum(["navigate", "background"]).optional()
|
|
44173
44669
|
});
|
|
44670
|
+
/** A delivery parameter value: what a notifier declared it takes. */
|
|
44671
|
+
var DeliveryParamValueSchema = union([
|
|
44672
|
+
string(),
|
|
44673
|
+
number(),
|
|
44674
|
+
boolean()
|
|
44675
|
+
]);
|
|
44676
|
+
/**
|
|
44677
|
+
* One extra delivery parameter a notifier KIND declares (D938). A rule that
|
|
44678
|
+
* addresses a target of that kind may set it; a kind that declares nothing is
|
|
44679
|
+
* never handed one. The admin UI derives its control from this descriptor —
|
|
44680
|
+
* no editor knows a service by name.
|
|
44681
|
+
*
|
|
44682
|
+
* Optional fields are `.optional()`, never `.default()` (a Zod default does not
|
|
44683
|
+
* run on the addon cap path).
|
|
44684
|
+
*/
|
|
44685
|
+
var DeliveryParamSchema = object({
|
|
44686
|
+
key: string().min(1),
|
|
44687
|
+
label: string(),
|
|
44688
|
+
/** i18n key of the label, resolved by the declaring addon's namespace. */
|
|
44689
|
+
labelKey: string().optional(),
|
|
44690
|
+
type: _enum([
|
|
44691
|
+
"enum",
|
|
44692
|
+
"number",
|
|
44693
|
+
"boolean",
|
|
44694
|
+
"string"
|
|
44695
|
+
]),
|
|
44696
|
+
/** `enum` only: the closed set of accepted values. */
|
|
44697
|
+
options: array(object({
|
|
44698
|
+
value: string(),
|
|
44699
|
+
label: string()
|
|
44700
|
+
})).optional(),
|
|
44701
|
+
/** `number` only. */
|
|
44702
|
+
min: number().optional(),
|
|
44703
|
+
max: number().optional(),
|
|
44704
|
+
/** What the notifier does when the rule sets nothing; shown as the placeholder. */
|
|
44705
|
+
default: DeliveryParamValueSchema.optional()
|
|
44706
|
+
});
|
|
44174
44707
|
/**
|
|
44175
44708
|
* The canonical notification. `body` is the only hard field (Apprise model).
|
|
44176
44709
|
* `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
|
|
@@ -44193,7 +44726,13 @@ var NotificationSchema = object({
|
|
|
44193
44726
|
tag: string().optional(),
|
|
44194
44727
|
deviceId: number().optional(),
|
|
44195
44728
|
eventId: string().optional(),
|
|
44196
|
-
metadata: record(string(), unknown()).optional()
|
|
44729
|
+
metadata: record(string(), unknown()).optional(),
|
|
44730
|
+
/**
|
|
44731
|
+
* Values for the parameters the target's kind DECLARES in
|
|
44732
|
+
* {@link TargetKindSchema} `deliveryParams`. Already validated against the
|
|
44733
|
+
* declaration by the sender; a notifier reads only the keys it declared.
|
|
44734
|
+
*/
|
|
44735
|
+
delivery: record(string(), DeliveryParamValueSchema).optional()
|
|
44197
44736
|
});
|
|
44198
44737
|
/** One declared native severity/priority level for a kind. */
|
|
44199
44738
|
var TargetKindLevelSchema = object({
|
|
@@ -44299,6 +44838,11 @@ var TargetKindSchema = object({
|
|
|
44299
44838
|
*/
|
|
44300
44839
|
destinationKeys: array(string()).optional(),
|
|
44301
44840
|
supportsDiscovery: boolean(),
|
|
44841
|
+
/**
|
|
44842
|
+
* Extra delivery parameters a rule may set for a target of this kind (D938).
|
|
44843
|
+
* Absent = none; the rule editor then offers nothing.
|
|
44844
|
+
*/
|
|
44845
|
+
deliveryParams: array(DeliveryParamSchema).optional(),
|
|
44302
44846
|
caps: TargetKindCapsSchema
|
|
44303
44847
|
});
|
|
44304
44848
|
/**
|
|
@@ -44398,51 +44942,6 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
|
|
|
44398
44942
|
kind: "mutation",
|
|
44399
44943
|
auth: "admin"
|
|
44400
44944
|
});
|
|
44401
|
-
new Set([
|
|
44402
|
-
{
|
|
44403
|
-
id: "person",
|
|
44404
|
-
name: "Person"
|
|
44405
|
-
},
|
|
44406
|
-
{
|
|
44407
|
-
id: "vehicle",
|
|
44408
|
-
name: "Vehicle"
|
|
44409
|
-
},
|
|
44410
|
-
{
|
|
44411
|
-
id: "animal",
|
|
44412
|
-
name: "Animal"
|
|
44413
|
-
},
|
|
44414
|
-
{
|
|
44415
|
-
id: "package",
|
|
44416
|
-
name: "Package"
|
|
44417
|
-
}
|
|
44418
|
-
].map((l) => l.id));
|
|
44419
|
-
var COCO_TO_MACRO = {
|
|
44420
|
-
mapping: {
|
|
44421
|
-
person: "person",
|
|
44422
|
-
bicycle: "vehicle",
|
|
44423
|
-
car: "vehicle",
|
|
44424
|
-
motorcycle: "vehicle",
|
|
44425
|
-
airplane: "vehicle",
|
|
44426
|
-
bus: "vehicle",
|
|
44427
|
-
train: "vehicle",
|
|
44428
|
-
truck: "vehicle",
|
|
44429
|
-
boat: "vehicle",
|
|
44430
|
-
bird: "animal",
|
|
44431
|
-
cat: "animal",
|
|
44432
|
-
dog: "animal",
|
|
44433
|
-
horse: "animal",
|
|
44434
|
-
sheep: "animal",
|
|
44435
|
-
cow: "animal",
|
|
44436
|
-
elephant: "animal",
|
|
44437
|
-
bear: "animal",
|
|
44438
|
-
zebra: "animal",
|
|
44439
|
-
giraffe: "animal",
|
|
44440
|
-
suitcase: "package",
|
|
44441
|
-
backpack: "package",
|
|
44442
|
-
handbag: "package"
|
|
44443
|
-
},
|
|
44444
|
-
preserveOriginal: false
|
|
44445
|
-
};
|
|
44446
44945
|
var AUDIO_MACRO_LABELS = [
|
|
44447
44946
|
{
|
|
44448
44947
|
id: "speech",
|
|
@@ -56530,7 +57029,9 @@ var ManifestShapeSchema = object({
|
|
|
56530
57029
|
icon: string().optional()
|
|
56531
57030
|
}).optional(),
|
|
56532
57031
|
protected: boolean().optional(),
|
|
56533
|
-
removable: boolean().optional()
|
|
57032
|
+
removable: boolean().optional(),
|
|
57033
|
+
/** Declared Integrations-page block (mirror of `AddonDeclaration.integrationSection`). */
|
|
57034
|
+
integrationSection: _enum(["system", "providers"]).optional()
|
|
56534
57035
|
});
|
|
56535
57036
|
var AddonProcessSchema = object({
|
|
56536
57037
|
pid: number().optional(),
|
|
@@ -56895,9 +57396,9 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
|
|
|
56895
57396
|
}), LogStreamEntrySchema, { kind: "subscription" });
|
|
56896
57397
|
object({
|
|
56897
57398
|
/** Carbon dioxide concentration in ppm. */
|
|
56898
|
-
|
|
57399
|
+
co2: number().min(0).optional().meta(readingMeta("concentration-volume")),
|
|
56899
57400
|
/** Total volatile organic compounds in ppb. */
|
|
56900
|
-
|
|
57401
|
+
voc: number().min(0).optional().meta(readingMeta("concentration-ppb")),
|
|
56901
57402
|
/** Particulate matter ≤ 2.5 μm in µg/m³. */
|
|
56902
57403
|
pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
|
|
56903
57404
|
/** Particulate matter ≤ 10 μm in µg/m³. */
|
|
@@ -56910,7 +57411,7 @@ object({
|
|
|
56910
57411
|
DeviceType.Sensor;
|
|
56911
57412
|
object({
|
|
56912
57413
|
/** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
|
|
56913
|
-
|
|
57414
|
+
illuminance: number().min(0).nullable().meta(readingMeta("illuminance", {
|
|
56914
57415
|
precision: 0,
|
|
56915
57416
|
label: "Illuminance"
|
|
56916
57417
|
})),
|
|
@@ -57007,6 +57508,84 @@ DeviceType.Camera, method(object({ deviceId: number() }), AudioMetricsSnapshotSc
|
|
|
57007
57508
|
* would produce more than `maxPoints` samples. */
|
|
57008
57509
|
sampleEveryMs: number().int().positive().optional()
|
|
57009
57510
|
}), AudioMetricsHistorySchema);
|
|
57511
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
57512
|
+
actionId: string().min(1),
|
|
57513
|
+
variables: record(string(), ActionVariableValueSchema).optional()
|
|
57514
|
+
}), _void(), {
|
|
57515
|
+
kind: "mutation",
|
|
57516
|
+
auth: "admin"
|
|
57517
|
+
}), method(object({ actionId: string().min(1) }), _void(), {
|
|
57518
|
+
kind: "mutation",
|
|
57519
|
+
auth: "admin"
|
|
57520
|
+
});
|
|
57521
|
+
/**
|
|
57522
|
+
* actions — the ONE surface for runnable actions, for the UI and for
|
|
57523
|
+
* automations. Provided by the core-blocks builtin on the hub.
|
|
57524
|
+
*
|
|
57525
|
+
* An action is a LIST ENTRY, not a device (D883): either internal (cap and wait
|
|
57526
|
+
* steps, kept in the hub's `actions` record kind) or declared by an addon over
|
|
57527
|
+
* `action-source`. `list` asks every `action-source` provider LIVE and overlays
|
|
57528
|
+
* the run status from the hub's `runs` ledger; there is no catalog here to
|
|
57529
|
+
* drift (D3).
|
|
57530
|
+
*
|
|
57531
|
+
* **Permissions follow the camera, as linked devices do.** An action is linked
|
|
57532
|
+
* to cameras by the operator (`setLinks`, D356: nothing links itself). A
|
|
57533
|
+
* non-admin may `get` / `run` an action only through a camera they may see that
|
|
57534
|
+
* links it: they name the camera (`deviceId`, a top-level field so the scope
|
|
57535
|
+
* gate sees it) and the provider refuses an action that camera does not link.
|
|
57536
|
+
* An admin, and an in-process caller (an automation block), may run any action.
|
|
57537
|
+
* Every refusal is typed (`[not-linked] …`) and logged.
|
|
57538
|
+
*
|
|
57539
|
+
* A second `run` of an action that is already running is REFUSED — traced and
|
|
57540
|
+
* logged — never queued.
|
|
57541
|
+
*/
|
|
57542
|
+
var ActionIdInput = object({ actionId: string().min(1) });
|
|
57543
|
+
var ActionLinksSchema = object({
|
|
57544
|
+
deviceId: number().int().nonnegative(),
|
|
57545
|
+
actionIds: array(string().min(1)).max(100)
|
|
57546
|
+
});
|
|
57547
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
57548
|
+
actionId: string().min(1),
|
|
57549
|
+
deviceId: number().int().nonnegative().optional()
|
|
57550
|
+
}), object({ action: ActionEntrySchema.nullable() }), {
|
|
57551
|
+
role: "viewer",
|
|
57552
|
+
auth: "protected",
|
|
57553
|
+
kind: "query",
|
|
57554
|
+
caller: "required"
|
|
57555
|
+
}), method(object({
|
|
57556
|
+
actionId: string().min(1),
|
|
57557
|
+
variables: record(string(), ActionVariableValueSchema).optional(),
|
|
57558
|
+
wait: boolean().optional(),
|
|
57559
|
+
origin: ActionRunOriginSchema.optional(),
|
|
57560
|
+
deviceId: number().int().nonnegative().optional()
|
|
57561
|
+
}), ActionRunResultSchema, {
|
|
57562
|
+
role: "viewer",
|
|
57563
|
+
auth: "protected",
|
|
57564
|
+
kind: "mutation",
|
|
57565
|
+
caller: "required"
|
|
57566
|
+
}), method(ActionIdInput, _void(), {
|
|
57567
|
+
kind: "mutation",
|
|
57568
|
+
auth: "admin"
|
|
57569
|
+
}), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({ action: ActionEntrySchema }), {
|
|
57570
|
+
kind: "mutation",
|
|
57571
|
+
auth: "admin"
|
|
57572
|
+
}), method(object({
|
|
57573
|
+
actionId: string().min(1),
|
|
57574
|
+
action: ActionInputSchema.partial()
|
|
57575
|
+
}), object({ action: ActionEntrySchema }), {
|
|
57576
|
+
kind: "mutation",
|
|
57577
|
+
auth: "admin"
|
|
57578
|
+
}), method(ActionIdInput, _void(), {
|
|
57579
|
+
kind: "mutation",
|
|
57580
|
+
auth: "admin"
|
|
57581
|
+
}), method(object({ deviceId: number().int().nonnegative() }), array(ActionEntrySchema), {
|
|
57582
|
+
role: "viewer",
|
|
57583
|
+
auth: "protected",
|
|
57584
|
+
kind: "query"
|
|
57585
|
+
}), method(object({ deviceId: number().int().nonnegative() }), ActionLinksSchema, { auth: "admin" }), method(ActionLinksSchema, ActionLinksSchema, {
|
|
57586
|
+
kind: "mutation",
|
|
57587
|
+
auth: "admin"
|
|
57588
|
+
});
|
|
57010
57589
|
object({
|
|
57011
57590
|
/** Whether the automation is currently enabled. Disabled automations
|
|
57012
57591
|
* ignore their trigger block — manual `trigger` still works. */
|
|
@@ -57060,7 +57639,7 @@ var BatteryStatusSchema = object({
|
|
|
57060
57639
|
* Consumers must SKIP a null rather than coerce it — `battery-band` already
|
|
57061
57640
|
* declines to band a non-finite reading, which is the correct shape.
|
|
57062
57641
|
*/
|
|
57063
|
-
|
|
57642
|
+
level: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
|
|
57064
57643
|
/**
|
|
57065
57644
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
57066
57645
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
@@ -57070,7 +57649,7 @@ var BatteryStatusSchema = object({
|
|
|
57070
57649
|
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
57071
57650
|
* power fields yet, or the firmware reported neither. Before it existed,
|
|
57072
57651
|
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
57073
|
-
* was drawn "on battery alone" — the same D315 defect `
|
|
57652
|
+
* was drawn "on battery alone" — the same D315 defect `level` closed
|
|
57074
57653
|
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
57075
57654
|
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
57076
57655
|
*/
|
|
@@ -57094,7 +57673,7 @@ var BatteryStatusSchema = object({
|
|
|
57094
57673
|
* that only report charge. A second reading on this cap, not a second
|
|
57095
57674
|
* `numeric-sensor` on the same device.
|
|
57096
57675
|
*/
|
|
57097
|
-
|
|
57676
|
+
voltage: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
57098
57677
|
/**
|
|
57099
57678
|
* Ms epoch of the last time the device PROVED it was reachable — a
|
|
57100
57679
|
* completed firmware round-trip, an observed wake, or an inbound push
|
|
@@ -57128,7 +57707,7 @@ var BatteryStatusSchema = object({
|
|
|
57128
57707
|
/**
|
|
57129
57708
|
* True when the source is a BINARY low-battery indicator (HA
|
|
57130
57709
|
* `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
|
|
57131
|
-
* charge level — `
|
|
57710
|
+
* charge level — `level` is then a coarse stand-in (100 = normal,
|
|
57132
57711
|
* sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
|
|
57133
57712
|
* misleading exact percentage. Absent/false → genuine 0–100 % reading.
|
|
57134
57713
|
*/
|
|
@@ -57159,33 +57738,395 @@ DeviceType.Sensor;
|
|
|
57159
57738
|
* controls to this single-method surface.
|
|
57160
57739
|
*
|
|
57161
57740
|
* The cap is intentionally minimal: a single `setBrightness({deviceId,
|
|
57162
|
-
*
|
|
57741
|
+
* level})` mutation plus the auto-injected `getStatus`. Drivers
|
|
57163
57742
|
* that expose richer controls (color temperature, scenes, schedules)
|
|
57164
57743
|
* should surface those via the device's `getSettingsUISchema()`
|
|
57165
57744
|
* instead of bloating this cap.
|
|
57166
57745
|
*/
|
|
57167
57746
|
var BrightnessStatusSchema = object({
|
|
57168
57747
|
/** Current level as 0..100 inclusive. Firmware-reported. */
|
|
57169
|
-
|
|
57748
|
+
level: number().min(0).max(100).meta(readingMeta("percentage")),
|
|
57170
57749
|
/** Ms epoch of the last operator-driven change. Useful for UI freshness. */
|
|
57171
57750
|
lastChangedAt: number()
|
|
57172
57751
|
});
|
|
57173
57752
|
DeviceType.Light, method(object({
|
|
57174
57753
|
deviceId: number().int().nonnegative(),
|
|
57175
|
-
|
|
57754
|
+
level: number().min(0).max(100)
|
|
57176
57755
|
}), _void(), {
|
|
57177
57756
|
kind: "mutation",
|
|
57178
57757
|
auth: "protected"
|
|
57179
57758
|
}), object({
|
|
57180
57759
|
deviceId: number(),
|
|
57181
|
-
|
|
57760
|
+
level: number().min(0).max(100),
|
|
57182
57761
|
lastChangedAt: number()
|
|
57183
57762
|
});
|
|
57763
|
+
/**
|
|
57764
|
+
* The role vocabulary of a remote (D963): what a button MEANS, independent of
|
|
57765
|
+
* how it is wired. A layout template places buttons by role; a device binds a
|
|
57766
|
+
* role to an action; an exporter asks for a role by name. Roles are shared so
|
|
57767
|
+
* one layout fits every appliance and one voice command fits every binding.
|
|
57768
|
+
*
|
|
57769
|
+
* A role outside this list is `custom:<key>` — the operator's own button (a
|
|
57770
|
+
* SmartIR source, a channel preset). The key is a lowercase slug.
|
|
57771
|
+
*/
|
|
57772
|
+
var REMOTE_KNOWN_ROLES = [
|
|
57773
|
+
"power",
|
|
57774
|
+
"power_on",
|
|
57775
|
+
"power_off",
|
|
57776
|
+
"volume_up",
|
|
57777
|
+
"volume_down",
|
|
57778
|
+
"mute",
|
|
57779
|
+
"channel_up",
|
|
57780
|
+
"channel_down",
|
|
57781
|
+
"up",
|
|
57782
|
+
"down",
|
|
57783
|
+
"left",
|
|
57784
|
+
"right",
|
|
57785
|
+
"ok",
|
|
57786
|
+
"back",
|
|
57787
|
+
"home",
|
|
57788
|
+
"menu",
|
|
57789
|
+
"info",
|
|
57790
|
+
"guide",
|
|
57791
|
+
"exit",
|
|
57792
|
+
"input",
|
|
57793
|
+
"play",
|
|
57794
|
+
"pause",
|
|
57795
|
+
"play_pause",
|
|
57796
|
+
"stop",
|
|
57797
|
+
"next",
|
|
57798
|
+
"previous",
|
|
57799
|
+
"fast_forward",
|
|
57800
|
+
"rewind",
|
|
57801
|
+
"digit_0",
|
|
57802
|
+
"digit_1",
|
|
57803
|
+
"digit_2",
|
|
57804
|
+
"digit_3",
|
|
57805
|
+
"digit_4",
|
|
57806
|
+
"digit_5",
|
|
57807
|
+
"digit_6",
|
|
57808
|
+
"digit_7",
|
|
57809
|
+
"digit_8",
|
|
57810
|
+
"digit_9"
|
|
57811
|
+
];
|
|
57812
|
+
var CUSTOM_KEY_RE = /^[a-z0-9][a-z0-9_]{0,47}$/;
|
|
57813
|
+
var KNOWN_ROLES = new Set(REMOTE_KNOWN_ROLES);
|
|
57814
|
+
function isRemoteKnownRole(value) {
|
|
57815
|
+
return KNOWN_ROLES.has(value);
|
|
57816
|
+
}
|
|
57817
|
+
function isRemoteCustomKey(key) {
|
|
57818
|
+
return CUSTOM_KEY_RE.test(key);
|
|
57819
|
+
}
|
|
57820
|
+
/** The key of a `custom:<key>` role, or null for any other string. */
|
|
57821
|
+
function customKeyOfRole(role) {
|
|
57822
|
+
if (!role.startsWith("custom:")) return null;
|
|
57823
|
+
const key = role.slice(7);
|
|
57824
|
+
return isRemoteCustomKey(key) ? key : null;
|
|
57825
|
+
}
|
|
57826
|
+
function isRemoteRole(value) {
|
|
57827
|
+
return isRemoteKnownRole(value) || customKeyOfRole(value) !== null;
|
|
57828
|
+
}
|
|
57829
|
+
var RemoteRoleSchema = string().refine(isRemoteRole, { message: "a role is one of the known roles or custom:<key> (lowercase letters, digits, _)" });
|
|
57830
|
+
var RemoteBindingSchema = object({ action: AutomationCapStepSchema.extend({ deviceId: number().int().nonnegative() }) });
|
|
57831
|
+
var RemoteCustomButtonSchema = object({
|
|
57832
|
+
/** The slug after `custom:` in the role. */
|
|
57833
|
+
key: string().refine(isRemoteCustomKey, { message: "a lowercase slug" }),
|
|
57834
|
+
/** What the operator calls it, and what a voice command may name. */
|
|
57835
|
+
name: string().min(1).max(60)
|
|
57836
|
+
});
|
|
57837
|
+
var RemotePowerModeSchema = _enum(["toggle", "discrete"]);
|
|
57838
|
+
var RemoteConfigSchema = object({
|
|
57839
|
+
layoutTemplateId: string().min(1).nullable(),
|
|
57840
|
+
/**
|
|
57841
|
+
* The transmitter device new bindings and an import send through. A binding
|
|
57842
|
+
* names its own device, so one command may override it.
|
|
57843
|
+
*/
|
|
57844
|
+
defaultTransmitterId: number().int().nonnegative().nullable().default(null),
|
|
57845
|
+
/** Keyed by role. A role with no entry falls back to the native cap. */
|
|
57846
|
+
bindings: record(string(), RemoteBindingSchema),
|
|
57847
|
+
customButtons: array(RemoteCustomButtonSchema).max(100),
|
|
57848
|
+
power: object({ mode: RemotePowerModeSchema })
|
|
57849
|
+
}).superRefine((config, ctx) => {
|
|
57850
|
+
const roles = Object.keys(config.bindings);
|
|
57851
|
+
if (roles.length > 200) ctx.addIssue({
|
|
57852
|
+
code: "custom",
|
|
57853
|
+
message: "too many bindings",
|
|
57854
|
+
path: ["bindings"]
|
|
57855
|
+
});
|
|
57856
|
+
for (const role of roles) if (!isRemoteRole(role)) ctx.addIssue({
|
|
57857
|
+
code: "custom",
|
|
57858
|
+
message: `"${role}" is not a role`,
|
|
57859
|
+
path: ["bindings", role]
|
|
57860
|
+
});
|
|
57861
|
+
const keys = /* @__PURE__ */ new Set();
|
|
57862
|
+
config.customButtons.forEach((button, index) => {
|
|
57863
|
+
if (keys.has(button.key)) ctx.addIssue({
|
|
57864
|
+
code: "custom",
|
|
57865
|
+
message: `custom button "${button.key}" is listed twice`,
|
|
57866
|
+
path: [
|
|
57867
|
+
"customButtons",
|
|
57868
|
+
index,
|
|
57869
|
+
"key"
|
|
57870
|
+
]
|
|
57871
|
+
});
|
|
57872
|
+
keys.add(button.key);
|
|
57873
|
+
});
|
|
57874
|
+
for (const role of roles) {
|
|
57875
|
+
const key = customKeyOfRole(role);
|
|
57876
|
+
if (key !== null && !keys.has(key)) ctx.addIssue({
|
|
57877
|
+
code: "custom",
|
|
57878
|
+
message: `${role} is bound but has no entry in customButtons`,
|
|
57879
|
+
path: ["bindings", role]
|
|
57880
|
+
});
|
|
57881
|
+
}
|
|
57882
|
+
});
|
|
57883
|
+
object({
|
|
57884
|
+
power: object({
|
|
57885
|
+
state: _enum(["on", "off"]),
|
|
57886
|
+
at: number()
|
|
57887
|
+
}).nullable(),
|
|
57888
|
+
muted: object({
|
|
57889
|
+
value: boolean(),
|
|
57890
|
+
at: number()
|
|
57891
|
+
}).nullable()
|
|
57892
|
+
});
|
|
57893
|
+
var RemoteLayoutButtonSchema = object({
|
|
57894
|
+
id: string().min(1).max(40),
|
|
57895
|
+
/** 0-based grid position. */
|
|
57896
|
+
row: number().int().min(0).max(24),
|
|
57897
|
+
col: number().int().min(0).max(24),
|
|
57898
|
+
rowSpan: number().int().min(1).max(24),
|
|
57899
|
+
colSpan: number().int().min(1).max(24),
|
|
57900
|
+
icon: string().min(1).max(60).optional(),
|
|
57901
|
+
label: string().min(1).max(40).optional(),
|
|
57902
|
+
role: RemoteRoleSchema
|
|
57903
|
+
});
|
|
57904
|
+
object({
|
|
57905
|
+
columns: number().int().min(1).max(24),
|
|
57906
|
+
rows: number().int().min(1).max(24),
|
|
57907
|
+
buttons: array(RemoteLayoutButtonSchema).max(200)
|
|
57908
|
+
}).superRefine((grid, ctx) => {
|
|
57909
|
+
const ids = /* @__PURE__ */ new Set();
|
|
57910
|
+
const taken = /* @__PURE__ */ new Map();
|
|
57911
|
+
grid.buttons.forEach((button, index) => {
|
|
57912
|
+
if (ids.has(button.id)) ctx.addIssue({
|
|
57913
|
+
code: "custom",
|
|
57914
|
+
message: `button id "${button.id}" is used twice`,
|
|
57915
|
+
path: [
|
|
57916
|
+
"buttons",
|
|
57917
|
+
index,
|
|
57918
|
+
"id"
|
|
57919
|
+
]
|
|
57920
|
+
});
|
|
57921
|
+
ids.add(button.id);
|
|
57922
|
+
if (button.row + button.rowSpan > grid.rows || button.col + button.colSpan > grid.columns) {
|
|
57923
|
+
ctx.addIssue({
|
|
57924
|
+
code: "custom",
|
|
57925
|
+
message: `button "${button.id}" leaves the grid`,
|
|
57926
|
+
path: ["buttons", index]
|
|
57927
|
+
});
|
|
57928
|
+
return;
|
|
57929
|
+
}
|
|
57930
|
+
for (let r = button.row; r < button.row + button.rowSpan; r += 1) for (let c = button.col; c < button.col + button.colSpan; c += 1) {
|
|
57931
|
+
const cell = `${r}:${c}`;
|
|
57932
|
+
const other = taken.get(cell);
|
|
57933
|
+
if (other !== void 0) {
|
|
57934
|
+
ctx.addIssue({
|
|
57935
|
+
code: "custom",
|
|
57936
|
+
message: `buttons "${other}" and "${button.id}" overlap`,
|
|
57937
|
+
path: ["buttons", index]
|
|
57938
|
+
});
|
|
57939
|
+
return;
|
|
57940
|
+
}
|
|
57941
|
+
taken.set(cell, button.id);
|
|
57942
|
+
}
|
|
57943
|
+
});
|
|
57944
|
+
});
|
|
57945
|
+
var RemoteBoundCommandSchema = object({
|
|
57946
|
+
role: RemoteRoleSchema,
|
|
57947
|
+
/** The operator's name for a custom button; absent for a known role. */
|
|
57948
|
+
label: string().optional(),
|
|
57949
|
+
custom: boolean()
|
|
57950
|
+
});
|
|
57951
|
+
var RemoteCommandListSchema = object({
|
|
57952
|
+
layoutTemplateId: string().nullable(),
|
|
57953
|
+
power: object({ mode: RemotePowerModeSchema }),
|
|
57954
|
+
/** Only the roles that are BOUND — the ones a press can reach. */
|
|
57955
|
+
commands: array(RemoteBoundCommandSchema)
|
|
57956
|
+
});
|
|
57957
|
+
var RemoteRefusalReasonSchema = _enum([
|
|
57958
|
+
"no-remote",
|
|
57959
|
+
"unbound-role",
|
|
57960
|
+
"action-failed"
|
|
57961
|
+
]);
|
|
57962
|
+
var RemoteSendResultSchema = discriminatedUnion("status", [
|
|
57963
|
+
object({
|
|
57964
|
+
status: literal("sent"),
|
|
57965
|
+
/** How many times the action ran. */
|
|
57966
|
+
sends: number().int().min(1)
|
|
57967
|
+
}),
|
|
57968
|
+
object({
|
|
57969
|
+
status: literal("skipped"),
|
|
57970
|
+
reason: literal("already-in-state")
|
|
57971
|
+
}),
|
|
57972
|
+
object({
|
|
57973
|
+
status: literal("refused"),
|
|
57974
|
+
reason: RemoteRefusalReasonSchema,
|
|
57975
|
+
detail: string().optional()
|
|
57976
|
+
})
|
|
57977
|
+
]);
|
|
57978
|
+
var RemoteMediaCommandSchema = _enum([
|
|
57979
|
+
"play",
|
|
57980
|
+
"pause",
|
|
57981
|
+
"stop",
|
|
57982
|
+
"next",
|
|
57983
|
+
"previous",
|
|
57984
|
+
"setMute",
|
|
57985
|
+
"selectSource"
|
|
57986
|
+
]);
|
|
57987
|
+
/** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
|
|
57988
|
+
var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
|
|
57989
|
+
var RemoteSetConfigResultSchema = discriminatedUnion("status", [object({ status: literal("saved") }), object({
|
|
57990
|
+
status: literal("refused"),
|
|
57991
|
+
reason: _enum(["unknown-template", "not-a-media-player"]),
|
|
57992
|
+
detail: string()
|
|
57993
|
+
})]);
|
|
57994
|
+
var deviceInput = object({ deviceId: number().int().nonnegative() });
|
|
57995
|
+
DeviceType.MediaPlayer;
|
|
57996
|
+
method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.extend({ config: RemoteConfigSchema }), RemoteSetConfigResultSchema, {
|
|
57997
|
+
kind: "mutation",
|
|
57998
|
+
auth: "admin"
|
|
57999
|
+
}), method(deviceInput, RemoteCommandListSchema, { auth: "protected" }), method(deviceInput.extend({
|
|
58000
|
+
role: RemoteRoleSchema,
|
|
58001
|
+
/** Sends in a row (volume steps). */
|
|
58002
|
+
repeat: number().int().min(1).max(50).default(1)
|
|
58003
|
+
}), RemoteSendResultSchema, {
|
|
58004
|
+
kind: "mutation",
|
|
58005
|
+
auth: "protected"
|
|
58006
|
+
}), method(deviceInput.extend({
|
|
58007
|
+
command: RemoteMediaCommandSchema,
|
|
58008
|
+
muted: boolean().optional(),
|
|
58009
|
+
source: string().optional(),
|
|
58010
|
+
repeat: number().int().min(1).max(50).default(1)
|
|
58011
|
+
}), RemoteMediaCommandResultSchema, {
|
|
58012
|
+
kind: "mutation",
|
|
58013
|
+
auth: "protected"
|
|
58014
|
+
});
|
|
58015
|
+
var TemplateKindSchema = _enum(["remote"]);
|
|
58016
|
+
/**
|
|
58017
|
+
* template — the generic store of reusable, named operator data (D963). A
|
|
58018
|
+
* record is `{ id, kind, name, payload }`; the kinds (today only `remote`, the
|
|
58019
|
+
* button grid of a remote) and the schema each payload must satisfy are
|
|
58020
|
+
* declared by the system in `template-kinds.ts`. Nothing here is specific to a
|
|
58021
|
+
* kind: the engine validates a payload against its kind's schema and, on a
|
|
58022
|
+
* delete, asks the kind's owner whether anything still points at the record.
|
|
58023
|
+
*
|
|
58024
|
+
* Every refusal is a typed result — a UI says "unknown kind" or names the
|
|
58025
|
+
* devices that still use a template, without parsing text.
|
|
58026
|
+
*/
|
|
58027
|
+
var TemplateRecordSchema = object({
|
|
58028
|
+
id: string().min(1),
|
|
58029
|
+
kind: TemplateKindSchema,
|
|
58030
|
+
name: string().min(1).max(120),
|
|
58031
|
+
/** Shaped by the kind; `checkTemplatePayload(kind, payload)` reads it. */
|
|
58032
|
+
payload: unknown(),
|
|
58033
|
+
createdAt: number(),
|
|
58034
|
+
updatedAt: number()
|
|
58035
|
+
});
|
|
58036
|
+
var TemplateWriteResultSchema = discriminatedUnion("status", [object({
|
|
58037
|
+
status: literal("saved"),
|
|
58038
|
+
template: TemplateRecordSchema
|
|
58039
|
+
}), object({
|
|
58040
|
+
status: literal("refused"),
|
|
58041
|
+
reason: _enum(["invalid-payload", "not-found"]),
|
|
58042
|
+
detail: string()
|
|
58043
|
+
})]);
|
|
58044
|
+
/** A device still pointing at a template. */
|
|
58045
|
+
var TemplateUserSchema = object({
|
|
58046
|
+
deviceId: number().int().nonnegative(),
|
|
58047
|
+
name: string()
|
|
58048
|
+
});
|
|
58049
|
+
var TemplateDeleteResultSchema = discriminatedUnion("status", [
|
|
58050
|
+
object({ status: literal("deleted") }),
|
|
58051
|
+
object({ status: literal("not-found") }),
|
|
58052
|
+
object({
|
|
58053
|
+
status: literal("in-use"),
|
|
58054
|
+
devices: array(TemplateUserSchema).min(1)
|
|
58055
|
+
})
|
|
58056
|
+
]);
|
|
58057
|
+
method(object({ kind: TemplateKindSchema.optional() }), array(TemplateRecordSchema), { auth: "protected" }), method(object({ id: string().min(1) }), TemplateRecordSchema.nullable(), { auth: "protected" }), method(object({
|
|
58058
|
+
kind: TemplateKindSchema,
|
|
58059
|
+
name: string().min(1).max(120),
|
|
58060
|
+
payload: unknown()
|
|
58061
|
+
}), TemplateWriteResultSchema, {
|
|
58062
|
+
kind: "mutation",
|
|
58063
|
+
auth: "admin"
|
|
58064
|
+
}), method(object({
|
|
58065
|
+
id: string().min(1),
|
|
58066
|
+
name: string().min(1).max(120).optional(),
|
|
58067
|
+
payload: unknown().optional()
|
|
58068
|
+
}), TemplateWriteResultSchema, {
|
|
58069
|
+
kind: "mutation",
|
|
58070
|
+
auth: "admin"
|
|
58071
|
+
}), method(object({ id: string().min(1) }), TemplateDeleteResultSchema, {
|
|
58072
|
+
kind: "mutation",
|
|
58073
|
+
auth: "admin"
|
|
58074
|
+
});
|
|
57184
58075
|
DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
57185
58076
|
kind: "mutation",
|
|
57186
58077
|
auth: "protected"
|
|
57187
58078
|
});
|
|
57188
58079
|
/**
|
|
58080
|
+
* A pulse train in signed microseconds: mark (+) first, then space (-), strictly
|
|
58081
|
+
* alternating, no zeros, 2..1024 entries.
|
|
58082
|
+
*/
|
|
58083
|
+
var IrTimingsSchema = array(number().int()).min(2).max(1024).superRefine((timings, ctx) => {
|
|
58084
|
+
timings.forEach((value, index) => {
|
|
58085
|
+
const expectMark = index % 2 === 0;
|
|
58086
|
+
if (value === 0 || value > 0 !== expectMark) ctx.addIssue({
|
|
58087
|
+
code: "custom",
|
|
58088
|
+
message: `timing ${index} must be a non-zero ${expectMark ? "mark (positive)" : "space (negative)"}`,
|
|
58089
|
+
path: [index]
|
|
58090
|
+
});
|
|
58091
|
+
});
|
|
58092
|
+
});
|
|
58093
|
+
/** Per-command transmit options. Every key is optional; a transmitter applies what it can. */
|
|
58094
|
+
var TransmitSettingsSchema = object({
|
|
58095
|
+
carrierHz: number().int().positive().optional(),
|
|
58096
|
+
dutyCyclePercent: number().int().min(1).max(100).optional(),
|
|
58097
|
+
repeat: number().int().min(0).max(20).optional(),
|
|
58098
|
+
repeatDelayMs: number().int().min(0).optional()
|
|
58099
|
+
});
|
|
58100
|
+
/** The setting keys a transmitter may declare as settable (`getInfo.settable`). */
|
|
58101
|
+
var TransmitSettingKeySchema = _enum([
|
|
58102
|
+
"carrierHz",
|
|
58103
|
+
"dutyCyclePercent",
|
|
58104
|
+
"repeat",
|
|
58105
|
+
"repeatDelayMs"
|
|
58106
|
+
]);
|
|
58107
|
+
var IrMediumSchema = _enum(["ir", "rf"]);
|
|
58108
|
+
var IrSendResultSchema = object({
|
|
58109
|
+
ok: literal(true),
|
|
58110
|
+
/** Settings the transmitter could not apply; the train was still sent. */
|
|
58111
|
+
ignoredSettings: array(string())
|
|
58112
|
+
});
|
|
58113
|
+
var IrTransmitterInfoSchema = object({
|
|
58114
|
+
media: array(IrMediumSchema),
|
|
58115
|
+
settable: array(TransmitSettingKeySchema),
|
|
58116
|
+
maxTimings: number().int().positive()
|
|
58117
|
+
});
|
|
58118
|
+
DeviceType.Generic, method(object({
|
|
58119
|
+
deviceId: number().int().nonnegative(),
|
|
58120
|
+
timings: IrTimingsSchema,
|
|
58121
|
+
settings: TransmitSettingsSchema.optional()
|
|
58122
|
+
}), IrSendResultSchema, {
|
|
58123
|
+
kind: "mutation",
|
|
58124
|
+
auth: "protected"
|
|
58125
|
+
}), method(object({ deviceId: number().int().nonnegative() }), IrTransmitterInfoSchema, {
|
|
58126
|
+
kind: "query",
|
|
58127
|
+
auth: "protected"
|
|
58128
|
+
});
|
|
58129
|
+
/**
|
|
57189
58130
|
* `calendar-source` — collection cap exposing per-provider calendars and
|
|
57190
58131
|
* their events. Every addon that contributes calendars (Home Assistant,
|
|
57191
58132
|
* a future Google Calendar addon, …) registers a provider here. The hub
|
|
@@ -57679,11 +58620,11 @@ var ColorInputSchema = discriminatedUnion("mode", [
|
|
|
57679
58620
|
}),
|
|
57680
58621
|
object({
|
|
57681
58622
|
mode: literal("mired"),
|
|
57682
|
-
|
|
58623
|
+
colorTemperature: number().int().min(50).max(1e3)
|
|
57683
58624
|
})
|
|
57684
58625
|
]);
|
|
57685
58626
|
object({
|
|
57686
|
-
/** Active color mode — which of `rgb` / `hsv` / `
|
|
58627
|
+
/** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
|
|
57687
58628
|
* the bulb's current state. */
|
|
57688
58629
|
mode: _enum([
|
|
57689
58630
|
"rgb",
|
|
@@ -57695,7 +58636,7 @@ object({
|
|
|
57695
58636
|
/** Populated when `mode === 'hsv'`. */
|
|
57696
58637
|
hsv: HsvTripletSchema.optional(),
|
|
57697
58638
|
/** Populated when `mode === 'mired'`. */
|
|
57698
|
-
|
|
58639
|
+
colorTemperature: number().int().optional().meta(readingMeta("colour-temperature")),
|
|
57699
58640
|
/** Ms epoch of the last operator-driven change. */
|
|
57700
58641
|
lastChangedAt: number()
|
|
57701
58642
|
});
|
|
@@ -57714,7 +58655,7 @@ DeviceType.Light, method(object({
|
|
|
57714
58655
|
]),
|
|
57715
58656
|
rgb: RgbTripletSchema.optional(),
|
|
57716
58657
|
hsv: HsvTripletSchema.optional(),
|
|
57717
|
-
|
|
58658
|
+
colorTemperature: number().int().optional(),
|
|
57718
58659
|
lastChangedAt: number()
|
|
57719
58660
|
});
|
|
57720
58661
|
var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
|
|
@@ -58152,11 +59093,11 @@ object({
|
|
|
58152
59093
|
/** Feature keys of the programs the appliance currently offers — drives the UI selector. */
|
|
58153
59094
|
availablePrograms: array(string()),
|
|
58154
59095
|
/** Seconds remaining on the active cycle, or null when not running / not known. */
|
|
58155
|
-
|
|
59096
|
+
remaining: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
58156
59097
|
/** Seconds the delayed start is set to (time until the cycle starts), or null. */
|
|
58157
|
-
|
|
59098
|
+
delayedStart: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
58158
59099
|
/** Cycle completion 0..100, or null when not applicable. */
|
|
58159
|
-
|
|
59100
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
58160
59101
|
/** True when the door is reported open; null when the door state is not known. */
|
|
58161
59102
|
doorOpen: boolean().nullable(),
|
|
58162
59103
|
/** True when the door is latched (locked) during a cycle; null when not reported. */
|
|
@@ -58774,7 +59715,7 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
|
|
|
58774
59715
|
object({
|
|
58775
59716
|
/** Active speed as 0..100 inclusive. Null when the device has no
|
|
58776
59717
|
* speed surface (single-speed fan). */
|
|
58777
|
-
|
|
59718
|
+
speed: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
58778
59719
|
/** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
|
|
58779
59720
|
* a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
|
|
58780
59721
|
percentageStep: number().positive().optional().meta(readingMeta("percentage")),
|
|
@@ -58794,7 +59735,7 @@ object({
|
|
|
58794
59735
|
});
|
|
58795
59736
|
DeviceType.Fan, method(object({
|
|
58796
59737
|
deviceId: number().int().nonnegative(),
|
|
58797
|
-
|
|
59738
|
+
speed: number().min(0).max(100)
|
|
58798
59739
|
}), _void(), {
|
|
58799
59740
|
kind: "mutation",
|
|
58800
59741
|
auth: "protected"
|
|
@@ -58985,7 +59926,7 @@ DeviceType.Humidifier, method(object({
|
|
|
58985
59926
|
*/
|
|
58986
59927
|
var HumiditySensorStatusSchema = object({
|
|
58987
59928
|
/** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
|
|
58988
|
-
|
|
59929
|
+
humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
|
|
58989
59930
|
precision: 0,
|
|
58990
59931
|
label: "Humidity"
|
|
58991
59932
|
})),
|
|
@@ -59428,7 +60369,7 @@ object({
|
|
|
59428
60369
|
batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
59429
60370
|
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
59430
60371
|
* task is active / progress is unavailable. */
|
|
59431
|
-
|
|
60372
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
59432
60373
|
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
59433
60374
|
* or null when unknown. */
|
|
59434
60375
|
currentCode: number().nullable().meta(readingMeta("none")),
|
|
@@ -59900,9 +60841,35 @@ var MediaInfoSchema = object({
|
|
|
59900
60841
|
/** Optional cover-art / thumbnail URL. */
|
|
59901
60842
|
imageUrl: string().optional()
|
|
59902
60843
|
});
|
|
60844
|
+
/**
|
|
60845
|
+
* Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
|
|
60846
|
+
* the device said so. `assumed`: the driver has no feedback (infrared) and
|
|
60847
|
+
* tracks what it last SENT; it moves only after a send was accepted, and a
|
|
60848
|
+
* human at the real remote makes it wrong. A UI shows an assumed value as a
|
|
60849
|
+
* guess, never as a reading.
|
|
60850
|
+
*/
|
|
60851
|
+
var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
|
|
60852
|
+
/** The fields of a media-player status a driver can only guess. */
|
|
60853
|
+
var MediaPlayerAssumedFieldSchema = _enum([
|
|
60854
|
+
"state",
|
|
60855
|
+
"volumeLevel",
|
|
60856
|
+
"isMuted",
|
|
60857
|
+
"source"
|
|
60858
|
+
]);
|
|
59903
60859
|
object({
|
|
59904
60860
|
/** Playback lifecycle state. */
|
|
59905
60861
|
state: MediaPlayerStateSchema,
|
|
60862
|
+
/**
|
|
60863
|
+
* Whether the state fields are readings or the driver's own bookkeeping.
|
|
60864
|
+
* A slice written before this field existed parses as `reported`.
|
|
60865
|
+
*/
|
|
60866
|
+
stateSource: MediaPlayerStateSourceSchema.default("reported"),
|
|
60867
|
+
/**
|
|
60868
|
+
* Which fields are the driver's own guess. `stateSource` is `assumed` when
|
|
60869
|
+
* this is not empty; a field not listed here is a reading even then (power
|
|
60870
|
+
* from a running-state source, mute guessed from the last send).
|
|
60871
|
+
*/
|
|
60872
|
+
assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
|
|
59906
60873
|
/** Volume as 0..100 inclusive. Null when the device has no volume
|
|
59907
60874
|
* surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
|
|
59908
60875
|
volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
@@ -59918,10 +60885,10 @@ object({
|
|
|
59918
60885
|
currentMedia: MediaInfoSchema.nullable(),
|
|
59919
60886
|
/** Current playback position in ms. Null when not seekable or
|
|
59920
60887
|
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
59921
|
-
|
|
60888
|
+
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
59922
60889
|
/** Total duration of the current media in ms. Null when unknown
|
|
59923
60890
|
* (live stream) or nothing is playing. */
|
|
59924
|
-
|
|
60891
|
+
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
59925
60892
|
/** Shuffle toggle. Null when no shuffle surface.
|
|
59926
60893
|
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
59927
60894
|
shuffle: boolean().nullable(),
|
|
@@ -59948,7 +60915,7 @@ DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }
|
|
|
59948
60915
|
auth: "protected"
|
|
59949
60916
|
}), method(object({
|
|
59950
60917
|
deviceId: number().int().nonnegative(),
|
|
59951
|
-
|
|
60918
|
+
position: number().int().nonnegative()
|
|
59952
60919
|
}), _void(), {
|
|
59953
60920
|
kind: "mutation",
|
|
59954
60921
|
auth: "protected"
|
|
@@ -60621,9 +61588,9 @@ var NetworkLinkStatusSchema = object({
|
|
|
60621
61588
|
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
60622
61589
|
* SKIP a null rather than coerce it.
|
|
60623
61590
|
*/
|
|
60624
|
-
|
|
61591
|
+
signal: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
60625
61592
|
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
60626
|
-
|
|
61593
|
+
rssi: number().optional().meta(readingMeta("signal-level")),
|
|
60627
61594
|
/** Network name of a wireless link, when the firmware reports it. */
|
|
60628
61595
|
ssid: string().optional(),
|
|
60629
61596
|
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
@@ -61284,10 +62251,20 @@ var PetFeederDeviceStatusSchema = _enum([
|
|
|
61284
62251
|
]);
|
|
61285
62252
|
var gramsPortion = number().int().min(4).max(200);
|
|
61286
62253
|
object({
|
|
61287
|
-
/** Food
|
|
61288
|
-
*
|
|
61289
|
-
* bowl
|
|
62254
|
+
/** Food in the TANK (hopper), as the feeder's own sensor reports it
|
|
62255
|
+
* (`state.food`). A coarse level code, not grams — `0` is empty. The
|
|
62256
|
+
* amount in the bowl is `bowlFood`. On dual-hopper models this is the
|
|
62257
|
+
* combined reading; per-hopper levels live in `food1`/`food2`. Null when
|
|
62258
|
+
* the device has not reported yet. */
|
|
61290
62259
|
foodLevel: number().nullable().meta(readingMeta("none")),
|
|
62260
|
+
/** Food in the BOWL as the feeder reports it (`state.bowl`), in the
|
|
62261
|
+
* feeder's own units. Null when the model reports none. */
|
|
62262
|
+
bowlFood: number().nullable().meta(readingMeta("none")),
|
|
62263
|
+
/** True while the pet is eating (`state.eating`). */
|
|
62264
|
+
eating: boolean(),
|
|
62265
|
+
/** Whether `markFoodReplenished` does anything on this model. When false
|
|
62266
|
+
* the client must not offer it. */
|
|
62267
|
+
supportsMarkRefilled: boolean(),
|
|
61291
62268
|
/** Hopper-1 food level (grams) on dual-hopper feeders; null on
|
|
61292
62269
|
* single-hopper models. */
|
|
61293
62270
|
food1: number().nullable().meta(readingMeta("none")),
|
|
@@ -61295,12 +62272,17 @@ object({
|
|
|
61295
62272
|
* single-hopper models. */
|
|
61296
62273
|
food2: number().nullable().meta(readingMeta("none")),
|
|
61297
62274
|
/** Derived low-food flag — mirrors the HA `food_level` binary_sensor
|
|
61298
|
-
* (`device_class: problem`, on = low). True when the
|
|
61299
|
-
*
|
|
62275
|
+
* (`device_class: problem`, on = low). True when the tank reports empty,
|
|
62276
|
+
* or, on a dual-hopper model, when EITHER hopper is empty. */
|
|
61300
62277
|
lowFood: boolean(),
|
|
61301
|
-
/** Battery charge 0..100 (%).
|
|
61302
|
-
*
|
|
62278
|
+
/** Battery charge 0..100 (%). On a feeder running on `mains` this is the
|
|
62279
|
+
* BACKUP battery's charge, not the power source. Null when the device has
|
|
62280
|
+
* no battery reading. */
|
|
61303
62281
|
batteryPower: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
62282
|
+
/** What the feeder is powered from right now: `mains` (plugged in, the
|
|
62283
|
+
* battery is only a backup) or `battery`. Null when the device does not
|
|
62284
|
+
* report it. */
|
|
62285
|
+
powerSource: _enum(["mains", "battery"]).nullable(),
|
|
61304
62286
|
/**
|
|
61305
62287
|
* Desiccant life remaining, stored in seconds (duration base, D944).
|
|
61306
62288
|
* Providers convert from the days the feeder reports. Null when the
|
|
@@ -61328,6 +62310,14 @@ object({
|
|
|
61328
62310
|
feedSound: boolean(),
|
|
61329
62311
|
/** Speaker / prompt volume level (device-scaled integer). */
|
|
61330
62312
|
volume: number().meta(readingMeta("none")),
|
|
62313
|
+
/** Portion (grams) of the last manual feed sent from a single-hopper
|
|
62314
|
+
* stepper — the default the next manual feed starts from. Persisted per
|
|
62315
|
+
* device by the provider; null until a manual feed has been sent. */
|
|
62316
|
+
lastFeedGrams: gramsPortion.nullable(),
|
|
62317
|
+
/** Hopper-1 portion of the last manual feed (dual-hopper); null until sent. */
|
|
62318
|
+
lastFeedHopper1: gramsPortion.nullable(),
|
|
62319
|
+
/** Hopper-2 portion of the last manual feed (dual-hopper); null until sent. */
|
|
62320
|
+
lastFeedHopper2: gramsPortion.nullable(),
|
|
61331
62321
|
/** Ms epoch when the slice was last refreshed from the cloud. */
|
|
61332
62322
|
lastFetchedAt: number()
|
|
61333
62323
|
});
|
|
@@ -61763,16 +62753,16 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
|
|
|
61763
62753
|
auth: "admin"
|
|
61764
62754
|
});
|
|
61765
62755
|
object({
|
|
61766
|
-
/** Instantaneous power draw
|
|
61767
|
-
|
|
62756
|
+
/** Instantaneous power draw (watts). */
|
|
62757
|
+
power: number().optional().meta(readingMeta("power", { label: "Power" })),
|
|
61768
62758
|
/** Cumulative energy in kilowatt-hours since the meter was reset. */
|
|
61769
|
-
|
|
61770
|
-
/** Voltage
|
|
61771
|
-
|
|
62759
|
+
energy: number().optional().meta(readingMeta("energy", { label: "Energy" })),
|
|
62760
|
+
/** Voltage (volts). */
|
|
62761
|
+
voltage: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
61772
62762
|
/** Current in amperes. */
|
|
61773
|
-
|
|
62763
|
+
current: number().optional().meta(readingMeta("current", { label: "Current" })),
|
|
61774
62764
|
/** Apparent power in volt-amperes. */
|
|
61775
|
-
|
|
62765
|
+
apparentPower: number().optional().meta(readingMeta("apparent-power")),
|
|
61776
62766
|
/** Power factor (0..1) if reported. */
|
|
61777
62767
|
powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
|
|
61778
62768
|
/** Ms epoch when the slice was last updated. */
|
|
@@ -61827,16 +62817,13 @@ var PresenceStatusSchema = object({
|
|
|
61827
62817
|
location: string().nullable(),
|
|
61828
62818
|
/** GPS coordinates when available. Null otherwise. */
|
|
61829
62819
|
gps: GpsLocationSchema.nullable(),
|
|
61830
|
-
/** Optional battery level of the tracking device (0..100). Null
|
|
61831
|
-
* when not reported. */
|
|
61832
|
-
batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
61833
62820
|
/** Ms epoch when the slice was last updated. */
|
|
61834
62821
|
lastChangedAt: number()
|
|
61835
62822
|
});
|
|
61836
62823
|
DeviceType.Presence;
|
|
61837
62824
|
object({
|
|
61838
62825
|
/** Current pressure in hPa. `null` when the sample was refused (D393). */
|
|
61839
|
-
|
|
62826
|
+
pressure: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
|
|
61840
62827
|
/** Ms epoch when the slice was last updated. */
|
|
61841
62828
|
lastFetchedAt: number()
|
|
61842
62829
|
});
|
|
@@ -64858,7 +65845,7 @@ DeviceType.Sensor;
|
|
|
64858
65845
|
*/
|
|
64859
65846
|
var TemperatureSensorStatusSchema = object({
|
|
64860
65847
|
/** Current temperature in Celsius. `null` when the sample was refused (D393). */
|
|
64861
|
-
|
|
65848
|
+
temperature: number().nullable().meta(readingMeta("temperature", {
|
|
64862
65849
|
precision: 1,
|
|
64863
65850
|
label: "Temperature"
|
|
64864
65851
|
})),
|
|
@@ -65122,7 +66109,7 @@ object({
|
|
|
65122
66109
|
/** Speed tokens the hardware accepts — drives the UI selector. */
|
|
65123
66110
|
availableFanSpeeds: array(string()),
|
|
65124
66111
|
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
65125
|
-
|
|
66112
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
65126
66113
|
/** Current error code (0 / null = no error). */
|
|
65127
66114
|
errorCode: number().nullable().meta(readingMeta("none")),
|
|
65128
66115
|
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
@@ -65991,9 +66978,17 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
|
|
|
65991
66978
|
kind: "mutation",
|
|
65992
66979
|
auth: "admin"
|
|
65993
66980
|
});
|
|
66981
|
+
discriminatedUnion("kind", [object({
|
|
66982
|
+
kind: literal("raw"),
|
|
66983
|
+
timings: array(number().int()),
|
|
66984
|
+
settings: TransmitSettingsSchema.optional()
|
|
66985
|
+
}), object({
|
|
66986
|
+
kind: literal("pronto"),
|
|
66987
|
+
code: string()
|
|
66988
|
+
})]);
|
|
65994
66989
|
DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
|
|
65995
66990
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
65996
|
-
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;
|
|
66991
|
+
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.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
65997
66992
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
65998
66993
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
65999
66994
|
new Set(CAP_NAMES);
|
|
@@ -66063,6 +67058,104 @@ Object.freeze({
|
|
|
66063
67058
|
access: "create",
|
|
66064
67059
|
role: "admin"
|
|
66065
67060
|
},
|
|
67061
|
+
"actions.create": {
|
|
67062
|
+
capName: "actions",
|
|
67063
|
+
capScope: "system",
|
|
67064
|
+
addonId: null,
|
|
67065
|
+
access: "create",
|
|
67066
|
+
role: "admin"
|
|
67067
|
+
},
|
|
67068
|
+
"actions.delete": {
|
|
67069
|
+
capName: "actions",
|
|
67070
|
+
capScope: "system",
|
|
67071
|
+
addonId: null,
|
|
67072
|
+
access: "delete",
|
|
67073
|
+
role: "admin"
|
|
67074
|
+
},
|
|
67075
|
+
"actions.get": {
|
|
67076
|
+
capName: "actions",
|
|
67077
|
+
capScope: "system",
|
|
67078
|
+
addonId: null,
|
|
67079
|
+
access: "view",
|
|
67080
|
+
role: "viewer"
|
|
67081
|
+
},
|
|
67082
|
+
"actions.getLinks": {
|
|
67083
|
+
capName: "actions",
|
|
67084
|
+
capScope: "system",
|
|
67085
|
+
addonId: null,
|
|
67086
|
+
access: "view",
|
|
67087
|
+
role: "admin"
|
|
67088
|
+
},
|
|
67089
|
+
"actions.getTraces": {
|
|
67090
|
+
capName: "actions",
|
|
67091
|
+
capScope: "system",
|
|
67092
|
+
addonId: null,
|
|
67093
|
+
access: "view",
|
|
67094
|
+
role: "admin"
|
|
67095
|
+
},
|
|
67096
|
+
"actions.list": {
|
|
67097
|
+
capName: "actions",
|
|
67098
|
+
capScope: "system",
|
|
67099
|
+
addonId: null,
|
|
67100
|
+
access: "view",
|
|
67101
|
+
role: "admin"
|
|
67102
|
+
},
|
|
67103
|
+
"actions.listForCamera": {
|
|
67104
|
+
capName: "actions",
|
|
67105
|
+
capScope: "system",
|
|
67106
|
+
addonId: null,
|
|
67107
|
+
access: "view",
|
|
67108
|
+
role: "viewer"
|
|
67109
|
+
},
|
|
67110
|
+
"actions.run": {
|
|
67111
|
+
capName: "actions",
|
|
67112
|
+
capScope: "system",
|
|
67113
|
+
addonId: null,
|
|
67114
|
+
access: "create",
|
|
67115
|
+
role: "viewer"
|
|
67116
|
+
},
|
|
67117
|
+
"actions.setLinks": {
|
|
67118
|
+
capName: "actions",
|
|
67119
|
+
capScope: "system",
|
|
67120
|
+
addonId: null,
|
|
67121
|
+
access: "create",
|
|
67122
|
+
role: "admin"
|
|
67123
|
+
},
|
|
67124
|
+
"actions.stop": {
|
|
67125
|
+
capName: "actions",
|
|
67126
|
+
capScope: "system",
|
|
67127
|
+
addonId: null,
|
|
67128
|
+
access: "create",
|
|
67129
|
+
role: "admin"
|
|
67130
|
+
},
|
|
67131
|
+
"actions.update": {
|
|
67132
|
+
capName: "actions",
|
|
67133
|
+
capScope: "system",
|
|
67134
|
+
addonId: null,
|
|
67135
|
+
access: "create",
|
|
67136
|
+
role: "admin"
|
|
67137
|
+
},
|
|
67138
|
+
"actionSource.listActions": {
|
|
67139
|
+
capName: "action-source",
|
|
67140
|
+
capScope: "system",
|
|
67141
|
+
addonId: null,
|
|
67142
|
+
access: "view",
|
|
67143
|
+
role: "admin"
|
|
67144
|
+
},
|
|
67145
|
+
"actionSource.runAction": {
|
|
67146
|
+
capName: "action-source",
|
|
67147
|
+
capScope: "system",
|
|
67148
|
+
addonId: null,
|
|
67149
|
+
access: "create",
|
|
67150
|
+
role: "admin"
|
|
67151
|
+
},
|
|
67152
|
+
"actionSource.stopAction": {
|
|
67153
|
+
capName: "action-source",
|
|
67154
|
+
capScope: "system",
|
|
67155
|
+
addonId: null,
|
|
67156
|
+
access: "create",
|
|
67157
|
+
role: "admin"
|
|
67158
|
+
},
|
|
66066
67159
|
"addonPages.listPages": {
|
|
66067
67160
|
capName: "addon-pages",
|
|
66068
67161
|
capScope: "system",
|
|
@@ -67344,6 +68437,13 @@ Object.freeze({
|
|
|
67344
68437
|
access: "view",
|
|
67345
68438
|
role: "admin"
|
|
67346
68439
|
},
|
|
68440
|
+
"coreBlocks.getAutomationRunState": {
|
|
68441
|
+
capName: "core-blocks",
|
|
68442
|
+
capScope: "system",
|
|
68443
|
+
addonId: null,
|
|
68444
|
+
access: "view",
|
|
68445
|
+
role: "admin"
|
|
68446
|
+
},
|
|
67347
68447
|
"coreBlocks.getBlockSettings": {
|
|
67348
68448
|
capName: "core-blocks",
|
|
67349
68449
|
capScope: "system",
|
|
@@ -67365,6 +68465,13 @@ Object.freeze({
|
|
|
67365
68465
|
access: "view",
|
|
67366
68466
|
role: "admin"
|
|
67367
68467
|
},
|
|
68468
|
+
"coreBlocks.getTraces": {
|
|
68469
|
+
capName: "core-blocks",
|
|
68470
|
+
capScope: "system",
|
|
68471
|
+
addonId: null,
|
|
68472
|
+
access: "view",
|
|
68473
|
+
role: "admin"
|
|
68474
|
+
},
|
|
67368
68475
|
"coreBlocks.getTypeDefs": {
|
|
67369
68476
|
capName: "core-blocks",
|
|
67370
68477
|
capScope: "system",
|
|
@@ -67400,6 +68507,13 @@ Object.freeze({
|
|
|
67400
68507
|
access: "create",
|
|
67401
68508
|
role: "admin"
|
|
67402
68509
|
},
|
|
68510
|
+
"coreBlocks.reportAutomationRun": {
|
|
68511
|
+
capName: "core-blocks",
|
|
68512
|
+
capScope: "system",
|
|
68513
|
+
addonId: null,
|
|
68514
|
+
access: "create",
|
|
68515
|
+
role: "admin"
|
|
68516
|
+
},
|
|
67403
68517
|
"coreBlocks.restart": {
|
|
67404
68518
|
capName: "core-blocks",
|
|
67405
68519
|
capScope: "system",
|
|
@@ -69479,6 +70593,20 @@ Object.freeze({
|
|
|
69479
70593
|
access: "create",
|
|
69480
70594
|
role: "viewer"
|
|
69481
70595
|
},
|
|
70596
|
+
"irTransmitter.getInfo": {
|
|
70597
|
+
capName: "ir-transmitter",
|
|
70598
|
+
capScope: "device",
|
|
70599
|
+
addonId: null,
|
|
70600
|
+
access: "view",
|
|
70601
|
+
role: "viewer"
|
|
70602
|
+
},
|
|
70603
|
+
"irTransmitter.send": {
|
|
70604
|
+
capName: "ir-transmitter",
|
|
70605
|
+
capScope: "device",
|
|
70606
|
+
addonId: null,
|
|
70607
|
+
access: "create",
|
|
70608
|
+
role: "viewer"
|
|
70609
|
+
},
|
|
69482
70610
|
"keychain.delete": {
|
|
69483
70611
|
capName: "keychain",
|
|
69484
70612
|
capScope: "system",
|
|
@@ -73602,6 +74730,41 @@ Object.freeze({
|
|
|
73602
74730
|
access: "create",
|
|
73603
74731
|
role: "admin"
|
|
73604
74732
|
},
|
|
74733
|
+
"remote.getConfig": {
|
|
74734
|
+
capName: "remote",
|
|
74735
|
+
capScope: "system",
|
|
74736
|
+
addonId: null,
|
|
74737
|
+
access: "view",
|
|
74738
|
+
role: "admin"
|
|
74739
|
+
},
|
|
74740
|
+
"remote.listCommands": {
|
|
74741
|
+
capName: "remote",
|
|
74742
|
+
capScope: "system",
|
|
74743
|
+
addonId: null,
|
|
74744
|
+
access: "view",
|
|
74745
|
+
role: "admin"
|
|
74746
|
+
},
|
|
74747
|
+
"remote.sendCommand": {
|
|
74748
|
+
capName: "remote",
|
|
74749
|
+
capScope: "system",
|
|
74750
|
+
addonId: null,
|
|
74751
|
+
access: "create",
|
|
74752
|
+
role: "admin"
|
|
74753
|
+
},
|
|
74754
|
+
"remote.sendMediaCommand": {
|
|
74755
|
+
capName: "remote",
|
|
74756
|
+
capScope: "system",
|
|
74757
|
+
addonId: null,
|
|
74758
|
+
access: "create",
|
|
74759
|
+
role: "admin"
|
|
74760
|
+
},
|
|
74761
|
+
"remote.setConfig": {
|
|
74762
|
+
capName: "remote",
|
|
74763
|
+
capScope: "system",
|
|
74764
|
+
addonId: null,
|
|
74765
|
+
access: "create",
|
|
74766
|
+
role: "admin"
|
|
74767
|
+
},
|
|
73605
74768
|
"runningState.getStatus": {
|
|
73606
74769
|
capName: "running-state",
|
|
73607
74770
|
capScope: "device",
|
|
@@ -74792,6 +75955,41 @@ Object.freeze({
|
|
|
74792
75955
|
access: "view",
|
|
74793
75956
|
role: "viewer"
|
|
74794
75957
|
},
|
|
75958
|
+
"template.create": {
|
|
75959
|
+
capName: "template",
|
|
75960
|
+
capScope: "system",
|
|
75961
|
+
addonId: null,
|
|
75962
|
+
access: "create",
|
|
75963
|
+
role: "admin"
|
|
75964
|
+
},
|
|
75965
|
+
"template.delete": {
|
|
75966
|
+
capName: "template",
|
|
75967
|
+
capScope: "system",
|
|
75968
|
+
addonId: null,
|
|
75969
|
+
access: "delete",
|
|
75970
|
+
role: "admin"
|
|
75971
|
+
},
|
|
75972
|
+
"template.get": {
|
|
75973
|
+
capName: "template",
|
|
75974
|
+
capScope: "system",
|
|
75975
|
+
addonId: null,
|
|
75976
|
+
access: "view",
|
|
75977
|
+
role: "admin"
|
|
75978
|
+
},
|
|
75979
|
+
"template.list": {
|
|
75980
|
+
capName: "template",
|
|
75981
|
+
capScope: "system",
|
|
75982
|
+
addonId: null,
|
|
75983
|
+
access: "view",
|
|
75984
|
+
role: "admin"
|
|
75985
|
+
},
|
|
75986
|
+
"template.update": {
|
|
75987
|
+
capName: "template",
|
|
75988
|
+
capScope: "system",
|
|
75989
|
+
addonId: null,
|
|
75990
|
+
access: "create",
|
|
75991
|
+
role: "admin"
|
|
75992
|
+
},
|
|
74795
75993
|
"terminalSession.adoptLegacyMonitor": {
|
|
74796
75994
|
capName: "terminal-session",
|
|
74797
75995
|
capScope: "system",
|
|
@@ -75973,7 +77171,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75973
77171
|
label: t("Full brightness", "Luminosità massima"),
|
|
75974
77172
|
phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
|
|
75975
77173
|
icon: "sun",
|
|
75976
|
-
args: {
|
|
77174
|
+
args: { level: 100 }
|
|
75977
77175
|
},
|
|
75978
77176
|
{
|
|
75979
77177
|
id: "brightness.half",
|
|
@@ -75981,7 +77179,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75981
77179
|
label: t("Half brightness", "Luminosità a metà"),
|
|
75982
77180
|
phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
|
|
75983
77181
|
icon: "sun-dim",
|
|
75984
|
-
args: {
|
|
77182
|
+
args: { level: 50 }
|
|
75985
77183
|
},
|
|
75986
77184
|
{
|
|
75987
77185
|
id: "brightness.off",
|
|
@@ -75989,16 +77187,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
75989
77187
|
label: t("Brightness off", "Luminosità a zero"),
|
|
75990
77188
|
phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
|
|
75991
77189
|
icon: "lightbulb-off",
|
|
75992
|
-
args: {
|
|
77190
|
+
args: { level: 0 }
|
|
75993
77191
|
},
|
|
75994
77192
|
{
|
|
75995
77193
|
id: "brightness.set",
|
|
75996
77194
|
method: "setBrightness",
|
|
75997
77195
|
label: t("Set brightness", "Imposta la luminosità"),
|
|
75998
|
-
phrase: t("Set the brightness of {device} to {
|
|
77196
|
+
phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
|
|
75999
77197
|
icon: "sun-medium",
|
|
76000
77198
|
openArgs: [{
|
|
76001
|
-
key: "
|
|
77199
|
+
key: "level",
|
|
76002
77200
|
label: PERCENT,
|
|
76003
77201
|
offer: {
|
|
76004
77202
|
kind: "number",
|
|
@@ -76012,13 +77210,13 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76012
77210
|
],
|
|
76013
77211
|
state: [{
|
|
76014
77212
|
kind: "numeric",
|
|
76015
|
-
field: "
|
|
77213
|
+
field: "level",
|
|
76016
77214
|
quantity: t("the brightness", "la luminosità"),
|
|
76017
77215
|
label: t("Brightness", "Luminosità"),
|
|
76018
77216
|
unit: "%",
|
|
76019
77217
|
icon: "sun"
|
|
76020
77218
|
}],
|
|
76021
|
-
events: { onBrightnessChanged: { notOperatorFacing: "the `
|
|
77219
|
+
events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
|
|
76022
77220
|
},
|
|
76023
77221
|
color: {
|
|
76024
77222
|
scope: "device",
|
|
@@ -76032,7 +77230,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76032
77230
|
icon: "sun",
|
|
76033
77231
|
args: { color: {
|
|
76034
77232
|
mode: "mired",
|
|
76035
|
-
|
|
77233
|
+
colorTemperature: 370
|
|
76036
77234
|
} }
|
|
76037
77235
|
},
|
|
76038
77236
|
{
|
|
@@ -76043,7 +77241,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76043
77241
|
icon: "snowflake",
|
|
76044
77242
|
args: { color: {
|
|
76045
77243
|
mode: "mired",
|
|
76046
|
-
|
|
77244
|
+
colorTemperature: 200
|
|
76047
77245
|
} }
|
|
76048
77246
|
},
|
|
76049
77247
|
{
|
|
@@ -76657,7 +77855,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76657
77855
|
label: t("Fan off", "Ventilatore spento"),
|
|
76658
77856
|
phrase: t("Stop {device}", "Ferma {device}"),
|
|
76659
77857
|
icon: "power-off",
|
|
76660
|
-
args: {
|
|
77858
|
+
args: { speed: 0 }
|
|
76661
77859
|
},
|
|
76662
77860
|
{
|
|
76663
77861
|
id: "fan.full",
|
|
@@ -76665,16 +77863,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76665
77863
|
label: t("Fan full", "Ventilatore al massimo"),
|
|
76666
77864
|
phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
|
|
76667
77865
|
icon: "fan",
|
|
76668
|
-
args: {
|
|
77866
|
+
args: { speed: 100 }
|
|
76669
77867
|
},
|
|
76670
77868
|
{
|
|
76671
77869
|
id: "fan.speed",
|
|
76672
77870
|
method: "setPercentage",
|
|
76673
77871
|
label: t("Set speed", "Imposta la velocità"),
|
|
76674
|
-
phrase: t("Set the speed of {device} to {
|
|
77872
|
+
phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
|
|
76675
77873
|
icon: "fan",
|
|
76676
77874
|
openArgs: [{
|
|
76677
|
-
key: "
|
|
77875
|
+
key: "speed",
|
|
76678
77876
|
label: t("Speed", "Velocità"),
|
|
76679
77877
|
offer: {
|
|
76680
77878
|
kind: "number",
|
|
@@ -76736,7 +77934,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76736
77934
|
],
|
|
76737
77935
|
state: [{
|
|
76738
77936
|
kind: "numeric",
|
|
76739
|
-
field: "
|
|
77937
|
+
field: "speed",
|
|
76740
77938
|
quantity: t("the speed", "la velocità"),
|
|
76741
77939
|
label: t("Speed", "Velocità"),
|
|
76742
77940
|
unit: "%",
|
|
@@ -77102,6 +78300,11 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
77102
78300
|
icon: "circle-dot"
|
|
77103
78301
|
}]
|
|
77104
78302
|
},
|
|
78303
|
+
"ir-transmitter": {
|
|
78304
|
+
scope: "device",
|
|
78305
|
+
noun: t("IR / RF transmitter", "Trasmettitore IR / RF"),
|
|
78306
|
+
notOperatorFacing: { send: "a raw pulse train is not something an operator composes in an automation; the remote that owns the command table sends it" }
|
|
78307
|
+
},
|
|
77105
78308
|
control: {
|
|
77106
78309
|
scope: "device",
|
|
77107
78310
|
noun: t("Control", "Controllo"),
|
|
@@ -77534,7 +78737,7 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
77534
78737
|
},
|
|
77535
78738
|
{
|
|
77536
78739
|
kind: "numeric",
|
|
77537
|
-
field: "
|
|
78740
|
+
field: "progress",
|
|
77538
78741
|
quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
|
|
77539
78742
|
label: t("Progress", "Avanzamento"),
|
|
77540
78743
|
unit: "%",
|
|
@@ -77892,10 +79095,10 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
77892
79095
|
id: "media.seek",
|
|
77893
79096
|
method: "seek",
|
|
77894
79097
|
label: t("Seek", "Vai al punto"),
|
|
77895
|
-
phrase: t("Move {device} to {
|
|
79098
|
+
phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
|
|
77896
79099
|
icon: "fast-forward",
|
|
77897
79100
|
openArgs: [{
|
|
77898
|
-
key: "
|
|
79101
|
+
key: "position",
|
|
77899
79102
|
label: t("Position", "Posizione"),
|
|
77900
79103
|
offer: {
|
|
77901
79104
|
kind: "number",
|
|
@@ -78944,7 +80147,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78944
80147
|
state: [
|
|
78945
80148
|
{
|
|
78946
80149
|
kind: "numeric",
|
|
78947
|
-
field: "
|
|
80150
|
+
field: "co2",
|
|
78948
80151
|
quantity: t("the CO₂", "la CO₂"),
|
|
78949
80152
|
label: t("CO₂", "CO₂"),
|
|
78950
80153
|
unit: "ppm",
|
|
@@ -78952,7 +80155,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78952
80155
|
},
|
|
78953
80156
|
{
|
|
78954
80157
|
kind: "numeric",
|
|
78955
|
-
field: "
|
|
80158
|
+
field: "voc",
|
|
78956
80159
|
quantity: t("the VOC level", "il livello di COV"),
|
|
78957
80160
|
label: t("VOC", "COV"),
|
|
78958
80161
|
unit: "ppb",
|
|
@@ -78988,7 +80191,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
78988
80191
|
noun: t("Light level", "Luminosità ambiente"),
|
|
78989
80192
|
state: [{
|
|
78990
80193
|
kind: "numeric",
|
|
78991
|
-
field: "
|
|
80194
|
+
field: "illuminance",
|
|
78992
80195
|
quantity: t("the light level", "la luminosità"),
|
|
78993
80196
|
label: t("Illuminance", "Illuminamento"),
|
|
78994
80197
|
unit: "lx",
|
|
@@ -79191,7 +80394,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79191
80394
|
noun: t("Humidity", "Umidità"),
|
|
79192
80395
|
state: [{
|
|
79193
80396
|
kind: "numeric",
|
|
79194
|
-
field: "
|
|
80397
|
+
field: "humidity",
|
|
79195
80398
|
quantity: t("the humidity", "l’umidità"),
|
|
79196
80399
|
label: t("Humidity", "Umidità"),
|
|
79197
80400
|
unit: "%",
|
|
@@ -79239,7 +80442,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79239
80442
|
state: [
|
|
79240
80443
|
{
|
|
79241
80444
|
kind: "numeric",
|
|
79242
|
-
field: "
|
|
80445
|
+
field: "power",
|
|
79243
80446
|
quantity: t("the power draw", "il consumo"),
|
|
79244
80447
|
label: t("Power", "Potenza"),
|
|
79245
80448
|
unit: "W",
|
|
@@ -79247,7 +80450,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79247
80450
|
},
|
|
79248
80451
|
{
|
|
79249
80452
|
kind: "numeric",
|
|
79250
|
-
field: "
|
|
80453
|
+
field: "energy",
|
|
79251
80454
|
quantity: t("the energy used", "l’energia consumata"),
|
|
79252
80455
|
label: t("Energy", "Energia"),
|
|
79253
80456
|
unit: "kWh",
|
|
@@ -79255,7 +80458,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79255
80458
|
},
|
|
79256
80459
|
{
|
|
79257
80460
|
kind: "numeric",
|
|
79258
|
-
field: "
|
|
80461
|
+
field: "voltage",
|
|
79259
80462
|
quantity: t("the voltage", "la tensione"),
|
|
79260
80463
|
label: t("Voltage", "Tensione"),
|
|
79261
80464
|
unit: "V",
|
|
@@ -79263,7 +80466,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79263
80466
|
},
|
|
79264
80467
|
{
|
|
79265
80468
|
kind: "numeric",
|
|
79266
|
-
field: "
|
|
80469
|
+
field: "current",
|
|
79267
80470
|
quantity: t("the current", "la corrente"),
|
|
79268
80471
|
label: t("Current", "Corrente"),
|
|
79269
80472
|
unit: "A",
|
|
@@ -79280,13 +80483,6 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79280
80483
|
label: t("Where", "Posizione"),
|
|
79281
80484
|
phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
|
|
79282
80485
|
icon: "map-pin"
|
|
79283
|
-
}, {
|
|
79284
|
-
kind: "numeric",
|
|
79285
|
-
field: "batteryPercent",
|
|
79286
|
-
quantity: t("the phone battery", "la batteria del telefono"),
|
|
79287
|
-
label: t("Battery", "Batteria"),
|
|
79288
|
-
unit: "%",
|
|
79289
|
-
icon: "battery"
|
|
79290
80486
|
}]
|
|
79291
80487
|
},
|
|
79292
80488
|
"pressure-sensor": {
|
|
@@ -79294,7 +80490,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79294
80490
|
noun: t("Pressure", "Pressione"),
|
|
79295
80491
|
state: [{
|
|
79296
80492
|
kind: "numeric",
|
|
79297
|
-
field: "
|
|
80493
|
+
field: "pressure",
|
|
79298
80494
|
quantity: t("the pressure", "la pressione"),
|
|
79299
80495
|
label: t("Pressure", "Pressione"),
|
|
79300
80496
|
unit: "hPa",
|
|
@@ -79330,7 +80526,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79330
80526
|
noun: t("Temperature", "Temperatura"),
|
|
79331
80527
|
state: [{
|
|
79332
80528
|
kind: "numeric",
|
|
79333
|
-
field: "
|
|
80529
|
+
field: "temperature",
|
|
79334
80530
|
quantity: t("the temperature", "la temperatura"),
|
|
79335
80531
|
label: t("Temperature", "Temperatura"),
|
|
79336
80532
|
unit: "°C",
|
|
@@ -79401,7 +80597,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79401
80597
|
state: [
|
|
79402
80598
|
{
|
|
79403
80599
|
kind: "numeric",
|
|
79404
|
-
field: "
|
|
80600
|
+
field: "level",
|
|
79405
80601
|
quantity: t("the battery level", "il livello della batteria"),
|
|
79406
80602
|
label: t("Battery", "Batteria"),
|
|
79407
80603
|
unit: "%",
|
|
@@ -79443,7 +80639,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79443
80639
|
icon: "battery-charging"
|
|
79444
80640
|
}
|
|
79445
80641
|
],
|
|
79446
|
-
events: { onStatusChanged: { notOperatorFacing: "the
|
|
80642
|
+
events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
|
|
79447
80643
|
extraEvents: [{
|
|
79448
80644
|
category: EventCategory.DeviceAwake,
|
|
79449
80645
|
label: t("Woke up", "Risvegliato"),
|
|
@@ -79461,7 +80657,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79461
80657
|
noun: t("Network link", "Collegamento di rete"),
|
|
79462
80658
|
state: [{
|
|
79463
80659
|
kind: "numeric",
|
|
79464
|
-
field: "
|
|
80660
|
+
field: "signal",
|
|
79465
80661
|
quantity: t("the signal strength", "l’intensità del segnale"),
|
|
79466
80662
|
label: t("Signal", "Segnale"),
|
|
79467
80663
|
unit: "%",
|
|
@@ -79554,6 +80750,8 @@ var ML = "model and training machinery — no device action";
|
|
|
79554
80750
|
var INTERNAL = "internal plumbing between addons — never operator-facing";
|
|
79555
80751
|
/** Every system-scoped cap, with why it is not a device's vocabulary. */
|
|
79556
80752
|
var SYSTEM_CAP_VOCABULARY = {
|
|
80753
|
+
"action-source": system(INTERNAL),
|
|
80754
|
+
actions: system("declared actions — run from the Actions page and from the cameras that link them"),
|
|
79557
80755
|
"addon-pages": system(UI_PLUMBING),
|
|
79558
80756
|
"addon-pages-source": system(UI_PLUMBING),
|
|
79559
80757
|
"addon-routes": system(UI_PLUMBING),
|
|
@@ -79623,6 +80821,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
79623
80821
|
"recording-archive": system(STORAGE),
|
|
79624
80822
|
"recording-export": system("recording exports — requested from the timeline, not an automation step"),
|
|
79625
80823
|
records: system(INTERNAL),
|
|
80824
|
+
remote: system("the per-device remote setup — authored in the Customize remote editor, sent through the remote UI"),
|
|
79626
80825
|
"server-management": system(CLUSTER),
|
|
79627
80826
|
"settings-store": system(INTERNAL),
|
|
79628
80827
|
"smtp-provider": system(INTERNAL),
|
|
@@ -79635,6 +80834,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
79635
80834
|
"storage-provider": system(STORAGE),
|
|
79636
80835
|
"stream-broker": system(PIPELINE),
|
|
79637
80836
|
system: system(CLUSTER),
|
|
80837
|
+
template: system("operator-authored templates — edited in their own editor, never actuated"),
|
|
79638
80838
|
"terminal-session": system(CLUSTER),
|
|
79639
80839
|
toast: system(UI_PLUMBING),
|
|
79640
80840
|
training: system(ML),
|
|
@@ -79775,6 +80975,31 @@ Object.freeze({
|
|
|
79775
80975
|
form: "single",
|
|
79776
80976
|
optional: false
|
|
79777
80977
|
}],
|
|
80978
|
+
"actions.get": [{
|
|
80979
|
+
name: "deviceId",
|
|
80980
|
+
form: "single",
|
|
80981
|
+
optional: true
|
|
80982
|
+
}],
|
|
80983
|
+
"actions.getLinks": [{
|
|
80984
|
+
name: "deviceId",
|
|
80985
|
+
form: "single",
|
|
80986
|
+
optional: false
|
|
80987
|
+
}],
|
|
80988
|
+
"actions.listForCamera": [{
|
|
80989
|
+
name: "deviceId",
|
|
80990
|
+
form: "single",
|
|
80991
|
+
optional: false
|
|
80992
|
+
}],
|
|
80993
|
+
"actions.run": [{
|
|
80994
|
+
name: "deviceId",
|
|
80995
|
+
form: "single",
|
|
80996
|
+
optional: true
|
|
80997
|
+
}],
|
|
80998
|
+
"actions.setLinks": [{
|
|
80999
|
+
name: "deviceId",
|
|
81000
|
+
form: "single",
|
|
81001
|
+
optional: false
|
|
81002
|
+
}],
|
|
79778
81003
|
"addonSettings.getDeviceSettings": [{
|
|
79779
81004
|
name: "deviceId",
|
|
79780
81005
|
form: "single",
|
|
@@ -80826,6 +82051,16 @@ Object.freeze({
|
|
|
80826
82051
|
form: "single",
|
|
80827
82052
|
optional: false
|
|
80828
82053
|
}],
|
|
82054
|
+
"irTransmitter.getInfo": [{
|
|
82055
|
+
name: "deviceId",
|
|
82056
|
+
form: "single",
|
|
82057
|
+
optional: false
|
|
82058
|
+
}],
|
|
82059
|
+
"irTransmitter.send": [{
|
|
82060
|
+
name: "deviceId",
|
|
82061
|
+
form: "single",
|
|
82062
|
+
optional: false
|
|
82063
|
+
}],
|
|
80829
82064
|
"keychain.deleteDeviceScope": [{
|
|
80830
82065
|
name: "deviceId",
|
|
80831
82066
|
form: "single",
|
|
@@ -82051,6 +83286,31 @@ Object.freeze({
|
|
|
82051
83286
|
form: "single",
|
|
82052
83287
|
optional: true
|
|
82053
83288
|
}],
|
|
83289
|
+
"remote.getConfig": [{
|
|
83290
|
+
name: "deviceId",
|
|
83291
|
+
form: "single",
|
|
83292
|
+
optional: false
|
|
83293
|
+
}],
|
|
83294
|
+
"remote.listCommands": [{
|
|
83295
|
+
name: "deviceId",
|
|
83296
|
+
form: "single",
|
|
83297
|
+
optional: false
|
|
83298
|
+
}],
|
|
83299
|
+
"remote.sendCommand": [{
|
|
83300
|
+
name: "deviceId",
|
|
83301
|
+
form: "single",
|
|
83302
|
+
optional: false
|
|
83303
|
+
}],
|
|
83304
|
+
"remote.sendMediaCommand": [{
|
|
83305
|
+
name: "deviceId",
|
|
83306
|
+
form: "single",
|
|
83307
|
+
optional: false
|
|
83308
|
+
}],
|
|
83309
|
+
"remote.setConfig": [{
|
|
83310
|
+
name: "deviceId",
|
|
83311
|
+
form: "single",
|
|
83312
|
+
optional: false
|
|
83313
|
+
}],
|
|
82054
83314
|
"runningState.getStatus": [{
|
|
82055
83315
|
name: "deviceId",
|
|
82056
83316
|
form: "single",
|
|
@@ -83957,8 +85217,17 @@ function resolveGrantDeviceIds(scopes, fleet, access) {
|
|
|
83957
85217
|
}
|
|
83958
85218
|
return out;
|
|
83959
85219
|
}
|
|
85220
|
+
String.raw`(?<=^|["'(\s>,\[{])`;
|
|
83960
85221
|
var MB = 1024 * 1024;
|
|
83961
85222
|
1024 * MB, 3072 * MB;
|
|
85223
|
+
object({
|
|
85224
|
+
manufacturer: string().optional(),
|
|
85225
|
+
supportedModels: array(string()).optional(),
|
|
85226
|
+
supportedController: string().optional(),
|
|
85227
|
+
commandsEncoding: string(),
|
|
85228
|
+
delay: number().nonnegative().optional(),
|
|
85229
|
+
commands: record(string(), unknown())
|
|
85230
|
+
});
|
|
83962
85231
|
//#endregion
|
|
83963
85232
|
//#region src/custom-actions.ts
|
|
83964
85233
|
/**
|
|
@@ -84205,6 +85474,148 @@ async function profileForCamStream(input) {
|
|
|
84205
85474
|
}
|
|
84206
85475
|
}
|
|
84207
85476
|
//#endregion
|
|
85477
|
+
//#region src/egress/alexa-source-profile.ts
|
|
85478
|
+
async function resolveAlexaSourceProfile(input) {
|
|
85479
|
+
const { api, deviceId, exposedEntry } = input;
|
|
85480
|
+
const log = input.logger;
|
|
85481
|
+
const pinnedProfile = (() => {
|
|
85482
|
+
const pref = exposedEntry?.settings?.streamPreference;
|
|
85483
|
+
if (pref === "low" || pref === "mid" || pref === "high") return pref;
|
|
85484
|
+
})();
|
|
85485
|
+
const allowTranscode = exposedEntry?.settings?.allowTranscode !== false;
|
|
85486
|
+
const scored = pinnedProfile === void 0 ? await api.cameraStreams.pickStream.query({
|
|
85487
|
+
deviceId,
|
|
85488
|
+
requirements: {
|
|
85489
|
+
acceptCodecs: ["h264"],
|
|
85490
|
+
minHeight: 480,
|
|
85491
|
+
maxHeight: ALEXA_MAX_LINES,
|
|
85492
|
+
excludeDerived: true,
|
|
85493
|
+
allowTranscode
|
|
85494
|
+
},
|
|
85495
|
+
preferences: { targetHeight: 720 }
|
|
85496
|
+
}).catch((err) => {
|
|
85497
|
+
log.warn("alexa rtc-session: pickStream threw — falling back to the high slot", {
|
|
85498
|
+
tags: { deviceId },
|
|
85499
|
+
meta: { error: err instanceof Error ? err.message : String(err) }
|
|
85500
|
+
});
|
|
85501
|
+
return null;
|
|
85502
|
+
}) : null;
|
|
85503
|
+
const scoredProfile = scored === null ? null : await profileForCamStream({
|
|
85504
|
+
api,
|
|
85505
|
+
deviceId,
|
|
85506
|
+
camStreamId: scored.camStreamId,
|
|
85507
|
+
logger: log
|
|
85508
|
+
});
|
|
85509
|
+
const sourceProfile = pinnedProfile ?? scoredProfile ?? "high";
|
|
85510
|
+
if (pinnedProfile === void 0) log.info("alexa rtc-session: source scored against the Echo requirements", {
|
|
85511
|
+
tags: { deviceId },
|
|
85512
|
+
meta: {
|
|
85513
|
+
chosen: sourceProfile,
|
|
85514
|
+
scored: scored === null ? "none-eligible" : scored.reason,
|
|
85515
|
+
camStreamId: scored?.camStreamId ?? null,
|
|
85516
|
+
slot: scoredProfile ?? (scored === null ? null : "no-slot"),
|
|
85517
|
+
height: scored?.resolution?.height ?? null,
|
|
85518
|
+
transcodes: scored?.transcodes ?? null,
|
|
85519
|
+
allowTranscode
|
|
85520
|
+
}
|
|
85521
|
+
});
|
|
85522
|
+
return sourceProfile;
|
|
85523
|
+
}
|
|
85524
|
+
var AlexaEgressPrewarm = class {
|
|
85525
|
+
deps;
|
|
85526
|
+
holds = /* @__PURE__ */ new Map();
|
|
85527
|
+
holdMs;
|
|
85528
|
+
disposed = false;
|
|
85529
|
+
constructor(deps) {
|
|
85530
|
+
this.deps = deps;
|
|
85531
|
+
this.holdMs = deps.holdMs ?? 3e4;
|
|
85532
|
+
}
|
|
85533
|
+
/** A doorbell press for `deviceId`. Never throws. */
|
|
85534
|
+
async onPress(deviceId) {
|
|
85535
|
+
const { api, logger } = this.deps;
|
|
85536
|
+
if (this.disposed) return;
|
|
85537
|
+
if (this.holds.has(deviceId)) {
|
|
85538
|
+
logger.debug("alexa egress prewarm: a hold is already pending, press ignored", { tags: { deviceId } });
|
|
85539
|
+
return;
|
|
85540
|
+
}
|
|
85541
|
+
if (this.deps.hasLiveSession(deviceId)) {
|
|
85542
|
+
logger.info("alexa egress prewarm: an Alexa session is already live, nothing to warm", { tags: { deviceId } });
|
|
85543
|
+
return;
|
|
85544
|
+
}
|
|
85545
|
+
const hold = {
|
|
85546
|
+
pipelineKey: null,
|
|
85547
|
+
timer: null
|
|
85548
|
+
};
|
|
85549
|
+
this.holds.set(deviceId, hold);
|
|
85550
|
+
const sessionId = `prewarm-${deviceId}-${Date.now()}`;
|
|
85551
|
+
try {
|
|
85552
|
+
const sourceProfile = await resolveAlexaSourceProfile({
|
|
85553
|
+
api,
|
|
85554
|
+
deviceId,
|
|
85555
|
+
exposedEntry: this.deps.listExposed().find((e) => e.deviceId === deviceId),
|
|
85556
|
+
logger
|
|
85557
|
+
});
|
|
85558
|
+
const acquired = await acquireAlexaEgress({
|
|
85559
|
+
api,
|
|
85560
|
+
deviceId,
|
|
85561
|
+
sourceProfile,
|
|
85562
|
+
sessionId,
|
|
85563
|
+
logger
|
|
85564
|
+
});
|
|
85565
|
+
hold.pipelineKey = acquired.pipelineKey;
|
|
85566
|
+
if (this.disposed || this.holds.get(deviceId) !== hold) {
|
|
85567
|
+
await this.release(deviceId, hold, "disposed before the hold was armed");
|
|
85568
|
+
return;
|
|
85569
|
+
}
|
|
85570
|
+
hold.timer = setTimeout(() => {
|
|
85571
|
+
this.release(deviceId, hold, "no session arrived");
|
|
85572
|
+
}, this.holdMs);
|
|
85573
|
+
hold.timer.unref?.();
|
|
85574
|
+
logger.info("alexa egress prewarm: transcode held for the coming session", {
|
|
85575
|
+
tags: { deviceId },
|
|
85576
|
+
meta: {
|
|
85577
|
+
pipelineKey: acquired.pipelineKey,
|
|
85578
|
+
sourceProfile,
|
|
85579
|
+
holdMs: this.holdMs
|
|
85580
|
+
}
|
|
85581
|
+
});
|
|
85582
|
+
} catch (err) {
|
|
85583
|
+
this.holds.delete(deviceId);
|
|
85584
|
+
logger.warn("alexa egress prewarm: acquire failed, the session will start the transcode", {
|
|
85585
|
+
tags: { deviceId },
|
|
85586
|
+
meta: { error: err instanceof Error ? err.message : String(err) }
|
|
85587
|
+
});
|
|
85588
|
+
}
|
|
85589
|
+
}
|
|
85590
|
+
/** Release every pending hold (addon shutdown). */
|
|
85591
|
+
async dispose() {
|
|
85592
|
+
this.disposed = true;
|
|
85593
|
+
const pending = [...this.holds.entries()];
|
|
85594
|
+
await Promise.all(pending.map(([deviceId, hold]) => this.release(deviceId, hold, "shutdown")));
|
|
85595
|
+
}
|
|
85596
|
+
async release(deviceId, hold, reason) {
|
|
85597
|
+
if (hold.timer) clearTimeout(hold.timer);
|
|
85598
|
+
hold.timer = null;
|
|
85599
|
+
if (this.holds.get(deviceId) === hold) this.holds.delete(deviceId);
|
|
85600
|
+
const pipelineKey = hold.pipelineKey;
|
|
85601
|
+
hold.pipelineKey = null;
|
|
85602
|
+
if (pipelineKey === null) return;
|
|
85603
|
+
await releaseAlexaEgress({
|
|
85604
|
+
api: this.deps.api,
|
|
85605
|
+
deviceId,
|
|
85606
|
+
pipelineKey,
|
|
85607
|
+
logger: this.deps.logger
|
|
85608
|
+
});
|
|
85609
|
+
this.deps.logger.info("alexa egress prewarm: hold released", {
|
|
85610
|
+
tags: { deviceId },
|
|
85611
|
+
meta: {
|
|
85612
|
+
pipelineKey,
|
|
85613
|
+
reason
|
|
85614
|
+
}
|
|
85615
|
+
});
|
|
85616
|
+
}
|
|
85617
|
+
};
|
|
85618
|
+
//#endregion
|
|
84208
85619
|
//#region src/handlers/endpoint-id.ts
|
|
84209
85620
|
/** The classes a camera publishes a detection sensor for (R1). */
|
|
84210
85621
|
var DETECTION_SENSOR_CLASSES = [
|
|
@@ -84481,47 +85892,12 @@ async function handleInitiateSessionWithOffer(header, endpointRaw, payloadRaw, d
|
|
|
84481
85892
|
if (sdpOffer.length === 0) return errorEnvelope(header, "INVALID_DIRECTIVE", "offer.value is empty");
|
|
84482
85893
|
const api = deps.ctx.api;
|
|
84483
85894
|
const exposedEntry = deps.listExposed().find((e) => e.deviceId === deviceId);
|
|
84484
|
-
const
|
|
84485
|
-
const pref = exposedEntry?.settings?.streamPreference;
|
|
84486
|
-
if (pref === "low" || pref === "mid" || pref === "high") return pref;
|
|
84487
|
-
})();
|
|
84488
|
-
const allowTranscode = exposedEntry?.settings?.allowTranscode !== false;
|
|
84489
|
-
const scored = pinnedProfile === void 0 ? await api.cameraStreams.pickStream.query({
|
|
84490
|
-
deviceId,
|
|
84491
|
-
requirements: {
|
|
84492
|
-
acceptCodecs: ["h264"],
|
|
84493
|
-
minHeight: 480,
|
|
84494
|
-
maxHeight: ALEXA_MAX_LINES,
|
|
84495
|
-
excludeDerived: true,
|
|
84496
|
-
allowTranscode
|
|
84497
|
-
},
|
|
84498
|
-
preferences: { targetHeight: 720 }
|
|
84499
|
-
}).catch((err) => {
|
|
84500
|
-
log.warn("alexa rtc-session: pickStream threw — falling back to the high slot", {
|
|
84501
|
-
tags: { deviceId },
|
|
84502
|
-
meta: { error: err instanceof Error ? err.message : String(err) }
|
|
84503
|
-
});
|
|
84504
|
-
return null;
|
|
84505
|
-
}) : null;
|
|
84506
|
-
const scoredProfile = scored === null ? null : await profileForCamStream({
|
|
85895
|
+
const sourceProfile = await resolveAlexaSourceProfile({
|
|
84507
85896
|
api,
|
|
84508
85897
|
deviceId,
|
|
84509
|
-
|
|
85898
|
+
exposedEntry,
|
|
84510
85899
|
logger: log
|
|
84511
85900
|
});
|
|
84512
|
-
const sourceProfile = pinnedProfile ?? scoredProfile ?? "high";
|
|
84513
|
-
if (pinnedProfile === void 0) log.info("alexa rtc-session: source scored against the Echo requirements", {
|
|
84514
|
-
tags: { deviceId },
|
|
84515
|
-
meta: {
|
|
84516
|
-
chosen: sourceProfile,
|
|
84517
|
-
scored: scored === null ? "none-eligible" : scored.reason,
|
|
84518
|
-
camStreamId: scored?.camStreamId ?? null,
|
|
84519
|
-
slot: scoredProfile ?? (scored === null ? null : "no-slot"),
|
|
84520
|
-
height: scored?.resolution?.height ?? null,
|
|
84521
|
-
transcodes: scored?.transcodes ?? null,
|
|
84522
|
-
allowTranscode
|
|
84523
|
-
}
|
|
84524
|
-
});
|
|
84525
85901
|
let derivedTarget;
|
|
84526
85902
|
/**
|
|
84527
85903
|
* The primitive's release handle, when this session acquired one. Recorded so
|
|
@@ -85678,13 +87054,13 @@ var temperatureAdapter = {
|
|
|
85678
87054
|
category: "TEMPERATURE_SENSOR"
|
|
85679
87055
|
}),
|
|
85680
87056
|
properties: (_cap, slice) => {
|
|
85681
|
-
const p = TemperatureSensorStatusSchema.pick({
|
|
85682
|
-
if (!p.success || p.data.
|
|
87057
|
+
const p = TemperatureSensorStatusSchema.pick({ temperature: true }).safeParse(slice);
|
|
87058
|
+
if (!p.success || p.data.temperature === null) return [];
|
|
85683
87059
|
return [{
|
|
85684
87060
|
namespace: "Alexa.TemperatureSensor",
|
|
85685
87061
|
name: "temperature",
|
|
85686
87062
|
value: {
|
|
85687
|
-
value: Math.round(p.data.
|
|
87063
|
+
value: Math.round(p.data.temperature * 10) / 10,
|
|
85688
87064
|
scale: "CELSIUS"
|
|
85689
87065
|
}
|
|
85690
87066
|
}];
|
|
@@ -86429,12 +87805,12 @@ var humidityAdapter = {
|
|
|
86429
87805
|
category: "TEMPERATURE_SENSOR"
|
|
86430
87806
|
}),
|
|
86431
87807
|
properties: (_cap, slice) => {
|
|
86432
|
-
const p = HumiditySensorStatusSchema.pick({
|
|
86433
|
-
if (!p.success || p.data.
|
|
87808
|
+
const p = HumiditySensorStatusSchema.pick({ humidity: true }).safeParse(slice);
|
|
87809
|
+
if (!p.success || p.data.humidity === null) return [];
|
|
86434
87810
|
return [{
|
|
86435
87811
|
namespace: "Alexa.HumiditySensor",
|
|
86436
87812
|
name: "relativeHumidity",
|
|
86437
|
-
value: { value: Math.max(0, Math.min(100, p.data.
|
|
87813
|
+
value: { value: Math.max(0, Math.min(100, p.data.humidity)) }
|
|
86438
87814
|
}];
|
|
86439
87815
|
},
|
|
86440
87816
|
directives: [],
|
|
@@ -86608,7 +87984,7 @@ async function handleSetBrightness(header, endpointRaw, payloadRaw, deps, _calle
|
|
|
86608
87984
|
try {
|
|
86609
87985
|
await api.brightness.setBrightness.mutate({
|
|
86610
87986
|
deviceId: targetDeviceId,
|
|
86611
|
-
percentage
|
|
87987
|
+
level: percentage
|
|
86612
87988
|
});
|
|
86613
87989
|
} catch (err) {
|
|
86614
87990
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -86752,11 +88128,11 @@ var GENERIC_ADAPTERS = [
|
|
|
86752
88128
|
},
|
|
86753
88129
|
properties: (capName, slice) => {
|
|
86754
88130
|
if (capName === "brightness") {
|
|
86755
|
-
const p = BrightnessStatusSchema.pick({
|
|
88131
|
+
const p = BrightnessStatusSchema.pick({ level: true }).safeParse(slice);
|
|
86756
88132
|
return p.success ? [{
|
|
86757
88133
|
namespace: "Alexa.BrightnessController",
|
|
86758
88134
|
name: "brightness",
|
|
86759
|
-
value: Math.max(0, Math.min(100, Math.round(p.data.
|
|
88135
|
+
value: Math.max(0, Math.min(100, Math.round(p.data.level)))
|
|
86760
88136
|
}] : [];
|
|
86761
88137
|
}
|
|
86762
88138
|
const p = SwitchStatusSchema.pick({ on: true }).safeParse(slice);
|
|
@@ -89806,7 +91182,7 @@ async function collectChildProperties(api, childDeviceId, properties, timeOfSamp
|
|
|
89806
91182
|
timeOfSample,
|
|
89807
91183
|
uncertaintyInMilliseconds: 0
|
|
89808
91184
|
});
|
|
89809
|
-
const level = numberField(await api.brightness.getStatus.query({ deviceId: childDeviceId }).catch(() => null), "
|
|
91185
|
+
const level = numberField(await api.brightness.getStatus.query({ deviceId: childDeviceId }).catch(() => null), "level");
|
|
89810
91186
|
if (level !== null) properties.push({
|
|
89811
91187
|
namespace: "Alexa.BrightnessController",
|
|
89812
91188
|
name: "brightness",
|
|
@@ -91334,6 +92710,7 @@ var LwaEventGateway = class {
|
|
|
91334
92710
|
return;
|
|
91335
92711
|
}
|
|
91336
92712
|
if (!this.hasProactiveCredentials()) return;
|
|
92713
|
+
this.deps.onExposedDoorbellPress?.(parentDeviceId);
|
|
91337
92714
|
for (const account of linked) {
|
|
91338
92715
|
if (!this.mayPush(account.userId, parentDeviceId, "doorbell press")) continue;
|
|
91339
92716
|
if (!this.findToken(account.userId)) {
|
|
@@ -93689,7 +95066,7 @@ function indexByDrivingDevice(exported) {
|
|
|
93689
95066
|
}
|
|
93690
95067
|
var EnabledSchema = object({ enabled: boolean() });
|
|
93691
95068
|
var OnSchema = object({ on: boolean() });
|
|
93692
|
-
var PercentageSchema = object({
|
|
95069
|
+
var PercentageSchema = object({ level: number() });
|
|
93693
95070
|
var OnlineSchema = object({ online: boolean() });
|
|
93694
95071
|
function power(on) {
|
|
93695
95072
|
return {
|
|
@@ -93770,7 +95147,7 @@ function stateReportsFor(change, exported) {
|
|
|
93770
95147
|
case "brightness": {
|
|
93771
95148
|
const parsed = PercentageSchema.safeParse(change.slice);
|
|
93772
95149
|
if (!parsed.success) break;
|
|
93773
|
-
const value = Math.max(0, Math.min(100, Math.round(parsed.data.
|
|
95150
|
+
const value = Math.max(0, Math.min(100, Math.round(parsed.data.level)));
|
|
93774
95151
|
for (const e of of("child")) reports.push({
|
|
93775
95152
|
...e,
|
|
93776
95153
|
interfaceName: "Alexa.BrightnessController",
|
|
@@ -94497,6 +95874,7 @@ var ExportAlexaAddon = class extends BaseAddon {
|
|
|
94497
95874
|
"tokens[userId].brokerCredential"
|
|
94498
95875
|
];
|
|
94499
95876
|
lwaGateway = null;
|
|
95877
|
+
egressPrewarm = null;
|
|
94500
95878
|
syncEngine = null;
|
|
94501
95879
|
/** S1 (D767): the linking user's live grants. Built in `onInitialize`, the
|
|
94502
95880
|
* first point `ctx` exists. */
|
|
@@ -94663,10 +96041,19 @@ var ExportAlexaAddon = class extends BaseAddon {
|
|
|
94663
96041
|
}
|
|
94664
96042
|
}));
|
|
94665
96043
|
const oauthIntegrationProvider = { getDescriptor: async () => buildAlexaOauthIntegration(this.config.publicHubUrl) };
|
|
96044
|
+
this.egressPrewarm = new AlexaEgressPrewarm({
|
|
96045
|
+
api: this.ctx.api,
|
|
96046
|
+
logger: this.ctx.logger,
|
|
96047
|
+
listExposed: () => this.config.exposed,
|
|
96048
|
+
hasLiveSession: (deviceId) => heldEgressHandles().some((h) => h.deviceId === deviceId)
|
|
96049
|
+
});
|
|
94666
96050
|
this.lwaGateway = new LwaEventGateway({
|
|
94667
96051
|
ctx: this.ctx,
|
|
94668
96052
|
logger: this.ctx.logger,
|
|
94669
96053
|
listExposed: () => this.config.exposed,
|
|
96054
|
+
onExposedDoorbellPress: (deviceId) => {
|
|
96055
|
+
this.egressPrewarm?.onPress(deviceId);
|
|
96056
|
+
},
|
|
94670
96057
|
listLinkedAccounts: () => this.config.linkedAccounts,
|
|
94671
96058
|
listTokens: () => this.config.tokens,
|
|
94672
96059
|
upsertToken: (input) => this.upsertToken(input),
|
|
@@ -94820,6 +96207,10 @@ var ExportAlexaAddon = class extends BaseAddon {
|
|
|
94820
96207
|
this.stateReconciler = null;
|
|
94821
96208
|
this.stateReporter?.stop();
|
|
94822
96209
|
this.stateReporter = null;
|
|
96210
|
+
if (this.egressPrewarm) {
|
|
96211
|
+
await this.egressPrewarm.dispose();
|
|
96212
|
+
this.egressPrewarm = null;
|
|
96213
|
+
}
|
|
94823
96214
|
if (this.lwaGateway) {
|
|
94824
96215
|
this.lwaGateway.stop();
|
|
94825
96216
|
this.lwaGateway = null;
|