@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
package/dist/hap-export.addon.js
CHANGED
|
@@ -49,7 +49,7 @@ let node_fs_promises = require("node:fs/promises");
|
|
|
49
49
|
node_fs_promises = __toESM(node_fs_promises, 1);
|
|
50
50
|
let node_events = require("node:events");
|
|
51
51
|
let node_dgram = require("node:dgram");
|
|
52
|
-
//#region ../types/dist/event-category-
|
|
52
|
+
//#region ../types/dist/event-category-DmZDPDf_.mjs
|
|
53
53
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
54
54
|
EventCategory["SystemBoot"] = "system.boot";
|
|
55
55
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -676,7 +676,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
676
676
|
* (a track was promoted to a stationary-registry entry) or departs (the
|
|
677
677
|
* object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
|
|
678
678
|
* the dedicated "Stationary" section — never the live event feed. Payload:
|
|
679
|
-
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp }`.
|
|
679
|
+
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
|
|
680
680
|
*/
|
|
681
681
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
682
682
|
/**
|
|
@@ -814,6 +814,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
814
814
|
*/
|
|
815
815
|
EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
|
|
816
816
|
/**
|
|
817
|
+
* An action run started or ended. Emitted by the `actions` surface.
|
|
818
|
+
* Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
|
|
819
|
+
*/
|
|
820
|
+
EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
|
|
821
|
+
/**
|
|
817
822
|
* Progress update from a running model conversion job.
|
|
818
823
|
* Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
|
|
819
824
|
* Emitted by `addon-model-studio` on the converting node.
|
|
@@ -5492,7 +5497,7 @@ var ZodIssueCode = {
|
|
|
5492
5497
|
var ZodFirstPartyTypeKind;
|
|
5493
5498
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5494
5499
|
//#endregion
|
|
5495
|
-
//#region ../types/dist/sleep
|
|
5500
|
+
//#region ../types/dist/sleep-Crlmu_tO.mjs
|
|
5496
5501
|
/**
|
|
5497
5502
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5498
5503
|
* window to float samples (D455).
|
|
@@ -8600,6 +8605,8 @@ Object.freeze({ "doorbell": "lastPressedAt" });
|
|
|
8600
8605
|
/** Every capability name, so addon code can check a name without the schema graph. */
|
|
8601
8606
|
var CAP_NAMES = Object.freeze([
|
|
8602
8607
|
"accessories",
|
|
8608
|
+
"action-source",
|
|
8609
|
+
"actions",
|
|
8603
8610
|
"addon-pages",
|
|
8604
8611
|
"addon-pages-source",
|
|
8605
8612
|
"addon-routes",
|
|
@@ -8788,11 +8795,11 @@ var CAP_NAMES = Object.freeze([
|
|
|
8788
8795
|
Object.freeze({
|
|
8789
8796
|
"air-quality-sensor": [
|
|
8790
8797
|
{
|
|
8791
|
-
"path": "
|
|
8798
|
+
"path": "co2",
|
|
8792
8799
|
"valueType": "number"
|
|
8793
8800
|
},
|
|
8794
8801
|
{
|
|
8795
|
-
"path": "
|
|
8802
|
+
"path": "voc",
|
|
8796
8803
|
"valueType": "number"
|
|
8797
8804
|
},
|
|
8798
8805
|
{
|
|
@@ -8842,7 +8849,7 @@ Object.freeze({
|
|
|
8842
8849
|
}
|
|
8843
8850
|
],
|
|
8844
8851
|
"ambient-light-sensor": [{
|
|
8845
|
-
"path": "
|
|
8852
|
+
"path": "illuminance",
|
|
8846
8853
|
"valueType": "number"
|
|
8847
8854
|
}],
|
|
8848
8855
|
"audio-metrics": [
|
|
@@ -8903,7 +8910,7 @@ Object.freeze({
|
|
|
8903
8910
|
],
|
|
8904
8911
|
"battery": [
|
|
8905
8912
|
{
|
|
8906
|
-
"path": "
|
|
8913
|
+
"path": "level",
|
|
8907
8914
|
"valueType": "number"
|
|
8908
8915
|
},
|
|
8909
8916
|
{
|
|
@@ -8925,7 +8932,7 @@ Object.freeze({
|
|
|
8925
8932
|
"valueType": "number"
|
|
8926
8933
|
},
|
|
8927
8934
|
{
|
|
8928
|
-
"path": "
|
|
8935
|
+
"path": "voltage",
|
|
8929
8936
|
"valueType": "number"
|
|
8930
8937
|
},
|
|
8931
8938
|
{
|
|
@@ -8946,7 +8953,7 @@ Object.freeze({
|
|
|
8946
8953
|
"valueType": "boolean"
|
|
8947
8954
|
}],
|
|
8948
8955
|
"brightness": [{
|
|
8949
|
-
"path": "
|
|
8956
|
+
"path": "level",
|
|
8950
8957
|
"valueType": "number"
|
|
8951
8958
|
}],
|
|
8952
8959
|
"broker": [{
|
|
@@ -9147,7 +9154,7 @@ Object.freeze({
|
|
|
9147
9154
|
"valueType": "number"
|
|
9148
9155
|
},
|
|
9149
9156
|
{
|
|
9150
|
-
"path": "
|
|
9157
|
+
"path": "colorTemperature",
|
|
9151
9158
|
"valueType": "number"
|
|
9152
9159
|
}
|
|
9153
9160
|
],
|
|
@@ -9326,15 +9333,15 @@ Object.freeze({
|
|
|
9326
9333
|
"valueType": "string"
|
|
9327
9334
|
},
|
|
9328
9335
|
{
|
|
9329
|
-
"path": "
|
|
9336
|
+
"path": "remaining",
|
|
9330
9337
|
"valueType": "number"
|
|
9331
9338
|
},
|
|
9332
9339
|
{
|
|
9333
|
-
"path": "
|
|
9340
|
+
"path": "delayedStart",
|
|
9334
9341
|
"valueType": "number"
|
|
9335
9342
|
},
|
|
9336
9343
|
{
|
|
9337
|
-
"path": "
|
|
9344
|
+
"path": "progress",
|
|
9338
9345
|
"valueType": "number"
|
|
9339
9346
|
},
|
|
9340
9347
|
{
|
|
@@ -9448,7 +9455,7 @@ Object.freeze({
|
|
|
9448
9455
|
],
|
|
9449
9456
|
"fan-control": [
|
|
9450
9457
|
{
|
|
9451
|
-
"path": "
|
|
9458
|
+
"path": "speed",
|
|
9452
9459
|
"valueType": "number"
|
|
9453
9460
|
},
|
|
9454
9461
|
{
|
|
@@ -9548,7 +9555,7 @@ Object.freeze({
|
|
|
9548
9555
|
}
|
|
9549
9556
|
],
|
|
9550
9557
|
"humidity-sensor": [{
|
|
9551
|
-
"path": "
|
|
9558
|
+
"path": "humidity",
|
|
9552
9559
|
"valueType": "number"
|
|
9553
9560
|
}],
|
|
9554
9561
|
"image": [{
|
|
@@ -9658,7 +9665,7 @@ Object.freeze({
|
|
|
9658
9665
|
"valueType": "number"
|
|
9659
9666
|
},
|
|
9660
9667
|
{
|
|
9661
|
-
"path": "
|
|
9668
|
+
"path": "progress",
|
|
9662
9669
|
"valueType": "number"
|
|
9663
9670
|
},
|
|
9664
9671
|
{
|
|
@@ -9737,11 +9744,11 @@ Object.freeze({
|
|
|
9737
9744
|
"valueType": "string"
|
|
9738
9745
|
},
|
|
9739
9746
|
{
|
|
9740
|
-
"path": "
|
|
9747
|
+
"path": "position",
|
|
9741
9748
|
"valueType": "number"
|
|
9742
9749
|
},
|
|
9743
9750
|
{
|
|
9744
|
-
"path": "
|
|
9751
|
+
"path": "duration",
|
|
9745
9752
|
"valueType": "number"
|
|
9746
9753
|
},
|
|
9747
9754
|
{
|
|
@@ -9843,11 +9850,11 @@ Object.freeze({
|
|
|
9843
9850
|
]
|
|
9844
9851
|
},
|
|
9845
9852
|
{
|
|
9846
|
-
"path": "
|
|
9853
|
+
"path": "signal",
|
|
9847
9854
|
"valueType": "number"
|
|
9848
9855
|
},
|
|
9849
9856
|
{
|
|
9850
|
-
"path": "
|
|
9857
|
+
"path": "rssi",
|
|
9851
9858
|
"valueType": "number"
|
|
9852
9859
|
},
|
|
9853
9860
|
{
|
|
@@ -9902,6 +9909,18 @@ Object.freeze({
|
|
|
9902
9909
|
"path": "foodLevel",
|
|
9903
9910
|
"valueType": "number"
|
|
9904
9911
|
},
|
|
9912
|
+
{
|
|
9913
|
+
"path": "bowlFood",
|
|
9914
|
+
"valueType": "number"
|
|
9915
|
+
},
|
|
9916
|
+
{
|
|
9917
|
+
"path": "eating",
|
|
9918
|
+
"valueType": "boolean"
|
|
9919
|
+
},
|
|
9920
|
+
{
|
|
9921
|
+
"path": "supportsMarkRefilled",
|
|
9922
|
+
"valueType": "boolean"
|
|
9923
|
+
},
|
|
9905
9924
|
{
|
|
9906
9925
|
"path": "food1",
|
|
9907
9926
|
"valueType": "number"
|
|
@@ -9966,23 +9985,23 @@ Object.freeze({
|
|
|
9966
9985
|
],
|
|
9967
9986
|
"power-meter": [
|
|
9968
9987
|
{
|
|
9969
|
-
"path": "
|
|
9988
|
+
"path": "power",
|
|
9970
9989
|
"valueType": "number"
|
|
9971
9990
|
},
|
|
9972
9991
|
{
|
|
9973
|
-
"path": "
|
|
9992
|
+
"path": "energy",
|
|
9974
9993
|
"valueType": "number"
|
|
9975
9994
|
},
|
|
9976
9995
|
{
|
|
9977
|
-
"path": "
|
|
9996
|
+
"path": "voltage",
|
|
9978
9997
|
"valueType": "number"
|
|
9979
9998
|
},
|
|
9980
9999
|
{
|
|
9981
|
-
"path": "
|
|
10000
|
+
"path": "current",
|
|
9982
10001
|
"valueType": "number"
|
|
9983
10002
|
},
|
|
9984
10003
|
{
|
|
9985
|
-
"path": "
|
|
10004
|
+
"path": "apparentPower",
|
|
9986
10005
|
"valueType": "number"
|
|
9987
10006
|
},
|
|
9988
10007
|
{
|
|
@@ -10010,14 +10029,10 @@ Object.freeze({
|
|
|
10010
10029
|
{
|
|
10011
10030
|
"path": "gps.accuracyMeters",
|
|
10012
10031
|
"valueType": "number"
|
|
10013
|
-
},
|
|
10014
|
-
{
|
|
10015
|
-
"path": "batteryPercent",
|
|
10016
|
-
"valueType": "number"
|
|
10017
10032
|
}
|
|
10018
10033
|
],
|
|
10019
10034
|
"pressure-sensor": [{
|
|
10020
|
-
"path": "
|
|
10035
|
+
"path": "pressure",
|
|
10021
10036
|
"valueType": "number"
|
|
10022
10037
|
}],
|
|
10023
10038
|
"privacy-mask": [{
|
|
@@ -10331,7 +10346,7 @@ Object.freeze({
|
|
|
10331
10346
|
"valueType": "boolean"
|
|
10332
10347
|
}],
|
|
10333
10348
|
"temperature-sensor": [{
|
|
10334
|
-
"path": "
|
|
10349
|
+
"path": "temperature",
|
|
10335
10350
|
"valueType": "number"
|
|
10336
10351
|
}],
|
|
10337
10352
|
"update": [
|
|
@@ -10379,7 +10394,7 @@ Object.freeze({
|
|
|
10379
10394
|
"valueType": "string"
|
|
10380
10395
|
},
|
|
10381
10396
|
{
|
|
10382
|
-
"path": "
|
|
10397
|
+
"path": "progress",
|
|
10383
10398
|
"valueType": "number"
|
|
10384
10399
|
},
|
|
10385
10400
|
{
|
|
@@ -10864,7 +10879,7 @@ function errMsg$16(err) {
|
|
|
10864
10879
|
return String(err);
|
|
10865
10880
|
}
|
|
10866
10881
|
//#endregion
|
|
10867
|
-
//#region ../types/dist/composition-
|
|
10882
|
+
//#region ../types/dist/composition-CZImLpOI.mjs
|
|
10868
10883
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
10869
10884
|
opus: "libopus",
|
|
10870
10885
|
aac: "aac",
|
|
@@ -16203,6 +16218,14 @@ var AutomationConditionLeafSchema = object({
|
|
|
16203
16218
|
array(union([string(), number()]))
|
|
16204
16219
|
])
|
|
16205
16220
|
});
|
|
16221
|
+
var AutomationConditionStationaryPresentSchema = object({
|
|
16222
|
+
kind: literal("stationary-present"),
|
|
16223
|
+
deviceId: number().int().nonnegative(),
|
|
16224
|
+
/** Class names; a macro class matches every raw class that maps to it. */
|
|
16225
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
16226
|
+
/** The parked object must be in at least one of these zones. */
|
|
16227
|
+
zones: array(string().min(1)).min(1).optional()
|
|
16228
|
+
});
|
|
16206
16229
|
/**
|
|
16207
16230
|
* The expression leaf, declared as a plain object rather than an intersection
|
|
16208
16231
|
* with {@link ExpressionSourceSchema}: a discriminated union has to be able to
|
|
@@ -16236,7 +16259,8 @@ var AutomationConditionSchema = lazy(() => discriminatedUnion("kind", [
|
|
|
16236
16259
|
child: AutomationConditionSchema
|
|
16237
16260
|
}),
|
|
16238
16261
|
AutomationConditionLeafSchema,
|
|
16239
|
-
AutomationConditionExpressionSchema
|
|
16262
|
+
AutomationConditionExpressionSchema,
|
|
16263
|
+
AutomationConditionStationaryPresentSchema
|
|
16240
16264
|
]));
|
|
16241
16265
|
/**
|
|
16242
16266
|
* What starts a run.
|
|
@@ -16277,7 +16301,34 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
16277
16301
|
kind: literal("schedule"),
|
|
16278
16302
|
cron: string().min(1).max(120)
|
|
16279
16303
|
}),
|
|
16280
|
-
object({ kind: literal("manual") })
|
|
16304
|
+
object({ kind: literal("manual") }),
|
|
16305
|
+
object({
|
|
16306
|
+
kind: literal("detection"),
|
|
16307
|
+
/** Class names. A macro class (`animal`, `vehicle`, `person`, `package`)
|
|
16308
|
+
* matches every raw class that maps to it; any other name matches
|
|
16309
|
+
* exactly. */
|
|
16310
|
+
classes: array(string().min(1)).min(1),
|
|
16311
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
16312
|
+
/** The track must have visited at least one of these zones. */
|
|
16313
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
16314
|
+
/** Best-so-far confidence the track must reach. */
|
|
16315
|
+
minScore: number().min(0).max(1).optional()
|
|
16316
|
+
}),
|
|
16317
|
+
object({
|
|
16318
|
+
kind: literal("stationary"),
|
|
16319
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
16320
|
+
/** Class names; a macro class matches like the detection trigger. */
|
|
16321
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
16322
|
+
/** The parked object must be in at least one of these zones. */
|
|
16323
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
16324
|
+
/** `appeared`: it became parked. `departed`: the registry retired it.
|
|
16325
|
+
* The vocabulary of `PipelineAnalyticsStationaryChanged`. */
|
|
16326
|
+
phase: _enum(["appeared", "departed"])
|
|
16327
|
+
}),
|
|
16328
|
+
object({
|
|
16329
|
+
kind: literal("interval"),
|
|
16330
|
+
minutes: number().int().min(1).max(1440)
|
|
16331
|
+
})
|
|
16281
16332
|
]);
|
|
16282
16333
|
/**
|
|
16283
16334
|
* One action step.
|
|
@@ -16297,28 +16348,47 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
16297
16348
|
* is called. The runner still receives a number and is untouched; the
|
|
16298
16349
|
* resolution is the recipe's job, not the runner's.
|
|
16299
16350
|
*/
|
|
16351
|
+
var AutomationWaitStepSchema = object({
|
|
16352
|
+
kind: literal("wait"),
|
|
16353
|
+
seconds: number().min(0).max(300)
|
|
16354
|
+
});
|
|
16355
|
+
var AutomationCapStepSchema = object({
|
|
16356
|
+
kind: literal("cap"),
|
|
16357
|
+
/**
|
|
16358
|
+
* One device, several same-family devices (locks / climate family / …),
|
|
16359
|
+
* or `{ $var }` for the device that triggered the run. An array is
|
|
16360
|
+
* fan-out at codegen — each id gets the same cap.method call.
|
|
16361
|
+
*/
|
|
16362
|
+
deviceId: union([
|
|
16363
|
+
number().int(),
|
|
16364
|
+
array(number().int()).min(1),
|
|
16365
|
+
object({ $var: string().min(1) })
|
|
16366
|
+
]),
|
|
16367
|
+
cap: string().min(1),
|
|
16368
|
+
method: string().min(1),
|
|
16369
|
+
/** Values may carry `{{vars.x}}` slots, or be exactly `{ $var: 'name' }`, which
|
|
16370
|
+
* SUBSTITUTE and do not evaluate (§3.2.3). Anything beyond substitution is
|
|
16371
|
+
* the expression leaf. */
|
|
16372
|
+
args: record(string(), unknown()).optional()
|
|
16373
|
+
});
|
|
16374
|
+
/**
|
|
16375
|
+
* The steps an internal Action may contain: cap and wait, and nothing that can
|
|
16376
|
+
* call back into an Action — so an Action can never reach itself (no cycles).
|
|
16377
|
+
*/
|
|
16378
|
+
var ActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
|
|
16300
16379
|
var AutomationActionSchema = discriminatedUnion("kind", [
|
|
16380
|
+
AutomationWaitStepSchema,
|
|
16381
|
+
AutomationCapStepSchema,
|
|
16301
16382
|
object({
|
|
16302
|
-
kind: literal("
|
|
16303
|
-
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
|
|
16309
|
-
|
|
16310
|
-
|
|
16311
|
-
*/
|
|
16312
|
-
deviceId: union([
|
|
16313
|
-
number().int(),
|
|
16314
|
-
array(number().int()).min(1),
|
|
16315
|
-
object({ $var: string().min(1) })
|
|
16316
|
-
]),
|
|
16317
|
-
cap: string().min(1),
|
|
16318
|
-
method: string().min(1),
|
|
16319
|
-
/** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
|
|
16320
|
-
* evaluate (§3.2.3). Anything beyond substitution is the expression leaf. */
|
|
16321
|
-
args: record(string(), unknown()).optional()
|
|
16383
|
+
kind: literal("action"),
|
|
16384
|
+
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
16385
|
+
actionId: string().min(1),
|
|
16386
|
+
/** Values for the action's declared variables; the others take their default. */
|
|
16387
|
+
variables: record(string(), union([
|
|
16388
|
+
string(),
|
|
16389
|
+
number(),
|
|
16390
|
+
boolean()
|
|
16391
|
+
])).optional()
|
|
16322
16392
|
}),
|
|
16323
16393
|
object({
|
|
16324
16394
|
kind: literal("code"),
|
|
@@ -16327,10 +16397,357 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
16327
16397
|
code: string().min(1).max(2e4)
|
|
16328
16398
|
})
|
|
16329
16399
|
]);
|
|
16400
|
+
/**
|
|
16401
|
+
* How a trigger that arrives while the automation is busy (or cooling down) is
|
|
16402
|
+
* handled. One of the automation's execution modes, never a property of its
|
|
16403
|
+
* actions. Absent means `single`.
|
|
16404
|
+
*
|
|
16405
|
+
* - `single` — drop the trigger while a run is in progress (traced + logged).
|
|
16406
|
+
* - `restart` — abort the run in progress (at its next step boundary), start fresh.
|
|
16407
|
+
* - `queued` — queue up to `max` triggers, drop the rest (traced).
|
|
16408
|
+
* - `parallel` — up to `max` runs at once, drop the rest (traced).
|
|
16409
|
+
* - `cooldown` — `single`, and no new run until `minutes` after the last run
|
|
16410
|
+
* STARTED; persisted across a restart. A manual trigger bypasses only this
|
|
16411
|
+
* wait, never the single/queued limits.
|
|
16412
|
+
*/
|
|
16413
|
+
var AutomationRunModeSchema = discriminatedUnion("mode", [
|
|
16414
|
+
object({ mode: literal("single") }),
|
|
16415
|
+
object({ mode: literal("restart") }),
|
|
16416
|
+
object({
|
|
16417
|
+
mode: literal("queued"),
|
|
16418
|
+
max: number().int().min(1).max(10)
|
|
16419
|
+
}),
|
|
16420
|
+
object({
|
|
16421
|
+
mode: literal("parallel"),
|
|
16422
|
+
max: number().int().min(1).max(10)
|
|
16423
|
+
}),
|
|
16424
|
+
object({
|
|
16425
|
+
mode: literal("cooldown"),
|
|
16426
|
+
minutes: number().int().min(1).max(1440)
|
|
16427
|
+
})
|
|
16428
|
+
]);
|
|
16330
16429
|
var AutomationRecipeSchema = object({
|
|
16331
16430
|
triggers: array(AutomationTriggerSchema),
|
|
16332
16431
|
conditions: AutomationConditionSchema.optional(),
|
|
16333
|
-
actions: array(AutomationActionSchema)
|
|
16432
|
+
actions: array(AutomationActionSchema),
|
|
16433
|
+
runMode: AutomationRunModeSchema.optional(),
|
|
16434
|
+
/** How many run traces the automation keeps (default {@link DEFAULT_TRACE_KEEP}). */
|
|
16435
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
16436
|
+
});
|
|
16437
|
+
new Set([
|
|
16438
|
+
{
|
|
16439
|
+
id: "person",
|
|
16440
|
+
name: "Person"
|
|
16441
|
+
},
|
|
16442
|
+
{
|
|
16443
|
+
id: "vehicle",
|
|
16444
|
+
name: "Vehicle"
|
|
16445
|
+
},
|
|
16446
|
+
{
|
|
16447
|
+
id: "animal",
|
|
16448
|
+
name: "Animal"
|
|
16449
|
+
},
|
|
16450
|
+
{
|
|
16451
|
+
id: "package",
|
|
16452
|
+
name: "Package"
|
|
16453
|
+
}
|
|
16454
|
+
].map((l) => l.id));
|
|
16455
|
+
var COCO_TO_MACRO = {
|
|
16456
|
+
mapping: {
|
|
16457
|
+
person: "person",
|
|
16458
|
+
bicycle: "vehicle",
|
|
16459
|
+
car: "vehicle",
|
|
16460
|
+
motorcycle: "vehicle",
|
|
16461
|
+
airplane: "vehicle",
|
|
16462
|
+
bus: "vehicle",
|
|
16463
|
+
train: "vehicle",
|
|
16464
|
+
truck: "vehicle",
|
|
16465
|
+
boat: "vehicle",
|
|
16466
|
+
bird: "animal",
|
|
16467
|
+
cat: "animal",
|
|
16468
|
+
dog: "animal",
|
|
16469
|
+
horse: "animal",
|
|
16470
|
+
sheep: "animal",
|
|
16471
|
+
cow: "animal",
|
|
16472
|
+
elephant: "animal",
|
|
16473
|
+
bear: "animal",
|
|
16474
|
+
zebra: "animal",
|
|
16475
|
+
giraffe: "animal",
|
|
16476
|
+
suitcase: "package",
|
|
16477
|
+
backpack: "package",
|
|
16478
|
+
handbag: "package"
|
|
16479
|
+
},
|
|
16480
|
+
preserveOriginal: false
|
|
16481
|
+
};
|
|
16482
|
+
new Set(Object.values(COCO_TO_MACRO.mapping));
|
|
16483
|
+
/**
|
|
16484
|
+
* Run traces — what an automation (or, later, an Action run) DID, node by node,
|
|
16485
|
+
* so the editor can paint every block green or red with its reason.
|
|
16486
|
+
*
|
|
16487
|
+
* A trace is data, not a log: it covers the WHOLE tree — the trigger stage,
|
|
16488
|
+
* every condition node (containers and leaves, including the ones a
|
|
16489
|
+
* short-circuit never reached), the run-mode verdict and every action step —
|
|
16490
|
+
* each addressed by a stable path (`conditions.0.1`, `actions.2`, or `steps.N`
|
|
16491
|
+
* for an Action run). Skipped
|
|
16492
|
+
* evaluations are traced too, and identical consecutive skips collapse into a
|
|
16493
|
+
* repeat count so a trigger that fails every 5 minutes cannot flush real runs.
|
|
16494
|
+
*
|
|
16495
|
+
* {@link AutomationStepTraceSchema} is deliberately free of automation
|
|
16496
|
+
* vocabulary so an Action run records the same step shape.
|
|
16497
|
+
*/
|
|
16498
|
+
/** A value a trace may show: JSON primitives and short lists, nothing deeper. */
|
|
16499
|
+
var TraceValueSchema = union([
|
|
16500
|
+
string(),
|
|
16501
|
+
number(),
|
|
16502
|
+
boolean(),
|
|
16503
|
+
_null(),
|
|
16504
|
+
array(union([string(), number()]))
|
|
16505
|
+
]);
|
|
16506
|
+
var AutomationRunOutcomeSchema = _enum([
|
|
16507
|
+
"ran",
|
|
16508
|
+
"skipped-trigger",
|
|
16509
|
+
"skipped-conditions",
|
|
16510
|
+
"skipped-cooldown",
|
|
16511
|
+
"skipped-overlap",
|
|
16512
|
+
"failed",
|
|
16513
|
+
"aborted"
|
|
16514
|
+
]);
|
|
16515
|
+
/** `not-evaluated` = a short-circuit never reached the node. */
|
|
16516
|
+
var TraceNodeOutcomeSchema = _enum([
|
|
16517
|
+
"pass",
|
|
16518
|
+
"fail",
|
|
16519
|
+
"not-evaluated"
|
|
16520
|
+
]);
|
|
16521
|
+
var AutomationTriggerTraceSchema = object({
|
|
16522
|
+
kind: string().min(1),
|
|
16523
|
+
outcome: _enum(["pass", "fail"]),
|
|
16524
|
+
/** Why an event was rejected ("class person not in [dog]") or what fired. */
|
|
16525
|
+
reason: string(),
|
|
16526
|
+
/** deviceId, className, trackId, score … — only what the trigger exposes. */
|
|
16527
|
+
vars: record(string(), TraceValueSchema)
|
|
16528
|
+
});
|
|
16529
|
+
var AutomationConditionTraceNodeSchema = object({
|
|
16530
|
+
/** `conditions` for the root, `conditions.<i>` for its i-th child, … */
|
|
16531
|
+
path: string().min(1),
|
|
16532
|
+
kind: _enum([
|
|
16533
|
+
"all",
|
|
16534
|
+
"any",
|
|
16535
|
+
"not",
|
|
16536
|
+
"condition",
|
|
16537
|
+
"expression",
|
|
16538
|
+
"stationary-present"
|
|
16539
|
+
]),
|
|
16540
|
+
outcome: TraceNodeOutcomeSchema,
|
|
16541
|
+
reason: string(),
|
|
16542
|
+
deviceId: number().int().optional(),
|
|
16543
|
+
cap: string().optional(),
|
|
16544
|
+
fieldPath: string().optional(),
|
|
16545
|
+
operator: string().optional(),
|
|
16546
|
+
expected: TraceValueSchema.optional(),
|
|
16547
|
+
/** What the mirror held; `null` when it held nothing (unknown). */
|
|
16548
|
+
observed: TraceValueSchema.optional()
|
|
16549
|
+
});
|
|
16550
|
+
var AutomationRunVerdictSchema = object({
|
|
16551
|
+
mode: AutomationRunModeSchema,
|
|
16552
|
+
decision: _enum([
|
|
16553
|
+
"run",
|
|
16554
|
+
"queued",
|
|
16555
|
+
"restart",
|
|
16556
|
+
"drop",
|
|
16557
|
+
"cooldown",
|
|
16558
|
+
"bypass"
|
|
16559
|
+
]),
|
|
16560
|
+
reason: string()
|
|
16561
|
+
});
|
|
16562
|
+
/** One executed (or not-run) step — shared by automations and Action runs. */
|
|
16563
|
+
var AutomationStepTraceSchema = object({
|
|
16564
|
+
/** `actions.<i>` */
|
|
16565
|
+
path: string().min(1),
|
|
16566
|
+
kind: string().min(1),
|
|
16567
|
+
cap: string().optional(),
|
|
16568
|
+
method: string().optional(),
|
|
16569
|
+
deviceId: number().int().optional(),
|
|
16570
|
+
startedAt: number().optional(),
|
|
16571
|
+
endedAt: number().optional(),
|
|
16572
|
+
outcome: _enum([
|
|
16573
|
+
"ok",
|
|
16574
|
+
"error",
|
|
16575
|
+
"not-run"
|
|
16576
|
+
]),
|
|
16577
|
+
message: string().optional()
|
|
16578
|
+
});
|
|
16579
|
+
var AutomationRunTraceSchema = object({
|
|
16580
|
+
runId: string().min(1),
|
|
16581
|
+
startedAt: number(),
|
|
16582
|
+
endedAt: number(),
|
|
16583
|
+
trigger: AutomationTriggerTraceSchema,
|
|
16584
|
+
conditions: array(AutomationConditionTraceNodeSchema),
|
|
16585
|
+
verdict: AutomationRunVerdictSchema.optional(),
|
|
16586
|
+
steps: array(AutomationStepTraceSchema),
|
|
16587
|
+
outcome: AutomationRunOutcomeSchema,
|
|
16588
|
+
/** How many identical consecutive skips this trace stands for (>= 1). */
|
|
16589
|
+
repeat: number().int().min(1),
|
|
16590
|
+
/** When the latest of those repeats happened. */
|
|
16591
|
+
lastAt: number()
|
|
16592
|
+
});
|
|
16593
|
+
/**
|
|
16594
|
+
* What the hub's `runs` ledger holds for one owner (`automation:<blockId>` or
|
|
16595
|
+
* `action:<actionId>`): the cooldown stamp and the trace ring.
|
|
16596
|
+
*/
|
|
16597
|
+
var AutomationStateDocSchema = object({
|
|
16598
|
+
version: literal(1),
|
|
16599
|
+
lastRunStartedAt: number().nullable(),
|
|
16600
|
+
traces: array(AutomationRunTraceSchema)
|
|
16601
|
+
});
|
|
16602
|
+
/**
|
|
16603
|
+
* Actions — named, runnable things an operator (or an automation) can start,
|
|
16604
|
+
* declared as LIST ENTRIES, never as devices.
|
|
16605
|
+
*
|
|
16606
|
+
* An entry is either **internal** (a short list of cap/wait steps kept in the
|
|
16607
|
+
* hub's `actions` record kind) or declared by an addon through the
|
|
16608
|
+
* `action-source` collection (a Home Assistant script, a scene …). The one
|
|
16609
|
+
* surface the UI and automations talk to is the `actions` cap; it keeps no
|
|
16610
|
+
* catalog of its own (D3) — every `list` asks the providers live.
|
|
16611
|
+
*
|
|
16612
|
+
* This file is the data half: the entry schema, the variables an entry may
|
|
16613
|
+
* declare, and the pure resolution of the values a run was given. It holds no
|
|
16614
|
+
* runtime.
|
|
16615
|
+
*/
|
|
16616
|
+
/** What a variable's value is. `select` takes one of `options`. */
|
|
16617
|
+
var ActionVariableTypeSchema = _enum([
|
|
16618
|
+
"string",
|
|
16619
|
+
"number",
|
|
16620
|
+
"boolean",
|
|
16621
|
+
"select"
|
|
16622
|
+
]);
|
|
16623
|
+
var ACTION_VARIABLE_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
16624
|
+
var ActionVariableValueSchema = union([
|
|
16625
|
+
string(),
|
|
16626
|
+
number(),
|
|
16627
|
+
boolean()
|
|
16628
|
+
]);
|
|
16629
|
+
/**
|
|
16630
|
+
* One declared variable. Steps reference it as `{ $var: 'name' }` (the whole
|
|
16631
|
+
* value) or `{{vars.name}}` (inside a string) in their args.
|
|
16632
|
+
*/
|
|
16633
|
+
var ActionVariableSchema = object({
|
|
16634
|
+
name: string().regex(ACTION_VARIABLE_NAME_RE),
|
|
16635
|
+
label: string().min(1).max(120).optional(),
|
|
16636
|
+
type: ActionVariableTypeSchema,
|
|
16637
|
+
required: boolean().optional(),
|
|
16638
|
+
default: ActionVariableValueSchema.optional(),
|
|
16639
|
+
/** The allowed values of a `select`. */
|
|
16640
|
+
options: array(string().min(1)).min(1).optional()
|
|
16641
|
+
}).superRefine((v, ctx) => {
|
|
16642
|
+
if (v.type === "select" && v.options === void 0) ctx.addIssue({
|
|
16643
|
+
code: "custom",
|
|
16644
|
+
message: "a select variable needs options",
|
|
16645
|
+
path: ["options"]
|
|
16646
|
+
});
|
|
16647
|
+
if (v.default !== void 0 && variableValueError(v, v.default) !== null) ctx.addIssue({
|
|
16648
|
+
code: "custom",
|
|
16649
|
+
message: variableValueError(v, v.default) ?? "invalid default",
|
|
16650
|
+
path: ["default"]
|
|
16651
|
+
});
|
|
16652
|
+
});
|
|
16653
|
+
/** Why `value` is not a legal value for the variable, or null when it is. */
|
|
16654
|
+
function variableValueError(variable, value) {
|
|
16655
|
+
switch (variable.type) {
|
|
16656
|
+
case "string": return typeof value === "string" ? null : `variable "${variable.name}" must be a string`;
|
|
16657
|
+
case "number": return typeof value === "number" && Number.isFinite(value) ? null : `variable "${variable.name}" must be a number`;
|
|
16658
|
+
case "boolean": return typeof value === "boolean" ? null : `variable "${variable.name}" must be true or false`;
|
|
16659
|
+
case "select": return typeof value === "string" && (variable.options ?? []).includes(value) ? null : `variable "${variable.name}" must be one of ${(variable.options ?? []).join(", ")}`;
|
|
16660
|
+
}
|
|
16661
|
+
}
|
|
16662
|
+
var ActionSourceKindSchema = _enum(["internal", "addon"]);
|
|
16663
|
+
function isInternalActionId(actionId) {
|
|
16664
|
+
return actionId.startsWith("internal:") && actionId.length > 9;
|
|
16665
|
+
}
|
|
16666
|
+
/** The addon behind a `<addonId>:<localId>` id, or null for anything else (internal included). */
|
|
16667
|
+
function addonIdOfActionId(actionId) {
|
|
16668
|
+
if (isInternalActionId(actionId)) return null;
|
|
16669
|
+
const at = actionId.indexOf(":");
|
|
16670
|
+
return at > 0 && at < actionId.length - 1 ? actionId.slice(0, at) : null;
|
|
16671
|
+
}
|
|
16672
|
+
var ActionStatusSchema = object({
|
|
16673
|
+
isRunning: boolean(),
|
|
16674
|
+
/** Ms epoch the latest run STARTED; null when it never ran. */
|
|
16675
|
+
lastRunAt: number().nullable(),
|
|
16676
|
+
/** The latest run's failure; null on success or when it never ran. */
|
|
16677
|
+
lastError: string().nullable()
|
|
16678
|
+
});
|
|
16679
|
+
var ActionEntrySchema = object({
|
|
16680
|
+
/** `internal:<uuid>` or `<addonId>:<localId>`. */
|
|
16681
|
+
id: string().min(3),
|
|
16682
|
+
name: string().min(1).max(120),
|
|
16683
|
+
/** The addon that declared it; `core-blocks` for an internal one. */
|
|
16684
|
+
addonId: string().min(1),
|
|
16685
|
+
source: ActionSourceKindSchema,
|
|
16686
|
+
/** An addon-declared entry is edited where it was declared. */
|
|
16687
|
+
readOnly: boolean(),
|
|
16688
|
+
/** Internal only: cap and wait steps. No action-in-action, so no cycles. */
|
|
16689
|
+
steps: array(ActionStepSchema).min(1).max(50).optional(),
|
|
16690
|
+
variables: array(ActionVariableSchema).max(20).optional(),
|
|
16691
|
+
status: ActionStatusSchema
|
|
16692
|
+
}).superRefine((entry, ctx) => {
|
|
16693
|
+
if (entry.source === "internal") {
|
|
16694
|
+
if (!isInternalActionId(entry.id)) ctx.addIssue({
|
|
16695
|
+
code: "custom",
|
|
16696
|
+
message: "an internal action id is internal:<uuid>",
|
|
16697
|
+
path: ["id"]
|
|
16698
|
+
});
|
|
16699
|
+
return;
|
|
16700
|
+
}
|
|
16701
|
+
if (entry.steps !== void 0) ctx.addIssue({
|
|
16702
|
+
code: "custom",
|
|
16703
|
+
message: "only an internal action carries steps",
|
|
16704
|
+
path: ["steps"]
|
|
16705
|
+
});
|
|
16706
|
+
if (!entry.readOnly) ctx.addIssue({
|
|
16707
|
+
code: "custom",
|
|
16708
|
+
message: "an addon action is read-only here",
|
|
16709
|
+
path: ["readOnly"]
|
|
16710
|
+
});
|
|
16711
|
+
if (addonIdOfActionId(entry.id) === null) ctx.addIssue({
|
|
16712
|
+
code: "custom",
|
|
16713
|
+
message: "an addon action id is <addonId>:<localId>",
|
|
16714
|
+
path: ["id"]
|
|
16715
|
+
});
|
|
16716
|
+
});
|
|
16717
|
+
/** What an operator writes for an internal action. */
|
|
16718
|
+
var ActionInputSchema = object({
|
|
16719
|
+
name: string().min(1).max(120),
|
|
16720
|
+
steps: array(ActionStepSchema).min(1).max(50),
|
|
16721
|
+
variables: array(ActionVariableSchema).max(20).optional()
|
|
16722
|
+
});
|
|
16723
|
+
/** Who started a run. Absent = the operator pressed it. */
|
|
16724
|
+
var ActionRunOriginSchema = object({
|
|
16725
|
+
/** The automation block whose step started it. */
|
|
16726
|
+
blockId: string().min(1).optional() });
|
|
16727
|
+
/** `started` = the caller did not ask to wait. */
|
|
16728
|
+
var ActionRunOutcomeSchema = union([AutomationRunOutcomeSchema, literal("started")]);
|
|
16729
|
+
var ActionRunResultSchema = object({
|
|
16730
|
+
runId: string().min(1),
|
|
16731
|
+
outcome: ActionRunOutcomeSchema,
|
|
16732
|
+
/** Why it did not run, or what failed. */
|
|
16733
|
+
message: string().optional()
|
|
16734
|
+
});
|
|
16735
|
+
_enum([
|
|
16736
|
+
"not-found",
|
|
16737
|
+
"read-only",
|
|
16738
|
+
"invalid-variables",
|
|
16739
|
+
"invalid-steps",
|
|
16740
|
+
"not-linked",
|
|
16741
|
+
"busy"
|
|
16742
|
+
]);
|
|
16743
|
+
object({
|
|
16744
|
+
actionId: string(),
|
|
16745
|
+
runId: string(),
|
|
16746
|
+
isRunning: boolean(),
|
|
16747
|
+
/** Set when the run ended. */
|
|
16748
|
+
outcome: AutomationRunOutcomeSchema.optional(),
|
|
16749
|
+
lastRunAt: number().nullable(),
|
|
16750
|
+
lastError: string().nullable()
|
|
16334
16751
|
});
|
|
16335
16752
|
/**
|
|
16336
16753
|
* `addon-pages` — system-scoped singleton aggregator cap. Public-facing
|
|
@@ -18911,7 +19328,7 @@ var CompositionEventPlanSchema = object({
|
|
|
18911
19328
|
stateField: string(),
|
|
18912
19329
|
fieldKey: string()
|
|
18913
19330
|
});
|
|
18914
|
-
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.
|
|
19331
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
|
|
18915
19332
|
var CompositionProblemSchema = object({
|
|
18916
19333
|
code: _enum([
|
|
18917
19334
|
"reserved-variant",
|
|
@@ -19230,7 +19647,7 @@ var GROUP_TEMPLATES = [
|
|
|
19230
19647
|
summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
|
|
19231
19648
|
role: DeviceRole.TemperatureSensor,
|
|
19232
19649
|
outputCap: "temperature-sensor",
|
|
19233
|
-
outputField: "
|
|
19650
|
+
outputField: "temperature",
|
|
19234
19651
|
quantity: "temperature",
|
|
19235
19652
|
defaultAggregate: "mean",
|
|
19236
19653
|
empty: "null",
|
|
@@ -19241,7 +19658,7 @@ var GROUP_TEMPLATES = [
|
|
|
19241
19658
|
summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
19242
19659
|
role: DeviceRole.HumiditySensor,
|
|
19243
19660
|
outputCap: "humidity-sensor",
|
|
19244
|
-
outputField: "
|
|
19661
|
+
outputField: "humidity",
|
|
19245
19662
|
quantity: "humidity",
|
|
19246
19663
|
defaultAggregate: "mean",
|
|
19247
19664
|
empty: "null",
|
|
@@ -19252,7 +19669,7 @@ var GROUP_TEMPLATES = [
|
|
|
19252
19669
|
summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
|
|
19253
19670
|
role: DeviceRole.PressureSensor,
|
|
19254
19671
|
outputCap: "pressure-sensor",
|
|
19255
|
-
outputField: "
|
|
19672
|
+
outputField: "pressure",
|
|
19256
19673
|
quantity: "pressure",
|
|
19257
19674
|
defaultAggregate: "mean",
|
|
19258
19675
|
empty: "null",
|
|
@@ -19263,7 +19680,7 @@ var GROUP_TEMPLATES = [
|
|
|
19263
19680
|
summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
|
|
19264
19681
|
role: DeviceRole.AmbientLightSensor,
|
|
19265
19682
|
outputCap: "ambient-light-sensor",
|
|
19266
|
-
outputField: "
|
|
19683
|
+
outputField: "illuminance",
|
|
19267
19684
|
quantity: "illuminance",
|
|
19268
19685
|
defaultAggregate: "mean",
|
|
19269
19686
|
empty: "null",
|
|
@@ -19274,7 +19691,7 @@ var GROUP_TEMPLATES = [
|
|
|
19274
19691
|
summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
|
|
19275
19692
|
role: DeviceRole.PowerSensor,
|
|
19276
19693
|
outputCap: "power-meter",
|
|
19277
|
-
outputField: "
|
|
19694
|
+
outputField: "power",
|
|
19278
19695
|
quantity: "power",
|
|
19279
19696
|
defaultAggregate: "sum",
|
|
19280
19697
|
empty: "omit",
|
|
@@ -19285,7 +19702,7 @@ var GROUP_TEMPLATES = [
|
|
|
19285
19702
|
summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
|
|
19286
19703
|
role: DeviceRole.EnergySensor,
|
|
19287
19704
|
outputCap: "power-meter",
|
|
19288
|
-
outputField: "
|
|
19705
|
+
outputField: "energy",
|
|
19289
19706
|
quantity: "energy",
|
|
19290
19707
|
defaultAggregate: "sum",
|
|
19291
19708
|
empty: "omit",
|
|
@@ -19296,7 +19713,7 @@ var GROUP_TEMPLATES = [
|
|
|
19296
19713
|
summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
19297
19714
|
role: DeviceRole.BatterySensor,
|
|
19298
19715
|
outputCap: "battery",
|
|
19299
|
-
outputField: "
|
|
19716
|
+
outputField: "level",
|
|
19300
19717
|
quantity: "percentage",
|
|
19301
19718
|
defaultAggregate: "mean",
|
|
19302
19719
|
empty: "null",
|
|
@@ -19874,7 +20291,18 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
19874
20291
|
kind: "mutation",
|
|
19875
20292
|
auth: "admin",
|
|
19876
20293
|
access: "view"
|
|
19877
|
-
})
|
|
20294
|
+
}), method(object({
|
|
20295
|
+
blockId: string().min(1),
|
|
20296
|
+
trace: AutomationRunTraceSchema.optional(),
|
|
20297
|
+
runStartedAt: number().optional(),
|
|
20298
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
20299
|
+
}), _void(), {
|
|
20300
|
+
kind: "mutation",
|
|
20301
|
+
auth: "admin"
|
|
20302
|
+
}), method(object({ blockId: string().min(1) }), AutomationStateDocSchema, { auth: "admin" }), method(object({ blockId: string().min(1) }), object({
|
|
20303
|
+
traces: array(AutomationRunTraceSchema),
|
|
20304
|
+
lastError: string().nullable()
|
|
20305
|
+
}), { auth: "admin" });
|
|
19878
20306
|
/**
|
|
19879
20307
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
19880
20308
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -45048,51 +45476,6 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
|
|
|
45048
45476
|
kind: "mutation",
|
|
45049
45477
|
auth: "admin"
|
|
45050
45478
|
});
|
|
45051
|
-
new Set([
|
|
45052
|
-
{
|
|
45053
|
-
id: "person",
|
|
45054
|
-
name: "Person"
|
|
45055
|
-
},
|
|
45056
|
-
{
|
|
45057
|
-
id: "vehicle",
|
|
45058
|
-
name: "Vehicle"
|
|
45059
|
-
},
|
|
45060
|
-
{
|
|
45061
|
-
id: "animal",
|
|
45062
|
-
name: "Animal"
|
|
45063
|
-
},
|
|
45064
|
-
{
|
|
45065
|
-
id: "package",
|
|
45066
|
-
name: "Package"
|
|
45067
|
-
}
|
|
45068
|
-
].map((l) => l.id));
|
|
45069
|
-
var COCO_TO_MACRO = {
|
|
45070
|
-
mapping: {
|
|
45071
|
-
person: "person",
|
|
45072
|
-
bicycle: "vehicle",
|
|
45073
|
-
car: "vehicle",
|
|
45074
|
-
motorcycle: "vehicle",
|
|
45075
|
-
airplane: "vehicle",
|
|
45076
|
-
bus: "vehicle",
|
|
45077
|
-
train: "vehicle",
|
|
45078
|
-
truck: "vehicle",
|
|
45079
|
-
boat: "vehicle",
|
|
45080
|
-
bird: "animal",
|
|
45081
|
-
cat: "animal",
|
|
45082
|
-
dog: "animal",
|
|
45083
|
-
horse: "animal",
|
|
45084
|
-
sheep: "animal",
|
|
45085
|
-
cow: "animal",
|
|
45086
|
-
elephant: "animal",
|
|
45087
|
-
bear: "animal",
|
|
45088
|
-
zebra: "animal",
|
|
45089
|
-
giraffe: "animal",
|
|
45090
|
-
suitcase: "package",
|
|
45091
|
-
backpack: "package",
|
|
45092
|
-
handbag: "package"
|
|
45093
|
-
},
|
|
45094
|
-
preserveOriginal: false
|
|
45095
|
-
};
|
|
45096
45479
|
var AUDIO_MACRO_LABELS = [
|
|
45097
45480
|
{
|
|
45098
45481
|
id: "speech",
|
|
@@ -57722,9 +58105,9 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
|
|
|
57722
58105
|
}), LogStreamEntrySchema, { kind: "subscription" });
|
|
57723
58106
|
object({
|
|
57724
58107
|
/** Carbon dioxide concentration in ppm. */
|
|
57725
|
-
|
|
58108
|
+
co2: number().min(0).optional().meta(readingMeta("concentration-volume")),
|
|
57726
58109
|
/** Total volatile organic compounds in ppb. */
|
|
57727
|
-
|
|
58110
|
+
voc: number().min(0).optional().meta(readingMeta("concentration-ppb")),
|
|
57728
58111
|
/** Particulate matter ≤ 2.5 μm in µg/m³. */
|
|
57729
58112
|
pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
|
|
57730
58113
|
/** Particulate matter ≤ 10 μm in µg/m³. */
|
|
@@ -57741,7 +58124,7 @@ DeviceType.Sensor;
|
|
|
57741
58124
|
*/
|
|
57742
58125
|
var AmbientLightSensorStatusSchema = object({
|
|
57743
58126
|
/** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
|
|
57744
|
-
|
|
58127
|
+
illuminance: number().min(0).nullable().meta(readingMeta("illuminance", {
|
|
57745
58128
|
precision: 0,
|
|
57746
58129
|
label: "Illuminance"
|
|
57747
58130
|
})),
|
|
@@ -57838,6 +58221,84 @@ DeviceType.Camera, method(object({ deviceId: number() }), AudioMetricsSnapshotSc
|
|
|
57838
58221
|
* would produce more than `maxPoints` samples. */
|
|
57839
58222
|
sampleEveryMs: number().int().positive().optional()
|
|
57840
58223
|
}), AudioMetricsHistorySchema);
|
|
58224
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
58225
|
+
actionId: string().min(1),
|
|
58226
|
+
variables: record(string(), ActionVariableValueSchema).optional()
|
|
58227
|
+
}), _void(), {
|
|
58228
|
+
kind: "mutation",
|
|
58229
|
+
auth: "admin"
|
|
58230
|
+
}), method(object({ actionId: string().min(1) }), _void(), {
|
|
58231
|
+
kind: "mutation",
|
|
58232
|
+
auth: "admin"
|
|
58233
|
+
});
|
|
58234
|
+
/**
|
|
58235
|
+
* actions — the ONE surface for runnable actions, for the UI and for
|
|
58236
|
+
* automations. Provided by the core-blocks builtin on the hub.
|
|
58237
|
+
*
|
|
58238
|
+
* An action is a LIST ENTRY, not a device (D883): either internal (cap and wait
|
|
58239
|
+
* steps, kept in the hub's `actions` record kind) or declared by an addon over
|
|
58240
|
+
* `action-source`. `list` asks every `action-source` provider LIVE and overlays
|
|
58241
|
+
* the run status from the hub's `runs` ledger; there is no catalog here to
|
|
58242
|
+
* drift (D3).
|
|
58243
|
+
*
|
|
58244
|
+
* **Permissions follow the camera, as linked devices do.** An action is linked
|
|
58245
|
+
* to cameras by the operator (`setLinks`, D356: nothing links itself). A
|
|
58246
|
+
* non-admin may `get` / `run` an action only through a camera they may see that
|
|
58247
|
+
* links it: they name the camera (`deviceId`, a top-level field so the scope
|
|
58248
|
+
* gate sees it) and the provider refuses an action that camera does not link.
|
|
58249
|
+
* An admin, and an in-process caller (an automation block), may run any action.
|
|
58250
|
+
* Every refusal is typed (`[not-linked] …`) and logged.
|
|
58251
|
+
*
|
|
58252
|
+
* A second `run` of an action that is already running is REFUSED — traced and
|
|
58253
|
+
* logged — never queued.
|
|
58254
|
+
*/
|
|
58255
|
+
var ActionIdInput = object({ actionId: string().min(1) });
|
|
58256
|
+
var ActionLinksSchema = object({
|
|
58257
|
+
deviceId: number().int().nonnegative(),
|
|
58258
|
+
actionIds: array(string().min(1)).max(100)
|
|
58259
|
+
});
|
|
58260
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
58261
|
+
actionId: string().min(1),
|
|
58262
|
+
deviceId: number().int().nonnegative().optional()
|
|
58263
|
+
}), object({ action: ActionEntrySchema.nullable() }), {
|
|
58264
|
+
role: "viewer",
|
|
58265
|
+
auth: "protected",
|
|
58266
|
+
kind: "query",
|
|
58267
|
+
caller: "required"
|
|
58268
|
+
}), method(object({
|
|
58269
|
+
actionId: string().min(1),
|
|
58270
|
+
variables: record(string(), ActionVariableValueSchema).optional(),
|
|
58271
|
+
wait: boolean().optional(),
|
|
58272
|
+
origin: ActionRunOriginSchema.optional(),
|
|
58273
|
+
deviceId: number().int().nonnegative().optional()
|
|
58274
|
+
}), ActionRunResultSchema, {
|
|
58275
|
+
role: "viewer",
|
|
58276
|
+
auth: "protected",
|
|
58277
|
+
kind: "mutation",
|
|
58278
|
+
caller: "required"
|
|
58279
|
+
}), method(ActionIdInput, _void(), {
|
|
58280
|
+
kind: "mutation",
|
|
58281
|
+
auth: "admin"
|
|
58282
|
+
}), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({ action: ActionEntrySchema }), {
|
|
58283
|
+
kind: "mutation",
|
|
58284
|
+
auth: "admin"
|
|
58285
|
+
}), method(object({
|
|
58286
|
+
actionId: string().min(1),
|
|
58287
|
+
action: ActionInputSchema.partial()
|
|
58288
|
+
}), object({ action: ActionEntrySchema }), {
|
|
58289
|
+
kind: "mutation",
|
|
58290
|
+
auth: "admin"
|
|
58291
|
+
}), method(ActionIdInput, _void(), {
|
|
58292
|
+
kind: "mutation",
|
|
58293
|
+
auth: "admin"
|
|
58294
|
+
}), method(object({ deviceId: number().int().nonnegative() }), array(ActionEntrySchema), {
|
|
58295
|
+
role: "viewer",
|
|
58296
|
+
auth: "protected",
|
|
58297
|
+
kind: "query"
|
|
58298
|
+
}), method(object({ deviceId: number().int().nonnegative() }), ActionLinksSchema, { auth: "admin" }), method(ActionLinksSchema, ActionLinksSchema, {
|
|
58299
|
+
kind: "mutation",
|
|
58300
|
+
auth: "admin"
|
|
58301
|
+
});
|
|
57841
58302
|
object({
|
|
57842
58303
|
/** Whether the automation is currently enabled. Disabled automations
|
|
57843
58304
|
* ignore their trigger block — manual `trigger` still works. */
|
|
@@ -57891,7 +58352,7 @@ var BatteryStatusSchema = object({
|
|
|
57891
58352
|
* Consumers must SKIP a null rather than coerce it — `battery-band` already
|
|
57892
58353
|
* declines to band a non-finite reading, which is the correct shape.
|
|
57893
58354
|
*/
|
|
57894
|
-
|
|
58355
|
+
level: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
|
|
57895
58356
|
/**
|
|
57896
58357
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
57897
58358
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
@@ -57901,7 +58362,7 @@ var BatteryStatusSchema = object({
|
|
|
57901
58362
|
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
57902
58363
|
* power fields yet, or the firmware reported neither. Before it existed,
|
|
57903
58364
|
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
57904
|
-
* was drawn "on battery alone" — the same D315 defect `
|
|
58365
|
+
* was drawn "on battery alone" — the same D315 defect `level` closed
|
|
57905
58366
|
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
57906
58367
|
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
57907
58368
|
*/
|
|
@@ -57925,7 +58386,7 @@ var BatteryStatusSchema = object({
|
|
|
57925
58386
|
* that only report charge. A second reading on this cap, not a second
|
|
57926
58387
|
* `numeric-sensor` on the same device.
|
|
57927
58388
|
*/
|
|
57928
|
-
|
|
58389
|
+
voltage: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
57929
58390
|
/**
|
|
57930
58391
|
* Ms epoch of the last time the device PROVED it was reachable — a
|
|
57931
58392
|
* completed firmware round-trip, an observed wake, or an inbound push
|
|
@@ -57959,7 +58420,7 @@ var BatteryStatusSchema = object({
|
|
|
57959
58420
|
/**
|
|
57960
58421
|
* True when the source is a BINARY low-battery indicator (HA
|
|
57961
58422
|
* `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
|
|
57962
|
-
* charge level — `
|
|
58423
|
+
* charge level — `level` is then a coarse stand-in (100 = normal,
|
|
57963
58424
|
* sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
|
|
57964
58425
|
* misleading exact percentage. Absent/false → genuine 0–100 % reading.
|
|
57965
58426
|
*/
|
|
@@ -57985,19 +58446,19 @@ object({
|
|
|
57985
58446
|
DeviceType.Sensor;
|
|
57986
58447
|
object({
|
|
57987
58448
|
/** Current level as 0..100 inclusive. Firmware-reported. */
|
|
57988
|
-
|
|
58449
|
+
level: number().min(0).max(100).meta(readingMeta("percentage")),
|
|
57989
58450
|
/** Ms epoch of the last operator-driven change. Useful for UI freshness. */
|
|
57990
58451
|
lastChangedAt: number()
|
|
57991
58452
|
});
|
|
57992
58453
|
DeviceType.Light, method(object({
|
|
57993
58454
|
deviceId: number().int().nonnegative(),
|
|
57994
|
-
|
|
58455
|
+
level: number().min(0).max(100)
|
|
57995
58456
|
}), _void(), {
|
|
57996
58457
|
kind: "mutation",
|
|
57997
58458
|
auth: "protected"
|
|
57998
58459
|
}), object({
|
|
57999
58460
|
deviceId: number(),
|
|
58000
|
-
|
|
58461
|
+
level: number().min(0).max(100),
|
|
58001
58462
|
lastChangedAt: number()
|
|
58002
58463
|
});
|
|
58003
58464
|
DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
@@ -58502,11 +58963,11 @@ var ColorInputSchema = discriminatedUnion("mode", [
|
|
|
58502
58963
|
}),
|
|
58503
58964
|
object({
|
|
58504
58965
|
mode: literal("mired"),
|
|
58505
|
-
|
|
58966
|
+
colorTemperature: number().int().min(50).max(1e3)
|
|
58506
58967
|
})
|
|
58507
58968
|
]);
|
|
58508
58969
|
object({
|
|
58509
|
-
/** Active color mode — which of `rgb` / `hsv` / `
|
|
58970
|
+
/** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
|
|
58510
58971
|
* the bulb's current state. */
|
|
58511
58972
|
mode: _enum([
|
|
58512
58973
|
"rgb",
|
|
@@ -58518,7 +58979,7 @@ object({
|
|
|
58518
58979
|
/** Populated when `mode === 'hsv'`. */
|
|
58519
58980
|
hsv: HsvTripletSchema.optional(),
|
|
58520
58981
|
/** Populated when `mode === 'mired'`. */
|
|
58521
|
-
|
|
58982
|
+
colorTemperature: number().int().optional().meta(readingMeta("colour-temperature")),
|
|
58522
58983
|
/** Ms epoch of the last operator-driven change. */
|
|
58523
58984
|
lastChangedAt: number()
|
|
58524
58985
|
});
|
|
@@ -58537,7 +58998,7 @@ DeviceType.Light, method(object({
|
|
|
58537
58998
|
]),
|
|
58538
58999
|
rgb: RgbTripletSchema.optional(),
|
|
58539
59000
|
hsv: HsvTripletSchema.optional(),
|
|
58540
|
-
|
|
59001
|
+
colorTemperature: number().int().optional(),
|
|
58541
59002
|
lastChangedAt: number()
|
|
58542
59003
|
});
|
|
58543
59004
|
var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
|
|
@@ -58975,11 +59436,11 @@ object({
|
|
|
58975
59436
|
/** Feature keys of the programs the appliance currently offers — drives the UI selector. */
|
|
58976
59437
|
availablePrograms: array(string()),
|
|
58977
59438
|
/** Seconds remaining on the active cycle, or null when not running / not known. */
|
|
58978
|
-
|
|
59439
|
+
remaining: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
58979
59440
|
/** Seconds the delayed start is set to (time until the cycle starts), or null. */
|
|
58980
|
-
|
|
59441
|
+
delayedStart: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
58981
59442
|
/** Cycle completion 0..100, or null when not applicable. */
|
|
58982
|
-
|
|
59443
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
58983
59444
|
/** True when the door is reported open; null when the door state is not known. */
|
|
58984
59445
|
doorOpen: boolean().nullable(),
|
|
58985
59446
|
/** True when the door is latched (locked) during a cycle; null when not reported. */
|
|
@@ -59597,7 +60058,7 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
|
|
|
59597
60058
|
object({
|
|
59598
60059
|
/** Active speed as 0..100 inclusive. Null when the device has no
|
|
59599
60060
|
* speed surface (single-speed fan). */
|
|
59600
|
-
|
|
60061
|
+
speed: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
59601
60062
|
/** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
|
|
59602
60063
|
* a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
|
|
59603
60064
|
percentageStep: number().positive().optional().meta(readingMeta("percentage")),
|
|
@@ -59617,7 +60078,7 @@ object({
|
|
|
59617
60078
|
});
|
|
59618
60079
|
DeviceType.Fan, method(object({
|
|
59619
60080
|
deviceId: number().int().nonnegative(),
|
|
59620
|
-
|
|
60081
|
+
speed: number().min(0).max(100)
|
|
59621
60082
|
}), _void(), {
|
|
59622
60083
|
kind: "mutation",
|
|
59623
60084
|
auth: "protected"
|
|
@@ -59816,7 +60277,7 @@ DeviceType.Humidifier, method(object({
|
|
|
59816
60277
|
*/
|
|
59817
60278
|
var HumiditySensorStatusSchema = object({
|
|
59818
60279
|
/** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
|
|
59819
|
-
|
|
60280
|
+
humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
|
|
59820
60281
|
precision: 0,
|
|
59821
60282
|
label: "Humidity"
|
|
59822
60283
|
})),
|
|
@@ -60259,7 +60720,7 @@ object({
|
|
|
60259
60720
|
batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
60260
60721
|
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
60261
60722
|
* task is active / progress is unavailable. */
|
|
60262
|
-
|
|
60723
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
60263
60724
|
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
60264
60725
|
* or null when unknown. */
|
|
60265
60726
|
currentCode: number().nullable().meta(readingMeta("none")),
|
|
@@ -60749,10 +61210,10 @@ object({
|
|
|
60749
61210
|
currentMedia: MediaInfoSchema.nullable(),
|
|
60750
61211
|
/** Current playback position in ms. Null when not seekable or
|
|
60751
61212
|
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
60752
|
-
|
|
61213
|
+
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
60753
61214
|
/** Total duration of the current media in ms. Null when unknown
|
|
60754
61215
|
* (live stream) or nothing is playing. */
|
|
60755
|
-
|
|
61216
|
+
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
60756
61217
|
/** Shuffle toggle. Null when no shuffle surface.
|
|
60757
61218
|
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
60758
61219
|
shuffle: boolean().nullable(),
|
|
@@ -60779,7 +61240,7 @@ DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }
|
|
|
60779
61240
|
auth: "protected"
|
|
60780
61241
|
}), method(object({
|
|
60781
61242
|
deviceId: number().int().nonnegative(),
|
|
60782
|
-
|
|
61243
|
+
position: number().int().nonnegative()
|
|
60783
61244
|
}), _void(), {
|
|
60784
61245
|
kind: "mutation",
|
|
60785
61246
|
auth: "protected"
|
|
@@ -61452,9 +61913,9 @@ var NetworkLinkStatusSchema = object({
|
|
|
61452
61913
|
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
61453
61914
|
* SKIP a null rather than coerce it.
|
|
61454
61915
|
*/
|
|
61455
|
-
|
|
61916
|
+
signal: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
61456
61917
|
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
61457
|
-
|
|
61918
|
+
rssi: number().optional().meta(readingMeta("signal-level")),
|
|
61458
61919
|
/** Network name of a wireless link, when the firmware reports it. */
|
|
61459
61920
|
ssid: string().optional(),
|
|
61460
61921
|
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
@@ -62115,10 +62576,20 @@ var PetFeederDeviceStatusSchema = _enum([
|
|
|
62115
62576
|
]);
|
|
62116
62577
|
var gramsPortion = number().int().min(4).max(200);
|
|
62117
62578
|
object({
|
|
62118
|
-
/** Food
|
|
62119
|
-
*
|
|
62120
|
-
* bowl
|
|
62579
|
+
/** Food in the TANK (hopper), as the feeder's own sensor reports it
|
|
62580
|
+
* (`state.food`). A coarse level code, not grams — `0` is empty. The
|
|
62581
|
+
* amount in the bowl is `bowlFood`. On dual-hopper models this is the
|
|
62582
|
+
* combined reading; per-hopper levels live in `food1`/`food2`. Null when
|
|
62583
|
+
* the device has not reported yet. */
|
|
62121
62584
|
foodLevel: number().nullable().meta(readingMeta("none")),
|
|
62585
|
+
/** Food in the BOWL as the feeder reports it (`state.bowl`), in the
|
|
62586
|
+
* feeder's own units. Null when the model reports none. */
|
|
62587
|
+
bowlFood: number().nullable().meta(readingMeta("none")),
|
|
62588
|
+
/** True while the pet is eating (`state.eating`). */
|
|
62589
|
+
eating: boolean(),
|
|
62590
|
+
/** Whether `markFoodReplenished` does anything on this model. When false
|
|
62591
|
+
* the client must not offer it. */
|
|
62592
|
+
supportsMarkRefilled: boolean(),
|
|
62122
62593
|
/** Hopper-1 food level (grams) on dual-hopper feeders; null on
|
|
62123
62594
|
* single-hopper models. */
|
|
62124
62595
|
food1: number().nullable().meta(readingMeta("none")),
|
|
@@ -62126,8 +62597,8 @@ object({
|
|
|
62126
62597
|
* single-hopper models. */
|
|
62127
62598
|
food2: number().nullable().meta(readingMeta("none")),
|
|
62128
62599
|
/** Derived low-food flag — mirrors the HA `food_level` binary_sensor
|
|
62129
|
-
* (`device_class: problem`, on = low). True when the
|
|
62130
|
-
*
|
|
62600
|
+
* (`device_class: problem`, on = low). True when the tank reports empty,
|
|
62601
|
+
* or, on a dual-hopper model, when EITHER hopper is empty. */
|
|
62131
62602
|
lowFood: boolean(),
|
|
62132
62603
|
/** Battery charge 0..100 (%). Null on mains-powered models or when the
|
|
62133
62604
|
* device has no battery reading. */
|
|
@@ -62594,16 +63065,16 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
|
|
|
62594
63065
|
auth: "admin"
|
|
62595
63066
|
});
|
|
62596
63067
|
object({
|
|
62597
|
-
/** Instantaneous power draw
|
|
62598
|
-
|
|
63068
|
+
/** Instantaneous power draw (watts). */
|
|
63069
|
+
power: number().optional().meta(readingMeta("power", { label: "Power" })),
|
|
62599
63070
|
/** Cumulative energy in kilowatt-hours since the meter was reset. */
|
|
62600
|
-
|
|
62601
|
-
/** Voltage
|
|
62602
|
-
|
|
63071
|
+
energy: number().optional().meta(readingMeta("energy", { label: "Energy" })),
|
|
63072
|
+
/** Voltage (volts). */
|
|
63073
|
+
voltage: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
62603
63074
|
/** Current in amperes. */
|
|
62604
|
-
|
|
63075
|
+
current: number().optional().meta(readingMeta("current", { label: "Current" })),
|
|
62605
63076
|
/** Apparent power in volt-amperes. */
|
|
62606
|
-
|
|
63077
|
+
apparentPower: number().optional().meta(readingMeta("apparent-power")),
|
|
62607
63078
|
/** Power factor (0..1) if reported. */
|
|
62608
63079
|
powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
|
|
62609
63080
|
/** Ms epoch when the slice was last updated. */
|
|
@@ -62658,16 +63129,13 @@ var PresenceStatusSchema = object({
|
|
|
62658
63129
|
location: string().nullable(),
|
|
62659
63130
|
/** GPS coordinates when available. Null otherwise. */
|
|
62660
63131
|
gps: GpsLocationSchema.nullable(),
|
|
62661
|
-
/** Optional battery level of the tracking device (0..100). Null
|
|
62662
|
-
* when not reported. */
|
|
62663
|
-
batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
62664
63132
|
/** Ms epoch when the slice was last updated. */
|
|
62665
63133
|
lastChangedAt: number()
|
|
62666
63134
|
});
|
|
62667
63135
|
DeviceType.Presence;
|
|
62668
63136
|
object({
|
|
62669
63137
|
/** Current pressure in hPa. `null` when the sample was refused (D393). */
|
|
62670
|
-
|
|
63138
|
+
pressure: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
|
|
62671
63139
|
/** Ms epoch when the slice was last updated. */
|
|
62672
63140
|
lastFetchedAt: number()
|
|
62673
63141
|
});
|
|
@@ -65691,7 +66159,7 @@ DeviceType.Sensor;
|
|
|
65691
66159
|
*/
|
|
65692
66160
|
var TemperatureSensorStatusSchema = object({
|
|
65693
66161
|
/** Current temperature in Celsius. `null` when the sample was refused (D393). */
|
|
65694
|
-
|
|
66162
|
+
temperature: number().nullable().meta(readingMeta("temperature", {
|
|
65695
66163
|
precision: 1,
|
|
65696
66164
|
label: "Temperature"
|
|
65697
66165
|
})),
|
|
@@ -65955,7 +66423,7 @@ object({
|
|
|
65955
66423
|
/** Speed tokens the hardware accepts — drives the UI selector. */
|
|
65956
66424
|
availableFanSpeeds: array(string()),
|
|
65957
66425
|
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
65958
|
-
|
|
66426
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
65959
66427
|
/** Current error code (0 / null = no error). */
|
|
65960
66428
|
errorCode: number().nullable().meta(readingMeta("none")),
|
|
65961
66429
|
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
@@ -66896,6 +67364,104 @@ Object.freeze({
|
|
|
66896
67364
|
access: "create",
|
|
66897
67365
|
role: "admin"
|
|
66898
67366
|
},
|
|
67367
|
+
"actions.create": {
|
|
67368
|
+
capName: "actions",
|
|
67369
|
+
capScope: "system",
|
|
67370
|
+
addonId: null,
|
|
67371
|
+
access: "create",
|
|
67372
|
+
role: "admin"
|
|
67373
|
+
},
|
|
67374
|
+
"actions.delete": {
|
|
67375
|
+
capName: "actions",
|
|
67376
|
+
capScope: "system",
|
|
67377
|
+
addonId: null,
|
|
67378
|
+
access: "delete",
|
|
67379
|
+
role: "admin"
|
|
67380
|
+
},
|
|
67381
|
+
"actions.get": {
|
|
67382
|
+
capName: "actions",
|
|
67383
|
+
capScope: "system",
|
|
67384
|
+
addonId: null,
|
|
67385
|
+
access: "view",
|
|
67386
|
+
role: "viewer"
|
|
67387
|
+
},
|
|
67388
|
+
"actions.getLinks": {
|
|
67389
|
+
capName: "actions",
|
|
67390
|
+
capScope: "system",
|
|
67391
|
+
addonId: null,
|
|
67392
|
+
access: "view",
|
|
67393
|
+
role: "admin"
|
|
67394
|
+
},
|
|
67395
|
+
"actions.getTraces": {
|
|
67396
|
+
capName: "actions",
|
|
67397
|
+
capScope: "system",
|
|
67398
|
+
addonId: null,
|
|
67399
|
+
access: "view",
|
|
67400
|
+
role: "admin"
|
|
67401
|
+
},
|
|
67402
|
+
"actions.list": {
|
|
67403
|
+
capName: "actions",
|
|
67404
|
+
capScope: "system",
|
|
67405
|
+
addonId: null,
|
|
67406
|
+
access: "view",
|
|
67407
|
+
role: "admin"
|
|
67408
|
+
},
|
|
67409
|
+
"actions.listForCamera": {
|
|
67410
|
+
capName: "actions",
|
|
67411
|
+
capScope: "system",
|
|
67412
|
+
addonId: null,
|
|
67413
|
+
access: "view",
|
|
67414
|
+
role: "viewer"
|
|
67415
|
+
},
|
|
67416
|
+
"actions.run": {
|
|
67417
|
+
capName: "actions",
|
|
67418
|
+
capScope: "system",
|
|
67419
|
+
addonId: null,
|
|
67420
|
+
access: "create",
|
|
67421
|
+
role: "viewer"
|
|
67422
|
+
},
|
|
67423
|
+
"actions.setLinks": {
|
|
67424
|
+
capName: "actions",
|
|
67425
|
+
capScope: "system",
|
|
67426
|
+
addonId: null,
|
|
67427
|
+
access: "create",
|
|
67428
|
+
role: "admin"
|
|
67429
|
+
},
|
|
67430
|
+
"actions.stop": {
|
|
67431
|
+
capName: "actions",
|
|
67432
|
+
capScope: "system",
|
|
67433
|
+
addonId: null,
|
|
67434
|
+
access: "create",
|
|
67435
|
+
role: "admin"
|
|
67436
|
+
},
|
|
67437
|
+
"actions.update": {
|
|
67438
|
+
capName: "actions",
|
|
67439
|
+
capScope: "system",
|
|
67440
|
+
addonId: null,
|
|
67441
|
+
access: "create",
|
|
67442
|
+
role: "admin"
|
|
67443
|
+
},
|
|
67444
|
+
"actionSource.listActions": {
|
|
67445
|
+
capName: "action-source",
|
|
67446
|
+
capScope: "system",
|
|
67447
|
+
addonId: null,
|
|
67448
|
+
access: "view",
|
|
67449
|
+
role: "admin"
|
|
67450
|
+
},
|
|
67451
|
+
"actionSource.runAction": {
|
|
67452
|
+
capName: "action-source",
|
|
67453
|
+
capScope: "system",
|
|
67454
|
+
addonId: null,
|
|
67455
|
+
access: "create",
|
|
67456
|
+
role: "admin"
|
|
67457
|
+
},
|
|
67458
|
+
"actionSource.stopAction": {
|
|
67459
|
+
capName: "action-source",
|
|
67460
|
+
capScope: "system",
|
|
67461
|
+
addonId: null,
|
|
67462
|
+
access: "create",
|
|
67463
|
+
role: "admin"
|
|
67464
|
+
},
|
|
66899
67465
|
"addonPages.listPages": {
|
|
66900
67466
|
capName: "addon-pages",
|
|
66901
67467
|
capScope: "system",
|
|
@@ -68177,6 +68743,13 @@ Object.freeze({
|
|
|
68177
68743
|
access: "view",
|
|
68178
68744
|
role: "admin"
|
|
68179
68745
|
},
|
|
68746
|
+
"coreBlocks.getAutomationRunState": {
|
|
68747
|
+
capName: "core-blocks",
|
|
68748
|
+
capScope: "system",
|
|
68749
|
+
addonId: null,
|
|
68750
|
+
access: "view",
|
|
68751
|
+
role: "admin"
|
|
68752
|
+
},
|
|
68180
68753
|
"coreBlocks.getBlockSettings": {
|
|
68181
68754
|
capName: "core-blocks",
|
|
68182
68755
|
capScope: "system",
|
|
@@ -68198,6 +68771,13 @@ Object.freeze({
|
|
|
68198
68771
|
access: "view",
|
|
68199
68772
|
role: "admin"
|
|
68200
68773
|
},
|
|
68774
|
+
"coreBlocks.getTraces": {
|
|
68775
|
+
capName: "core-blocks",
|
|
68776
|
+
capScope: "system",
|
|
68777
|
+
addonId: null,
|
|
68778
|
+
access: "view",
|
|
68779
|
+
role: "admin"
|
|
68780
|
+
},
|
|
68201
68781
|
"coreBlocks.getTypeDefs": {
|
|
68202
68782
|
capName: "core-blocks",
|
|
68203
68783
|
capScope: "system",
|
|
@@ -68233,6 +68813,13 @@ Object.freeze({
|
|
|
68233
68813
|
access: "create",
|
|
68234
68814
|
role: "admin"
|
|
68235
68815
|
},
|
|
68816
|
+
"coreBlocks.reportAutomationRun": {
|
|
68817
|
+
capName: "core-blocks",
|
|
68818
|
+
capScope: "system",
|
|
68819
|
+
addonId: null,
|
|
68820
|
+
access: "create",
|
|
68821
|
+
role: "admin"
|
|
68822
|
+
},
|
|
68236
68823
|
"coreBlocks.restart": {
|
|
68237
68824
|
capName: "core-blocks",
|
|
68238
68825
|
capScope: "system",
|
|
@@ -76806,7 +77393,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76806
77393
|
label: t("Full brightness", "Luminosità massima"),
|
|
76807
77394
|
phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
|
|
76808
77395
|
icon: "sun",
|
|
76809
|
-
args: {
|
|
77396
|
+
args: { level: 100 }
|
|
76810
77397
|
},
|
|
76811
77398
|
{
|
|
76812
77399
|
id: "brightness.half",
|
|
@@ -76814,7 +77401,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76814
77401
|
label: t("Half brightness", "Luminosità a metà"),
|
|
76815
77402
|
phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
|
|
76816
77403
|
icon: "sun-dim",
|
|
76817
|
-
args: {
|
|
77404
|
+
args: { level: 50 }
|
|
76818
77405
|
},
|
|
76819
77406
|
{
|
|
76820
77407
|
id: "brightness.off",
|
|
@@ -76822,16 +77409,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76822
77409
|
label: t("Brightness off", "Luminosità a zero"),
|
|
76823
77410
|
phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
|
|
76824
77411
|
icon: "lightbulb-off",
|
|
76825
|
-
args: {
|
|
77412
|
+
args: { level: 0 }
|
|
76826
77413
|
},
|
|
76827
77414
|
{
|
|
76828
77415
|
id: "brightness.set",
|
|
76829
77416
|
method: "setBrightness",
|
|
76830
77417
|
label: t("Set brightness", "Imposta la luminosità"),
|
|
76831
|
-
phrase: t("Set the brightness of {device} to {
|
|
77418
|
+
phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
|
|
76832
77419
|
icon: "sun-medium",
|
|
76833
77420
|
openArgs: [{
|
|
76834
|
-
key: "
|
|
77421
|
+
key: "level",
|
|
76835
77422
|
label: PERCENT,
|
|
76836
77423
|
offer: {
|
|
76837
77424
|
kind: "number",
|
|
@@ -76845,13 +77432,13 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76845
77432
|
],
|
|
76846
77433
|
state: [{
|
|
76847
77434
|
kind: "numeric",
|
|
76848
|
-
field: "
|
|
77435
|
+
field: "level",
|
|
76849
77436
|
quantity: t("the brightness", "la luminosità"),
|
|
76850
77437
|
label: t("Brightness", "Luminosità"),
|
|
76851
77438
|
unit: "%",
|
|
76852
77439
|
icon: "sun"
|
|
76853
77440
|
}],
|
|
76854
|
-
events: { onBrightnessChanged: { notOperatorFacing: "the `
|
|
77441
|
+
events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
|
|
76855
77442
|
},
|
|
76856
77443
|
color: {
|
|
76857
77444
|
scope: "device",
|
|
@@ -76865,7 +77452,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76865
77452
|
icon: "sun",
|
|
76866
77453
|
args: { color: {
|
|
76867
77454
|
mode: "mired",
|
|
76868
|
-
|
|
77455
|
+
colorTemperature: 370
|
|
76869
77456
|
} }
|
|
76870
77457
|
},
|
|
76871
77458
|
{
|
|
@@ -76876,7 +77463,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
76876
77463
|
icon: "snowflake",
|
|
76877
77464
|
args: { color: {
|
|
76878
77465
|
mode: "mired",
|
|
76879
|
-
|
|
77466
|
+
colorTemperature: 200
|
|
76880
77467
|
} }
|
|
76881
77468
|
},
|
|
76882
77469
|
{
|
|
@@ -77490,7 +78077,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
77490
78077
|
label: t("Fan off", "Ventilatore spento"),
|
|
77491
78078
|
phrase: t("Stop {device}", "Ferma {device}"),
|
|
77492
78079
|
icon: "power-off",
|
|
77493
|
-
args: {
|
|
78080
|
+
args: { speed: 0 }
|
|
77494
78081
|
},
|
|
77495
78082
|
{
|
|
77496
78083
|
id: "fan.full",
|
|
@@ -77498,16 +78085,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
77498
78085
|
label: t("Fan full", "Ventilatore al massimo"),
|
|
77499
78086
|
phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
|
|
77500
78087
|
icon: "fan",
|
|
77501
|
-
args: {
|
|
78088
|
+
args: { speed: 100 }
|
|
77502
78089
|
},
|
|
77503
78090
|
{
|
|
77504
78091
|
id: "fan.speed",
|
|
77505
78092
|
method: "setPercentage",
|
|
77506
78093
|
label: t("Set speed", "Imposta la velocità"),
|
|
77507
|
-
phrase: t("Set the speed of {device} to {
|
|
78094
|
+
phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
|
|
77508
78095
|
icon: "fan",
|
|
77509
78096
|
openArgs: [{
|
|
77510
|
-
key: "
|
|
78097
|
+
key: "speed",
|
|
77511
78098
|
label: t("Speed", "Velocità"),
|
|
77512
78099
|
offer: {
|
|
77513
78100
|
kind: "number",
|
|
@@ -77569,7 +78156,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
77569
78156
|
],
|
|
77570
78157
|
state: [{
|
|
77571
78158
|
kind: "numeric",
|
|
77572
|
-
field: "
|
|
78159
|
+
field: "speed",
|
|
77573
78160
|
quantity: t("the speed", "la velocità"),
|
|
77574
78161
|
label: t("Speed", "Velocità"),
|
|
77575
78162
|
unit: "%",
|
|
@@ -78367,7 +78954,7 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
78367
78954
|
},
|
|
78368
78955
|
{
|
|
78369
78956
|
kind: "numeric",
|
|
78370
|
-
field: "
|
|
78957
|
+
field: "progress",
|
|
78371
78958
|
quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
|
|
78372
78959
|
label: t("Progress", "Avanzamento"),
|
|
78373
78960
|
unit: "%",
|
|
@@ -78725,10 +79312,10 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
78725
79312
|
id: "media.seek",
|
|
78726
79313
|
method: "seek",
|
|
78727
79314
|
label: t("Seek", "Vai al punto"),
|
|
78728
|
-
phrase: t("Move {device} to {
|
|
79315
|
+
phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
|
|
78729
79316
|
icon: "fast-forward",
|
|
78730
79317
|
openArgs: [{
|
|
78731
|
-
key: "
|
|
79318
|
+
key: "position",
|
|
78732
79319
|
label: t("Position", "Posizione"),
|
|
78733
79320
|
offer: {
|
|
78734
79321
|
kind: "number",
|
|
@@ -79777,7 +80364,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79777
80364
|
state: [
|
|
79778
80365
|
{
|
|
79779
80366
|
kind: "numeric",
|
|
79780
|
-
field: "
|
|
80367
|
+
field: "co2",
|
|
79781
80368
|
quantity: t("the CO₂", "la CO₂"),
|
|
79782
80369
|
label: t("CO₂", "CO₂"),
|
|
79783
80370
|
unit: "ppm",
|
|
@@ -79785,7 +80372,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79785
80372
|
},
|
|
79786
80373
|
{
|
|
79787
80374
|
kind: "numeric",
|
|
79788
|
-
field: "
|
|
80375
|
+
field: "voc",
|
|
79789
80376
|
quantity: t("the VOC level", "il livello di COV"),
|
|
79790
80377
|
label: t("VOC", "COV"),
|
|
79791
80378
|
unit: "ppb",
|
|
@@ -79821,7 +80408,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
79821
80408
|
noun: t("Light level", "Luminosità ambiente"),
|
|
79822
80409
|
state: [{
|
|
79823
80410
|
kind: "numeric",
|
|
79824
|
-
field: "
|
|
80411
|
+
field: "illuminance",
|
|
79825
80412
|
quantity: t("the light level", "la luminosità"),
|
|
79826
80413
|
label: t("Illuminance", "Illuminamento"),
|
|
79827
80414
|
unit: "lx",
|
|
@@ -80024,7 +80611,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80024
80611
|
noun: t("Humidity", "Umidità"),
|
|
80025
80612
|
state: [{
|
|
80026
80613
|
kind: "numeric",
|
|
80027
|
-
field: "
|
|
80614
|
+
field: "humidity",
|
|
80028
80615
|
quantity: t("the humidity", "l’umidità"),
|
|
80029
80616
|
label: t("Humidity", "Umidità"),
|
|
80030
80617
|
unit: "%",
|
|
@@ -80072,7 +80659,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80072
80659
|
state: [
|
|
80073
80660
|
{
|
|
80074
80661
|
kind: "numeric",
|
|
80075
|
-
field: "
|
|
80662
|
+
field: "power",
|
|
80076
80663
|
quantity: t("the power draw", "il consumo"),
|
|
80077
80664
|
label: t("Power", "Potenza"),
|
|
80078
80665
|
unit: "W",
|
|
@@ -80080,7 +80667,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80080
80667
|
},
|
|
80081
80668
|
{
|
|
80082
80669
|
kind: "numeric",
|
|
80083
|
-
field: "
|
|
80670
|
+
field: "energy",
|
|
80084
80671
|
quantity: t("the energy used", "l’energia consumata"),
|
|
80085
80672
|
label: t("Energy", "Energia"),
|
|
80086
80673
|
unit: "kWh",
|
|
@@ -80088,7 +80675,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80088
80675
|
},
|
|
80089
80676
|
{
|
|
80090
80677
|
kind: "numeric",
|
|
80091
|
-
field: "
|
|
80678
|
+
field: "voltage",
|
|
80092
80679
|
quantity: t("the voltage", "la tensione"),
|
|
80093
80680
|
label: t("Voltage", "Tensione"),
|
|
80094
80681
|
unit: "V",
|
|
@@ -80096,7 +80683,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80096
80683
|
},
|
|
80097
80684
|
{
|
|
80098
80685
|
kind: "numeric",
|
|
80099
|
-
field: "
|
|
80686
|
+
field: "current",
|
|
80100
80687
|
quantity: t("the current", "la corrente"),
|
|
80101
80688
|
label: t("Current", "Corrente"),
|
|
80102
80689
|
unit: "A",
|
|
@@ -80113,13 +80700,6 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80113
80700
|
label: t("Where", "Posizione"),
|
|
80114
80701
|
phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
|
|
80115
80702
|
icon: "map-pin"
|
|
80116
|
-
}, {
|
|
80117
|
-
kind: "numeric",
|
|
80118
|
-
field: "batteryPercent",
|
|
80119
|
-
quantity: t("the phone battery", "la batteria del telefono"),
|
|
80120
|
-
label: t("Battery", "Batteria"),
|
|
80121
|
-
unit: "%",
|
|
80122
|
-
icon: "battery"
|
|
80123
80703
|
}]
|
|
80124
80704
|
},
|
|
80125
80705
|
"pressure-sensor": {
|
|
@@ -80127,7 +80707,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80127
80707
|
noun: t("Pressure", "Pressione"),
|
|
80128
80708
|
state: [{
|
|
80129
80709
|
kind: "numeric",
|
|
80130
|
-
field: "
|
|
80710
|
+
field: "pressure",
|
|
80131
80711
|
quantity: t("the pressure", "la pressione"),
|
|
80132
80712
|
label: t("Pressure", "Pressione"),
|
|
80133
80713
|
unit: "hPa",
|
|
@@ -80163,7 +80743,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80163
80743
|
noun: t("Temperature", "Temperatura"),
|
|
80164
80744
|
state: [{
|
|
80165
80745
|
kind: "numeric",
|
|
80166
|
-
field: "
|
|
80746
|
+
field: "temperature",
|
|
80167
80747
|
quantity: t("the temperature", "la temperatura"),
|
|
80168
80748
|
label: t("Temperature", "Temperatura"),
|
|
80169
80749
|
unit: "°C",
|
|
@@ -80234,7 +80814,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80234
80814
|
state: [
|
|
80235
80815
|
{
|
|
80236
80816
|
kind: "numeric",
|
|
80237
|
-
field: "
|
|
80817
|
+
field: "level",
|
|
80238
80818
|
quantity: t("the battery level", "il livello della batteria"),
|
|
80239
80819
|
label: t("Battery", "Batteria"),
|
|
80240
80820
|
unit: "%",
|
|
@@ -80276,7 +80856,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80276
80856
|
icon: "battery-charging"
|
|
80277
80857
|
}
|
|
80278
80858
|
],
|
|
80279
|
-
events: { onStatusChanged: { notOperatorFacing: "the
|
|
80859
|
+
events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
|
|
80280
80860
|
extraEvents: [{
|
|
80281
80861
|
category: EventCategory.DeviceAwake,
|
|
80282
80862
|
label: t("Woke up", "Risvegliato"),
|
|
@@ -80294,7 +80874,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
80294
80874
|
noun: t("Network link", "Collegamento di rete"),
|
|
80295
80875
|
state: [{
|
|
80296
80876
|
kind: "numeric",
|
|
80297
|
-
field: "
|
|
80877
|
+
field: "signal",
|
|
80298
80878
|
quantity: t("the signal strength", "l’intensità del segnale"),
|
|
80299
80879
|
label: t("Signal", "Segnale"),
|
|
80300
80880
|
unit: "%",
|
|
@@ -80387,6 +80967,8 @@ var ML = "model and training machinery — no device action";
|
|
|
80387
80967
|
var INTERNAL = "internal plumbing between addons — never operator-facing";
|
|
80388
80968
|
/** Every system-scoped cap, with why it is not a device's vocabulary. */
|
|
80389
80969
|
var SYSTEM_CAP_VOCABULARY = {
|
|
80970
|
+
"action-source": system(INTERNAL),
|
|
80971
|
+
actions: system("declared actions — run from the Actions page and from the cameras that link them"),
|
|
80390
80972
|
"addon-pages": system(UI_PLUMBING),
|
|
80391
80973
|
"addon-pages-source": system(UI_PLUMBING),
|
|
80392
80974
|
"addon-routes": system(UI_PLUMBING),
|
|
@@ -80608,6 +81190,31 @@ Object.freeze({
|
|
|
80608
81190
|
form: "single",
|
|
80609
81191
|
optional: false
|
|
80610
81192
|
}],
|
|
81193
|
+
"actions.get": [{
|
|
81194
|
+
name: "deviceId",
|
|
81195
|
+
form: "single",
|
|
81196
|
+
optional: true
|
|
81197
|
+
}],
|
|
81198
|
+
"actions.getLinks": [{
|
|
81199
|
+
name: "deviceId",
|
|
81200
|
+
form: "single",
|
|
81201
|
+
optional: false
|
|
81202
|
+
}],
|
|
81203
|
+
"actions.listForCamera": [{
|
|
81204
|
+
name: "deviceId",
|
|
81205
|
+
form: "single",
|
|
81206
|
+
optional: false
|
|
81207
|
+
}],
|
|
81208
|
+
"actions.run": [{
|
|
81209
|
+
name: "deviceId",
|
|
81210
|
+
form: "single",
|
|
81211
|
+
optional: true
|
|
81212
|
+
}],
|
|
81213
|
+
"actions.setLinks": [{
|
|
81214
|
+
name: "deviceId",
|
|
81215
|
+
form: "single",
|
|
81216
|
+
optional: false
|
|
81217
|
+
}],
|
|
80611
81218
|
"addonSettings.getDeviceSettings": [{
|
|
80612
81219
|
name: "deviceId",
|
|
80613
81220
|
form: "single",
|
|
@@ -84689,6 +85296,7 @@ DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
|
84689
85296
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
84690
85297
|
DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
|
|
84691
85298
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
85299
|
+
String.raw`(?<=^|["'(\s>,\[{])`;
|
|
84692
85300
|
var MB = 1024 * 1024;
|
|
84693
85301
|
1024 * MB, 3072 * MB;
|
|
84694
85302
|
process.platform, process.env["SystemRoot"];
|
|
@@ -133988,7 +134596,7 @@ function applyServiceLabel(service, name) {
|
|
|
133988
134596
|
var LOW_BATTERY_THRESHOLD_PCT = 20;
|
|
133989
134597
|
/**
|
|
133990
134598
|
* Mapping:
|
|
133991
|
-
* - `BatteryStatus.
|
|
134599
|
+
* - `BatteryStatus.level` (0..100) → `Characteristic.BatteryLevel`
|
|
133992
134600
|
* - `BatteryStatus.charging`:
|
|
133993
134601
|
* `'none'` → `ChargingState.NOT_CHARGING`
|
|
133994
134602
|
* `'dc' | 'solar'` → `ChargingState.CHARGING`
|
|
@@ -133996,12 +134604,12 @@ var LOW_BATTERY_THRESHOLD_PCT = 20;
|
|
|
133996
134604
|
* either value would be a claim
|
|
133997
134605
|
* - `percentage <= LOW_BATTERY_THRESHOLD_PCT` → `StatusLowBattery.LOW`
|
|
133998
134606
|
*/
|
|
133999
|
-
var batteryCharacteristicUpdates = reader(BatteryStatusSchema.pick({
|
|
134000
|
-
if (status.
|
|
134607
|
+
var batteryCharacteristicUpdates = reader(BatteryStatusSchema.pick({ level: true }).extend({ charging: BatteryStatusSchema.shape.charging.optional() }), (status) => {
|
|
134608
|
+
if (status.level === null) return status.charging === void 0 || status.charging === "unknown" ? [] : [{
|
|
134001
134609
|
characteristic: import_dist.Characteristic.ChargingState,
|
|
134002
134610
|
value: status.charging === "none" ? import_dist.Characteristic.ChargingState.NOT_CHARGING : import_dist.Characteristic.ChargingState.CHARGING
|
|
134003
134611
|
}];
|
|
134004
|
-
const pct = Math.max(0, Math.min(100, Math.round(status.
|
|
134612
|
+
const pct = Math.max(0, Math.min(100, Math.round(status.level)));
|
|
134005
134613
|
return [
|
|
134006
134614
|
{
|
|
134007
134615
|
characteristic: import_dist.Characteristic.BatteryLevel,
|
|
@@ -134103,7 +134711,7 @@ async function buildChildSwitch(bctx, subtype, deviceType) {
|
|
|
134103
134711
|
}
|
|
134104
134712
|
if (useLightbulb) try {
|
|
134105
134713
|
const status = await proxy.brightness?.getStatus({});
|
|
134106
|
-
if (status && typeof status.
|
|
134714
|
+
if (status && typeof status.level === "number") service.updateCharacteristic(import_dist.Characteristic.Brightness, status.level);
|
|
134107
134715
|
} catch (err) {
|
|
134108
134716
|
log.debug("export-hap: child brightness.getStatus failed (non-fatal)", { meta: { error: errMsg$13(err) } });
|
|
134109
134717
|
}
|
|
@@ -134122,7 +134730,7 @@ async function buildChildSwitch(bctx, subtype, deviceType) {
|
|
|
134122
134730
|
const percentage = typeof value === "number" ? value : Number(value);
|
|
134123
134731
|
if (!Number.isFinite(percentage)) return;
|
|
134124
134732
|
try {
|
|
134125
|
-
await proxy.brightness?.setBrightness({ percentage });
|
|
134733
|
+
await proxy.brightness?.setBrightness({ level: percentage });
|
|
134126
134734
|
} catch (err) {
|
|
134127
134735
|
log.warn("export-hap: child brightness.setBrightness failed", { meta: {
|
|
134128
134736
|
percentage,
|
|
@@ -134139,7 +134747,7 @@ async function buildChildSwitch(bctx, subtype, deviceType) {
|
|
|
134139
134747
|
}
|
|
134140
134748
|
if (useLightbulb && proxy.state.brightness) {
|
|
134141
134749
|
const unsubBrightness = proxy.state.brightness.subscribe((value) => {
|
|
134142
|
-
if (value && typeof value.
|
|
134750
|
+
if (value && typeof value.level === "number") service.updateCharacteristic(import_dist.Characteristic.Brightness, value.level);
|
|
134143
134751
|
});
|
|
134144
134752
|
unsubscribes.push(unsubBrightness);
|
|
134145
134753
|
}
|
|
@@ -134685,9 +135293,9 @@ var SENSOR_SPECS = {
|
|
|
134685
135293
|
addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.TemperatureSensor, name, subtype),
|
|
134686
135294
|
getStatus: (proxy) => proxy.temperatureSensor?.getStatus({}),
|
|
134687
135295
|
subscribe: (proxy, onValue) => proxy.state.temperatureSensor?.subscribe(onValue) ?? null,
|
|
134688
|
-
read: reader(TemperatureSensorStatusSchema.pick({
|
|
135296
|
+
read: reader(TemperatureSensorStatusSchema.pick({ temperature: true }), (status) => status.temperature === null ? [] : [{
|
|
134689
135297
|
characteristic: import_dist.Characteristic.CurrentTemperature,
|
|
134690
|
-
value: status.
|
|
135298
|
+
value: status.temperature
|
|
134691
135299
|
}])
|
|
134692
135300
|
},
|
|
134693
135301
|
"humidity-sensor": {
|
|
@@ -134695,9 +135303,9 @@ var SENSOR_SPECS = {
|
|
|
134695
135303
|
addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.HumiditySensor, name, subtype),
|
|
134696
135304
|
getStatus: (proxy) => proxy.humiditySensor?.getStatus({}),
|
|
134697
135305
|
subscribe: (proxy, onValue) => proxy.state.humiditySensor?.subscribe(onValue) ?? null,
|
|
134698
|
-
read: reader(HumiditySensorStatusSchema.pick({
|
|
135306
|
+
read: reader(HumiditySensorStatusSchema.pick({ humidity: true }), (status) => status.humidity === null ? [] : [{
|
|
134699
135307
|
characteristic: import_dist.Characteristic.CurrentRelativeHumidity,
|
|
134700
|
-
value: status.
|
|
135308
|
+
value: status.humidity
|
|
134701
135309
|
}])
|
|
134702
135310
|
},
|
|
134703
135311
|
"ambient-light-sensor": {
|
|
@@ -134705,9 +135313,9 @@ var SENSOR_SPECS = {
|
|
|
134705
135313
|
addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.LightSensor, name, subtype),
|
|
134706
135314
|
getStatus: (proxy) => proxy.ambientLightSensor?.getStatus({}),
|
|
134707
135315
|
subscribe: (proxy, onValue) => proxy.state.ambientLightSensor?.subscribe(onValue) ?? null,
|
|
134708
|
-
read: reader(AmbientLightSensorStatusSchema.pick({
|
|
135316
|
+
read: reader(AmbientLightSensorStatusSchema.pick({ illuminance: true }), (status) => status.illuminance === null ? [] : [{
|
|
134709
135317
|
characteristic: import_dist.Characteristic.CurrentAmbientLightLevel,
|
|
134710
|
-
value: Math.max(MIN_LUX, status.
|
|
135318
|
+
value: Math.max(MIN_LUX, status.illuminance)
|
|
134711
135319
|
}])
|
|
134712
135320
|
}
|
|
134713
135321
|
};
|