@camstack/addon-export-hap 1.2.184 → 1.2.185
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/hap-export.addon.js +812 -204
- package/dist/hap-export.addon.mjs +812 -204
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
39
39
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
40
40
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
41
41
|
//#endregion
|
|
42
|
-
//#region ../types/dist/event-category-
|
|
42
|
+
//#region ../types/dist/event-category-DmZDPDf_.mjs
|
|
43
43
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
44
44
|
EventCategory["SystemBoot"] = "system.boot";
|
|
45
45
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -666,7 +666,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
666
666
|
* (a track was promoted to a stationary-registry entry) or departs (the
|
|
667
667
|
* object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
|
|
668
668
|
* the dedicated "Stationary" section — never the live event feed. Payload:
|
|
669
|
-
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp }`.
|
|
669
|
+
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
|
|
670
670
|
*/
|
|
671
671
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
672
672
|
/**
|
|
@@ -804,6 +804,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
804
804
|
*/
|
|
805
805
|
EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
|
|
806
806
|
/**
|
|
807
|
+
* An action run started or ended. Emitted by the `actions` surface.
|
|
808
|
+
* Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
|
|
809
|
+
*/
|
|
810
|
+
EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
|
|
811
|
+
/**
|
|
807
812
|
* Progress update from a running model conversion job.
|
|
808
813
|
* Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
|
|
809
814
|
* Emitted by `addon-model-studio` on the converting node.
|
|
@@ -5482,7 +5487,7 @@ var ZodIssueCode = {
|
|
|
5482
5487
|
var ZodFirstPartyTypeKind;
|
|
5483
5488
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5484
5489
|
//#endregion
|
|
5485
|
-
//#region ../types/dist/sleep
|
|
5490
|
+
//#region ../types/dist/sleep-Crlmu_tO.mjs
|
|
5486
5491
|
/**
|
|
5487
5492
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5488
5493
|
* window to float samples (D455).
|
|
@@ -8590,6 +8595,8 @@ Object.freeze({ "doorbell": "lastPressedAt" });
|
|
|
8590
8595
|
/** Every capability name, so addon code can check a name without the schema graph. */
|
|
8591
8596
|
var CAP_NAMES = Object.freeze([
|
|
8592
8597
|
"accessories",
|
|
8598
|
+
"action-source",
|
|
8599
|
+
"actions",
|
|
8593
8600
|
"addon-pages",
|
|
8594
8601
|
"addon-pages-source",
|
|
8595
8602
|
"addon-routes",
|
|
@@ -8778,11 +8785,11 @@ var CAP_NAMES = Object.freeze([
|
|
|
8778
8785
|
Object.freeze({
|
|
8779
8786
|
"air-quality-sensor": [
|
|
8780
8787
|
{
|
|
8781
|
-
"path": "
|
|
8788
|
+
"path": "co2",
|
|
8782
8789
|
"valueType": "number"
|
|
8783
8790
|
},
|
|
8784
8791
|
{
|
|
8785
|
-
"path": "
|
|
8792
|
+
"path": "voc",
|
|
8786
8793
|
"valueType": "number"
|
|
8787
8794
|
},
|
|
8788
8795
|
{
|
|
@@ -8832,7 +8839,7 @@ Object.freeze({
|
|
|
8832
8839
|
}
|
|
8833
8840
|
],
|
|
8834
8841
|
"ambient-light-sensor": [{
|
|
8835
|
-
"path": "
|
|
8842
|
+
"path": "illuminance",
|
|
8836
8843
|
"valueType": "number"
|
|
8837
8844
|
}],
|
|
8838
8845
|
"audio-metrics": [
|
|
@@ -8893,7 +8900,7 @@ Object.freeze({
|
|
|
8893
8900
|
],
|
|
8894
8901
|
"battery": [
|
|
8895
8902
|
{
|
|
8896
|
-
"path": "
|
|
8903
|
+
"path": "level",
|
|
8897
8904
|
"valueType": "number"
|
|
8898
8905
|
},
|
|
8899
8906
|
{
|
|
@@ -8915,7 +8922,7 @@ Object.freeze({
|
|
|
8915
8922
|
"valueType": "number"
|
|
8916
8923
|
},
|
|
8917
8924
|
{
|
|
8918
|
-
"path": "
|
|
8925
|
+
"path": "voltage",
|
|
8919
8926
|
"valueType": "number"
|
|
8920
8927
|
},
|
|
8921
8928
|
{
|
|
@@ -8936,7 +8943,7 @@ Object.freeze({
|
|
|
8936
8943
|
"valueType": "boolean"
|
|
8937
8944
|
}],
|
|
8938
8945
|
"brightness": [{
|
|
8939
|
-
"path": "
|
|
8946
|
+
"path": "level",
|
|
8940
8947
|
"valueType": "number"
|
|
8941
8948
|
}],
|
|
8942
8949
|
"broker": [{
|
|
@@ -9137,7 +9144,7 @@ Object.freeze({
|
|
|
9137
9144
|
"valueType": "number"
|
|
9138
9145
|
},
|
|
9139
9146
|
{
|
|
9140
|
-
"path": "
|
|
9147
|
+
"path": "colorTemperature",
|
|
9141
9148
|
"valueType": "number"
|
|
9142
9149
|
}
|
|
9143
9150
|
],
|
|
@@ -9316,15 +9323,15 @@ Object.freeze({
|
|
|
9316
9323
|
"valueType": "string"
|
|
9317
9324
|
},
|
|
9318
9325
|
{
|
|
9319
|
-
"path": "
|
|
9326
|
+
"path": "remaining",
|
|
9320
9327
|
"valueType": "number"
|
|
9321
9328
|
},
|
|
9322
9329
|
{
|
|
9323
|
-
"path": "
|
|
9330
|
+
"path": "delayedStart",
|
|
9324
9331
|
"valueType": "number"
|
|
9325
9332
|
},
|
|
9326
9333
|
{
|
|
9327
|
-
"path": "
|
|
9334
|
+
"path": "progress",
|
|
9328
9335
|
"valueType": "number"
|
|
9329
9336
|
},
|
|
9330
9337
|
{
|
|
@@ -9438,7 +9445,7 @@ Object.freeze({
|
|
|
9438
9445
|
],
|
|
9439
9446
|
"fan-control": [
|
|
9440
9447
|
{
|
|
9441
|
-
"path": "
|
|
9448
|
+
"path": "speed",
|
|
9442
9449
|
"valueType": "number"
|
|
9443
9450
|
},
|
|
9444
9451
|
{
|
|
@@ -9538,7 +9545,7 @@ Object.freeze({
|
|
|
9538
9545
|
}
|
|
9539
9546
|
],
|
|
9540
9547
|
"humidity-sensor": [{
|
|
9541
|
-
"path": "
|
|
9548
|
+
"path": "humidity",
|
|
9542
9549
|
"valueType": "number"
|
|
9543
9550
|
}],
|
|
9544
9551
|
"image": [{
|
|
@@ -9648,7 +9655,7 @@ Object.freeze({
|
|
|
9648
9655
|
"valueType": "number"
|
|
9649
9656
|
},
|
|
9650
9657
|
{
|
|
9651
|
-
"path": "
|
|
9658
|
+
"path": "progress",
|
|
9652
9659
|
"valueType": "number"
|
|
9653
9660
|
},
|
|
9654
9661
|
{
|
|
@@ -9727,11 +9734,11 @@ Object.freeze({
|
|
|
9727
9734
|
"valueType": "string"
|
|
9728
9735
|
},
|
|
9729
9736
|
{
|
|
9730
|
-
"path": "
|
|
9737
|
+
"path": "position",
|
|
9731
9738
|
"valueType": "number"
|
|
9732
9739
|
},
|
|
9733
9740
|
{
|
|
9734
|
-
"path": "
|
|
9741
|
+
"path": "duration",
|
|
9735
9742
|
"valueType": "number"
|
|
9736
9743
|
},
|
|
9737
9744
|
{
|
|
@@ -9833,11 +9840,11 @@ Object.freeze({
|
|
|
9833
9840
|
]
|
|
9834
9841
|
},
|
|
9835
9842
|
{
|
|
9836
|
-
"path": "
|
|
9843
|
+
"path": "signal",
|
|
9837
9844
|
"valueType": "number"
|
|
9838
9845
|
},
|
|
9839
9846
|
{
|
|
9840
|
-
"path": "
|
|
9847
|
+
"path": "rssi",
|
|
9841
9848
|
"valueType": "number"
|
|
9842
9849
|
},
|
|
9843
9850
|
{
|
|
@@ -9892,6 +9899,18 @@ Object.freeze({
|
|
|
9892
9899
|
"path": "foodLevel",
|
|
9893
9900
|
"valueType": "number"
|
|
9894
9901
|
},
|
|
9902
|
+
{
|
|
9903
|
+
"path": "bowlFood",
|
|
9904
|
+
"valueType": "number"
|
|
9905
|
+
},
|
|
9906
|
+
{
|
|
9907
|
+
"path": "eating",
|
|
9908
|
+
"valueType": "boolean"
|
|
9909
|
+
},
|
|
9910
|
+
{
|
|
9911
|
+
"path": "supportsMarkRefilled",
|
|
9912
|
+
"valueType": "boolean"
|
|
9913
|
+
},
|
|
9895
9914
|
{
|
|
9896
9915
|
"path": "food1",
|
|
9897
9916
|
"valueType": "number"
|
|
@@ -9956,23 +9975,23 @@ Object.freeze({
|
|
|
9956
9975
|
],
|
|
9957
9976
|
"power-meter": [
|
|
9958
9977
|
{
|
|
9959
|
-
"path": "
|
|
9978
|
+
"path": "power",
|
|
9960
9979
|
"valueType": "number"
|
|
9961
9980
|
},
|
|
9962
9981
|
{
|
|
9963
|
-
"path": "
|
|
9982
|
+
"path": "energy",
|
|
9964
9983
|
"valueType": "number"
|
|
9965
9984
|
},
|
|
9966
9985
|
{
|
|
9967
|
-
"path": "
|
|
9986
|
+
"path": "voltage",
|
|
9968
9987
|
"valueType": "number"
|
|
9969
9988
|
},
|
|
9970
9989
|
{
|
|
9971
|
-
"path": "
|
|
9990
|
+
"path": "current",
|
|
9972
9991
|
"valueType": "number"
|
|
9973
9992
|
},
|
|
9974
9993
|
{
|
|
9975
|
-
"path": "
|
|
9994
|
+
"path": "apparentPower",
|
|
9976
9995
|
"valueType": "number"
|
|
9977
9996
|
},
|
|
9978
9997
|
{
|
|
@@ -10000,14 +10019,10 @@ Object.freeze({
|
|
|
10000
10019
|
{
|
|
10001
10020
|
"path": "gps.accuracyMeters",
|
|
10002
10021
|
"valueType": "number"
|
|
10003
|
-
},
|
|
10004
|
-
{
|
|
10005
|
-
"path": "batteryPercent",
|
|
10006
|
-
"valueType": "number"
|
|
10007
10022
|
}
|
|
10008
10023
|
],
|
|
10009
10024
|
"pressure-sensor": [{
|
|
10010
|
-
"path": "
|
|
10025
|
+
"path": "pressure",
|
|
10011
10026
|
"valueType": "number"
|
|
10012
10027
|
}],
|
|
10013
10028
|
"privacy-mask": [{
|
|
@@ -10321,7 +10336,7 @@ Object.freeze({
|
|
|
10321
10336
|
"valueType": "boolean"
|
|
10322
10337
|
}],
|
|
10323
10338
|
"temperature-sensor": [{
|
|
10324
|
-
"path": "
|
|
10339
|
+
"path": "temperature",
|
|
10325
10340
|
"valueType": "number"
|
|
10326
10341
|
}],
|
|
10327
10342
|
"update": [
|
|
@@ -10369,7 +10384,7 @@ Object.freeze({
|
|
|
10369
10384
|
"valueType": "string"
|
|
10370
10385
|
},
|
|
10371
10386
|
{
|
|
10372
|
-
"path": "
|
|
10387
|
+
"path": "progress",
|
|
10373
10388
|
"valueType": "number"
|
|
10374
10389
|
},
|
|
10375
10390
|
{
|
|
@@ -10854,7 +10869,7 @@ function errMsg$16(err) {
|
|
|
10854
10869
|
return String(err);
|
|
10855
10870
|
}
|
|
10856
10871
|
//#endregion
|
|
10857
|
-
//#region ../types/dist/composition-
|
|
10872
|
+
//#region ../types/dist/composition-CZImLpOI.mjs
|
|
10858
10873
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
10859
10874
|
opus: "libopus",
|
|
10860
10875
|
aac: "aac",
|
|
@@ -16193,6 +16208,14 @@ var AutomationConditionLeafSchema = object({
|
|
|
16193
16208
|
array(union([string(), number()]))
|
|
16194
16209
|
])
|
|
16195
16210
|
});
|
|
16211
|
+
var AutomationConditionStationaryPresentSchema = object({
|
|
16212
|
+
kind: literal("stationary-present"),
|
|
16213
|
+
deviceId: number().int().nonnegative(),
|
|
16214
|
+
/** Class names; a macro class matches every raw class that maps to it. */
|
|
16215
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
16216
|
+
/** The parked object must be in at least one of these zones. */
|
|
16217
|
+
zones: array(string().min(1)).min(1).optional()
|
|
16218
|
+
});
|
|
16196
16219
|
/**
|
|
16197
16220
|
* The expression leaf, declared as a plain object rather than an intersection
|
|
16198
16221
|
* with {@link ExpressionSourceSchema}: a discriminated union has to be able to
|
|
@@ -16226,7 +16249,8 @@ var AutomationConditionSchema = lazy(() => discriminatedUnion("kind", [
|
|
|
16226
16249
|
child: AutomationConditionSchema
|
|
16227
16250
|
}),
|
|
16228
16251
|
AutomationConditionLeafSchema,
|
|
16229
|
-
AutomationConditionExpressionSchema
|
|
16252
|
+
AutomationConditionExpressionSchema,
|
|
16253
|
+
AutomationConditionStationaryPresentSchema
|
|
16230
16254
|
]));
|
|
16231
16255
|
/**
|
|
16232
16256
|
* What starts a run.
|
|
@@ -16267,7 +16291,34 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
16267
16291
|
kind: literal("schedule"),
|
|
16268
16292
|
cron: string().min(1).max(120)
|
|
16269
16293
|
}),
|
|
16270
|
-
object({ kind: literal("manual") })
|
|
16294
|
+
object({ kind: literal("manual") }),
|
|
16295
|
+
object({
|
|
16296
|
+
kind: literal("detection"),
|
|
16297
|
+
/** Class names. A macro class (`animal`, `vehicle`, `person`, `package`)
|
|
16298
|
+
* matches every raw class that maps to it; any other name matches
|
|
16299
|
+
* exactly. */
|
|
16300
|
+
classes: array(string().min(1)).min(1),
|
|
16301
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
16302
|
+
/** The track must have visited at least one of these zones. */
|
|
16303
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
16304
|
+
/** Best-so-far confidence the track must reach. */
|
|
16305
|
+
minScore: number().min(0).max(1).optional()
|
|
16306
|
+
}),
|
|
16307
|
+
object({
|
|
16308
|
+
kind: literal("stationary"),
|
|
16309
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
16310
|
+
/** Class names; a macro class matches like the detection trigger. */
|
|
16311
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
16312
|
+
/** The parked object must be in at least one of these zones. */
|
|
16313
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
16314
|
+
/** `appeared`: it became parked. `departed`: the registry retired it.
|
|
16315
|
+
* The vocabulary of `PipelineAnalyticsStationaryChanged`. */
|
|
16316
|
+
phase: _enum(["appeared", "departed"])
|
|
16317
|
+
}),
|
|
16318
|
+
object({
|
|
16319
|
+
kind: literal("interval"),
|
|
16320
|
+
minutes: number().int().min(1).max(1440)
|
|
16321
|
+
})
|
|
16271
16322
|
]);
|
|
16272
16323
|
/**
|
|
16273
16324
|
* One action step.
|
|
@@ -16287,28 +16338,47 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
16287
16338
|
* is called. The runner still receives a number and is untouched; the
|
|
16288
16339
|
* resolution is the recipe's job, not the runner's.
|
|
16289
16340
|
*/
|
|
16341
|
+
var AutomationWaitStepSchema = object({
|
|
16342
|
+
kind: literal("wait"),
|
|
16343
|
+
seconds: number().min(0).max(300)
|
|
16344
|
+
});
|
|
16345
|
+
var AutomationCapStepSchema = object({
|
|
16346
|
+
kind: literal("cap"),
|
|
16347
|
+
/**
|
|
16348
|
+
* One device, several same-family devices (locks / climate family / …),
|
|
16349
|
+
* or `{ $var }` for the device that triggered the run. An array is
|
|
16350
|
+
* fan-out at codegen — each id gets the same cap.method call.
|
|
16351
|
+
*/
|
|
16352
|
+
deviceId: union([
|
|
16353
|
+
number().int(),
|
|
16354
|
+
array(number().int()).min(1),
|
|
16355
|
+
object({ $var: string().min(1) })
|
|
16356
|
+
]),
|
|
16357
|
+
cap: string().min(1),
|
|
16358
|
+
method: string().min(1),
|
|
16359
|
+
/** Values may carry `{{vars.x}}` slots, or be exactly `{ $var: 'name' }`, which
|
|
16360
|
+
* SUBSTITUTE and do not evaluate (§3.2.3). Anything beyond substitution is
|
|
16361
|
+
* the expression leaf. */
|
|
16362
|
+
args: record(string(), unknown()).optional()
|
|
16363
|
+
});
|
|
16364
|
+
/**
|
|
16365
|
+
* The steps an internal Action may contain: cap and wait, and nothing that can
|
|
16366
|
+
* call back into an Action — so an Action can never reach itself (no cycles).
|
|
16367
|
+
*/
|
|
16368
|
+
var ActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
|
|
16290
16369
|
var AutomationActionSchema = discriminatedUnion("kind", [
|
|
16370
|
+
AutomationWaitStepSchema,
|
|
16371
|
+
AutomationCapStepSchema,
|
|
16291
16372
|
object({
|
|
16292
|
-
kind: literal("
|
|
16293
|
-
|
|
16294
|
-
|
|
16295
|
-
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16301
|
-
*/
|
|
16302
|
-
deviceId: union([
|
|
16303
|
-
number().int(),
|
|
16304
|
-
array(number().int()).min(1),
|
|
16305
|
-
object({ $var: string().min(1) })
|
|
16306
|
-
]),
|
|
16307
|
-
cap: string().min(1),
|
|
16308
|
-
method: string().min(1),
|
|
16309
|
-
/** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
|
|
16310
|
-
* evaluate (§3.2.3). Anything beyond substitution is the expression leaf. */
|
|
16311
|
-
args: record(string(), unknown()).optional()
|
|
16373
|
+
kind: literal("action"),
|
|
16374
|
+
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
16375
|
+
actionId: string().min(1),
|
|
16376
|
+
/** Values for the action's declared variables; the others take their default. */
|
|
16377
|
+
variables: record(string(), union([
|
|
16378
|
+
string(),
|
|
16379
|
+
number(),
|
|
16380
|
+
boolean()
|
|
16381
|
+
])).optional()
|
|
16312
16382
|
}),
|
|
16313
16383
|
object({
|
|
16314
16384
|
kind: literal("code"),
|
|
@@ -16317,10 +16387,357 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
16317
16387
|
code: string().min(1).max(2e4)
|
|
16318
16388
|
})
|
|
16319
16389
|
]);
|
|
16390
|
+
/**
|
|
16391
|
+
* How a trigger that arrives while the automation is busy (or cooling down) is
|
|
16392
|
+
* handled. One of the automation's execution modes, never a property of its
|
|
16393
|
+
* actions. Absent means `single`.
|
|
16394
|
+
*
|
|
16395
|
+
* - `single` — drop the trigger while a run is in progress (traced + logged).
|
|
16396
|
+
* - `restart` — abort the run in progress (at its next step boundary), start fresh.
|
|
16397
|
+
* - `queued` — queue up to `max` triggers, drop the rest (traced).
|
|
16398
|
+
* - `parallel` — up to `max` runs at once, drop the rest (traced).
|
|
16399
|
+
* - `cooldown` — `single`, and no new run until `minutes` after the last run
|
|
16400
|
+
* STARTED; persisted across a restart. A manual trigger bypasses only this
|
|
16401
|
+
* wait, never the single/queued limits.
|
|
16402
|
+
*/
|
|
16403
|
+
var AutomationRunModeSchema = discriminatedUnion("mode", [
|
|
16404
|
+
object({ mode: literal("single") }),
|
|
16405
|
+
object({ mode: literal("restart") }),
|
|
16406
|
+
object({
|
|
16407
|
+
mode: literal("queued"),
|
|
16408
|
+
max: number().int().min(1).max(10)
|
|
16409
|
+
}),
|
|
16410
|
+
object({
|
|
16411
|
+
mode: literal("parallel"),
|
|
16412
|
+
max: number().int().min(1).max(10)
|
|
16413
|
+
}),
|
|
16414
|
+
object({
|
|
16415
|
+
mode: literal("cooldown"),
|
|
16416
|
+
minutes: number().int().min(1).max(1440)
|
|
16417
|
+
})
|
|
16418
|
+
]);
|
|
16320
16419
|
var AutomationRecipeSchema = object({
|
|
16321
16420
|
triggers: array(AutomationTriggerSchema),
|
|
16322
16421
|
conditions: AutomationConditionSchema.optional(),
|
|
16323
|
-
actions: array(AutomationActionSchema)
|
|
16422
|
+
actions: array(AutomationActionSchema),
|
|
16423
|
+
runMode: AutomationRunModeSchema.optional(),
|
|
16424
|
+
/** How many run traces the automation keeps (default {@link DEFAULT_TRACE_KEEP}). */
|
|
16425
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
16426
|
+
});
|
|
16427
|
+
new Set([
|
|
16428
|
+
{
|
|
16429
|
+
id: "person",
|
|
16430
|
+
name: "Person"
|
|
16431
|
+
},
|
|
16432
|
+
{
|
|
16433
|
+
id: "vehicle",
|
|
16434
|
+
name: "Vehicle"
|
|
16435
|
+
},
|
|
16436
|
+
{
|
|
16437
|
+
id: "animal",
|
|
16438
|
+
name: "Animal"
|
|
16439
|
+
},
|
|
16440
|
+
{
|
|
16441
|
+
id: "package",
|
|
16442
|
+
name: "Package"
|
|
16443
|
+
}
|
|
16444
|
+
].map((l) => l.id));
|
|
16445
|
+
var COCO_TO_MACRO = {
|
|
16446
|
+
mapping: {
|
|
16447
|
+
person: "person",
|
|
16448
|
+
bicycle: "vehicle",
|
|
16449
|
+
car: "vehicle",
|
|
16450
|
+
motorcycle: "vehicle",
|
|
16451
|
+
airplane: "vehicle",
|
|
16452
|
+
bus: "vehicle",
|
|
16453
|
+
train: "vehicle",
|
|
16454
|
+
truck: "vehicle",
|
|
16455
|
+
boat: "vehicle",
|
|
16456
|
+
bird: "animal",
|
|
16457
|
+
cat: "animal",
|
|
16458
|
+
dog: "animal",
|
|
16459
|
+
horse: "animal",
|
|
16460
|
+
sheep: "animal",
|
|
16461
|
+
cow: "animal",
|
|
16462
|
+
elephant: "animal",
|
|
16463
|
+
bear: "animal",
|
|
16464
|
+
zebra: "animal",
|
|
16465
|
+
giraffe: "animal",
|
|
16466
|
+
suitcase: "package",
|
|
16467
|
+
backpack: "package",
|
|
16468
|
+
handbag: "package"
|
|
16469
|
+
},
|
|
16470
|
+
preserveOriginal: false
|
|
16471
|
+
};
|
|
16472
|
+
new Set(Object.values(COCO_TO_MACRO.mapping));
|
|
16473
|
+
/**
|
|
16474
|
+
* Run traces — what an automation (or, later, an Action run) DID, node by node,
|
|
16475
|
+
* so the editor can paint every block green or red with its reason.
|
|
16476
|
+
*
|
|
16477
|
+
* A trace is data, not a log: it covers the WHOLE tree — the trigger stage,
|
|
16478
|
+
* every condition node (containers and leaves, including the ones a
|
|
16479
|
+
* short-circuit never reached), the run-mode verdict and every action step —
|
|
16480
|
+
* each addressed by a stable path (`conditions.0.1`, `actions.2`, or `steps.N`
|
|
16481
|
+
* for an Action run). Skipped
|
|
16482
|
+
* evaluations are traced too, and identical consecutive skips collapse into a
|
|
16483
|
+
* repeat count so a trigger that fails every 5 minutes cannot flush real runs.
|
|
16484
|
+
*
|
|
16485
|
+
* {@link AutomationStepTraceSchema} is deliberately free of automation
|
|
16486
|
+
* vocabulary so an Action run records the same step shape.
|
|
16487
|
+
*/
|
|
16488
|
+
/** A value a trace may show: JSON primitives and short lists, nothing deeper. */
|
|
16489
|
+
var TraceValueSchema = union([
|
|
16490
|
+
string(),
|
|
16491
|
+
number(),
|
|
16492
|
+
boolean(),
|
|
16493
|
+
_null(),
|
|
16494
|
+
array(union([string(), number()]))
|
|
16495
|
+
]);
|
|
16496
|
+
var AutomationRunOutcomeSchema = _enum([
|
|
16497
|
+
"ran",
|
|
16498
|
+
"skipped-trigger",
|
|
16499
|
+
"skipped-conditions",
|
|
16500
|
+
"skipped-cooldown",
|
|
16501
|
+
"skipped-overlap",
|
|
16502
|
+
"failed",
|
|
16503
|
+
"aborted"
|
|
16504
|
+
]);
|
|
16505
|
+
/** `not-evaluated` = a short-circuit never reached the node. */
|
|
16506
|
+
var TraceNodeOutcomeSchema = _enum([
|
|
16507
|
+
"pass",
|
|
16508
|
+
"fail",
|
|
16509
|
+
"not-evaluated"
|
|
16510
|
+
]);
|
|
16511
|
+
var AutomationTriggerTraceSchema = object({
|
|
16512
|
+
kind: string().min(1),
|
|
16513
|
+
outcome: _enum(["pass", "fail"]),
|
|
16514
|
+
/** Why an event was rejected ("class person not in [dog]") or what fired. */
|
|
16515
|
+
reason: string(),
|
|
16516
|
+
/** deviceId, className, trackId, score … — only what the trigger exposes. */
|
|
16517
|
+
vars: record(string(), TraceValueSchema)
|
|
16518
|
+
});
|
|
16519
|
+
var AutomationConditionTraceNodeSchema = object({
|
|
16520
|
+
/** `conditions` for the root, `conditions.<i>` for its i-th child, … */
|
|
16521
|
+
path: string().min(1),
|
|
16522
|
+
kind: _enum([
|
|
16523
|
+
"all",
|
|
16524
|
+
"any",
|
|
16525
|
+
"not",
|
|
16526
|
+
"condition",
|
|
16527
|
+
"expression",
|
|
16528
|
+
"stationary-present"
|
|
16529
|
+
]),
|
|
16530
|
+
outcome: TraceNodeOutcomeSchema,
|
|
16531
|
+
reason: string(),
|
|
16532
|
+
deviceId: number().int().optional(),
|
|
16533
|
+
cap: string().optional(),
|
|
16534
|
+
fieldPath: string().optional(),
|
|
16535
|
+
operator: string().optional(),
|
|
16536
|
+
expected: TraceValueSchema.optional(),
|
|
16537
|
+
/** What the mirror held; `null` when it held nothing (unknown). */
|
|
16538
|
+
observed: TraceValueSchema.optional()
|
|
16539
|
+
});
|
|
16540
|
+
var AutomationRunVerdictSchema = object({
|
|
16541
|
+
mode: AutomationRunModeSchema,
|
|
16542
|
+
decision: _enum([
|
|
16543
|
+
"run",
|
|
16544
|
+
"queued",
|
|
16545
|
+
"restart",
|
|
16546
|
+
"drop",
|
|
16547
|
+
"cooldown",
|
|
16548
|
+
"bypass"
|
|
16549
|
+
]),
|
|
16550
|
+
reason: string()
|
|
16551
|
+
});
|
|
16552
|
+
/** One executed (or not-run) step — shared by automations and Action runs. */
|
|
16553
|
+
var AutomationStepTraceSchema = object({
|
|
16554
|
+
/** `actions.<i>` */
|
|
16555
|
+
path: string().min(1),
|
|
16556
|
+
kind: string().min(1),
|
|
16557
|
+
cap: string().optional(),
|
|
16558
|
+
method: string().optional(),
|
|
16559
|
+
deviceId: number().int().optional(),
|
|
16560
|
+
startedAt: number().optional(),
|
|
16561
|
+
endedAt: number().optional(),
|
|
16562
|
+
outcome: _enum([
|
|
16563
|
+
"ok",
|
|
16564
|
+
"error",
|
|
16565
|
+
"not-run"
|
|
16566
|
+
]),
|
|
16567
|
+
message: string().optional()
|
|
16568
|
+
});
|
|
16569
|
+
var AutomationRunTraceSchema = object({
|
|
16570
|
+
runId: string().min(1),
|
|
16571
|
+
startedAt: number(),
|
|
16572
|
+
endedAt: number(),
|
|
16573
|
+
trigger: AutomationTriggerTraceSchema,
|
|
16574
|
+
conditions: array(AutomationConditionTraceNodeSchema),
|
|
16575
|
+
verdict: AutomationRunVerdictSchema.optional(),
|
|
16576
|
+
steps: array(AutomationStepTraceSchema),
|
|
16577
|
+
outcome: AutomationRunOutcomeSchema,
|
|
16578
|
+
/** How many identical consecutive skips this trace stands for (>= 1). */
|
|
16579
|
+
repeat: number().int().min(1),
|
|
16580
|
+
/** When the latest of those repeats happened. */
|
|
16581
|
+
lastAt: number()
|
|
16582
|
+
});
|
|
16583
|
+
/**
|
|
16584
|
+
* What the hub's `runs` ledger holds for one owner (`automation:<blockId>` or
|
|
16585
|
+
* `action:<actionId>`): the cooldown stamp and the trace ring.
|
|
16586
|
+
*/
|
|
16587
|
+
var AutomationStateDocSchema = object({
|
|
16588
|
+
version: literal(1),
|
|
16589
|
+
lastRunStartedAt: number().nullable(),
|
|
16590
|
+
traces: array(AutomationRunTraceSchema)
|
|
16591
|
+
});
|
|
16592
|
+
/**
|
|
16593
|
+
* Actions — named, runnable things an operator (or an automation) can start,
|
|
16594
|
+
* declared as LIST ENTRIES, never as devices.
|
|
16595
|
+
*
|
|
16596
|
+
* An entry is either **internal** (a short list of cap/wait steps kept in the
|
|
16597
|
+
* hub's `actions` record kind) or declared by an addon through the
|
|
16598
|
+
* `action-source` collection (a Home Assistant script, a scene …). The one
|
|
16599
|
+
* surface the UI and automations talk to is the `actions` cap; it keeps no
|
|
16600
|
+
* catalog of its own (D3) — every `list` asks the providers live.
|
|
16601
|
+
*
|
|
16602
|
+
* This file is the data half: the entry schema, the variables an entry may
|
|
16603
|
+
* declare, and the pure resolution of the values a run was given. It holds no
|
|
16604
|
+
* runtime.
|
|
16605
|
+
*/
|
|
16606
|
+
/** What a variable's value is. `select` takes one of `options`. */
|
|
16607
|
+
var ActionVariableTypeSchema = _enum([
|
|
16608
|
+
"string",
|
|
16609
|
+
"number",
|
|
16610
|
+
"boolean",
|
|
16611
|
+
"select"
|
|
16612
|
+
]);
|
|
16613
|
+
var ACTION_VARIABLE_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
16614
|
+
var ActionVariableValueSchema = union([
|
|
16615
|
+
string(),
|
|
16616
|
+
number(),
|
|
16617
|
+
boolean()
|
|
16618
|
+
]);
|
|
16619
|
+
/**
|
|
16620
|
+
* One declared variable. Steps reference it as `{ $var: 'name' }` (the whole
|
|
16621
|
+
* value) or `{{vars.name}}` (inside a string) in their args.
|
|
16622
|
+
*/
|
|
16623
|
+
var ActionVariableSchema = object({
|
|
16624
|
+
name: string().regex(ACTION_VARIABLE_NAME_RE),
|
|
16625
|
+
label: string().min(1).max(120).optional(),
|
|
16626
|
+
type: ActionVariableTypeSchema,
|
|
16627
|
+
required: boolean().optional(),
|
|
16628
|
+
default: ActionVariableValueSchema.optional(),
|
|
16629
|
+
/** The allowed values of a `select`. */
|
|
16630
|
+
options: array(string().min(1)).min(1).optional()
|
|
16631
|
+
}).superRefine((v, ctx) => {
|
|
16632
|
+
if (v.type === "select" && v.options === void 0) ctx.addIssue({
|
|
16633
|
+
code: "custom",
|
|
16634
|
+
message: "a select variable needs options",
|
|
16635
|
+
path: ["options"]
|
|
16636
|
+
});
|
|
16637
|
+
if (v.default !== void 0 && variableValueError(v, v.default) !== null) ctx.addIssue({
|
|
16638
|
+
code: "custom",
|
|
16639
|
+
message: variableValueError(v, v.default) ?? "invalid default",
|
|
16640
|
+
path: ["default"]
|
|
16641
|
+
});
|
|
16642
|
+
});
|
|
16643
|
+
/** Why `value` is not a legal value for the variable, or null when it is. */
|
|
16644
|
+
function variableValueError(variable, value) {
|
|
16645
|
+
switch (variable.type) {
|
|
16646
|
+
case "string": return typeof value === "string" ? null : `variable "${variable.name}" must be a string`;
|
|
16647
|
+
case "number": return typeof value === "number" && Number.isFinite(value) ? null : `variable "${variable.name}" must be a number`;
|
|
16648
|
+
case "boolean": return typeof value === "boolean" ? null : `variable "${variable.name}" must be true or false`;
|
|
16649
|
+
case "select": return typeof value === "string" && (variable.options ?? []).includes(value) ? null : `variable "${variable.name}" must be one of ${(variable.options ?? []).join(", ")}`;
|
|
16650
|
+
}
|
|
16651
|
+
}
|
|
16652
|
+
var ActionSourceKindSchema = _enum(["internal", "addon"]);
|
|
16653
|
+
function isInternalActionId(actionId) {
|
|
16654
|
+
return actionId.startsWith("internal:") && actionId.length > 9;
|
|
16655
|
+
}
|
|
16656
|
+
/** The addon behind a `<addonId>:<localId>` id, or null for anything else (internal included). */
|
|
16657
|
+
function addonIdOfActionId(actionId) {
|
|
16658
|
+
if (isInternalActionId(actionId)) return null;
|
|
16659
|
+
const at = actionId.indexOf(":");
|
|
16660
|
+
return at > 0 && at < actionId.length - 1 ? actionId.slice(0, at) : null;
|
|
16661
|
+
}
|
|
16662
|
+
var ActionStatusSchema = object({
|
|
16663
|
+
isRunning: boolean(),
|
|
16664
|
+
/** Ms epoch the latest run STARTED; null when it never ran. */
|
|
16665
|
+
lastRunAt: number().nullable(),
|
|
16666
|
+
/** The latest run's failure; null on success or when it never ran. */
|
|
16667
|
+
lastError: string().nullable()
|
|
16668
|
+
});
|
|
16669
|
+
var ActionEntrySchema = object({
|
|
16670
|
+
/** `internal:<uuid>` or `<addonId>:<localId>`. */
|
|
16671
|
+
id: string().min(3),
|
|
16672
|
+
name: string().min(1).max(120),
|
|
16673
|
+
/** The addon that declared it; `core-blocks` for an internal one. */
|
|
16674
|
+
addonId: string().min(1),
|
|
16675
|
+
source: ActionSourceKindSchema,
|
|
16676
|
+
/** An addon-declared entry is edited where it was declared. */
|
|
16677
|
+
readOnly: boolean(),
|
|
16678
|
+
/** Internal only: cap and wait steps. No action-in-action, so no cycles. */
|
|
16679
|
+
steps: array(ActionStepSchema).min(1).max(50).optional(),
|
|
16680
|
+
variables: array(ActionVariableSchema).max(20).optional(),
|
|
16681
|
+
status: ActionStatusSchema
|
|
16682
|
+
}).superRefine((entry, ctx) => {
|
|
16683
|
+
if (entry.source === "internal") {
|
|
16684
|
+
if (!isInternalActionId(entry.id)) ctx.addIssue({
|
|
16685
|
+
code: "custom",
|
|
16686
|
+
message: "an internal action id is internal:<uuid>",
|
|
16687
|
+
path: ["id"]
|
|
16688
|
+
});
|
|
16689
|
+
return;
|
|
16690
|
+
}
|
|
16691
|
+
if (entry.steps !== void 0) ctx.addIssue({
|
|
16692
|
+
code: "custom",
|
|
16693
|
+
message: "only an internal action carries steps",
|
|
16694
|
+
path: ["steps"]
|
|
16695
|
+
});
|
|
16696
|
+
if (!entry.readOnly) ctx.addIssue({
|
|
16697
|
+
code: "custom",
|
|
16698
|
+
message: "an addon action is read-only here",
|
|
16699
|
+
path: ["readOnly"]
|
|
16700
|
+
});
|
|
16701
|
+
if (addonIdOfActionId(entry.id) === null) ctx.addIssue({
|
|
16702
|
+
code: "custom",
|
|
16703
|
+
message: "an addon action id is <addonId>:<localId>",
|
|
16704
|
+
path: ["id"]
|
|
16705
|
+
});
|
|
16706
|
+
});
|
|
16707
|
+
/** What an operator writes for an internal action. */
|
|
16708
|
+
var ActionInputSchema = object({
|
|
16709
|
+
name: string().min(1).max(120),
|
|
16710
|
+
steps: array(ActionStepSchema).min(1).max(50),
|
|
16711
|
+
variables: array(ActionVariableSchema).max(20).optional()
|
|
16712
|
+
});
|
|
16713
|
+
/** Who started a run. Absent = the operator pressed it. */
|
|
16714
|
+
var ActionRunOriginSchema = object({
|
|
16715
|
+
/** The automation block whose step started it. */
|
|
16716
|
+
blockId: string().min(1).optional() });
|
|
16717
|
+
/** `started` = the caller did not ask to wait. */
|
|
16718
|
+
var ActionRunOutcomeSchema = union([AutomationRunOutcomeSchema, literal("started")]);
|
|
16719
|
+
var ActionRunResultSchema = object({
|
|
16720
|
+
runId: string().min(1),
|
|
16721
|
+
outcome: ActionRunOutcomeSchema,
|
|
16722
|
+
/** Why it did not run, or what failed. */
|
|
16723
|
+
message: string().optional()
|
|
16724
|
+
});
|
|
16725
|
+
_enum([
|
|
16726
|
+
"not-found",
|
|
16727
|
+
"read-only",
|
|
16728
|
+
"invalid-variables",
|
|
16729
|
+
"invalid-steps",
|
|
16730
|
+
"not-linked",
|
|
16731
|
+
"busy"
|
|
16732
|
+
]);
|
|
16733
|
+
object({
|
|
16734
|
+
actionId: string(),
|
|
16735
|
+
runId: string(),
|
|
16736
|
+
isRunning: boolean(),
|
|
16737
|
+
/** Set when the run ended. */
|
|
16738
|
+
outcome: AutomationRunOutcomeSchema.optional(),
|
|
16739
|
+
lastRunAt: number().nullable(),
|
|
16740
|
+
lastError: string().nullable()
|
|
16324
16741
|
});
|
|
16325
16742
|
/**
|
|
16326
16743
|
* `addon-pages` — system-scoped singleton aggregator cap. Public-facing
|
|
@@ -18901,7 +19318,7 @@ var CompositionEventPlanSchema = object({
|
|
|
18901
19318
|
stateField: string(),
|
|
18902
19319
|
fieldKey: string()
|
|
18903
19320
|
});
|
|
18904
|
-
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.
|
|
19321
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
|
|
18905
19322
|
var CompositionProblemSchema = object({
|
|
18906
19323
|
code: _enum([
|
|
18907
19324
|
"reserved-variant",
|
|
@@ -19220,7 +19637,7 @@ var GROUP_TEMPLATES = [
|
|
|
19220
19637
|
summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
|
|
19221
19638
|
role: DeviceRole.TemperatureSensor,
|
|
19222
19639
|
outputCap: "temperature-sensor",
|
|
19223
|
-
outputField: "
|
|
19640
|
+
outputField: "temperature",
|
|
19224
19641
|
quantity: "temperature",
|
|
19225
19642
|
defaultAggregate: "mean",
|
|
19226
19643
|
empty: "null",
|
|
@@ -19231,7 +19648,7 @@ var GROUP_TEMPLATES = [
|
|
|
19231
19648
|
summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
19232
19649
|
role: DeviceRole.HumiditySensor,
|
|
19233
19650
|
outputCap: "humidity-sensor",
|
|
19234
|
-
outputField: "
|
|
19651
|
+
outputField: "humidity",
|
|
19235
19652
|
quantity: "humidity",
|
|
19236
19653
|
defaultAggregate: "mean",
|
|
19237
19654
|
empty: "null",
|
|
@@ -19242,7 +19659,7 @@ var GROUP_TEMPLATES = [
|
|
|
19242
19659
|
summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
|
|
19243
19660
|
role: DeviceRole.PressureSensor,
|
|
19244
19661
|
outputCap: "pressure-sensor",
|
|
19245
|
-
outputField: "
|
|
19662
|
+
outputField: "pressure",
|
|
19246
19663
|
quantity: "pressure",
|
|
19247
19664
|
defaultAggregate: "mean",
|
|
19248
19665
|
empty: "null",
|
|
@@ -19253,7 +19670,7 @@ var GROUP_TEMPLATES = [
|
|
|
19253
19670
|
summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
|
|
19254
19671
|
role: DeviceRole.AmbientLightSensor,
|
|
19255
19672
|
outputCap: "ambient-light-sensor",
|
|
19256
|
-
outputField: "
|
|
19673
|
+
outputField: "illuminance",
|
|
19257
19674
|
quantity: "illuminance",
|
|
19258
19675
|
defaultAggregate: "mean",
|
|
19259
19676
|
empty: "null",
|
|
@@ -19264,7 +19681,7 @@ var GROUP_TEMPLATES = [
|
|
|
19264
19681
|
summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
|
|
19265
19682
|
role: DeviceRole.PowerSensor,
|
|
19266
19683
|
outputCap: "power-meter",
|
|
19267
|
-
outputField: "
|
|
19684
|
+
outputField: "power",
|
|
19268
19685
|
quantity: "power",
|
|
19269
19686
|
defaultAggregate: "sum",
|
|
19270
19687
|
empty: "omit",
|
|
@@ -19275,7 +19692,7 @@ var GROUP_TEMPLATES = [
|
|
|
19275
19692
|
summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
|
|
19276
19693
|
role: DeviceRole.EnergySensor,
|
|
19277
19694
|
outputCap: "power-meter",
|
|
19278
|
-
outputField: "
|
|
19695
|
+
outputField: "energy",
|
|
19279
19696
|
quantity: "energy",
|
|
19280
19697
|
defaultAggregate: "sum",
|
|
19281
19698
|
empty: "omit",
|
|
@@ -19286,7 +19703,7 @@ var GROUP_TEMPLATES = [
|
|
|
19286
19703
|
summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
19287
19704
|
role: DeviceRole.BatterySensor,
|
|
19288
19705
|
outputCap: "battery",
|
|
19289
|
-
outputField: "
|
|
19706
|
+
outputField: "level",
|
|
19290
19707
|
quantity: "percentage",
|
|
19291
19708
|
defaultAggregate: "mean",
|
|
19292
19709
|
empty: "null",
|
|
@@ -19864,7 +20281,18 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
19864
20281
|
kind: "mutation",
|
|
19865
20282
|
auth: "admin",
|
|
19866
20283
|
access: "view"
|
|
19867
|
-
})
|
|
20284
|
+
}), method(object({
|
|
20285
|
+
blockId: string().min(1),
|
|
20286
|
+
trace: AutomationRunTraceSchema.optional(),
|
|
20287
|
+
runStartedAt: number().optional(),
|
|
20288
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
20289
|
+
}), _void(), {
|
|
20290
|
+
kind: "mutation",
|
|
20291
|
+
auth: "admin"
|
|
20292
|
+
}), method(object({ blockId: string().min(1) }), AutomationStateDocSchema, { auth: "admin" }), method(object({ blockId: string().min(1) }), object({
|
|
20293
|
+
traces: array(AutomationRunTraceSchema),
|
|
20294
|
+
lastError: string().nullable()
|
|
20295
|
+
}), { auth: "admin" });
|
|
19868
20296
|
/**
|
|
19869
20297
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
19870
20298
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -45038,51 +45466,6 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
|
|
|
45038
45466
|
kind: "mutation",
|
|
45039
45467
|
auth: "admin"
|
|
45040
45468
|
});
|
|
45041
|
-
new Set([
|
|
45042
|
-
{
|
|
45043
|
-
id: "person",
|
|
45044
|
-
name: "Person"
|
|
45045
|
-
},
|
|
45046
|
-
{
|
|
45047
|
-
id: "vehicle",
|
|
45048
|
-
name: "Vehicle"
|
|
45049
|
-
},
|
|
45050
|
-
{
|
|
45051
|
-
id: "animal",
|
|
45052
|
-
name: "Animal"
|
|
45053
|
-
},
|
|
45054
|
-
{
|
|
45055
|
-
id: "package",
|
|
45056
|
-
name: "Package"
|
|
45057
|
-
}
|
|
45058
|
-
].map((l) => l.id));
|
|
45059
|
-
var COCO_TO_MACRO = {
|
|
45060
|
-
mapping: {
|
|
45061
|
-
person: "person",
|
|
45062
|
-
bicycle: "vehicle",
|
|
45063
|
-
car: "vehicle",
|
|
45064
|
-
motorcycle: "vehicle",
|
|
45065
|
-
airplane: "vehicle",
|
|
45066
|
-
bus: "vehicle",
|
|
45067
|
-
train: "vehicle",
|
|
45068
|
-
truck: "vehicle",
|
|
45069
|
-
boat: "vehicle",
|
|
45070
|
-
bird: "animal",
|
|
45071
|
-
cat: "animal",
|
|
45072
|
-
dog: "animal",
|
|
45073
|
-
horse: "animal",
|
|
45074
|
-
sheep: "animal",
|
|
45075
|
-
cow: "animal",
|
|
45076
|
-
elephant: "animal",
|
|
45077
|
-
bear: "animal",
|
|
45078
|
-
zebra: "animal",
|
|
45079
|
-
giraffe: "animal",
|
|
45080
|
-
suitcase: "package",
|
|
45081
|
-
backpack: "package",
|
|
45082
|
-
handbag: "package"
|
|
45083
|
-
},
|
|
45084
|
-
preserveOriginal: false
|
|
45085
|
-
};
|
|
45086
45469
|
var AUDIO_MACRO_LABELS = [
|
|
45087
45470
|
{
|
|
45088
45471
|
id: "speech",
|
|
@@ -57712,9 +58095,9 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
|
|
|
57712
58095
|
}), LogStreamEntrySchema, { kind: "subscription" });
|
|
57713
58096
|
object({
|
|
57714
58097
|
/** Carbon dioxide concentration in ppm. */
|
|
57715
|
-
|
|
58098
|
+
co2: number().min(0).optional().meta(readingMeta("concentration-volume")),
|
|
57716
58099
|
/** Total volatile organic compounds in ppb. */
|
|
57717
|
-
|
|
58100
|
+
voc: number().min(0).optional().meta(readingMeta("concentration-ppb")),
|
|
57718
58101
|
/** Particulate matter ≤ 2.5 μm in µg/m³. */
|
|
57719
58102
|
pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
|
|
57720
58103
|
/** Particulate matter ≤ 10 μm in µg/m³. */
|
|
@@ -57731,7 +58114,7 @@ DeviceType.Sensor;
|
|
|
57731
58114
|
*/
|
|
57732
58115
|
var AmbientLightSensorStatusSchema = object({
|
|
57733
58116
|
/** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
|
|
57734
|
-
|
|
58117
|
+
illuminance: number().min(0).nullable().meta(readingMeta("illuminance", {
|
|
57735
58118
|
precision: 0,
|
|
57736
58119
|
label: "Illuminance"
|
|
57737
58120
|
})),
|
|
@@ -57828,6 +58211,84 @@ DeviceType.Camera, method(object({ deviceId: number() }), AudioMetricsSnapshotSc
|
|
|
57828
58211
|
* would produce more than `maxPoints` samples. */
|
|
57829
58212
|
sampleEveryMs: number().int().positive().optional()
|
|
57830
58213
|
}), AudioMetricsHistorySchema);
|
|
58214
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
58215
|
+
actionId: string().min(1),
|
|
58216
|
+
variables: record(string(), ActionVariableValueSchema).optional()
|
|
58217
|
+
}), _void(), {
|
|
58218
|
+
kind: "mutation",
|
|
58219
|
+
auth: "admin"
|
|
58220
|
+
}), method(object({ actionId: string().min(1) }), _void(), {
|
|
58221
|
+
kind: "mutation",
|
|
58222
|
+
auth: "admin"
|
|
58223
|
+
});
|
|
58224
|
+
/**
|
|
58225
|
+
* actions — the ONE surface for runnable actions, for the UI and for
|
|
58226
|
+
* automations. Provided by the core-blocks builtin on the hub.
|
|
58227
|
+
*
|
|
58228
|
+
* An action is a LIST ENTRY, not a device (D883): either internal (cap and wait
|
|
58229
|
+
* steps, kept in the hub's `actions` record kind) or declared by an addon over
|
|
58230
|
+
* `action-source`. `list` asks every `action-source` provider LIVE and overlays
|
|
58231
|
+
* the run status from the hub's `runs` ledger; there is no catalog here to
|
|
58232
|
+
* drift (D3).
|
|
58233
|
+
*
|
|
58234
|
+
* **Permissions follow the camera, as linked devices do.** An action is linked
|
|
58235
|
+
* to cameras by the operator (`setLinks`, D356: nothing links itself). A
|
|
58236
|
+
* non-admin may `get` / `run` an action only through a camera they may see that
|
|
58237
|
+
* links it: they name the camera (`deviceId`, a top-level field so the scope
|
|
58238
|
+
* gate sees it) and the provider refuses an action that camera does not link.
|
|
58239
|
+
* An admin, and an in-process caller (an automation block), may run any action.
|
|
58240
|
+
* Every refusal is typed (`[not-linked] …`) and logged.
|
|
58241
|
+
*
|
|
58242
|
+
* A second `run` of an action that is already running is REFUSED — traced and
|
|
58243
|
+
* logged — never queued.
|
|
58244
|
+
*/
|
|
58245
|
+
var ActionIdInput = object({ actionId: string().min(1) });
|
|
58246
|
+
var ActionLinksSchema = object({
|
|
58247
|
+
deviceId: number().int().nonnegative(),
|
|
58248
|
+
actionIds: array(string().min(1)).max(100)
|
|
58249
|
+
});
|
|
58250
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
58251
|
+
actionId: string().min(1),
|
|
58252
|
+
deviceId: number().int().nonnegative().optional()
|
|
58253
|
+
}), object({ action: ActionEntrySchema.nullable() }), {
|
|
58254
|
+
role: "viewer",
|
|
58255
|
+
auth: "protected",
|
|
58256
|
+
kind: "query",
|
|
58257
|
+
caller: "required"
|
|
58258
|
+
}), method(object({
|
|
58259
|
+
actionId: string().min(1),
|
|
58260
|
+
variables: record(string(), ActionVariableValueSchema).optional(),
|
|
58261
|
+
wait: boolean().optional(),
|
|
58262
|
+
origin: ActionRunOriginSchema.optional(),
|
|
58263
|
+
deviceId: number().int().nonnegative().optional()
|
|
58264
|
+
}), ActionRunResultSchema, {
|
|
58265
|
+
role: "viewer",
|
|
58266
|
+
auth: "protected",
|
|
58267
|
+
kind: "mutation",
|
|
58268
|
+
caller: "required"
|
|
58269
|
+
}), method(ActionIdInput, _void(), {
|
|
58270
|
+
kind: "mutation",
|
|
58271
|
+
auth: "admin"
|
|
58272
|
+
}), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({ action: ActionEntrySchema }), {
|
|
58273
|
+
kind: "mutation",
|
|
58274
|
+
auth: "admin"
|
|
58275
|
+
}), method(object({
|
|
58276
|
+
actionId: string().min(1),
|
|
58277
|
+
action: ActionInputSchema.partial()
|
|
58278
|
+
}), object({ action: ActionEntrySchema }), {
|
|
58279
|
+
kind: "mutation",
|
|
58280
|
+
auth: "admin"
|
|
58281
|
+
}), method(ActionIdInput, _void(), {
|
|
58282
|
+
kind: "mutation",
|
|
58283
|
+
auth: "admin"
|
|
58284
|
+
}), method(object({ deviceId: number().int().nonnegative() }), array(ActionEntrySchema), {
|
|
58285
|
+
role: "viewer",
|
|
58286
|
+
auth: "protected",
|
|
58287
|
+
kind: "query"
|
|
58288
|
+
}), method(object({ deviceId: number().int().nonnegative() }), ActionLinksSchema, { auth: "admin" }), method(ActionLinksSchema, ActionLinksSchema, {
|
|
58289
|
+
kind: "mutation",
|
|
58290
|
+
auth: "admin"
|
|
58291
|
+
});
|
|
57831
58292
|
object({
|
|
57832
58293
|
/** Whether the automation is currently enabled. Disabled automations
|
|
57833
58294
|
* ignore their trigger block — manual `trigger` still works. */
|
|
@@ -57881,7 +58342,7 @@ var BatteryStatusSchema = object({
|
|
|
57881
58342
|
* Consumers must SKIP a null rather than coerce it — `battery-band` already
|
|
57882
58343
|
* declines to band a non-finite reading, which is the correct shape.
|
|
57883
58344
|
*/
|
|
57884
|
-
|
|
58345
|
+
level: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
|
|
57885
58346
|
/**
|
|
57886
58347
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
57887
58348
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
@@ -57891,7 +58352,7 @@ var BatteryStatusSchema = object({
|
|
|
57891
58352
|
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
57892
58353
|
* power fields yet, or the firmware reported neither. Before it existed,
|
|
57893
58354
|
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
57894
|
-
* was drawn "on battery alone" — the same D315 defect `
|
|
58355
|
+
* was drawn "on battery alone" — the same D315 defect `level` closed
|
|
57895
58356
|
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
57896
58357
|
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
57897
58358
|
*/
|
|
@@ -57915,7 +58376,7 @@ var BatteryStatusSchema = object({
|
|
|
57915
58376
|
* that only report charge. A second reading on this cap, not a second
|
|
57916
58377
|
* `numeric-sensor` on the same device.
|
|
57917
58378
|
*/
|
|
57918
|
-
|
|
58379
|
+
voltage: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
57919
58380
|
/**
|
|
57920
58381
|
* Ms epoch of the last time the device PROVED it was reachable — a
|
|
57921
58382
|
* completed firmware round-trip, an observed wake, or an inbound push
|
|
@@ -57949,7 +58410,7 @@ var BatteryStatusSchema = object({
|
|
|
57949
58410
|
/**
|
|
57950
58411
|
* True when the source is a BINARY low-battery indicator (HA
|
|
57951
58412
|
* `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
|
|
57952
|
-
* charge level — `
|
|
58413
|
+
* charge level — `level` is then a coarse stand-in (100 = normal,
|
|
57953
58414
|
* sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
|
|
57954
58415
|
* misleading exact percentage. Absent/false → genuine 0–100 % reading.
|
|
57955
58416
|
*/
|
|
@@ -57975,19 +58436,19 @@ object({
|
|
|
57975
58436
|
DeviceType.Sensor;
|
|
57976
58437
|
object({
|
|
57977
58438
|
/** Current level as 0..100 inclusive. Firmware-reported. */
|
|
57978
|
-
|
|
58439
|
+
level: number().min(0).max(100).meta(readingMeta("percentage")),
|
|
57979
58440
|
/** Ms epoch of the last operator-driven change. Useful for UI freshness. */
|
|
57980
58441
|
lastChangedAt: number()
|
|
57981
58442
|
});
|
|
57982
58443
|
DeviceType.Light, method(object({
|
|
57983
58444
|
deviceId: number().int().nonnegative(),
|
|
57984
|
-
|
|
58445
|
+
level: number().min(0).max(100)
|
|
57985
58446
|
}), _void(), {
|
|
57986
58447
|
kind: "mutation",
|
|
57987
58448
|
auth: "protected"
|
|
57988
58449
|
}), object({
|
|
57989
58450
|
deviceId: number(),
|
|
57990
|
-
|
|
58451
|
+
level: number().min(0).max(100),
|
|
57991
58452
|
lastChangedAt: number()
|
|
57992
58453
|
});
|
|
57993
58454
|
DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
@@ -58492,11 +58953,11 @@ var ColorInputSchema = discriminatedUnion("mode", [
|
|
|
58492
58953
|
}),
|
|
58493
58954
|
object({
|
|
58494
58955
|
mode: literal("mired"),
|
|
58495
|
-
|
|
58956
|
+
colorTemperature: number().int().min(50).max(1e3)
|
|
58496
58957
|
})
|
|
58497
58958
|
]);
|
|
58498
58959
|
object({
|
|
58499
|
-
/** Active color mode — which of `rgb` / `hsv` / `
|
|
58960
|
+
/** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
|
|
58500
58961
|
* the bulb's current state. */
|
|
58501
58962
|
mode: _enum([
|
|
58502
58963
|
"rgb",
|
|
@@ -58508,7 +58969,7 @@ object({
|
|
|
58508
58969
|
/** Populated when `mode === 'hsv'`. */
|
|
58509
58970
|
hsv: HsvTripletSchema.optional(),
|
|
58510
58971
|
/** Populated when `mode === 'mired'`. */
|
|
58511
|
-
|
|
58972
|
+
colorTemperature: number().int().optional().meta(readingMeta("colour-temperature")),
|
|
58512
58973
|
/** Ms epoch of the last operator-driven change. */
|
|
58513
58974
|
lastChangedAt: number()
|
|
58514
58975
|
});
|
|
@@ -58527,7 +58988,7 @@ DeviceType.Light, method(object({
|
|
|
58527
58988
|
]),
|
|
58528
58989
|
rgb: RgbTripletSchema.optional(),
|
|
58529
58990
|
hsv: HsvTripletSchema.optional(),
|
|
58530
|
-
|
|
58991
|
+
colorTemperature: number().int().optional(),
|
|
58531
58992
|
lastChangedAt: number()
|
|
58532
58993
|
});
|
|
58533
58994
|
var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
|
|
@@ -58965,11 +59426,11 @@ object({
|
|
|
58965
59426
|
/** Feature keys of the programs the appliance currently offers — drives the UI selector. */
|
|
58966
59427
|
availablePrograms: array(string()),
|
|
58967
59428
|
/** Seconds remaining on the active cycle, or null when not running / not known. */
|
|
58968
|
-
|
|
59429
|
+
remaining: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
58969
59430
|
/** Seconds the delayed start is set to (time until the cycle starts), or null. */
|
|
58970
|
-
|
|
59431
|
+
delayedStart: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
58971
59432
|
/** Cycle completion 0..100, or null when not applicable. */
|
|
58972
|
-
|
|
59433
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
58973
59434
|
/** True when the door is reported open; null when the door state is not known. */
|
|
58974
59435
|
doorOpen: boolean().nullable(),
|
|
58975
59436
|
/** True when the door is latched (locked) during a cycle; null when not reported. */
|
|
@@ -59587,7 +60048,7 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
|
|
|
59587
60048
|
object({
|
|
59588
60049
|
/** Active speed as 0..100 inclusive. Null when the device has no
|
|
59589
60050
|
* speed surface (single-speed fan). */
|
|
59590
|
-
|
|
60051
|
+
speed: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
59591
60052
|
/** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
|
|
59592
60053
|
* a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
|
|
59593
60054
|
percentageStep: number().positive().optional().meta(readingMeta("percentage")),
|
|
@@ -59607,7 +60068,7 @@ object({
|
|
|
59607
60068
|
});
|
|
59608
60069
|
DeviceType.Fan, method(object({
|
|
59609
60070
|
deviceId: number().int().nonnegative(),
|
|
59610
|
-
|
|
60071
|
+
speed: number().min(0).max(100)
|
|
59611
60072
|
}), _void(), {
|
|
59612
60073
|
kind: "mutation",
|
|
59613
60074
|
auth: "protected"
|
|
@@ -59806,7 +60267,7 @@ DeviceType.Humidifier, method(object({
|
|
|
59806
60267
|
*/
|
|
59807
60268
|
var HumiditySensorStatusSchema = object({
|
|
59808
60269
|
/** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
|
|
59809
|
-
|
|
60270
|
+
humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
|
|
59810
60271
|
precision: 0,
|
|
59811
60272
|
label: "Humidity"
|
|
59812
60273
|
})),
|
|
@@ -60249,7 +60710,7 @@ object({
|
|
|
60249
60710
|
batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
60250
60711
|
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
60251
60712
|
* task is active / progress is unavailable. */
|
|
60252
|
-
|
|
60713
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
60253
60714
|
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
60254
60715
|
* or null when unknown. */
|
|
60255
60716
|
currentCode: number().nullable().meta(readingMeta("none")),
|
|
@@ -60739,10 +61200,10 @@ object({
|
|
|
60739
61200
|
currentMedia: MediaInfoSchema.nullable(),
|
|
60740
61201
|
/** Current playback position in ms. Null when not seekable or
|
|
60741
61202
|
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
60742
|
-
|
|
61203
|
+
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
60743
61204
|
/** Total duration of the current media in ms. Null when unknown
|
|
60744
61205
|
* (live stream) or nothing is playing. */
|
|
60745
|
-
|
|
61206
|
+
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
60746
61207
|
/** Shuffle toggle. Null when no shuffle surface.
|
|
60747
61208
|
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
60748
61209
|
shuffle: boolean().nullable(),
|
|
@@ -60769,7 +61230,7 @@ DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }
|
|
|
60769
61230
|
auth: "protected"
|
|
60770
61231
|
}), method(object({
|
|
60771
61232
|
deviceId: number().int().nonnegative(),
|
|
60772
|
-
|
|
61233
|
+
position: number().int().nonnegative()
|
|
60773
61234
|
}), _void(), {
|
|
60774
61235
|
kind: "mutation",
|
|
60775
61236
|
auth: "protected"
|
|
@@ -61442,9 +61903,9 @@ var NetworkLinkStatusSchema = object({
|
|
|
61442
61903
|
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
61443
61904
|
* SKIP a null rather than coerce it.
|
|
61444
61905
|
*/
|
|
61445
|
-
|
|
61906
|
+
signal: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
61446
61907
|
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
61447
|
-
|
|
61908
|
+
rssi: number().optional().meta(readingMeta("signal-level")),
|
|
61448
61909
|
/** Network name of a wireless link, when the firmware reports it. */
|
|
61449
61910
|
ssid: string().optional(),
|
|
61450
61911
|
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
@@ -62105,10 +62566,20 @@ var PetFeederDeviceStatusSchema = _enum([
|
|
|
62105
62566
|
]);
|
|
62106
62567
|
var gramsPortion = number().int().min(4).max(200);
|
|
62107
62568
|
object({
|
|
62108
|
-
/** Food
|
|
62109
|
-
*
|
|
62110
|
-
* bowl
|
|
62569
|
+
/** Food in the TANK (hopper), as the feeder's own sensor reports it
|
|
62570
|
+
* (`state.food`). A coarse level code, not grams — `0` is empty. The
|
|
62571
|
+
* amount in the bowl is `bowlFood`. On dual-hopper models this is the
|
|
62572
|
+
* combined reading; per-hopper levels live in `food1`/`food2`. Null when
|
|
62573
|
+
* the device has not reported yet. */
|
|
62111
62574
|
foodLevel: number().nullable().meta(readingMeta("none")),
|
|
62575
|
+
/** Food in the BOWL as the feeder reports it (`state.bowl`), in the
|
|
62576
|
+
* feeder's own units. Null when the model reports none. */
|
|
62577
|
+
bowlFood: number().nullable().meta(readingMeta("none")),
|
|
62578
|
+
/** True while the pet is eating (`state.eating`). */
|
|
62579
|
+
eating: boolean(),
|
|
62580
|
+
/** Whether `markFoodReplenished` does anything on this model. When false
|
|
62581
|
+
* the client must not offer it. */
|
|
62582
|
+
supportsMarkRefilled: boolean(),
|
|
62112
62583
|
/** Hopper-1 food level (grams) on dual-hopper feeders; null on
|
|
62113
62584
|
* single-hopper models. */
|
|
62114
62585
|
food1: number().nullable().meta(readingMeta("none")),
|
|
@@ -62116,8 +62587,8 @@ object({
|
|
|
62116
62587
|
* single-hopper models. */
|
|
62117
62588
|
food2: number().nullable().meta(readingMeta("none")),
|
|
62118
62589
|
/** Derived low-food flag — mirrors the HA `food_level` binary_sensor
|
|
62119
|
-
* (`device_class: problem`, on = low). True when the
|
|
62120
|
-
*
|
|
62590
|
+
* (`device_class: problem`, on = low). True when the tank reports empty,
|
|
62591
|
+
* or, on a dual-hopper model, when EITHER hopper is empty. */
|
|
62121
62592
|
lowFood: boolean(),
|
|
62122
62593
|
/** Battery charge 0..100 (%). Null on mains-powered models or when the
|
|
62123
62594
|
* device has no battery reading. */
|
|
@@ -62584,16 +63055,16 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
|
|
|
62584
63055
|
auth: "admin"
|
|
62585
63056
|
});
|
|
62586
63057
|
object({
|
|
62587
|
-
/** Instantaneous power draw
|
|
62588
|
-
|
|
63058
|
+
/** Instantaneous power draw (watts). */
|
|
63059
|
+
power: number().optional().meta(readingMeta("power", { label: "Power" })),
|
|
62589
63060
|
/** Cumulative energy in kilowatt-hours since the meter was reset. */
|
|
62590
|
-
|
|
62591
|
-
/** Voltage
|
|
62592
|
-
|
|
63061
|
+
energy: number().optional().meta(readingMeta("energy", { label: "Energy" })),
|
|
63062
|
+
/** Voltage (volts). */
|
|
63063
|
+
voltage: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
62593
63064
|
/** Current in amperes. */
|
|
62594
|
-
|
|
63065
|
+
current: number().optional().meta(readingMeta("current", { label: "Current" })),
|
|
62595
63066
|
/** Apparent power in volt-amperes. */
|
|
62596
|
-
|
|
63067
|
+
apparentPower: number().optional().meta(readingMeta("apparent-power")),
|
|
62597
63068
|
/** Power factor (0..1) if reported. */
|
|
62598
63069
|
powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
|
|
62599
63070
|
/** Ms epoch when the slice was last updated. */
|
|
@@ -62648,16 +63119,13 @@ var PresenceStatusSchema = object({
|
|
|
62648
63119
|
location: string().nullable(),
|
|
62649
63120
|
/** GPS coordinates when available. Null otherwise. */
|
|
62650
63121
|
gps: GpsLocationSchema.nullable(),
|
|
62651
|
-
/** Optional battery level of the tracking device (0..100). Null
|
|
62652
|
-
* when not reported. */
|
|
62653
|
-
batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
62654
63122
|
/** Ms epoch when the slice was last updated. */
|
|
62655
63123
|
lastChangedAt: number()
|
|
62656
63124
|
});
|
|
62657
63125
|
DeviceType.Presence;
|
|
62658
63126
|
object({
|
|
62659
63127
|
/** Current pressure in hPa. `null` when the sample was refused (D393). */
|
|
62660
|
-
|
|
63128
|
+
pressure: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
|
|
62661
63129
|
/** Ms epoch when the slice was last updated. */
|
|
62662
63130
|
lastFetchedAt: number()
|
|
62663
63131
|
});
|
|
@@ -65681,7 +66149,7 @@ DeviceType.Sensor;
|
|
|
65681
66149
|
*/
|
|
65682
66150
|
var TemperatureSensorStatusSchema = object({
|
|
65683
66151
|
/** Current temperature in Celsius. `null` when the sample was refused (D393). */
|
|
65684
|
-
|
|
66152
|
+
temperature: number().nullable().meta(readingMeta("temperature", {
|
|
65685
66153
|
precision: 1,
|
|
65686
66154
|
label: "Temperature"
|
|
65687
66155
|
})),
|
|
@@ -65945,7 +66413,7 @@ object({
|
|
|
65945
66413
|
/** Speed tokens the hardware accepts — drives the UI selector. */
|
|
65946
66414
|
availableFanSpeeds: array(string()),
|
|
65947
66415
|
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
65948
|
-
|
|
66416
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
65949
66417
|
/** Current error code (0 / null = no error). */
|
|
65950
66418
|
errorCode: number().nullable().meta(readingMeta("none")),
|
|
65951
66419
|
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
@@ -66886,6 +67354,104 @@ Object.freeze({
|
|
|
66886
67354
|
access: "create",
|
|
66887
67355
|
role: "admin"
|
|
66888
67356
|
},
|
|
67357
|
+
"actions.create": {
|
|
67358
|
+
capName: "actions",
|
|
67359
|
+
capScope: "system",
|
|
67360
|
+
addonId: null,
|
|
67361
|
+
access: "create",
|
|
67362
|
+
role: "admin"
|
|
67363
|
+
},
|
|
67364
|
+
"actions.delete": {
|
|
67365
|
+
capName: "actions",
|
|
67366
|
+
capScope: "system",
|
|
67367
|
+
addonId: null,
|
|
67368
|
+
access: "delete",
|
|
67369
|
+
role: "admin"
|
|
67370
|
+
},
|
|
67371
|
+
"actions.get": {
|
|
67372
|
+
capName: "actions",
|
|
67373
|
+
capScope: "system",
|
|
67374
|
+
addonId: null,
|
|
67375
|
+
access: "view",
|
|
67376
|
+
role: "viewer"
|
|
67377
|
+
},
|
|
67378
|
+
"actions.getLinks": {
|
|
67379
|
+
capName: "actions",
|
|
67380
|
+
capScope: "system",
|
|
67381
|
+
addonId: null,
|
|
67382
|
+
access: "view",
|
|
67383
|
+
role: "admin"
|
|
67384
|
+
},
|
|
67385
|
+
"actions.getTraces": {
|
|
67386
|
+
capName: "actions",
|
|
67387
|
+
capScope: "system",
|
|
67388
|
+
addonId: null,
|
|
67389
|
+
access: "view",
|
|
67390
|
+
role: "admin"
|
|
67391
|
+
},
|
|
67392
|
+
"actions.list": {
|
|
67393
|
+
capName: "actions",
|
|
67394
|
+
capScope: "system",
|
|
67395
|
+
addonId: null,
|
|
67396
|
+
access: "view",
|
|
67397
|
+
role: "admin"
|
|
67398
|
+
},
|
|
67399
|
+
"actions.listForCamera": {
|
|
67400
|
+
capName: "actions",
|
|
67401
|
+
capScope: "system",
|
|
67402
|
+
addonId: null,
|
|
67403
|
+
access: "view",
|
|
67404
|
+
role: "viewer"
|
|
67405
|
+
},
|
|
67406
|
+
"actions.run": {
|
|
67407
|
+
capName: "actions",
|
|
67408
|
+
capScope: "system",
|
|
67409
|
+
addonId: null,
|
|
67410
|
+
access: "create",
|
|
67411
|
+
role: "viewer"
|
|
67412
|
+
},
|
|
67413
|
+
"actions.setLinks": {
|
|
67414
|
+
capName: "actions",
|
|
67415
|
+
capScope: "system",
|
|
67416
|
+
addonId: null,
|
|
67417
|
+
access: "create",
|
|
67418
|
+
role: "admin"
|
|
67419
|
+
},
|
|
67420
|
+
"actions.stop": {
|
|
67421
|
+
capName: "actions",
|
|
67422
|
+
capScope: "system",
|
|
67423
|
+
addonId: null,
|
|
67424
|
+
access: "create",
|
|
67425
|
+
role: "admin"
|
|
67426
|
+
},
|
|
67427
|
+
"actions.update": {
|
|
67428
|
+
capName: "actions",
|
|
67429
|
+
capScope: "system",
|
|
67430
|
+
addonId: null,
|
|
67431
|
+
access: "create",
|
|
67432
|
+
role: "admin"
|
|
67433
|
+
},
|
|
67434
|
+
"actionSource.listActions": {
|
|
67435
|
+
capName: "action-source",
|
|
67436
|
+
capScope: "system",
|
|
67437
|
+
addonId: null,
|
|
67438
|
+
access: "view",
|
|
67439
|
+
role: "admin"
|
|
67440
|
+
},
|
|
67441
|
+
"actionSource.runAction": {
|
|
67442
|
+
capName: "action-source",
|
|
67443
|
+
capScope: "system",
|
|
67444
|
+
addonId: null,
|
|
67445
|
+
access: "create",
|
|
67446
|
+
role: "admin"
|
|
67447
|
+
},
|
|
67448
|
+
"actionSource.stopAction": {
|
|
67449
|
+
capName: "action-source",
|
|
67450
|
+
capScope: "system",
|
|
67451
|
+
addonId: null,
|
|
67452
|
+
access: "create",
|
|
67453
|
+
role: "admin"
|
|
67454
|
+
},
|
|
66889
67455
|
"addonPages.listPages": {
|
|
66890
67456
|
capName: "addon-pages",
|
|
66891
67457
|
capScope: "system",
|
|
@@ -68167,6 +68733,13 @@ Object.freeze({
|
|
|
68167
68733
|
access: "view",
|
|
68168
68734
|
role: "admin"
|
|
68169
68735
|
},
|
|
68736
|
+
"coreBlocks.getAutomationRunState": {
|
|
68737
|
+
capName: "core-blocks",
|
|
68738
|
+
capScope: "system",
|
|
68739
|
+
addonId: null,
|
|
68740
|
+
access: "view",
|
|
68741
|
+
role: "admin"
|
|
68742
|
+
},
|
|
68170
68743
|
"coreBlocks.getBlockSettings": {
|
|
68171
68744
|
capName: "core-blocks",
|
|
68172
68745
|
capScope: "system",
|
|
@@ -68188,6 +68761,13 @@ Object.freeze({
|
|
|
68188
68761
|
access: "view",
|
|
68189
68762
|
role: "admin"
|
|
68190
68763
|
},
|
|
68764
|
+
"coreBlocks.getTraces": {
|
|
68765
|
+
capName: "core-blocks",
|
|
68766
|
+
capScope: "system",
|
|
68767
|
+
addonId: null,
|
|
68768
|
+
access: "view",
|
|
68769
|
+
role: "admin"
|
|
68770
|
+
},
|
|
68191
68771
|
"coreBlocks.getTypeDefs": {
|
|
68192
68772
|
capName: "core-blocks",
|
|
68193
68773
|
capScope: "system",
|
|
@@ -68223,6 +68803,13 @@ Object.freeze({
|
|
|
68223
68803
|
access: "create",
|
|
68224
68804
|
role: "admin"
|
|
68225
68805
|
},
|
|
68806
|
+
"coreBlocks.reportAutomationRun": {
|
|
68807
|
+
capName: "core-blocks",
|
|
68808
|
+
capScope: "system",
|
|
68809
|
+
addonId: null,
|
|
68810
|
+
access: "create",
|
|
68811
|
+
role: "admin"
|
|
68812
|
+
},
|
|
68226
68813
|
"coreBlocks.restart": {
|
|
68227
68814
|
capName: "core-blocks",
|
|
68228
68815
|
capScope: "system",
|
|
@@ -76796,7 +77383,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76796
77383
|
label: t("Full brightness", "Luminosità massima"),
|
|
76797
77384
|
phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
|
|
76798
77385
|
icon: "sun",
|
|
76799
|
-
args: {
|
|
77386
|
+
args: { level: 100 }
|
|
76800
77387
|
},
|
|
76801
77388
|
{
|
|
76802
77389
|
id: "brightness.half",
|
|
@@ -76804,7 +77391,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76804
77391
|
label: t("Half brightness", "Luminosità a metà"),
|
|
76805
77392
|
phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
|
|
76806
77393
|
icon: "sun-dim",
|
|
76807
|
-
args: {
|
|
77394
|
+
args: { level: 50 }
|
|
76808
77395
|
},
|
|
76809
77396
|
{
|
|
76810
77397
|
id: "brightness.off",
|
|
@@ -76812,16 +77399,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76812
77399
|
label: t("Brightness off", "Luminosità a zero"),
|
|
76813
77400
|
phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
|
|
76814
77401
|
icon: "lightbulb-off",
|
|
76815
|
-
args: {
|
|
77402
|
+
args: { level: 0 }
|
|
76816
77403
|
},
|
|
76817
77404
|
{
|
|
76818
77405
|
id: "brightness.set",
|
|
76819
77406
|
method: "setBrightness",
|
|
76820
77407
|
label: t("Set brightness", "Imposta la luminosità"),
|
|
76821
|
-
phrase: t("Set the brightness of {device} to {
|
|
77408
|
+
phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
|
|
76822
77409
|
icon: "sun-medium",
|
|
76823
77410
|
openArgs: [{
|
|
76824
|
-
key: "
|
|
77411
|
+
key: "level",
|
|
76825
77412
|
label: PERCENT,
|
|
76826
77413
|
offer: {
|
|
76827
77414
|
kind: "number",
|
|
@@ -76835,13 +77422,13 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76835
77422
|
],
|
|
76836
77423
|
state: [{
|
|
76837
77424
|
kind: "numeric",
|
|
76838
|
-
field: "
|
|
77425
|
+
field: "level",
|
|
76839
77426
|
quantity: t("the brightness", "la luminosità"),
|
|
76840
77427
|
label: t("Brightness", "Luminosità"),
|
|
76841
77428
|
unit: "%",
|
|
76842
77429
|
icon: "sun"
|
|
76843
77430
|
}],
|
|
76844
|
-
events: { onBrightnessChanged: { notOperatorFacing: "the `
|
|
77431
|
+
events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
|
|
76845
77432
|
},
|
|
76846
77433
|
color: {
|
|
76847
77434
|
scope: "device",
|
|
@@ -76855,7 +77442,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76855
77442
|
icon: "sun",
|
|
76856
77443
|
args: { color: {
|
|
76857
77444
|
mode: "mired",
|
|
76858
|
-
|
|
77445
|
+
colorTemperature: 370
|
|
76859
77446
|
} }
|
|
76860
77447
|
},
|
|
76861
77448
|
{
|
|
@@ -76866,7 +77453,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76866
77453
|
icon: "snowflake",
|
|
76867
77454
|
args: { color: {
|
|
76868
77455
|
mode: "mired",
|
|
76869
|
-
|
|
77456
|
+
colorTemperature: 200
|
|
76870
77457
|
} }
|
|
76871
77458
|
},
|
|
76872
77459
|
{
|
|
@@ -77480,7 +78067,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
77480
78067
|
label: t("Fan off", "Ventilatore spento"),
|
|
77481
78068
|
phrase: t("Stop {device}", "Ferma {device}"),
|
|
77482
78069
|
icon: "power-off",
|
|
77483
|
-
args: {
|
|
78070
|
+
args: { speed: 0 }
|
|
77484
78071
|
},
|
|
77485
78072
|
{
|
|
77486
78073
|
id: "fan.full",
|
|
@@ -77488,16 +78075,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
77488
78075
|
label: t("Fan full", "Ventilatore al massimo"),
|
|
77489
78076
|
phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
|
|
77490
78077
|
icon: "fan",
|
|
77491
|
-
args: {
|
|
78078
|
+
args: { speed: 100 }
|
|
77492
78079
|
},
|
|
77493
78080
|
{
|
|
77494
78081
|
id: "fan.speed",
|
|
77495
78082
|
method: "setPercentage",
|
|
77496
78083
|
label: t("Set speed", "Imposta la velocità"),
|
|
77497
|
-
phrase: t("Set the speed of {device} to {
|
|
78084
|
+
phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
|
|
77498
78085
|
icon: "fan",
|
|
77499
78086
|
openArgs: [{
|
|
77500
|
-
key: "
|
|
78087
|
+
key: "speed",
|
|
77501
78088
|
label: t("Speed", "Velocità"),
|
|
77502
78089
|
offer: {
|
|
77503
78090
|
kind: "number",
|
|
@@ -77559,7 +78146,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
77559
78146
|
],
|
|
77560
78147
|
state: [{
|
|
77561
78148
|
kind: "numeric",
|
|
77562
|
-
field: "
|
|
78149
|
+
field: "speed",
|
|
77563
78150
|
quantity: t("the speed", "la velocità"),
|
|
77564
78151
|
label: t("Speed", "Velocità"),
|
|
77565
78152
|
unit: "%",
|
|
@@ -78357,7 +78944,7 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
78357
78944
|
},
|
|
78358
78945
|
{
|
|
78359
78946
|
kind: "numeric",
|
|
78360
|
-
field: "
|
|
78947
|
+
field: "progress",
|
|
78361
78948
|
quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
|
|
78362
78949
|
label: t("Progress", "Avanzamento"),
|
|
78363
78950
|
unit: "%",
|
|
@@ -78715,10 +79302,10 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
78715
79302
|
id: "media.seek",
|
|
78716
79303
|
method: "seek",
|
|
78717
79304
|
label: t("Seek", "Vai al punto"),
|
|
78718
|
-
phrase: t("Move {device} to {
|
|
79305
|
+
phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
|
|
78719
79306
|
icon: "fast-forward",
|
|
78720
79307
|
openArgs: [{
|
|
78721
|
-
key: "
|
|
79308
|
+
key: "position",
|
|
78722
79309
|
label: t("Position", "Posizione"),
|
|
78723
79310
|
offer: {
|
|
78724
79311
|
kind: "number",
|
|
@@ -79767,7 +80354,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79767
80354
|
state: [
|
|
79768
80355
|
{
|
|
79769
80356
|
kind: "numeric",
|
|
79770
|
-
field: "
|
|
80357
|
+
field: "co2",
|
|
79771
80358
|
quantity: t("the CO₂", "la CO₂"),
|
|
79772
80359
|
label: t("CO₂", "CO₂"),
|
|
79773
80360
|
unit: "ppm",
|
|
@@ -79775,7 +80362,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79775
80362
|
},
|
|
79776
80363
|
{
|
|
79777
80364
|
kind: "numeric",
|
|
79778
|
-
field: "
|
|
80365
|
+
field: "voc",
|
|
79779
80366
|
quantity: t("the VOC level", "il livello di COV"),
|
|
79780
80367
|
label: t("VOC", "COV"),
|
|
79781
80368
|
unit: "ppb",
|
|
@@ -79811,7 +80398,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79811
80398
|
noun: t("Light level", "Luminosità ambiente"),
|
|
79812
80399
|
state: [{
|
|
79813
80400
|
kind: "numeric",
|
|
79814
|
-
field: "
|
|
80401
|
+
field: "illuminance",
|
|
79815
80402
|
quantity: t("the light level", "la luminosità"),
|
|
79816
80403
|
label: t("Illuminance", "Illuminamento"),
|
|
79817
80404
|
unit: "lx",
|
|
@@ -80014,7 +80601,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80014
80601
|
noun: t("Humidity", "Umidità"),
|
|
80015
80602
|
state: [{
|
|
80016
80603
|
kind: "numeric",
|
|
80017
|
-
field: "
|
|
80604
|
+
field: "humidity",
|
|
80018
80605
|
quantity: t("the humidity", "l’umidità"),
|
|
80019
80606
|
label: t("Humidity", "Umidità"),
|
|
80020
80607
|
unit: "%",
|
|
@@ -80062,7 +80649,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80062
80649
|
state: [
|
|
80063
80650
|
{
|
|
80064
80651
|
kind: "numeric",
|
|
80065
|
-
field: "
|
|
80652
|
+
field: "power",
|
|
80066
80653
|
quantity: t("the power draw", "il consumo"),
|
|
80067
80654
|
label: t("Power", "Potenza"),
|
|
80068
80655
|
unit: "W",
|
|
@@ -80070,7 +80657,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80070
80657
|
},
|
|
80071
80658
|
{
|
|
80072
80659
|
kind: "numeric",
|
|
80073
|
-
field: "
|
|
80660
|
+
field: "energy",
|
|
80074
80661
|
quantity: t("the energy used", "l’energia consumata"),
|
|
80075
80662
|
label: t("Energy", "Energia"),
|
|
80076
80663
|
unit: "kWh",
|
|
@@ -80078,7 +80665,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80078
80665
|
},
|
|
80079
80666
|
{
|
|
80080
80667
|
kind: "numeric",
|
|
80081
|
-
field: "
|
|
80668
|
+
field: "voltage",
|
|
80082
80669
|
quantity: t("the voltage", "la tensione"),
|
|
80083
80670
|
label: t("Voltage", "Tensione"),
|
|
80084
80671
|
unit: "V",
|
|
@@ -80086,7 +80673,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80086
80673
|
},
|
|
80087
80674
|
{
|
|
80088
80675
|
kind: "numeric",
|
|
80089
|
-
field: "
|
|
80676
|
+
field: "current",
|
|
80090
80677
|
quantity: t("the current", "la corrente"),
|
|
80091
80678
|
label: t("Current", "Corrente"),
|
|
80092
80679
|
unit: "A",
|
|
@@ -80103,13 +80690,6 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80103
80690
|
label: t("Where", "Posizione"),
|
|
80104
80691
|
phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
|
|
80105
80692
|
icon: "map-pin"
|
|
80106
|
-
}, {
|
|
80107
|
-
kind: "numeric",
|
|
80108
|
-
field: "batteryPercent",
|
|
80109
|
-
quantity: t("the phone battery", "la batteria del telefono"),
|
|
80110
|
-
label: t("Battery", "Batteria"),
|
|
80111
|
-
unit: "%",
|
|
80112
|
-
icon: "battery"
|
|
80113
80693
|
}]
|
|
80114
80694
|
},
|
|
80115
80695
|
"pressure-sensor": {
|
|
@@ -80117,7 +80697,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80117
80697
|
noun: t("Pressure", "Pressione"),
|
|
80118
80698
|
state: [{
|
|
80119
80699
|
kind: "numeric",
|
|
80120
|
-
field: "
|
|
80700
|
+
field: "pressure",
|
|
80121
80701
|
quantity: t("the pressure", "la pressione"),
|
|
80122
80702
|
label: t("Pressure", "Pressione"),
|
|
80123
80703
|
unit: "hPa",
|
|
@@ -80153,7 +80733,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80153
80733
|
noun: t("Temperature", "Temperatura"),
|
|
80154
80734
|
state: [{
|
|
80155
80735
|
kind: "numeric",
|
|
80156
|
-
field: "
|
|
80736
|
+
field: "temperature",
|
|
80157
80737
|
quantity: t("the temperature", "la temperatura"),
|
|
80158
80738
|
label: t("Temperature", "Temperatura"),
|
|
80159
80739
|
unit: "°C",
|
|
@@ -80224,7 +80804,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80224
80804
|
state: [
|
|
80225
80805
|
{
|
|
80226
80806
|
kind: "numeric",
|
|
80227
|
-
field: "
|
|
80807
|
+
field: "level",
|
|
80228
80808
|
quantity: t("the battery level", "il livello della batteria"),
|
|
80229
80809
|
label: t("Battery", "Batteria"),
|
|
80230
80810
|
unit: "%",
|
|
@@ -80266,7 +80846,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80266
80846
|
icon: "battery-charging"
|
|
80267
80847
|
}
|
|
80268
80848
|
],
|
|
80269
|
-
events: { onStatusChanged: { notOperatorFacing: "the
|
|
80849
|
+
events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
|
|
80270
80850
|
extraEvents: [{
|
|
80271
80851
|
category: EventCategory.DeviceAwake,
|
|
80272
80852
|
label: t("Woke up", "Risvegliato"),
|
|
@@ -80284,7 +80864,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80284
80864
|
noun: t("Network link", "Collegamento di rete"),
|
|
80285
80865
|
state: [{
|
|
80286
80866
|
kind: "numeric",
|
|
80287
|
-
field: "
|
|
80867
|
+
field: "signal",
|
|
80288
80868
|
quantity: t("the signal strength", "l’intensità del segnale"),
|
|
80289
80869
|
label: t("Signal", "Segnale"),
|
|
80290
80870
|
unit: "%",
|
|
@@ -80377,6 +80957,8 @@ var ML = "model and training machinery — no device action";
|
|
|
80377
80957
|
var INTERNAL = "internal plumbing between addons — never operator-facing";
|
|
80378
80958
|
/** Every system-scoped cap, with why it is not a device's vocabulary. */
|
|
80379
80959
|
var SYSTEM_CAP_VOCABULARY = {
|
|
80960
|
+
"action-source": system(INTERNAL),
|
|
80961
|
+
actions: system("declared actions — run from the Actions page and from the cameras that link them"),
|
|
80380
80962
|
"addon-pages": system(UI_PLUMBING),
|
|
80381
80963
|
"addon-pages-source": system(UI_PLUMBING),
|
|
80382
80964
|
"addon-routes": system(UI_PLUMBING),
|
|
@@ -80598,6 +81180,31 @@ Object.freeze({
|
|
|
80598
81180
|
form: "single",
|
|
80599
81181
|
optional: false
|
|
80600
81182
|
}],
|
|
81183
|
+
"actions.get": [{
|
|
81184
|
+
name: "deviceId",
|
|
81185
|
+
form: "single",
|
|
81186
|
+
optional: true
|
|
81187
|
+
}],
|
|
81188
|
+
"actions.getLinks": [{
|
|
81189
|
+
name: "deviceId",
|
|
81190
|
+
form: "single",
|
|
81191
|
+
optional: false
|
|
81192
|
+
}],
|
|
81193
|
+
"actions.listForCamera": [{
|
|
81194
|
+
name: "deviceId",
|
|
81195
|
+
form: "single",
|
|
81196
|
+
optional: false
|
|
81197
|
+
}],
|
|
81198
|
+
"actions.run": [{
|
|
81199
|
+
name: "deviceId",
|
|
81200
|
+
form: "single",
|
|
81201
|
+
optional: true
|
|
81202
|
+
}],
|
|
81203
|
+
"actions.setLinks": [{
|
|
81204
|
+
name: "deviceId",
|
|
81205
|
+
form: "single",
|
|
81206
|
+
optional: false
|
|
81207
|
+
}],
|
|
80601
81208
|
"addonSettings.getDeviceSettings": [{
|
|
80602
81209
|
name: "deviceId",
|
|
80603
81210
|
form: "single",
|
|
@@ -84679,6 +85286,7 @@ DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
|
84679
85286
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
84680
85287
|
DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
|
|
84681
85288
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
85289
|
+
String.raw`(?<=^|["'(\s>,\[{])`;
|
|
84682
85290
|
var MB = 1024 * 1024;
|
|
84683
85291
|
1024 * MB, 3072 * MB;
|
|
84684
85292
|
process.platform, process.env["SystemRoot"];
|
|
@@ -133978,7 +134586,7 @@ function applyServiceLabel(service, name) {
|
|
|
133978
134586
|
var LOW_BATTERY_THRESHOLD_PCT = 20;
|
|
133979
134587
|
/**
|
|
133980
134588
|
* Mapping:
|
|
133981
|
-
* - `BatteryStatus.
|
|
134589
|
+
* - `BatteryStatus.level` (0..100) → `Characteristic.BatteryLevel`
|
|
133982
134590
|
* - `BatteryStatus.charging`:
|
|
133983
134591
|
* `'none'` → `ChargingState.NOT_CHARGING`
|
|
133984
134592
|
* `'dc' | 'solar'` → `ChargingState.CHARGING`
|
|
@@ -133986,12 +134594,12 @@ var LOW_BATTERY_THRESHOLD_PCT = 20;
|
|
|
133986
134594
|
* either value would be a claim
|
|
133987
134595
|
* - `percentage <= LOW_BATTERY_THRESHOLD_PCT` → `StatusLowBattery.LOW`
|
|
133988
134596
|
*/
|
|
133989
|
-
var batteryCharacteristicUpdates = reader(BatteryStatusSchema.pick({
|
|
133990
|
-
if (status.
|
|
134597
|
+
var batteryCharacteristicUpdates = reader(BatteryStatusSchema.pick({ level: true }).extend({ charging: BatteryStatusSchema.shape.charging.optional() }), (status) => {
|
|
134598
|
+
if (status.level === null) return status.charging === void 0 || status.charging === "unknown" ? [] : [{
|
|
133991
134599
|
characteristic: import_dist.Characteristic.ChargingState,
|
|
133992
134600
|
value: status.charging === "none" ? import_dist.Characteristic.ChargingState.NOT_CHARGING : import_dist.Characteristic.ChargingState.CHARGING
|
|
133993
134601
|
}];
|
|
133994
|
-
const pct = Math.max(0, Math.min(100, Math.round(status.
|
|
134602
|
+
const pct = Math.max(0, Math.min(100, Math.round(status.level)));
|
|
133995
134603
|
return [
|
|
133996
134604
|
{
|
|
133997
134605
|
characteristic: import_dist.Characteristic.BatteryLevel,
|
|
@@ -134093,7 +134701,7 @@ async function buildChildSwitch(bctx, subtype, deviceType) {
|
|
|
134093
134701
|
}
|
|
134094
134702
|
if (useLightbulb) try {
|
|
134095
134703
|
const status = await proxy.brightness?.getStatus({});
|
|
134096
|
-
if (status && typeof status.
|
|
134704
|
+
if (status && typeof status.level === "number") service.updateCharacteristic(import_dist.Characteristic.Brightness, status.level);
|
|
134097
134705
|
} catch (err) {
|
|
134098
134706
|
log.debug("export-hap: child brightness.getStatus failed (non-fatal)", { meta: { error: errMsg$13(err) } });
|
|
134099
134707
|
}
|
|
@@ -134112,7 +134720,7 @@ async function buildChildSwitch(bctx, subtype, deviceType) {
|
|
|
134112
134720
|
const percentage = typeof value === "number" ? value : Number(value);
|
|
134113
134721
|
if (!Number.isFinite(percentage)) return;
|
|
134114
134722
|
try {
|
|
134115
|
-
await proxy.brightness?.setBrightness({ percentage });
|
|
134723
|
+
await proxy.brightness?.setBrightness({ level: percentage });
|
|
134116
134724
|
} catch (err) {
|
|
134117
134725
|
log.warn("export-hap: child brightness.setBrightness failed", { meta: {
|
|
134118
134726
|
percentage,
|
|
@@ -134129,7 +134737,7 @@ async function buildChildSwitch(bctx, subtype, deviceType) {
|
|
|
134129
134737
|
}
|
|
134130
134738
|
if (useLightbulb && proxy.state.brightness) {
|
|
134131
134739
|
const unsubBrightness = proxy.state.brightness.subscribe((value) => {
|
|
134132
|
-
if (value && typeof value.
|
|
134740
|
+
if (value && typeof value.level === "number") service.updateCharacteristic(import_dist.Characteristic.Brightness, value.level);
|
|
134133
134741
|
});
|
|
134134
134742
|
unsubscribes.push(unsubBrightness);
|
|
134135
134743
|
}
|
|
@@ -134675,9 +135283,9 @@ var SENSOR_SPECS = {
|
|
|
134675
135283
|
addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.TemperatureSensor, name, subtype),
|
|
134676
135284
|
getStatus: (proxy) => proxy.temperatureSensor?.getStatus({}),
|
|
134677
135285
|
subscribe: (proxy, onValue) => proxy.state.temperatureSensor?.subscribe(onValue) ?? null,
|
|
134678
|
-
read: reader(TemperatureSensorStatusSchema.pick({
|
|
135286
|
+
read: reader(TemperatureSensorStatusSchema.pick({ temperature: true }), (status) => status.temperature === null ? [] : [{
|
|
134679
135287
|
characteristic: import_dist.Characteristic.CurrentTemperature,
|
|
134680
|
-
value: status.
|
|
135288
|
+
value: status.temperature
|
|
134681
135289
|
}])
|
|
134682
135290
|
},
|
|
134683
135291
|
"humidity-sensor": {
|
|
@@ -134685,9 +135293,9 @@ var SENSOR_SPECS = {
|
|
|
134685
135293
|
addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.HumiditySensor, name, subtype),
|
|
134686
135294
|
getStatus: (proxy) => proxy.humiditySensor?.getStatus({}),
|
|
134687
135295
|
subscribe: (proxy, onValue) => proxy.state.humiditySensor?.subscribe(onValue) ?? null,
|
|
134688
|
-
read: reader(HumiditySensorStatusSchema.pick({
|
|
135296
|
+
read: reader(HumiditySensorStatusSchema.pick({ humidity: true }), (status) => status.humidity === null ? [] : [{
|
|
134689
135297
|
characteristic: import_dist.Characteristic.CurrentRelativeHumidity,
|
|
134690
|
-
value: status.
|
|
135298
|
+
value: status.humidity
|
|
134691
135299
|
}])
|
|
134692
135300
|
},
|
|
134693
135301
|
"ambient-light-sensor": {
|
|
@@ -134695,9 +135303,9 @@ var SENSOR_SPECS = {
|
|
|
134695
135303
|
addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.LightSensor, name, subtype),
|
|
134696
135304
|
getStatus: (proxy) => proxy.ambientLightSensor?.getStatus({}),
|
|
134697
135305
|
subscribe: (proxy, onValue) => proxy.state.ambientLightSensor?.subscribe(onValue) ?? null,
|
|
134698
|
-
read: reader(AmbientLightSensorStatusSchema.pick({
|
|
135306
|
+
read: reader(AmbientLightSensorStatusSchema.pick({ illuminance: true }), (status) => status.illuminance === null ? [] : [{
|
|
134699
135307
|
characteristic: import_dist.Characteristic.CurrentAmbientLightLevel,
|
|
134700
|
-
value: Math.max(MIN_LUX, status.
|
|
135308
|
+
value: Math.max(MIN_LUX, status.illuminance)
|
|
134701
135309
|
}])
|
|
134702
135310
|
}
|
|
134703
135311
|
};
|