@camstack/addon-provider-hikvision 1.2.177 → 1.2.178
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/addon.js +851 -247
- package/dist/addon.mjs +851 -247
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -34,7 +34,7 @@ let node_os = require("node:os");
|
|
|
34
34
|
let node_net = require("node:net");
|
|
35
35
|
let node_http = require("node:http");
|
|
36
36
|
let node_https = require("node:https");
|
|
37
|
-
//#region ../types/dist/event-category-
|
|
37
|
+
//#region ../types/dist/event-category-DmZDPDf_.mjs
|
|
38
38
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
39
39
|
EventCategory["SystemBoot"] = "system.boot";
|
|
40
40
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -661,7 +661,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
661
661
|
* (a track was promoted to a stationary-registry entry) or departs (the
|
|
662
662
|
* object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
|
|
663
663
|
* the dedicated "Stationary" section — never the live event feed. Payload:
|
|
664
|
-
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp }`.
|
|
664
|
+
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
|
|
665
665
|
*/
|
|
666
666
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
667
667
|
/**
|
|
@@ -799,6 +799,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
799
799
|
*/
|
|
800
800
|
EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
|
|
801
801
|
/**
|
|
802
|
+
* An action run started or ended. Emitted by the `actions` surface.
|
|
803
|
+
* Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
|
|
804
|
+
*/
|
|
805
|
+
EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
|
|
806
|
+
/**
|
|
802
807
|
* Progress update from a running model conversion job.
|
|
803
808
|
* Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
|
|
804
809
|
* Emitted by `addon-model-studio` on the converting node.
|
|
@@ -5477,7 +5482,7 @@ var ZodIssueCode = {
|
|
|
5477
5482
|
var ZodFirstPartyTypeKind;
|
|
5478
5483
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5479
5484
|
//#endregion
|
|
5480
|
-
//#region ../types/dist/sleep
|
|
5485
|
+
//#region ../types/dist/sleep-Crlmu_tO.mjs
|
|
5481
5486
|
/**
|
|
5482
5487
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5483
5488
|
* window to float samples (D455).
|
|
@@ -8609,6 +8614,8 @@ Object.freeze({ "doorbell": "lastPressedAt" });
|
|
|
8609
8614
|
/** Every capability name, so addon code can check a name without the schema graph. */
|
|
8610
8615
|
var CAP_NAMES = Object.freeze([
|
|
8611
8616
|
"accessories",
|
|
8617
|
+
"action-source",
|
|
8618
|
+
"actions",
|
|
8612
8619
|
"addon-pages",
|
|
8613
8620
|
"addon-pages-source",
|
|
8614
8621
|
"addon-routes",
|
|
@@ -8797,11 +8804,11 @@ var CAP_NAMES = Object.freeze([
|
|
|
8797
8804
|
Object.freeze({
|
|
8798
8805
|
"air-quality-sensor": [
|
|
8799
8806
|
{
|
|
8800
|
-
"path": "
|
|
8807
|
+
"path": "co2",
|
|
8801
8808
|
"valueType": "number"
|
|
8802
8809
|
},
|
|
8803
8810
|
{
|
|
8804
|
-
"path": "
|
|
8811
|
+
"path": "voc",
|
|
8805
8812
|
"valueType": "number"
|
|
8806
8813
|
},
|
|
8807
8814
|
{
|
|
@@ -8851,7 +8858,7 @@ Object.freeze({
|
|
|
8851
8858
|
}
|
|
8852
8859
|
],
|
|
8853
8860
|
"ambient-light-sensor": [{
|
|
8854
|
-
"path": "
|
|
8861
|
+
"path": "illuminance",
|
|
8855
8862
|
"valueType": "number"
|
|
8856
8863
|
}],
|
|
8857
8864
|
"audio-metrics": [
|
|
@@ -8912,7 +8919,7 @@ Object.freeze({
|
|
|
8912
8919
|
],
|
|
8913
8920
|
"battery": [
|
|
8914
8921
|
{
|
|
8915
|
-
"path": "
|
|
8922
|
+
"path": "level",
|
|
8916
8923
|
"valueType": "number"
|
|
8917
8924
|
},
|
|
8918
8925
|
{
|
|
@@ -8934,7 +8941,7 @@ Object.freeze({
|
|
|
8934
8941
|
"valueType": "number"
|
|
8935
8942
|
},
|
|
8936
8943
|
{
|
|
8937
|
-
"path": "
|
|
8944
|
+
"path": "voltage",
|
|
8938
8945
|
"valueType": "number"
|
|
8939
8946
|
},
|
|
8940
8947
|
{
|
|
@@ -8955,7 +8962,7 @@ Object.freeze({
|
|
|
8955
8962
|
"valueType": "boolean"
|
|
8956
8963
|
}],
|
|
8957
8964
|
"brightness": [{
|
|
8958
|
-
"path": "
|
|
8965
|
+
"path": "level",
|
|
8959
8966
|
"valueType": "number"
|
|
8960
8967
|
}],
|
|
8961
8968
|
"broker": [{
|
|
@@ -9156,7 +9163,7 @@ Object.freeze({
|
|
|
9156
9163
|
"valueType": "number"
|
|
9157
9164
|
},
|
|
9158
9165
|
{
|
|
9159
|
-
"path": "
|
|
9166
|
+
"path": "colorTemperature",
|
|
9160
9167
|
"valueType": "number"
|
|
9161
9168
|
}
|
|
9162
9169
|
],
|
|
@@ -9335,15 +9342,15 @@ Object.freeze({
|
|
|
9335
9342
|
"valueType": "string"
|
|
9336
9343
|
},
|
|
9337
9344
|
{
|
|
9338
|
-
"path": "
|
|
9345
|
+
"path": "remaining",
|
|
9339
9346
|
"valueType": "number"
|
|
9340
9347
|
},
|
|
9341
9348
|
{
|
|
9342
|
-
"path": "
|
|
9349
|
+
"path": "delayedStart",
|
|
9343
9350
|
"valueType": "number"
|
|
9344
9351
|
},
|
|
9345
9352
|
{
|
|
9346
|
-
"path": "
|
|
9353
|
+
"path": "progress",
|
|
9347
9354
|
"valueType": "number"
|
|
9348
9355
|
},
|
|
9349
9356
|
{
|
|
@@ -9457,7 +9464,7 @@ Object.freeze({
|
|
|
9457
9464
|
],
|
|
9458
9465
|
"fan-control": [
|
|
9459
9466
|
{
|
|
9460
|
-
"path": "
|
|
9467
|
+
"path": "speed",
|
|
9461
9468
|
"valueType": "number"
|
|
9462
9469
|
},
|
|
9463
9470
|
{
|
|
@@ -9557,7 +9564,7 @@ Object.freeze({
|
|
|
9557
9564
|
}
|
|
9558
9565
|
],
|
|
9559
9566
|
"humidity-sensor": [{
|
|
9560
|
-
"path": "
|
|
9567
|
+
"path": "humidity",
|
|
9561
9568
|
"valueType": "number"
|
|
9562
9569
|
}],
|
|
9563
9570
|
"image": [{
|
|
@@ -9667,7 +9674,7 @@ Object.freeze({
|
|
|
9667
9674
|
"valueType": "number"
|
|
9668
9675
|
},
|
|
9669
9676
|
{
|
|
9670
|
-
"path": "
|
|
9677
|
+
"path": "progress",
|
|
9671
9678
|
"valueType": "number"
|
|
9672
9679
|
},
|
|
9673
9680
|
{
|
|
@@ -9746,11 +9753,11 @@ Object.freeze({
|
|
|
9746
9753
|
"valueType": "string"
|
|
9747
9754
|
},
|
|
9748
9755
|
{
|
|
9749
|
-
"path": "
|
|
9756
|
+
"path": "position",
|
|
9750
9757
|
"valueType": "number"
|
|
9751
9758
|
},
|
|
9752
9759
|
{
|
|
9753
|
-
"path": "
|
|
9760
|
+
"path": "duration",
|
|
9754
9761
|
"valueType": "number"
|
|
9755
9762
|
},
|
|
9756
9763
|
{
|
|
@@ -9852,11 +9859,11 @@ Object.freeze({
|
|
|
9852
9859
|
]
|
|
9853
9860
|
},
|
|
9854
9861
|
{
|
|
9855
|
-
"path": "
|
|
9862
|
+
"path": "signal",
|
|
9856
9863
|
"valueType": "number"
|
|
9857
9864
|
},
|
|
9858
9865
|
{
|
|
9859
|
-
"path": "
|
|
9866
|
+
"path": "rssi",
|
|
9860
9867
|
"valueType": "number"
|
|
9861
9868
|
},
|
|
9862
9869
|
{
|
|
@@ -9911,6 +9918,18 @@ Object.freeze({
|
|
|
9911
9918
|
"path": "foodLevel",
|
|
9912
9919
|
"valueType": "number"
|
|
9913
9920
|
},
|
|
9921
|
+
{
|
|
9922
|
+
"path": "bowlFood",
|
|
9923
|
+
"valueType": "number"
|
|
9924
|
+
},
|
|
9925
|
+
{
|
|
9926
|
+
"path": "eating",
|
|
9927
|
+
"valueType": "boolean"
|
|
9928
|
+
},
|
|
9929
|
+
{
|
|
9930
|
+
"path": "supportsMarkRefilled",
|
|
9931
|
+
"valueType": "boolean"
|
|
9932
|
+
},
|
|
9914
9933
|
{
|
|
9915
9934
|
"path": "food1",
|
|
9916
9935
|
"valueType": "number"
|
|
@@ -9975,23 +9994,23 @@ Object.freeze({
|
|
|
9975
9994
|
],
|
|
9976
9995
|
"power-meter": [
|
|
9977
9996
|
{
|
|
9978
|
-
"path": "
|
|
9997
|
+
"path": "power",
|
|
9979
9998
|
"valueType": "number"
|
|
9980
9999
|
},
|
|
9981
10000
|
{
|
|
9982
|
-
"path": "
|
|
10001
|
+
"path": "energy",
|
|
9983
10002
|
"valueType": "number"
|
|
9984
10003
|
},
|
|
9985
10004
|
{
|
|
9986
|
-
"path": "
|
|
10005
|
+
"path": "voltage",
|
|
9987
10006
|
"valueType": "number"
|
|
9988
10007
|
},
|
|
9989
10008
|
{
|
|
9990
|
-
"path": "
|
|
10009
|
+
"path": "current",
|
|
9991
10010
|
"valueType": "number"
|
|
9992
10011
|
},
|
|
9993
10012
|
{
|
|
9994
|
-
"path": "
|
|
10013
|
+
"path": "apparentPower",
|
|
9995
10014
|
"valueType": "number"
|
|
9996
10015
|
},
|
|
9997
10016
|
{
|
|
@@ -10019,14 +10038,10 @@ Object.freeze({
|
|
|
10019
10038
|
{
|
|
10020
10039
|
"path": "gps.accuracyMeters",
|
|
10021
10040
|
"valueType": "number"
|
|
10022
|
-
},
|
|
10023
|
-
{
|
|
10024
|
-
"path": "batteryPercent",
|
|
10025
|
-
"valueType": "number"
|
|
10026
10041
|
}
|
|
10027
10042
|
],
|
|
10028
10043
|
"pressure-sensor": [{
|
|
10029
|
-
"path": "
|
|
10044
|
+
"path": "pressure",
|
|
10030
10045
|
"valueType": "number"
|
|
10031
10046
|
}],
|
|
10032
10047
|
"privacy-mask": [{
|
|
@@ -10340,7 +10355,7 @@ Object.freeze({
|
|
|
10340
10355
|
"valueType": "boolean"
|
|
10341
10356
|
}],
|
|
10342
10357
|
"temperature-sensor": [{
|
|
10343
|
-
"path": "
|
|
10358
|
+
"path": "temperature",
|
|
10344
10359
|
"valueType": "number"
|
|
10345
10360
|
}],
|
|
10346
10361
|
"update": [
|
|
@@ -10388,7 +10403,7 @@ Object.freeze({
|
|
|
10388
10403
|
"valueType": "string"
|
|
10389
10404
|
},
|
|
10390
10405
|
{
|
|
10391
|
-
"path": "
|
|
10406
|
+
"path": "progress",
|
|
10392
10407
|
"valueType": "number"
|
|
10393
10408
|
},
|
|
10394
10409
|
{
|
|
@@ -10877,7 +10892,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
10877
10892
|
return DeviceRole;
|
|
10878
10893
|
}({});
|
|
10879
10894
|
//#endregion
|
|
10880
|
-
//#region ../types/dist/composition-
|
|
10895
|
+
//#region ../types/dist/composition-CZImLpOI.mjs
|
|
10881
10896
|
/**
|
|
10882
10897
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
10883
10898
|
*
|
|
@@ -15716,6 +15731,14 @@ var AutomationConditionLeafSchema = object({
|
|
|
15716
15731
|
array(union([string(), number()]))
|
|
15717
15732
|
])
|
|
15718
15733
|
});
|
|
15734
|
+
var AutomationConditionStationaryPresentSchema = object({
|
|
15735
|
+
kind: literal("stationary-present"),
|
|
15736
|
+
deviceId: number().int().nonnegative(),
|
|
15737
|
+
/** Class names; a macro class matches every raw class that maps to it. */
|
|
15738
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
15739
|
+
/** The parked object must be in at least one of these zones. */
|
|
15740
|
+
zones: array(string().min(1)).min(1).optional()
|
|
15741
|
+
});
|
|
15719
15742
|
/**
|
|
15720
15743
|
* The expression leaf, declared as a plain object rather than an intersection
|
|
15721
15744
|
* with {@link ExpressionSourceSchema}: a discriminated union has to be able to
|
|
@@ -15749,7 +15772,8 @@ var AutomationConditionSchema = lazy(() => discriminatedUnion("kind", [
|
|
|
15749
15772
|
child: AutomationConditionSchema
|
|
15750
15773
|
}),
|
|
15751
15774
|
AutomationConditionLeafSchema,
|
|
15752
|
-
AutomationConditionExpressionSchema
|
|
15775
|
+
AutomationConditionExpressionSchema,
|
|
15776
|
+
AutomationConditionStationaryPresentSchema
|
|
15753
15777
|
]));
|
|
15754
15778
|
/**
|
|
15755
15779
|
* What starts a run.
|
|
@@ -15790,7 +15814,34 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
15790
15814
|
kind: literal("schedule"),
|
|
15791
15815
|
cron: string().min(1).max(120)
|
|
15792
15816
|
}),
|
|
15793
|
-
object({ kind: literal("manual") })
|
|
15817
|
+
object({ kind: literal("manual") }),
|
|
15818
|
+
object({
|
|
15819
|
+
kind: literal("detection"),
|
|
15820
|
+
/** Class names. A macro class (`animal`, `vehicle`, `person`, `package`)
|
|
15821
|
+
* matches every raw class that maps to it; any other name matches
|
|
15822
|
+
* exactly. */
|
|
15823
|
+
classes: array(string().min(1)).min(1),
|
|
15824
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
15825
|
+
/** The track must have visited at least one of these zones. */
|
|
15826
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
15827
|
+
/** Best-so-far confidence the track must reach. */
|
|
15828
|
+
minScore: number().min(0).max(1).optional()
|
|
15829
|
+
}),
|
|
15830
|
+
object({
|
|
15831
|
+
kind: literal("stationary"),
|
|
15832
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
15833
|
+
/** Class names; a macro class matches like the detection trigger. */
|
|
15834
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
15835
|
+
/** The parked object must be in at least one of these zones. */
|
|
15836
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
15837
|
+
/** `appeared`: it became parked. `departed`: the registry retired it.
|
|
15838
|
+
* The vocabulary of `PipelineAnalyticsStationaryChanged`. */
|
|
15839
|
+
phase: _enum(["appeared", "departed"])
|
|
15840
|
+
}),
|
|
15841
|
+
object({
|
|
15842
|
+
kind: literal("interval"),
|
|
15843
|
+
minutes: number().int().min(1).max(1440)
|
|
15844
|
+
})
|
|
15794
15845
|
]);
|
|
15795
15846
|
/**
|
|
15796
15847
|
* One action step.
|
|
@@ -15810,28 +15861,47 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
15810
15861
|
* is called. The runner still receives a number and is untouched; the
|
|
15811
15862
|
* resolution is the recipe's job, not the runner's.
|
|
15812
15863
|
*/
|
|
15864
|
+
var AutomationWaitStepSchema = object({
|
|
15865
|
+
kind: literal("wait"),
|
|
15866
|
+
seconds: number().min(0).max(300)
|
|
15867
|
+
});
|
|
15868
|
+
var AutomationCapStepSchema = object({
|
|
15869
|
+
kind: literal("cap"),
|
|
15870
|
+
/**
|
|
15871
|
+
* One device, several same-family devices (locks / climate family / …),
|
|
15872
|
+
* or `{ $var }` for the device that triggered the run. An array is
|
|
15873
|
+
* fan-out at codegen — each id gets the same cap.method call.
|
|
15874
|
+
*/
|
|
15875
|
+
deviceId: union([
|
|
15876
|
+
number().int(),
|
|
15877
|
+
array(number().int()).min(1),
|
|
15878
|
+
object({ $var: string().min(1) })
|
|
15879
|
+
]),
|
|
15880
|
+
cap: string().min(1),
|
|
15881
|
+
method: string().min(1),
|
|
15882
|
+
/** Values may carry `{{vars.x}}` slots, or be exactly `{ $var: 'name' }`, which
|
|
15883
|
+
* SUBSTITUTE and do not evaluate (§3.2.3). Anything beyond substitution is
|
|
15884
|
+
* the expression leaf. */
|
|
15885
|
+
args: record(string(), unknown()).optional()
|
|
15886
|
+
});
|
|
15887
|
+
/**
|
|
15888
|
+
* The steps an internal Action may contain: cap and wait, and nothing that can
|
|
15889
|
+
* call back into an Action — so an Action can never reach itself (no cycles).
|
|
15890
|
+
*/
|
|
15891
|
+
var ActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
|
|
15813
15892
|
var AutomationActionSchema = discriminatedUnion("kind", [
|
|
15893
|
+
AutomationWaitStepSchema,
|
|
15894
|
+
AutomationCapStepSchema,
|
|
15814
15895
|
object({
|
|
15815
|
-
kind: literal("
|
|
15816
|
-
|
|
15817
|
-
|
|
15818
|
-
|
|
15819
|
-
|
|
15820
|
-
|
|
15821
|
-
|
|
15822
|
-
|
|
15823
|
-
|
|
15824
|
-
*/
|
|
15825
|
-
deviceId: union([
|
|
15826
|
-
number().int(),
|
|
15827
|
-
array(number().int()).min(1),
|
|
15828
|
-
object({ $var: string().min(1) })
|
|
15829
|
-
]),
|
|
15830
|
-
cap: string().min(1),
|
|
15831
|
-
method: string().min(1),
|
|
15832
|
-
/** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
|
|
15833
|
-
* evaluate (§3.2.3). Anything beyond substitution is the expression leaf. */
|
|
15834
|
-
args: record(string(), unknown()).optional()
|
|
15896
|
+
kind: literal("action"),
|
|
15897
|
+
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
15898
|
+
actionId: string().min(1),
|
|
15899
|
+
/** Values for the action's declared variables; the others take their default. */
|
|
15900
|
+
variables: record(string(), union([
|
|
15901
|
+
string(),
|
|
15902
|
+
number(),
|
|
15903
|
+
boolean()
|
|
15904
|
+
])).optional()
|
|
15835
15905
|
}),
|
|
15836
15906
|
object({
|
|
15837
15907
|
kind: literal("code"),
|
|
@@ -15840,10 +15910,357 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
15840
15910
|
code: string().min(1).max(2e4)
|
|
15841
15911
|
})
|
|
15842
15912
|
]);
|
|
15913
|
+
/**
|
|
15914
|
+
* How a trigger that arrives while the automation is busy (or cooling down) is
|
|
15915
|
+
* handled. One of the automation's execution modes, never a property of its
|
|
15916
|
+
* actions. Absent means `single`.
|
|
15917
|
+
*
|
|
15918
|
+
* - `single` — drop the trigger while a run is in progress (traced + logged).
|
|
15919
|
+
* - `restart` — abort the run in progress (at its next step boundary), start fresh.
|
|
15920
|
+
* - `queued` — queue up to `max` triggers, drop the rest (traced).
|
|
15921
|
+
* - `parallel` — up to `max` runs at once, drop the rest (traced).
|
|
15922
|
+
* - `cooldown` — `single`, and no new run until `minutes` after the last run
|
|
15923
|
+
* STARTED; persisted across a restart. A manual trigger bypasses only this
|
|
15924
|
+
* wait, never the single/queued limits.
|
|
15925
|
+
*/
|
|
15926
|
+
var AutomationRunModeSchema = discriminatedUnion("mode", [
|
|
15927
|
+
object({ mode: literal("single") }),
|
|
15928
|
+
object({ mode: literal("restart") }),
|
|
15929
|
+
object({
|
|
15930
|
+
mode: literal("queued"),
|
|
15931
|
+
max: number().int().min(1).max(10)
|
|
15932
|
+
}),
|
|
15933
|
+
object({
|
|
15934
|
+
mode: literal("parallel"),
|
|
15935
|
+
max: number().int().min(1).max(10)
|
|
15936
|
+
}),
|
|
15937
|
+
object({
|
|
15938
|
+
mode: literal("cooldown"),
|
|
15939
|
+
minutes: number().int().min(1).max(1440)
|
|
15940
|
+
})
|
|
15941
|
+
]);
|
|
15843
15942
|
var AutomationRecipeSchema = object({
|
|
15844
15943
|
triggers: array(AutomationTriggerSchema),
|
|
15845
15944
|
conditions: AutomationConditionSchema.optional(),
|
|
15846
|
-
actions: array(AutomationActionSchema)
|
|
15945
|
+
actions: array(AutomationActionSchema),
|
|
15946
|
+
runMode: AutomationRunModeSchema.optional(),
|
|
15947
|
+
/** How many run traces the automation keeps (default {@link DEFAULT_TRACE_KEEP}). */
|
|
15948
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
15949
|
+
});
|
|
15950
|
+
new Set([
|
|
15951
|
+
{
|
|
15952
|
+
id: "person",
|
|
15953
|
+
name: "Person"
|
|
15954
|
+
},
|
|
15955
|
+
{
|
|
15956
|
+
id: "vehicle",
|
|
15957
|
+
name: "Vehicle"
|
|
15958
|
+
},
|
|
15959
|
+
{
|
|
15960
|
+
id: "animal",
|
|
15961
|
+
name: "Animal"
|
|
15962
|
+
},
|
|
15963
|
+
{
|
|
15964
|
+
id: "package",
|
|
15965
|
+
name: "Package"
|
|
15966
|
+
}
|
|
15967
|
+
].map((l) => l.id));
|
|
15968
|
+
var COCO_TO_MACRO = {
|
|
15969
|
+
mapping: {
|
|
15970
|
+
person: "person",
|
|
15971
|
+
bicycle: "vehicle",
|
|
15972
|
+
car: "vehicle",
|
|
15973
|
+
motorcycle: "vehicle",
|
|
15974
|
+
airplane: "vehicle",
|
|
15975
|
+
bus: "vehicle",
|
|
15976
|
+
train: "vehicle",
|
|
15977
|
+
truck: "vehicle",
|
|
15978
|
+
boat: "vehicle",
|
|
15979
|
+
bird: "animal",
|
|
15980
|
+
cat: "animal",
|
|
15981
|
+
dog: "animal",
|
|
15982
|
+
horse: "animal",
|
|
15983
|
+
sheep: "animal",
|
|
15984
|
+
cow: "animal",
|
|
15985
|
+
elephant: "animal",
|
|
15986
|
+
bear: "animal",
|
|
15987
|
+
zebra: "animal",
|
|
15988
|
+
giraffe: "animal",
|
|
15989
|
+
suitcase: "package",
|
|
15990
|
+
backpack: "package",
|
|
15991
|
+
handbag: "package"
|
|
15992
|
+
},
|
|
15993
|
+
preserveOriginal: false
|
|
15994
|
+
};
|
|
15995
|
+
new Set(Object.values(COCO_TO_MACRO.mapping));
|
|
15996
|
+
/**
|
|
15997
|
+
* Run traces — what an automation (or, later, an Action run) DID, node by node,
|
|
15998
|
+
* so the editor can paint every block green or red with its reason.
|
|
15999
|
+
*
|
|
16000
|
+
* A trace is data, not a log: it covers the WHOLE tree — the trigger stage,
|
|
16001
|
+
* every condition node (containers and leaves, including the ones a
|
|
16002
|
+
* short-circuit never reached), the run-mode verdict and every action step —
|
|
16003
|
+
* each addressed by a stable path (`conditions.0.1`, `actions.2`, or `steps.N`
|
|
16004
|
+
* for an Action run). Skipped
|
|
16005
|
+
* evaluations are traced too, and identical consecutive skips collapse into a
|
|
16006
|
+
* repeat count so a trigger that fails every 5 minutes cannot flush real runs.
|
|
16007
|
+
*
|
|
16008
|
+
* {@link AutomationStepTraceSchema} is deliberately free of automation
|
|
16009
|
+
* vocabulary so an Action run records the same step shape.
|
|
16010
|
+
*/
|
|
16011
|
+
/** A value a trace may show: JSON primitives and short lists, nothing deeper. */
|
|
16012
|
+
var TraceValueSchema = union([
|
|
16013
|
+
string(),
|
|
16014
|
+
number(),
|
|
16015
|
+
boolean(),
|
|
16016
|
+
_null(),
|
|
16017
|
+
array(union([string(), number()]))
|
|
16018
|
+
]);
|
|
16019
|
+
var AutomationRunOutcomeSchema = _enum([
|
|
16020
|
+
"ran",
|
|
16021
|
+
"skipped-trigger",
|
|
16022
|
+
"skipped-conditions",
|
|
16023
|
+
"skipped-cooldown",
|
|
16024
|
+
"skipped-overlap",
|
|
16025
|
+
"failed",
|
|
16026
|
+
"aborted"
|
|
16027
|
+
]);
|
|
16028
|
+
/** `not-evaluated` = a short-circuit never reached the node. */
|
|
16029
|
+
var TraceNodeOutcomeSchema = _enum([
|
|
16030
|
+
"pass",
|
|
16031
|
+
"fail",
|
|
16032
|
+
"not-evaluated"
|
|
16033
|
+
]);
|
|
16034
|
+
var AutomationTriggerTraceSchema = object({
|
|
16035
|
+
kind: string().min(1),
|
|
16036
|
+
outcome: _enum(["pass", "fail"]),
|
|
16037
|
+
/** Why an event was rejected ("class person not in [dog]") or what fired. */
|
|
16038
|
+
reason: string(),
|
|
16039
|
+
/** deviceId, className, trackId, score … — only what the trigger exposes. */
|
|
16040
|
+
vars: record(string(), TraceValueSchema)
|
|
16041
|
+
});
|
|
16042
|
+
var AutomationConditionTraceNodeSchema = object({
|
|
16043
|
+
/** `conditions` for the root, `conditions.<i>` for its i-th child, … */
|
|
16044
|
+
path: string().min(1),
|
|
16045
|
+
kind: _enum([
|
|
16046
|
+
"all",
|
|
16047
|
+
"any",
|
|
16048
|
+
"not",
|
|
16049
|
+
"condition",
|
|
16050
|
+
"expression",
|
|
16051
|
+
"stationary-present"
|
|
16052
|
+
]),
|
|
16053
|
+
outcome: TraceNodeOutcomeSchema,
|
|
16054
|
+
reason: string(),
|
|
16055
|
+
deviceId: number().int().optional(),
|
|
16056
|
+
cap: string().optional(),
|
|
16057
|
+
fieldPath: string().optional(),
|
|
16058
|
+
operator: string().optional(),
|
|
16059
|
+
expected: TraceValueSchema.optional(),
|
|
16060
|
+
/** What the mirror held; `null` when it held nothing (unknown). */
|
|
16061
|
+
observed: TraceValueSchema.optional()
|
|
16062
|
+
});
|
|
16063
|
+
var AutomationRunVerdictSchema = object({
|
|
16064
|
+
mode: AutomationRunModeSchema,
|
|
16065
|
+
decision: _enum([
|
|
16066
|
+
"run",
|
|
16067
|
+
"queued",
|
|
16068
|
+
"restart",
|
|
16069
|
+
"drop",
|
|
16070
|
+
"cooldown",
|
|
16071
|
+
"bypass"
|
|
16072
|
+
]),
|
|
16073
|
+
reason: string()
|
|
16074
|
+
});
|
|
16075
|
+
/** One executed (or not-run) step — shared by automations and Action runs. */
|
|
16076
|
+
var AutomationStepTraceSchema = object({
|
|
16077
|
+
/** `actions.<i>` */
|
|
16078
|
+
path: string().min(1),
|
|
16079
|
+
kind: string().min(1),
|
|
16080
|
+
cap: string().optional(),
|
|
16081
|
+
method: string().optional(),
|
|
16082
|
+
deviceId: number().int().optional(),
|
|
16083
|
+
startedAt: number().optional(),
|
|
16084
|
+
endedAt: number().optional(),
|
|
16085
|
+
outcome: _enum([
|
|
16086
|
+
"ok",
|
|
16087
|
+
"error",
|
|
16088
|
+
"not-run"
|
|
16089
|
+
]),
|
|
16090
|
+
message: string().optional()
|
|
16091
|
+
});
|
|
16092
|
+
var AutomationRunTraceSchema = object({
|
|
16093
|
+
runId: string().min(1),
|
|
16094
|
+
startedAt: number(),
|
|
16095
|
+
endedAt: number(),
|
|
16096
|
+
trigger: AutomationTriggerTraceSchema,
|
|
16097
|
+
conditions: array(AutomationConditionTraceNodeSchema),
|
|
16098
|
+
verdict: AutomationRunVerdictSchema.optional(),
|
|
16099
|
+
steps: array(AutomationStepTraceSchema),
|
|
16100
|
+
outcome: AutomationRunOutcomeSchema,
|
|
16101
|
+
/** How many identical consecutive skips this trace stands for (>= 1). */
|
|
16102
|
+
repeat: number().int().min(1),
|
|
16103
|
+
/** When the latest of those repeats happened. */
|
|
16104
|
+
lastAt: number()
|
|
16105
|
+
});
|
|
16106
|
+
/**
|
|
16107
|
+
* What the hub's `runs` ledger holds for one owner (`automation:<blockId>` or
|
|
16108
|
+
* `action:<actionId>`): the cooldown stamp and the trace ring.
|
|
16109
|
+
*/
|
|
16110
|
+
var AutomationStateDocSchema = object({
|
|
16111
|
+
version: literal(1),
|
|
16112
|
+
lastRunStartedAt: number().nullable(),
|
|
16113
|
+
traces: array(AutomationRunTraceSchema)
|
|
16114
|
+
});
|
|
16115
|
+
/**
|
|
16116
|
+
* Actions — named, runnable things an operator (or an automation) can start,
|
|
16117
|
+
* declared as LIST ENTRIES, never as devices.
|
|
16118
|
+
*
|
|
16119
|
+
* An entry is either **internal** (a short list of cap/wait steps kept in the
|
|
16120
|
+
* hub's `actions` record kind) or declared by an addon through the
|
|
16121
|
+
* `action-source` collection (a Home Assistant script, a scene …). The one
|
|
16122
|
+
* surface the UI and automations talk to is the `actions` cap; it keeps no
|
|
16123
|
+
* catalog of its own (D3) — every `list` asks the providers live.
|
|
16124
|
+
*
|
|
16125
|
+
* This file is the data half: the entry schema, the variables an entry may
|
|
16126
|
+
* declare, and the pure resolution of the values a run was given. It holds no
|
|
16127
|
+
* runtime.
|
|
16128
|
+
*/
|
|
16129
|
+
/** What a variable's value is. `select` takes one of `options`. */
|
|
16130
|
+
var ActionVariableTypeSchema = _enum([
|
|
16131
|
+
"string",
|
|
16132
|
+
"number",
|
|
16133
|
+
"boolean",
|
|
16134
|
+
"select"
|
|
16135
|
+
]);
|
|
16136
|
+
var ACTION_VARIABLE_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
16137
|
+
var ActionVariableValueSchema = union([
|
|
16138
|
+
string(),
|
|
16139
|
+
number(),
|
|
16140
|
+
boolean()
|
|
16141
|
+
]);
|
|
16142
|
+
/**
|
|
16143
|
+
* One declared variable. Steps reference it as `{ $var: 'name' }` (the whole
|
|
16144
|
+
* value) or `{{vars.name}}` (inside a string) in their args.
|
|
16145
|
+
*/
|
|
16146
|
+
var ActionVariableSchema = object({
|
|
16147
|
+
name: string().regex(ACTION_VARIABLE_NAME_RE),
|
|
16148
|
+
label: string().min(1).max(120).optional(),
|
|
16149
|
+
type: ActionVariableTypeSchema,
|
|
16150
|
+
required: boolean().optional(),
|
|
16151
|
+
default: ActionVariableValueSchema.optional(),
|
|
16152
|
+
/** The allowed values of a `select`. */
|
|
16153
|
+
options: array(string().min(1)).min(1).optional()
|
|
16154
|
+
}).superRefine((v, ctx) => {
|
|
16155
|
+
if (v.type === "select" && v.options === void 0) ctx.addIssue({
|
|
16156
|
+
code: "custom",
|
|
16157
|
+
message: "a select variable needs options",
|
|
16158
|
+
path: ["options"]
|
|
16159
|
+
});
|
|
16160
|
+
if (v.default !== void 0 && variableValueError(v, v.default) !== null) ctx.addIssue({
|
|
16161
|
+
code: "custom",
|
|
16162
|
+
message: variableValueError(v, v.default) ?? "invalid default",
|
|
16163
|
+
path: ["default"]
|
|
16164
|
+
});
|
|
16165
|
+
});
|
|
16166
|
+
/** Why `value` is not a legal value for the variable, or null when it is. */
|
|
16167
|
+
function variableValueError(variable, value) {
|
|
16168
|
+
switch (variable.type) {
|
|
16169
|
+
case "string": return typeof value === "string" ? null : `variable "${variable.name}" must be a string`;
|
|
16170
|
+
case "number": return typeof value === "number" && Number.isFinite(value) ? null : `variable "${variable.name}" must be a number`;
|
|
16171
|
+
case "boolean": return typeof value === "boolean" ? null : `variable "${variable.name}" must be true or false`;
|
|
16172
|
+
case "select": return typeof value === "string" && (variable.options ?? []).includes(value) ? null : `variable "${variable.name}" must be one of ${(variable.options ?? []).join(", ")}`;
|
|
16173
|
+
}
|
|
16174
|
+
}
|
|
16175
|
+
var ActionSourceKindSchema = _enum(["internal", "addon"]);
|
|
16176
|
+
function isInternalActionId(actionId) {
|
|
16177
|
+
return actionId.startsWith("internal:") && actionId.length > 9;
|
|
16178
|
+
}
|
|
16179
|
+
/** The addon behind a `<addonId>:<localId>` id, or null for anything else (internal included). */
|
|
16180
|
+
function addonIdOfActionId(actionId) {
|
|
16181
|
+
if (isInternalActionId(actionId)) return null;
|
|
16182
|
+
const at = actionId.indexOf(":");
|
|
16183
|
+
return at > 0 && at < actionId.length - 1 ? actionId.slice(0, at) : null;
|
|
16184
|
+
}
|
|
16185
|
+
var ActionStatusSchema = object({
|
|
16186
|
+
isRunning: boolean(),
|
|
16187
|
+
/** Ms epoch the latest run STARTED; null when it never ran. */
|
|
16188
|
+
lastRunAt: number().nullable(),
|
|
16189
|
+
/** The latest run's failure; null on success or when it never ran. */
|
|
16190
|
+
lastError: string().nullable()
|
|
16191
|
+
});
|
|
16192
|
+
var ActionEntrySchema = object({
|
|
16193
|
+
/** `internal:<uuid>` or `<addonId>:<localId>`. */
|
|
16194
|
+
id: string().min(3),
|
|
16195
|
+
name: string().min(1).max(120),
|
|
16196
|
+
/** The addon that declared it; `core-blocks` for an internal one. */
|
|
16197
|
+
addonId: string().min(1),
|
|
16198
|
+
source: ActionSourceKindSchema,
|
|
16199
|
+
/** An addon-declared entry is edited where it was declared. */
|
|
16200
|
+
readOnly: boolean(),
|
|
16201
|
+
/** Internal only: cap and wait steps. No action-in-action, so no cycles. */
|
|
16202
|
+
steps: array(ActionStepSchema).min(1).max(50).optional(),
|
|
16203
|
+
variables: array(ActionVariableSchema).max(20).optional(),
|
|
16204
|
+
status: ActionStatusSchema
|
|
16205
|
+
}).superRefine((entry, ctx) => {
|
|
16206
|
+
if (entry.source === "internal") {
|
|
16207
|
+
if (!isInternalActionId(entry.id)) ctx.addIssue({
|
|
16208
|
+
code: "custom",
|
|
16209
|
+
message: "an internal action id is internal:<uuid>",
|
|
16210
|
+
path: ["id"]
|
|
16211
|
+
});
|
|
16212
|
+
return;
|
|
16213
|
+
}
|
|
16214
|
+
if (entry.steps !== void 0) ctx.addIssue({
|
|
16215
|
+
code: "custom",
|
|
16216
|
+
message: "only an internal action carries steps",
|
|
16217
|
+
path: ["steps"]
|
|
16218
|
+
});
|
|
16219
|
+
if (!entry.readOnly) ctx.addIssue({
|
|
16220
|
+
code: "custom",
|
|
16221
|
+
message: "an addon action is read-only here",
|
|
16222
|
+
path: ["readOnly"]
|
|
16223
|
+
});
|
|
16224
|
+
if (addonIdOfActionId(entry.id) === null) ctx.addIssue({
|
|
16225
|
+
code: "custom",
|
|
16226
|
+
message: "an addon action id is <addonId>:<localId>",
|
|
16227
|
+
path: ["id"]
|
|
16228
|
+
});
|
|
16229
|
+
});
|
|
16230
|
+
/** What an operator writes for an internal action. */
|
|
16231
|
+
var ActionInputSchema = object({
|
|
16232
|
+
name: string().min(1).max(120),
|
|
16233
|
+
steps: array(ActionStepSchema).min(1).max(50),
|
|
16234
|
+
variables: array(ActionVariableSchema).max(20).optional()
|
|
16235
|
+
});
|
|
16236
|
+
/** Who started a run. Absent = the operator pressed it. */
|
|
16237
|
+
var ActionRunOriginSchema = object({
|
|
16238
|
+
/** The automation block whose step started it. */
|
|
16239
|
+
blockId: string().min(1).optional() });
|
|
16240
|
+
/** `started` = the caller did not ask to wait. */
|
|
16241
|
+
var ActionRunOutcomeSchema = union([AutomationRunOutcomeSchema, literal("started")]);
|
|
16242
|
+
var ActionRunResultSchema = object({
|
|
16243
|
+
runId: string().min(1),
|
|
16244
|
+
outcome: ActionRunOutcomeSchema,
|
|
16245
|
+
/** Why it did not run, or what failed. */
|
|
16246
|
+
message: string().optional()
|
|
16247
|
+
});
|
|
16248
|
+
_enum([
|
|
16249
|
+
"not-found",
|
|
16250
|
+
"read-only",
|
|
16251
|
+
"invalid-variables",
|
|
16252
|
+
"invalid-steps",
|
|
16253
|
+
"not-linked",
|
|
16254
|
+
"busy"
|
|
16255
|
+
]);
|
|
16256
|
+
object({
|
|
16257
|
+
actionId: string(),
|
|
16258
|
+
runId: string(),
|
|
16259
|
+
isRunning: boolean(),
|
|
16260
|
+
/** Set when the run ended. */
|
|
16261
|
+
outcome: AutomationRunOutcomeSchema.optional(),
|
|
16262
|
+
lastRunAt: number().nullable(),
|
|
16263
|
+
lastError: string().nullable()
|
|
15847
16264
|
});
|
|
15848
16265
|
/**
|
|
15849
16266
|
* `addon-pages` — system-scoped singleton aggregator cap. Public-facing
|
|
@@ -18530,7 +18947,7 @@ var CompositionEventPlanSchema = object({
|
|
|
18530
18947
|
stateField: string(),
|
|
18531
18948
|
fieldKey: string()
|
|
18532
18949
|
});
|
|
18533
|
-
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.
|
|
18950
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
|
|
18534
18951
|
var CompositionProblemSchema = object({
|
|
18535
18952
|
code: _enum([
|
|
18536
18953
|
"reserved-variant",
|
|
@@ -18849,7 +19266,7 @@ var GROUP_TEMPLATES = [
|
|
|
18849
19266
|
summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
|
|
18850
19267
|
role: DeviceRole.TemperatureSensor,
|
|
18851
19268
|
outputCap: "temperature-sensor",
|
|
18852
|
-
outputField: "
|
|
19269
|
+
outputField: "temperature",
|
|
18853
19270
|
quantity: "temperature",
|
|
18854
19271
|
defaultAggregate: "mean",
|
|
18855
19272
|
empty: "null",
|
|
@@ -18860,7 +19277,7 @@ var GROUP_TEMPLATES = [
|
|
|
18860
19277
|
summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
18861
19278
|
role: DeviceRole.HumiditySensor,
|
|
18862
19279
|
outputCap: "humidity-sensor",
|
|
18863
|
-
outputField: "
|
|
19280
|
+
outputField: "humidity",
|
|
18864
19281
|
quantity: "humidity",
|
|
18865
19282
|
defaultAggregate: "mean",
|
|
18866
19283
|
empty: "null",
|
|
@@ -18871,7 +19288,7 @@ var GROUP_TEMPLATES = [
|
|
|
18871
19288
|
summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
|
|
18872
19289
|
role: DeviceRole.PressureSensor,
|
|
18873
19290
|
outputCap: "pressure-sensor",
|
|
18874
|
-
outputField: "
|
|
19291
|
+
outputField: "pressure",
|
|
18875
19292
|
quantity: "pressure",
|
|
18876
19293
|
defaultAggregate: "mean",
|
|
18877
19294
|
empty: "null",
|
|
@@ -18882,7 +19299,7 @@ var GROUP_TEMPLATES = [
|
|
|
18882
19299
|
summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
|
|
18883
19300
|
role: DeviceRole.AmbientLightSensor,
|
|
18884
19301
|
outputCap: "ambient-light-sensor",
|
|
18885
|
-
outputField: "
|
|
19302
|
+
outputField: "illuminance",
|
|
18886
19303
|
quantity: "illuminance",
|
|
18887
19304
|
defaultAggregate: "mean",
|
|
18888
19305
|
empty: "null",
|
|
@@ -18893,7 +19310,7 @@ var GROUP_TEMPLATES = [
|
|
|
18893
19310
|
summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
|
|
18894
19311
|
role: DeviceRole.PowerSensor,
|
|
18895
19312
|
outputCap: "power-meter",
|
|
18896
|
-
outputField: "
|
|
19313
|
+
outputField: "power",
|
|
18897
19314
|
quantity: "power",
|
|
18898
19315
|
defaultAggregate: "sum",
|
|
18899
19316
|
empty: "omit",
|
|
@@ -18904,7 +19321,7 @@ var GROUP_TEMPLATES = [
|
|
|
18904
19321
|
summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
|
|
18905
19322
|
role: DeviceRole.EnergySensor,
|
|
18906
19323
|
outputCap: "power-meter",
|
|
18907
|
-
outputField: "
|
|
19324
|
+
outputField: "energy",
|
|
18908
19325
|
quantity: "energy",
|
|
18909
19326
|
defaultAggregate: "sum",
|
|
18910
19327
|
empty: "omit",
|
|
@@ -18915,7 +19332,7 @@ var GROUP_TEMPLATES = [
|
|
|
18915
19332
|
summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
18916
19333
|
role: DeviceRole.BatterySensor,
|
|
18917
19334
|
outputCap: "battery",
|
|
18918
|
-
outputField: "
|
|
19335
|
+
outputField: "level",
|
|
18919
19336
|
quantity: "percentage",
|
|
18920
19337
|
defaultAggregate: "mean",
|
|
18921
19338
|
empty: "null",
|
|
@@ -19493,7 +19910,18 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
19493
19910
|
kind: "mutation",
|
|
19494
19911
|
auth: "admin",
|
|
19495
19912
|
access: "view"
|
|
19496
|
-
})
|
|
19913
|
+
}), method(object({
|
|
19914
|
+
blockId: string().min(1),
|
|
19915
|
+
trace: AutomationRunTraceSchema.optional(),
|
|
19916
|
+
runStartedAt: number().optional(),
|
|
19917
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
19918
|
+
}), _void(), {
|
|
19919
|
+
kind: "mutation",
|
|
19920
|
+
auth: "admin"
|
|
19921
|
+
}), method(object({ blockId: string().min(1) }), AutomationStateDocSchema, { auth: "admin" }), method(object({ blockId: string().min(1) }), object({
|
|
19922
|
+
traces: array(AutomationRunTraceSchema),
|
|
19923
|
+
lastError: string().nullable()
|
|
19924
|
+
}), { auth: "admin" });
|
|
19497
19925
|
/**
|
|
19498
19926
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
19499
19927
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -44910,51 +45338,6 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
|
|
|
44910
45338
|
kind: "mutation",
|
|
44911
45339
|
auth: "admin"
|
|
44912
45340
|
});
|
|
44913
|
-
new Set([
|
|
44914
|
-
{
|
|
44915
|
-
id: "person",
|
|
44916
|
-
name: "Person"
|
|
44917
|
-
},
|
|
44918
|
-
{
|
|
44919
|
-
id: "vehicle",
|
|
44920
|
-
name: "Vehicle"
|
|
44921
|
-
},
|
|
44922
|
-
{
|
|
44923
|
-
id: "animal",
|
|
44924
|
-
name: "Animal"
|
|
44925
|
-
},
|
|
44926
|
-
{
|
|
44927
|
-
id: "package",
|
|
44928
|
-
name: "Package"
|
|
44929
|
-
}
|
|
44930
|
-
].map((l) => l.id));
|
|
44931
|
-
var COCO_TO_MACRO = {
|
|
44932
|
-
mapping: {
|
|
44933
|
-
person: "person",
|
|
44934
|
-
bicycle: "vehicle",
|
|
44935
|
-
car: "vehicle",
|
|
44936
|
-
motorcycle: "vehicle",
|
|
44937
|
-
airplane: "vehicle",
|
|
44938
|
-
bus: "vehicle",
|
|
44939
|
-
train: "vehicle",
|
|
44940
|
-
truck: "vehicle",
|
|
44941
|
-
boat: "vehicle",
|
|
44942
|
-
bird: "animal",
|
|
44943
|
-
cat: "animal",
|
|
44944
|
-
dog: "animal",
|
|
44945
|
-
horse: "animal",
|
|
44946
|
-
sheep: "animal",
|
|
44947
|
-
cow: "animal",
|
|
44948
|
-
elephant: "animal",
|
|
44949
|
-
bear: "animal",
|
|
44950
|
-
zebra: "animal",
|
|
44951
|
-
giraffe: "animal",
|
|
44952
|
-
suitcase: "package",
|
|
44953
|
-
backpack: "package",
|
|
44954
|
-
handbag: "package"
|
|
44955
|
-
},
|
|
44956
|
-
preserveOriginal: false
|
|
44957
|
-
};
|
|
44958
45341
|
var AUDIO_MACRO_LABELS = [
|
|
44959
45342
|
{
|
|
44960
45343
|
id: "speech",
|
|
@@ -58043,9 +58426,9 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
|
|
|
58043
58426
|
*/
|
|
58044
58427
|
var AirQualitySensorStatusSchema = object({
|
|
58045
58428
|
/** Carbon dioxide concentration in ppm. */
|
|
58046
|
-
|
|
58429
|
+
co2: number().min(0).optional().meta(readingMeta("concentration-volume")),
|
|
58047
58430
|
/** Total volatile organic compounds in ppb. */
|
|
58048
|
-
|
|
58431
|
+
voc: number().min(0).optional().meta(readingMeta("concentration-ppb")),
|
|
58049
58432
|
/** Particulate matter ≤ 2.5 μm in µg/m³. */
|
|
58050
58433
|
pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
|
|
58051
58434
|
/** Particulate matter ≤ 10 μm in µg/m³. */
|
|
@@ -58078,12 +58461,12 @@ var airQualitySensorCapability = {
|
|
|
58078
58461
|
* History (D850): recorded series.
|
|
58079
58462
|
*/
|
|
58080
58463
|
history: { fields: {
|
|
58081
|
-
|
|
58464
|
+
co2: {
|
|
58082
58465
|
kind: "gauge",
|
|
58083
58466
|
unit: "ppm",
|
|
58084
58467
|
deadband: 5
|
|
58085
58468
|
},
|
|
58086
|
-
|
|
58469
|
+
voc: {
|
|
58087
58470
|
kind: "gauge",
|
|
58088
58471
|
unit: "ppb",
|
|
58089
58472
|
deadband: 5
|
|
@@ -58114,7 +58497,7 @@ var airQualitySensorCapability = {
|
|
|
58114
58497
|
*/
|
|
58115
58498
|
var AmbientLightSensorStatusSchema = object({
|
|
58116
58499
|
/** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
|
|
58117
|
-
|
|
58500
|
+
illuminance: number().min(0).nullable().meta(readingMeta("illuminance", {
|
|
58118
58501
|
precision: 0,
|
|
58119
58502
|
label: "Illuminance"
|
|
58120
58503
|
})),
|
|
@@ -58143,7 +58526,7 @@ var ambientLightSensorCapability = {
|
|
|
58143
58526
|
/**
|
|
58144
58527
|
* History (D850): recorded series. Wide range, so a RELATIVE deadband (10 %).
|
|
58145
58528
|
*/
|
|
58146
|
-
history: { fields: {
|
|
58529
|
+
history: { fields: { illuminance: {
|
|
58147
58530
|
kind: "gauge",
|
|
58148
58531
|
unit: "lx",
|
|
58149
58532
|
deadbandPct: 10,
|
|
@@ -58282,6 +58665,84 @@ var audioMetricsCapability = {
|
|
|
58282
58665
|
*/
|
|
58283
58666
|
history: "none"
|
|
58284
58667
|
};
|
|
58668
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
58669
|
+
actionId: string().min(1),
|
|
58670
|
+
variables: record(string(), ActionVariableValueSchema).optional()
|
|
58671
|
+
}), _void(), {
|
|
58672
|
+
kind: "mutation",
|
|
58673
|
+
auth: "admin"
|
|
58674
|
+
}), method(object({ actionId: string().min(1) }), _void(), {
|
|
58675
|
+
kind: "mutation",
|
|
58676
|
+
auth: "admin"
|
|
58677
|
+
});
|
|
58678
|
+
/**
|
|
58679
|
+
* actions — the ONE surface for runnable actions, for the UI and for
|
|
58680
|
+
* automations. Provided by the core-blocks builtin on the hub.
|
|
58681
|
+
*
|
|
58682
|
+
* An action is a LIST ENTRY, not a device (D883): either internal (cap and wait
|
|
58683
|
+
* steps, kept in the hub's `actions` record kind) or declared by an addon over
|
|
58684
|
+
* `action-source`. `list` asks every `action-source` provider LIVE and overlays
|
|
58685
|
+
* the run status from the hub's `runs` ledger; there is no catalog here to
|
|
58686
|
+
* drift (D3).
|
|
58687
|
+
*
|
|
58688
|
+
* **Permissions follow the camera, as linked devices do.** An action is linked
|
|
58689
|
+
* to cameras by the operator (`setLinks`, D356: nothing links itself). A
|
|
58690
|
+
* non-admin may `get` / `run` an action only through a camera they may see that
|
|
58691
|
+
* links it: they name the camera (`deviceId`, a top-level field so the scope
|
|
58692
|
+
* gate sees it) and the provider refuses an action that camera does not link.
|
|
58693
|
+
* An admin, and an in-process caller (an automation block), may run any action.
|
|
58694
|
+
* Every refusal is typed (`[not-linked] …`) and logged.
|
|
58695
|
+
*
|
|
58696
|
+
* A second `run` of an action that is already running is REFUSED — traced and
|
|
58697
|
+
* logged — never queued.
|
|
58698
|
+
*/
|
|
58699
|
+
var ActionIdInput = object({ actionId: string().min(1) });
|
|
58700
|
+
var ActionLinksSchema = object({
|
|
58701
|
+
deviceId: number().int().nonnegative(),
|
|
58702
|
+
actionIds: array(string().min(1)).max(100)
|
|
58703
|
+
});
|
|
58704
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
58705
|
+
actionId: string().min(1),
|
|
58706
|
+
deviceId: number().int().nonnegative().optional()
|
|
58707
|
+
}), object({ action: ActionEntrySchema.nullable() }), {
|
|
58708
|
+
role: "viewer",
|
|
58709
|
+
auth: "protected",
|
|
58710
|
+
kind: "query",
|
|
58711
|
+
caller: "required"
|
|
58712
|
+
}), method(object({
|
|
58713
|
+
actionId: string().min(1),
|
|
58714
|
+
variables: record(string(), ActionVariableValueSchema).optional(),
|
|
58715
|
+
wait: boolean().optional(),
|
|
58716
|
+
origin: ActionRunOriginSchema.optional(),
|
|
58717
|
+
deviceId: number().int().nonnegative().optional()
|
|
58718
|
+
}), ActionRunResultSchema, {
|
|
58719
|
+
role: "viewer",
|
|
58720
|
+
auth: "protected",
|
|
58721
|
+
kind: "mutation",
|
|
58722
|
+
caller: "required"
|
|
58723
|
+
}), method(ActionIdInput, _void(), {
|
|
58724
|
+
kind: "mutation",
|
|
58725
|
+
auth: "admin"
|
|
58726
|
+
}), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({ action: ActionEntrySchema }), {
|
|
58727
|
+
kind: "mutation",
|
|
58728
|
+
auth: "admin"
|
|
58729
|
+
}), method(object({
|
|
58730
|
+
actionId: string().min(1),
|
|
58731
|
+
action: ActionInputSchema.partial()
|
|
58732
|
+
}), object({ action: ActionEntrySchema }), {
|
|
58733
|
+
kind: "mutation",
|
|
58734
|
+
auth: "admin"
|
|
58735
|
+
}), method(ActionIdInput, _void(), {
|
|
58736
|
+
kind: "mutation",
|
|
58737
|
+
auth: "admin"
|
|
58738
|
+
}), method(object({ deviceId: number().int().nonnegative() }), array(ActionEntrySchema), {
|
|
58739
|
+
role: "viewer",
|
|
58740
|
+
auth: "protected",
|
|
58741
|
+
kind: "query"
|
|
58742
|
+
}), method(object({ deviceId: number().int().nonnegative() }), ActionLinksSchema, { auth: "admin" }), method(ActionLinksSchema, ActionLinksSchema, {
|
|
58743
|
+
kind: "mutation",
|
|
58744
|
+
auth: "admin"
|
|
58745
|
+
});
|
|
58285
58746
|
/**
|
|
58286
58747
|
* Automation-control cap. Models HA `automation.*` entities on
|
|
58287
58748
|
* `DeviceType.Automation`. An automation is a trigger+condition+
|
|
@@ -58378,7 +58839,7 @@ var BatteryStatusSchema = object({
|
|
|
58378
58839
|
* Consumers must SKIP a null rather than coerce it — `battery-band` already
|
|
58379
58840
|
* declines to band a non-finite reading, which is the correct shape.
|
|
58380
58841
|
*/
|
|
58381
|
-
|
|
58842
|
+
level: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
|
|
58382
58843
|
/**
|
|
58383
58844
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
58384
58845
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
@@ -58388,7 +58849,7 @@ var BatteryStatusSchema = object({
|
|
|
58388
58849
|
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
58389
58850
|
* power fields yet, or the firmware reported neither. Before it existed,
|
|
58390
58851
|
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
58391
|
-
* was drawn "on battery alone" — the same D315 defect `
|
|
58852
|
+
* was drawn "on battery alone" — the same D315 defect `level` closed
|
|
58392
58853
|
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
58393
58854
|
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
58394
58855
|
*/
|
|
@@ -58412,7 +58873,7 @@ var BatteryStatusSchema = object({
|
|
|
58412
58873
|
* that only report charge. A second reading on this cap, not a second
|
|
58413
58874
|
* `numeric-sensor` on the same device.
|
|
58414
58875
|
*/
|
|
58415
|
-
|
|
58876
|
+
voltage: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
58416
58877
|
/**
|
|
58417
58878
|
* Ms epoch of the last time the device PROVED it was reachable — a
|
|
58418
58879
|
* completed firmware round-trip, an observed wake, or an inbound push
|
|
@@ -58446,7 +58907,7 @@ var BatteryStatusSchema = object({
|
|
|
58446
58907
|
/**
|
|
58447
58908
|
* True when the source is a BINARY low-battery indicator (HA
|
|
58448
58909
|
* `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
|
|
58449
|
-
* charge level — `
|
|
58910
|
+
* charge level — `level` is then a coarse stand-in (100 = normal,
|
|
58450
58911
|
* sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
|
|
58451
58912
|
* misleading exact percentage. Absent/false → genuine 0–100 % reading.
|
|
58452
58913
|
*/
|
|
@@ -58466,15 +58927,15 @@ var BATTERY_DEVICE_TYPES = [
|
|
|
58466
58927
|
var batteryCustomize = {
|
|
58467
58928
|
version: 1,
|
|
58468
58929
|
targets: [{
|
|
58469
|
-
id: "
|
|
58930
|
+
id: "level",
|
|
58470
58931
|
cardinality: "scalar",
|
|
58471
58932
|
vocabulary: {
|
|
58472
58933
|
cap: "battery",
|
|
58473
|
-
stateField: "
|
|
58934
|
+
stateField: "level"
|
|
58474
58935
|
},
|
|
58475
58936
|
deviceTypes: BATTERY_DEVICE_TYPES,
|
|
58476
58937
|
apply: "add",
|
|
58477
|
-
path: "
|
|
58938
|
+
path: "level",
|
|
58478
58939
|
sources: [{
|
|
58479
58940
|
kind: "field",
|
|
58480
58941
|
valueKinds: ["number", "string"],
|
|
@@ -58568,7 +59029,7 @@ onStatusChanged: { data: object({
|
|
|
58568
59029
|
schema: BatteryStatusSchema,
|
|
58569
59030
|
kind: "push",
|
|
58570
59031
|
empty: {
|
|
58571
|
-
|
|
59032
|
+
level: null,
|
|
58572
59033
|
charging: "unknown",
|
|
58573
59034
|
sleeping: false,
|
|
58574
59035
|
lastUpdated: 0
|
|
@@ -58595,11 +59056,11 @@ onStatusChanged: { data: object({
|
|
|
58595
59056
|
* History (D850): recorded series. The generic capture replaces the `battery` series of `pipeline-analytics:stats-5m`.
|
|
58596
59057
|
*/
|
|
58597
59058
|
history: { fields: {
|
|
58598
|
-
|
|
59059
|
+
level: {
|
|
58599
59060
|
kind: "gauge",
|
|
58600
59061
|
unit: "%"
|
|
58601
59062
|
},
|
|
58602
|
-
|
|
59063
|
+
voltage: {
|
|
58603
59064
|
kind: "gauge",
|
|
58604
59065
|
unit: "V"
|
|
58605
59066
|
}
|
|
@@ -58659,14 +59120,14 @@ var binaryCapability = {
|
|
|
58659
59120
|
* controls to this single-method surface.
|
|
58660
59121
|
*
|
|
58661
59122
|
* The cap is intentionally minimal: a single `setBrightness({deviceId,
|
|
58662
|
-
*
|
|
59123
|
+
* level})` mutation plus the auto-injected `getStatus`. Drivers
|
|
58663
59124
|
* that expose richer controls (color temperature, scenes, schedules)
|
|
58664
59125
|
* should surface those via the device's `getSettingsUISchema()`
|
|
58665
59126
|
* instead of bloating this cap.
|
|
58666
59127
|
*/
|
|
58667
59128
|
var BrightnessStatusSchema = object({
|
|
58668
59129
|
/** Current level as 0..100 inclusive. Firmware-reported. */
|
|
58669
|
-
|
|
59130
|
+
level: number().min(0).max(100).meta(readingMeta("percentage")),
|
|
58670
59131
|
/** Ms epoch of the last operator-driven change. Useful for UI freshness. */
|
|
58671
59132
|
lastChangedAt: number()
|
|
58672
59133
|
});
|
|
@@ -58678,7 +59139,7 @@ var brightnessCapability = {
|
|
|
58678
59139
|
deviceTypes: [DeviceType.Light],
|
|
58679
59140
|
methods: { setBrightness: method(object({
|
|
58680
59141
|
deviceId: number().int().nonnegative(),
|
|
58681
|
-
|
|
59142
|
+
level: number().min(0).max(100)
|
|
58682
59143
|
}), _void(), {
|
|
58683
59144
|
kind: "mutation",
|
|
58684
59145
|
auth: "protected"
|
|
@@ -58691,7 +59152,7 @@ var brightnessCapability = {
|
|
|
58691
59152
|
*/
|
|
58692
59153
|
onBrightnessChanged: { data: object({
|
|
58693
59154
|
deviceId: number(),
|
|
58694
|
-
|
|
59155
|
+
level: number().min(0).max(100),
|
|
58695
59156
|
lastChangedAt: number()
|
|
58696
59157
|
}) } },
|
|
58697
59158
|
status: {
|
|
@@ -58714,7 +59175,7 @@ onBrightnessChanged: { data: object({
|
|
|
58714
59175
|
/**
|
|
58715
59176
|
* History (D850): recorded series. Actuator tier: level keeps every change.
|
|
58716
59177
|
*/
|
|
58717
|
-
history: { fields: {
|
|
59178
|
+
history: { fields: { level: {
|
|
58718
59179
|
kind: "gauge",
|
|
58719
59180
|
unit: "%",
|
|
58720
59181
|
minIntervalMs: 0
|
|
@@ -59311,11 +59772,11 @@ var ColorInputSchema = discriminatedUnion("mode", [
|
|
|
59311
59772
|
}),
|
|
59312
59773
|
object({
|
|
59313
59774
|
mode: literal("mired"),
|
|
59314
|
-
|
|
59775
|
+
colorTemperature: number().int().min(50).max(1e3)
|
|
59315
59776
|
})
|
|
59316
59777
|
]);
|
|
59317
59778
|
var ColorStatusSchema = object({
|
|
59318
|
-
/** Active color mode — which of `rgb` / `hsv` / `
|
|
59779
|
+
/** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
|
|
59319
59780
|
* the bulb's current state. */
|
|
59320
59781
|
mode: _enum([
|
|
59321
59782
|
"rgb",
|
|
@@ -59327,7 +59788,7 @@ var ColorStatusSchema = object({
|
|
|
59327
59788
|
/** Populated when `mode === 'hsv'`. */
|
|
59328
59789
|
hsv: HsvTripletSchema.optional(),
|
|
59329
59790
|
/** Populated when `mode === 'mired'`. */
|
|
59330
|
-
|
|
59791
|
+
colorTemperature: number().int().optional().meta(readingMeta("colour-temperature")),
|
|
59331
59792
|
/** Ms epoch of the last operator-driven change. */
|
|
59332
59793
|
lastChangedAt: number()
|
|
59333
59794
|
});
|
|
@@ -59359,7 +59820,7 @@ onColorChanged: { data: object({
|
|
|
59359
59820
|
]),
|
|
59360
59821
|
rgb: RgbTripletSchema.optional(),
|
|
59361
59822
|
hsv: HsvTripletSchema.optional(),
|
|
59362
|
-
|
|
59823
|
+
colorTemperature: number().int().optional(),
|
|
59363
59824
|
lastChangedAt: number()
|
|
59364
59825
|
}) } },
|
|
59365
59826
|
status: {
|
|
@@ -60236,11 +60697,11 @@ var DishwasherStatusSchema = object({
|
|
|
60236
60697
|
/** Feature keys of the programs the appliance currently offers — drives the UI selector. */
|
|
60237
60698
|
availablePrograms: array(string()),
|
|
60238
60699
|
/** Seconds remaining on the active cycle, or null when not running / not known. */
|
|
60239
|
-
|
|
60700
|
+
remaining: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
60240
60701
|
/** Seconds the delayed start is set to (time until the cycle starts), or null. */
|
|
60241
|
-
|
|
60702
|
+
delayedStart: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
60242
60703
|
/** Cycle completion 0..100, or null when not applicable. */
|
|
60243
|
-
|
|
60704
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
60244
60705
|
/** True when the door is reported open; null when the door state is not known. */
|
|
60245
60706
|
doorOpen: boolean().nullable(),
|
|
60246
60707
|
/** True when the door is latched (locked) during a cycle; null when not reported. */
|
|
@@ -60459,14 +60920,14 @@ var dishwasherCapability = {
|
|
|
60459
60920
|
runtimeState: DishwasherStatusSchema,
|
|
60460
60921
|
durability: "session",
|
|
60461
60922
|
history: { fields: {
|
|
60462
|
-
|
|
60923
|
+
progress: {
|
|
60463
60924
|
kind: "gauge",
|
|
60464
60925
|
unit: "%",
|
|
60465
60926
|
deadband: 2
|
|
60466
60927
|
},
|
|
60467
60928
|
state: { kind: "enum" },
|
|
60468
60929
|
operationState: { kind: "enum" },
|
|
60469
|
-
|
|
60930
|
+
remaining: {
|
|
60470
60931
|
kind: "gauge",
|
|
60471
60932
|
unit: "s",
|
|
60472
60933
|
minIntervalMs: 6e4
|
|
@@ -61057,7 +61518,7 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
|
|
|
61057
61518
|
var FanControlStatusSchema = object({
|
|
61058
61519
|
/** Active speed as 0..100 inclusive. Null when the device has no
|
|
61059
61520
|
* speed surface (single-speed fan). */
|
|
61060
|
-
|
|
61521
|
+
speed: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
61061
61522
|
/** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
|
|
61062
61523
|
* a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
|
|
61063
61524
|
percentageStep: number().positive().optional().meta(readingMeta("percentage")),
|
|
@@ -61084,7 +61545,7 @@ var fanControlCapability = {
|
|
|
61084
61545
|
methods: {
|
|
61085
61546
|
setPercentage: method(object({
|
|
61086
61547
|
deviceId: number().int().nonnegative(),
|
|
61087
|
-
|
|
61548
|
+
speed: number().min(0).max(100)
|
|
61088
61549
|
}), _void(), {
|
|
61089
61550
|
kind: "mutation",
|
|
61090
61551
|
auth: "protected"
|
|
@@ -61117,7 +61578,7 @@ var fanControlCapability = {
|
|
|
61117
61578
|
},
|
|
61118
61579
|
/**
|
|
61119
61580
|
* Runtime-state slice — mirrored by the kernel. UI fan speed
|
|
61120
|
-
* sliders read `
|
|
61581
|
+
* sliders read `speed` for live updates.
|
|
61121
61582
|
*/
|
|
61122
61583
|
runtimeState: FanControlStatusSchema,
|
|
61123
61584
|
/**
|
|
@@ -61131,7 +61592,7 @@ var fanControlCapability = {
|
|
|
61131
61592
|
* History (D850): recorded series. Actuator tier: speed keeps every change.
|
|
61132
61593
|
*/
|
|
61133
61594
|
history: { fields: {
|
|
61134
|
-
|
|
61595
|
+
speed: {
|
|
61135
61596
|
kind: "gauge",
|
|
61136
61597
|
unit: "%",
|
|
61137
61598
|
minIntervalMs: 0
|
|
@@ -61576,7 +62037,7 @@ var humidifierCapability = {
|
|
|
61576
62037
|
*/
|
|
61577
62038
|
var HumiditySensorStatusSchema = object({
|
|
61578
62039
|
/** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
|
|
61579
|
-
|
|
62040
|
+
humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
|
|
61580
62041
|
precision: 0,
|
|
61581
62042
|
label: "Humidity"
|
|
61582
62043
|
})),
|
|
@@ -61605,7 +62066,7 @@ var humiditySensorCapability = {
|
|
|
61605
62066
|
/**
|
|
61606
62067
|
* History (D850): recorded series.
|
|
61607
62068
|
*/
|
|
61608
|
-
history: { fields: {
|
|
62069
|
+
history: { fields: { humidity: {
|
|
61609
62070
|
kind: "gauge",
|
|
61610
62071
|
unit: "%",
|
|
61611
62072
|
deadband: .5
|
|
@@ -62245,7 +62706,7 @@ var LawnMowerControlStatusSchema = object({
|
|
|
62245
62706
|
batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
62246
62707
|
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
62247
62708
|
* task is active / progress is unavailable. */
|
|
62248
|
-
|
|
62709
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
62249
62710
|
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
62250
62711
|
* or null when unknown. */
|
|
62251
62712
|
currentCode: number().nullable().meta(readingMeta("none")),
|
|
@@ -62745,7 +63206,7 @@ var lockControlCapability = {
|
|
|
62745
63206
|
volatileStateFields: ["lastChangedAt"]
|
|
62746
63207
|
};
|
|
62747
63208
|
/**
|
|
62748
|
-
* A monotonic total between resets (D944). Energy uses `power-meter.
|
|
63209
|
+
* A monotonic total between resets (D944). Energy uses `power-meter.energy`
|
|
62749
63210
|
* so dashboards keep one series; every other instantaneous reading lands here.
|
|
62750
63211
|
* `value` is the time integral in the source quantity's accumulated base
|
|
62751
63212
|
* (base-unit seconds, or kWh on the power meter). `null` is a gap, never zero.
|
|
@@ -62839,10 +63300,10 @@ var MediaPlayerStatusSchema = object({
|
|
|
62839
63300
|
currentMedia: MediaInfoSchema.nullable(),
|
|
62840
63301
|
/** Current playback position in ms. Null when not seekable or
|
|
62841
63302
|
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
62842
|
-
|
|
63303
|
+
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
62843
63304
|
/** Total duration of the current media in ms. Null when unknown
|
|
62844
63305
|
* (live stream) or nothing is playing. */
|
|
62845
|
-
|
|
63306
|
+
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
62846
63307
|
/** Shuffle toggle. Null when no shuffle surface.
|
|
62847
63308
|
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
62848
63309
|
shuffle: boolean().nullable(),
|
|
@@ -62881,7 +63342,7 @@ var mediaPlayerCapability = {
|
|
|
62881
63342
|
}),
|
|
62882
63343
|
seek: method(object({
|
|
62883
63344
|
deviceId: number().int().nonnegative(),
|
|
62884
|
-
|
|
63345
|
+
position: number().int().nonnegative()
|
|
62885
63346
|
}), _void(), {
|
|
62886
63347
|
kind: "mutation",
|
|
62887
63348
|
auth: "protected"
|
|
@@ -62953,7 +63414,7 @@ var mediaPlayerCapability = {
|
|
|
62953
63414
|
/**
|
|
62954
63415
|
* History (D850): volume (a level an operator or an automation sets; the
|
|
62955
63416
|
* default 10 s floor folds a slider drag into its end value) and mute.
|
|
62956
|
-
* `
|
|
63417
|
+
* `position` is not recorded: it moves continuously while playing.
|
|
62957
63418
|
*/
|
|
62958
63419
|
history: { fields: {
|
|
62959
63420
|
volumeLevel: {
|
|
@@ -63915,9 +64376,9 @@ var NetworkLinkStatusSchema = object({
|
|
|
63915
64376
|
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
63916
64377
|
* SKIP a null rather than coerce it.
|
|
63917
64378
|
*/
|
|
63918
|
-
|
|
64379
|
+
signal: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
63919
64380
|
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
63920
|
-
|
|
64381
|
+
rssi: number().optional().meta(readingMeta("signal-level")),
|
|
63921
64382
|
/** Network name of a wireless link, when the firmware reports it. */
|
|
63922
64383
|
ssid: string().optional(),
|
|
63923
64384
|
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
@@ -63953,7 +64414,7 @@ onStatusChanged: { data: object({
|
|
|
63953
64414
|
kind: "push",
|
|
63954
64415
|
empty: {
|
|
63955
64416
|
type: "unknown",
|
|
63956
|
-
|
|
64417
|
+
signal: null,
|
|
63957
64418
|
lastUpdated: 0
|
|
63958
64419
|
}
|
|
63959
64420
|
},
|
|
@@ -63976,13 +64437,13 @@ onStatusChanged: { data: object({
|
|
|
63976
64437
|
* History (D850): recorded series.
|
|
63977
64438
|
*/
|
|
63978
64439
|
history: { fields: {
|
|
63979
|
-
|
|
64440
|
+
signal: {
|
|
63980
64441
|
kind: "gauge",
|
|
63981
64442
|
unit: "%",
|
|
63982
64443
|
deadband: 3,
|
|
63983
64444
|
minIntervalMs: 6e4
|
|
63984
64445
|
},
|
|
63985
|
-
|
|
64446
|
+
rssi: {
|
|
63986
64447
|
kind: "gauge",
|
|
63987
64448
|
unit: "dBm",
|
|
63988
64449
|
deadband: 2,
|
|
@@ -64773,10 +65234,20 @@ var PetFeederDeviceStatusSchema = _enum([
|
|
|
64773
65234
|
]);
|
|
64774
65235
|
var gramsPortion = number().int().min(4).max(200);
|
|
64775
65236
|
var PetFeederStatusSchema = object({
|
|
64776
|
-
/** Food
|
|
64777
|
-
*
|
|
64778
|
-
* bowl
|
|
65237
|
+
/** Food in the TANK (hopper), as the feeder's own sensor reports it
|
|
65238
|
+
* (`state.food`). A coarse level code, not grams — `0` is empty. The
|
|
65239
|
+
* amount in the bowl is `bowlFood`. On dual-hopper models this is the
|
|
65240
|
+
* combined reading; per-hopper levels live in `food1`/`food2`. Null when
|
|
65241
|
+
* the device has not reported yet. */
|
|
64779
65242
|
foodLevel: number().nullable().meta(readingMeta("none")),
|
|
65243
|
+
/** Food in the BOWL as the feeder reports it (`state.bowl`), in the
|
|
65244
|
+
* feeder's own units. Null when the model reports none. */
|
|
65245
|
+
bowlFood: number().nullable().meta(readingMeta("none")),
|
|
65246
|
+
/** True while the pet is eating (`state.eating`). */
|
|
65247
|
+
eating: boolean(),
|
|
65248
|
+
/** Whether `markFoodReplenished` does anything on this model. When false
|
|
65249
|
+
* the client must not offer it. */
|
|
65250
|
+
supportsMarkRefilled: boolean(),
|
|
64780
65251
|
/** Hopper-1 food level (grams) on dual-hopper feeders; null on
|
|
64781
65252
|
* single-hopper models. */
|
|
64782
65253
|
food1: number().nullable().meta(readingMeta("none")),
|
|
@@ -64784,8 +65255,8 @@ var PetFeederStatusSchema = object({
|
|
|
64784
65255
|
* single-hopper models. */
|
|
64785
65256
|
food2: number().nullable().meta(readingMeta("none")),
|
|
64786
65257
|
/** Derived low-food flag — mirrors the HA `food_level` binary_sensor
|
|
64787
|
-
* (`device_class: problem`, on = low). True when the
|
|
64788
|
-
*
|
|
65258
|
+
* (`device_class: problem`, on = low). True when the tank reports empty,
|
|
65259
|
+
* or, on a dual-hopper model, when EITHER hopper is empty. */
|
|
64789
65260
|
lowFood: boolean(),
|
|
64790
65261
|
/** Battery charge 0..100 (%). Null on mains-powered models or when the
|
|
64791
65262
|
* device has no battery reading. */
|
|
@@ -64853,7 +65324,9 @@ var petFeederCapability = {
|
|
|
64853
65324
|
kind: "mutation",
|
|
64854
65325
|
auth: "protected"
|
|
64855
65326
|
}),
|
|
64856
|
-
/**
|
|
65327
|
+
/** Tell the PetKit cloud a hopper was refilled so it stops its low-food
|
|
65328
|
+
* reminders (D4H/D4S/D4SH only — see `supportsMarkRefilled`). It does not
|
|
65329
|
+
* change any sensor reading. */
|
|
64857
65330
|
markFoodReplenished: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
64858
65331
|
kind: "mutation",
|
|
64859
65332
|
auth: "protected"
|
|
@@ -64926,6 +65399,7 @@ var petFeederCapability = {
|
|
|
64926
65399
|
*/
|
|
64927
65400
|
history: { fields: {
|
|
64928
65401
|
foodLevel: { kind: "gauge" },
|
|
65402
|
+
bowlFood: { kind: "gauge" },
|
|
64929
65403
|
food1: { kind: "gauge" },
|
|
64930
65404
|
food2: { kind: "gauge" },
|
|
64931
65405
|
batteryPower: {
|
|
@@ -65335,16 +65809,16 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
|
|
|
65335
65809
|
* in real-world devices.
|
|
65336
65810
|
*/
|
|
65337
65811
|
var PowerMeterStatusSchema = object({
|
|
65338
|
-
/** Instantaneous power draw
|
|
65339
|
-
|
|
65812
|
+
/** Instantaneous power draw (watts). */
|
|
65813
|
+
power: number().optional().meta(readingMeta("power", { label: "Power" })),
|
|
65340
65814
|
/** Cumulative energy in kilowatt-hours since the meter was reset. */
|
|
65341
|
-
|
|
65342
|
-
/** Voltage
|
|
65343
|
-
|
|
65815
|
+
energy: number().optional().meta(readingMeta("energy", { label: "Energy" })),
|
|
65816
|
+
/** Voltage (volts). */
|
|
65817
|
+
voltage: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
65344
65818
|
/** Current in amperes. */
|
|
65345
|
-
|
|
65819
|
+
current: number().optional().meta(readingMeta("current", { label: "Current" })),
|
|
65346
65820
|
/** Apparent power in volt-amperes. */
|
|
65347
|
-
|
|
65821
|
+
apparentPower: number().optional().meta(readingMeta("apparent-power")),
|
|
65348
65822
|
/** Power factor (0..1) if reported. */
|
|
65349
65823
|
powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
|
|
65350
65824
|
/** Ms epoch when the slice was last updated. */
|
|
@@ -65402,14 +65876,14 @@ function powerTarget(id, unit) {
|
|
|
65402
65876
|
advancedExpression: true
|
|
65403
65877
|
};
|
|
65404
65878
|
}
|
|
65405
|
-
/** "Power and energy" extension:
|
|
65879
|
+
/** "Power and energy" extension: power, energy, voltage and current from other devices (D951). */
|
|
65406
65880
|
var powerMeterCustomize = {
|
|
65407
65881
|
version: 1,
|
|
65408
65882
|
targets: [
|
|
65409
|
-
powerTarget("
|
|
65410
|
-
powerTarget("
|
|
65411
|
-
powerTarget("
|
|
65412
|
-
powerTarget("
|
|
65883
|
+
powerTarget("power", "W"),
|
|
65884
|
+
powerTarget("energy", "kWh"),
|
|
65885
|
+
powerTarget("voltage", "V"),
|
|
65886
|
+
powerTarget("current", "A")
|
|
65413
65887
|
]
|
|
65414
65888
|
};
|
|
65415
65889
|
var powerMeterCapability = {
|
|
@@ -65425,41 +65899,41 @@ var powerMeterCapability = {
|
|
|
65425
65899
|
},
|
|
65426
65900
|
runtimeState: PowerMeterStatusSchema,
|
|
65427
65901
|
/**
|
|
65428
|
-
* Runtime-state durability: **restored** — as `numeric-sensor`; `
|
|
65902
|
+
* Runtime-state durability: **restored** — as `numeric-sensor`; `energy` is an accumulator whose restored value is the baseline.
|
|
65429
65903
|
*
|
|
65430
65904
|
* See `RuntimeStateDurability`. Enforced by
|
|
65431
65905
|
* `scripts/check-runtime-state-durability.ts`.
|
|
65432
65906
|
*/
|
|
65433
65907
|
durability: "restored",
|
|
65434
65908
|
/**
|
|
65435
|
-
* History (D850): recorded series. Gauges are floored at 30 s; `
|
|
65909
|
+
* History (D850): recorded series. Gauges are floored at 30 s; `energy` is the one monotonic meter (counter).
|
|
65436
65910
|
*/
|
|
65437
65911
|
history: { fields: {
|
|
65438
|
-
|
|
65912
|
+
power: {
|
|
65439
65913
|
kind: "gauge",
|
|
65440
65914
|
unit: "W",
|
|
65441
65915
|
deadband: 1,
|
|
65442
65916
|
minIntervalMs: 3e4
|
|
65443
65917
|
},
|
|
65444
|
-
|
|
65918
|
+
energy: {
|
|
65445
65919
|
kind: "counter",
|
|
65446
65920
|
unit: "kWh",
|
|
65447
65921
|
deadband: .01,
|
|
65448
65922
|
minIntervalMs: 6e4
|
|
65449
65923
|
},
|
|
65450
|
-
|
|
65924
|
+
voltage: {
|
|
65451
65925
|
kind: "gauge",
|
|
65452
65926
|
unit: "V",
|
|
65453
65927
|
deadband: 1,
|
|
65454
65928
|
minIntervalMs: 3e4
|
|
65455
65929
|
},
|
|
65456
|
-
|
|
65930
|
+
current: {
|
|
65457
65931
|
kind: "gauge",
|
|
65458
65932
|
unit: "A",
|
|
65459
65933
|
deadband: .05,
|
|
65460
65934
|
minIntervalMs: 3e4
|
|
65461
65935
|
},
|
|
65462
|
-
|
|
65936
|
+
apparentPower: {
|
|
65463
65937
|
kind: "gauge",
|
|
65464
65938
|
unit: "VA",
|
|
65465
65939
|
deadband: 1,
|
|
@@ -65509,9 +65983,6 @@ var PresenceStatusSchema = object({
|
|
|
65509
65983
|
location: string().nullable(),
|
|
65510
65984
|
/** GPS coordinates when available. Null otherwise. */
|
|
65511
65985
|
gps: GpsLocationSchema.nullable(),
|
|
65512
|
-
/** Optional battery level of the tracking device (0..100). Null
|
|
65513
|
-
* when not reported. */
|
|
65514
|
-
batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
65515
65986
|
/** Ms epoch when the slice was last updated. */
|
|
65516
65987
|
lastChangedAt: number()
|
|
65517
65988
|
});
|
|
@@ -65540,14 +66011,7 @@ var presenceCapability = {
|
|
|
65540
66011
|
* `scripts/check-runtime-state-durability.ts`.
|
|
65541
66012
|
*/
|
|
65542
66013
|
durability: "restored",
|
|
65543
|
-
|
|
65544
|
-
* History (D850): recorded series.
|
|
65545
|
-
*/
|
|
65546
|
-
history: { fields: { batteryPercent: {
|
|
65547
|
-
kind: "gauge",
|
|
65548
|
-
unit: "%",
|
|
65549
|
-
deadband: 1
|
|
65550
|
-
} } },
|
|
66014
|
+
history: "none",
|
|
65551
66015
|
/** Clock fields: written, but excluded from the compare that decides
|
|
65552
66016
|
* whether persisting is worth a SQLite commit. */
|
|
65553
66017
|
volatileStateFields: ["lastChangedAt"]
|
|
@@ -65562,7 +66026,7 @@ var presenceCapability = {
|
|
|
65562
66026
|
*/
|
|
65563
66027
|
var PressureSensorStatusSchema = object({
|
|
65564
66028
|
/** Current pressure in hPa. `null` when the sample was refused (D393). */
|
|
65565
|
-
|
|
66029
|
+
pressure: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
|
|
65566
66030
|
/** Ms epoch when the slice was last updated. */
|
|
65567
66031
|
lastFetchedAt: number()
|
|
65568
66032
|
});
|
|
@@ -65588,7 +66052,7 @@ var pressureSensorCapability = {
|
|
|
65588
66052
|
/**
|
|
65589
66053
|
* History (D850): recorded series.
|
|
65590
66054
|
*/
|
|
65591
|
-
history: { fields: {
|
|
66055
|
+
history: { fields: { pressure: {
|
|
65592
66056
|
kind: "gauge",
|
|
65593
66057
|
unit: "hPa",
|
|
65594
66058
|
deadband: .1
|
|
@@ -69802,7 +70266,7 @@ var tamperCapability = {
|
|
|
69802
70266
|
*/
|
|
69803
70267
|
var TemperatureSensorStatusSchema = object({
|
|
69804
70268
|
/** Current temperature in Celsius. `null` when the sample was refused (D393). */
|
|
69805
|
-
|
|
70269
|
+
temperature: number().nullable().meta(readingMeta("temperature", {
|
|
69806
70270
|
precision: 1,
|
|
69807
70271
|
label: "Temperature"
|
|
69808
70272
|
})),
|
|
@@ -69831,7 +70295,7 @@ var temperatureSensorCapability = {
|
|
|
69831
70295
|
/**
|
|
69832
70296
|
* History (D850): recorded series.
|
|
69833
70297
|
*/
|
|
69834
|
-
history: { fields: {
|
|
70298
|
+
history: { fields: { temperature: {
|
|
69835
70299
|
kind: "gauge",
|
|
69836
70300
|
unit: "°C",
|
|
69837
70301
|
deadband: .1
|
|
@@ -70128,7 +70592,7 @@ var VacuumControlStatusSchema = object({
|
|
|
70128
70592
|
/** Speed tokens the hardware accepts — drives the UI selector. */
|
|
70129
70593
|
availableFanSpeeds: array(string()),
|
|
70130
70594
|
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
70131
|
-
|
|
70595
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
70132
70596
|
/** Current error code (0 / null = no error). */
|
|
70133
70597
|
errorCode: number().nullable().meta(readingMeta("none")),
|
|
70134
70598
|
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
@@ -71930,7 +72394,7 @@ var BaseDevice = class {
|
|
|
71930
72394
|
* `device-local-state.ts`. Drivers access via:
|
|
71931
72395
|
*
|
|
71932
72396
|
* `this.state.battery.sleeping = true` // patches the battery slice
|
|
71933
|
-
* `const pct = this.state.battery.
|
|
72397
|
+
* `const pct = this.state.battery.level` // reads the battery slice
|
|
71934
72398
|
* `this.state.deviceStatus.online = true` // mirrors `markOnline(true)`
|
|
71935
72399
|
*
|
|
71936
72400
|
* Adding a new cap with `runtimeState:` automatically extends this
|
|
@@ -71970,7 +72434,7 @@ var BaseDevice = class {
|
|
|
71970
72434
|
* shape; drivers don't redeclare it, they just write through.
|
|
71971
72435
|
*
|
|
71972
72436
|
* Read: `this.runtimeState.getCapState('battery')` →
|
|
71973
|
-
* `{
|
|
72437
|
+
* `{level, charging, sleeping, lastUpdated}` for any
|
|
71974
72438
|
* provider that registers `batteryCapability`.
|
|
71975
72439
|
* Write: `this.runtimeState.setCapState('battery', { … })`.
|
|
71976
72440
|
*
|
|
@@ -73148,6 +73612,104 @@ Object.freeze({
|
|
|
73148
73612
|
access: "create",
|
|
73149
73613
|
role: "admin"
|
|
73150
73614
|
},
|
|
73615
|
+
"actions.create": {
|
|
73616
|
+
capName: "actions",
|
|
73617
|
+
capScope: "system",
|
|
73618
|
+
addonId: null,
|
|
73619
|
+
access: "create",
|
|
73620
|
+
role: "admin"
|
|
73621
|
+
},
|
|
73622
|
+
"actions.delete": {
|
|
73623
|
+
capName: "actions",
|
|
73624
|
+
capScope: "system",
|
|
73625
|
+
addonId: null,
|
|
73626
|
+
access: "delete",
|
|
73627
|
+
role: "admin"
|
|
73628
|
+
},
|
|
73629
|
+
"actions.get": {
|
|
73630
|
+
capName: "actions",
|
|
73631
|
+
capScope: "system",
|
|
73632
|
+
addonId: null,
|
|
73633
|
+
access: "view",
|
|
73634
|
+
role: "viewer"
|
|
73635
|
+
},
|
|
73636
|
+
"actions.getLinks": {
|
|
73637
|
+
capName: "actions",
|
|
73638
|
+
capScope: "system",
|
|
73639
|
+
addonId: null,
|
|
73640
|
+
access: "view",
|
|
73641
|
+
role: "admin"
|
|
73642
|
+
},
|
|
73643
|
+
"actions.getTraces": {
|
|
73644
|
+
capName: "actions",
|
|
73645
|
+
capScope: "system",
|
|
73646
|
+
addonId: null,
|
|
73647
|
+
access: "view",
|
|
73648
|
+
role: "admin"
|
|
73649
|
+
},
|
|
73650
|
+
"actions.list": {
|
|
73651
|
+
capName: "actions",
|
|
73652
|
+
capScope: "system",
|
|
73653
|
+
addonId: null,
|
|
73654
|
+
access: "view",
|
|
73655
|
+
role: "admin"
|
|
73656
|
+
},
|
|
73657
|
+
"actions.listForCamera": {
|
|
73658
|
+
capName: "actions",
|
|
73659
|
+
capScope: "system",
|
|
73660
|
+
addonId: null,
|
|
73661
|
+
access: "view",
|
|
73662
|
+
role: "viewer"
|
|
73663
|
+
},
|
|
73664
|
+
"actions.run": {
|
|
73665
|
+
capName: "actions",
|
|
73666
|
+
capScope: "system",
|
|
73667
|
+
addonId: null,
|
|
73668
|
+
access: "create",
|
|
73669
|
+
role: "viewer"
|
|
73670
|
+
},
|
|
73671
|
+
"actions.setLinks": {
|
|
73672
|
+
capName: "actions",
|
|
73673
|
+
capScope: "system",
|
|
73674
|
+
addonId: null,
|
|
73675
|
+
access: "create",
|
|
73676
|
+
role: "admin"
|
|
73677
|
+
},
|
|
73678
|
+
"actions.stop": {
|
|
73679
|
+
capName: "actions",
|
|
73680
|
+
capScope: "system",
|
|
73681
|
+
addonId: null,
|
|
73682
|
+
access: "create",
|
|
73683
|
+
role: "admin"
|
|
73684
|
+
},
|
|
73685
|
+
"actions.update": {
|
|
73686
|
+
capName: "actions",
|
|
73687
|
+
capScope: "system",
|
|
73688
|
+
addonId: null,
|
|
73689
|
+
access: "create",
|
|
73690
|
+
role: "admin"
|
|
73691
|
+
},
|
|
73692
|
+
"actionSource.listActions": {
|
|
73693
|
+
capName: "action-source",
|
|
73694
|
+
capScope: "system",
|
|
73695
|
+
addonId: null,
|
|
73696
|
+
access: "view",
|
|
73697
|
+
role: "admin"
|
|
73698
|
+
},
|
|
73699
|
+
"actionSource.runAction": {
|
|
73700
|
+
capName: "action-source",
|
|
73701
|
+
capScope: "system",
|
|
73702
|
+
addonId: null,
|
|
73703
|
+
access: "create",
|
|
73704
|
+
role: "admin"
|
|
73705
|
+
},
|
|
73706
|
+
"actionSource.stopAction": {
|
|
73707
|
+
capName: "action-source",
|
|
73708
|
+
capScope: "system",
|
|
73709
|
+
addonId: null,
|
|
73710
|
+
access: "create",
|
|
73711
|
+
role: "admin"
|
|
73712
|
+
},
|
|
73151
73713
|
"addonPages.listPages": {
|
|
73152
73714
|
capName: "addon-pages",
|
|
73153
73715
|
capScope: "system",
|
|
@@ -74429,6 +74991,13 @@ Object.freeze({
|
|
|
74429
74991
|
access: "view",
|
|
74430
74992
|
role: "admin"
|
|
74431
74993
|
},
|
|
74994
|
+
"coreBlocks.getAutomationRunState": {
|
|
74995
|
+
capName: "core-blocks",
|
|
74996
|
+
capScope: "system",
|
|
74997
|
+
addonId: null,
|
|
74998
|
+
access: "view",
|
|
74999
|
+
role: "admin"
|
|
75000
|
+
},
|
|
74432
75001
|
"coreBlocks.getBlockSettings": {
|
|
74433
75002
|
capName: "core-blocks",
|
|
74434
75003
|
capScope: "system",
|
|
@@ -74450,6 +75019,13 @@ Object.freeze({
|
|
|
74450
75019
|
access: "view",
|
|
74451
75020
|
role: "admin"
|
|
74452
75021
|
},
|
|
75022
|
+
"coreBlocks.getTraces": {
|
|
75023
|
+
capName: "core-blocks",
|
|
75024
|
+
capScope: "system",
|
|
75025
|
+
addonId: null,
|
|
75026
|
+
access: "view",
|
|
75027
|
+
role: "admin"
|
|
75028
|
+
},
|
|
74453
75029
|
"coreBlocks.getTypeDefs": {
|
|
74454
75030
|
capName: "core-blocks",
|
|
74455
75031
|
capScope: "system",
|
|
@@ -74485,6 +75061,13 @@ Object.freeze({
|
|
|
74485
75061
|
access: "create",
|
|
74486
75062
|
role: "admin"
|
|
74487
75063
|
},
|
|
75064
|
+
"coreBlocks.reportAutomationRun": {
|
|
75065
|
+
capName: "core-blocks",
|
|
75066
|
+
capScope: "system",
|
|
75067
|
+
addonId: null,
|
|
75068
|
+
access: "create",
|
|
75069
|
+
role: "admin"
|
|
75070
|
+
},
|
|
74488
75071
|
"coreBlocks.restart": {
|
|
74489
75072
|
capName: "core-blocks",
|
|
74490
75073
|
capScope: "system",
|
|
@@ -83058,7 +83641,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83058
83641
|
label: t("Full brightness", "Luminosità massima"),
|
|
83059
83642
|
phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
|
|
83060
83643
|
icon: "sun",
|
|
83061
|
-
args: {
|
|
83644
|
+
args: { level: 100 }
|
|
83062
83645
|
},
|
|
83063
83646
|
{
|
|
83064
83647
|
id: "brightness.half",
|
|
@@ -83066,7 +83649,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83066
83649
|
label: t("Half brightness", "Luminosità a metà"),
|
|
83067
83650
|
phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
|
|
83068
83651
|
icon: "sun-dim",
|
|
83069
|
-
args: {
|
|
83652
|
+
args: { level: 50 }
|
|
83070
83653
|
},
|
|
83071
83654
|
{
|
|
83072
83655
|
id: "brightness.off",
|
|
@@ -83074,16 +83657,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83074
83657
|
label: t("Brightness off", "Luminosità a zero"),
|
|
83075
83658
|
phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
|
|
83076
83659
|
icon: "lightbulb-off",
|
|
83077
|
-
args: {
|
|
83660
|
+
args: { level: 0 }
|
|
83078
83661
|
},
|
|
83079
83662
|
{
|
|
83080
83663
|
id: "brightness.set",
|
|
83081
83664
|
method: "setBrightness",
|
|
83082
83665
|
label: t("Set brightness", "Imposta la luminosità"),
|
|
83083
|
-
phrase: t("Set the brightness of {device} to {
|
|
83666
|
+
phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
|
|
83084
83667
|
icon: "sun-medium",
|
|
83085
83668
|
openArgs: [{
|
|
83086
|
-
key: "
|
|
83669
|
+
key: "level",
|
|
83087
83670
|
label: PERCENT,
|
|
83088
83671
|
offer: {
|
|
83089
83672
|
kind: "number",
|
|
@@ -83097,13 +83680,13 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83097
83680
|
],
|
|
83098
83681
|
state: [{
|
|
83099
83682
|
kind: "numeric",
|
|
83100
|
-
field: "
|
|
83683
|
+
field: "level",
|
|
83101
83684
|
quantity: t("the brightness", "la luminosità"),
|
|
83102
83685
|
label: t("Brightness", "Luminosità"),
|
|
83103
83686
|
unit: "%",
|
|
83104
83687
|
icon: "sun"
|
|
83105
83688
|
}],
|
|
83106
|
-
events: { onBrightnessChanged: { notOperatorFacing: "the `
|
|
83689
|
+
events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
|
|
83107
83690
|
},
|
|
83108
83691
|
color: {
|
|
83109
83692
|
scope: "device",
|
|
@@ -83117,7 +83700,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83117
83700
|
icon: "sun",
|
|
83118
83701
|
args: { color: {
|
|
83119
83702
|
mode: "mired",
|
|
83120
|
-
|
|
83703
|
+
colorTemperature: 370
|
|
83121
83704
|
} }
|
|
83122
83705
|
},
|
|
83123
83706
|
{
|
|
@@ -83128,7 +83711,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83128
83711
|
icon: "snowflake",
|
|
83129
83712
|
args: { color: {
|
|
83130
83713
|
mode: "mired",
|
|
83131
|
-
|
|
83714
|
+
colorTemperature: 200
|
|
83132
83715
|
} }
|
|
83133
83716
|
},
|
|
83134
83717
|
{
|
|
@@ -83742,7 +84325,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83742
84325
|
label: t("Fan off", "Ventilatore spento"),
|
|
83743
84326
|
phrase: t("Stop {device}", "Ferma {device}"),
|
|
83744
84327
|
icon: "power-off",
|
|
83745
|
-
args: {
|
|
84328
|
+
args: { speed: 0 }
|
|
83746
84329
|
},
|
|
83747
84330
|
{
|
|
83748
84331
|
id: "fan.full",
|
|
@@ -83750,16 +84333,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83750
84333
|
label: t("Fan full", "Ventilatore al massimo"),
|
|
83751
84334
|
phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
|
|
83752
84335
|
icon: "fan",
|
|
83753
|
-
args: {
|
|
84336
|
+
args: { speed: 100 }
|
|
83754
84337
|
},
|
|
83755
84338
|
{
|
|
83756
84339
|
id: "fan.speed",
|
|
83757
84340
|
method: "setPercentage",
|
|
83758
84341
|
label: t("Set speed", "Imposta la velocità"),
|
|
83759
|
-
phrase: t("Set the speed of {device} to {
|
|
84342
|
+
phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
|
|
83760
84343
|
icon: "fan",
|
|
83761
84344
|
openArgs: [{
|
|
83762
|
-
key: "
|
|
84345
|
+
key: "speed",
|
|
83763
84346
|
label: t("Speed", "Velocità"),
|
|
83764
84347
|
offer: {
|
|
83765
84348
|
kind: "number",
|
|
@@ -83821,7 +84404,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83821
84404
|
],
|
|
83822
84405
|
state: [{
|
|
83823
84406
|
kind: "numeric",
|
|
83824
|
-
field: "
|
|
84407
|
+
field: "speed",
|
|
83825
84408
|
quantity: t("the speed", "la velocità"),
|
|
83826
84409
|
label: t("Speed", "Velocità"),
|
|
83827
84410
|
unit: "%",
|
|
@@ -84619,7 +85202,7 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
84619
85202
|
},
|
|
84620
85203
|
{
|
|
84621
85204
|
kind: "numeric",
|
|
84622
|
-
field: "
|
|
85205
|
+
field: "progress",
|
|
84623
85206
|
quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
|
|
84624
85207
|
label: t("Progress", "Avanzamento"),
|
|
84625
85208
|
unit: "%",
|
|
@@ -84977,10 +85560,10 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
84977
85560
|
id: "media.seek",
|
|
84978
85561
|
method: "seek",
|
|
84979
85562
|
label: t("Seek", "Vai al punto"),
|
|
84980
|
-
phrase: t("Move {device} to {
|
|
85563
|
+
phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
|
|
84981
85564
|
icon: "fast-forward",
|
|
84982
85565
|
openArgs: [{
|
|
84983
|
-
key: "
|
|
85566
|
+
key: "position",
|
|
84984
85567
|
label: t("Position", "Posizione"),
|
|
84985
85568
|
offer: {
|
|
84986
85569
|
kind: "number",
|
|
@@ -86029,7 +86612,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86029
86612
|
state: [
|
|
86030
86613
|
{
|
|
86031
86614
|
kind: "numeric",
|
|
86032
|
-
field: "
|
|
86615
|
+
field: "co2",
|
|
86033
86616
|
quantity: t("the CO₂", "la CO₂"),
|
|
86034
86617
|
label: t("CO₂", "CO₂"),
|
|
86035
86618
|
unit: "ppm",
|
|
@@ -86037,7 +86620,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86037
86620
|
},
|
|
86038
86621
|
{
|
|
86039
86622
|
kind: "numeric",
|
|
86040
|
-
field: "
|
|
86623
|
+
field: "voc",
|
|
86041
86624
|
quantity: t("the VOC level", "il livello di COV"),
|
|
86042
86625
|
label: t("VOC", "COV"),
|
|
86043
86626
|
unit: "ppb",
|
|
@@ -86073,7 +86656,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86073
86656
|
noun: t("Light level", "Luminosità ambiente"),
|
|
86074
86657
|
state: [{
|
|
86075
86658
|
kind: "numeric",
|
|
86076
|
-
field: "
|
|
86659
|
+
field: "illuminance",
|
|
86077
86660
|
quantity: t("the light level", "la luminosità"),
|
|
86078
86661
|
label: t("Illuminance", "Illuminamento"),
|
|
86079
86662
|
unit: "lx",
|
|
@@ -86276,7 +86859,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86276
86859
|
noun: t("Humidity", "Umidità"),
|
|
86277
86860
|
state: [{
|
|
86278
86861
|
kind: "numeric",
|
|
86279
|
-
field: "
|
|
86862
|
+
field: "humidity",
|
|
86280
86863
|
quantity: t("the humidity", "l’umidità"),
|
|
86281
86864
|
label: t("Humidity", "Umidità"),
|
|
86282
86865
|
unit: "%",
|
|
@@ -86324,7 +86907,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86324
86907
|
state: [
|
|
86325
86908
|
{
|
|
86326
86909
|
kind: "numeric",
|
|
86327
|
-
field: "
|
|
86910
|
+
field: "power",
|
|
86328
86911
|
quantity: t("the power draw", "il consumo"),
|
|
86329
86912
|
label: t("Power", "Potenza"),
|
|
86330
86913
|
unit: "W",
|
|
@@ -86332,7 +86915,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86332
86915
|
},
|
|
86333
86916
|
{
|
|
86334
86917
|
kind: "numeric",
|
|
86335
|
-
field: "
|
|
86918
|
+
field: "energy",
|
|
86336
86919
|
quantity: t("the energy used", "l’energia consumata"),
|
|
86337
86920
|
label: t("Energy", "Energia"),
|
|
86338
86921
|
unit: "kWh",
|
|
@@ -86340,7 +86923,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86340
86923
|
},
|
|
86341
86924
|
{
|
|
86342
86925
|
kind: "numeric",
|
|
86343
|
-
field: "
|
|
86926
|
+
field: "voltage",
|
|
86344
86927
|
quantity: t("the voltage", "la tensione"),
|
|
86345
86928
|
label: t("Voltage", "Tensione"),
|
|
86346
86929
|
unit: "V",
|
|
@@ -86348,7 +86931,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86348
86931
|
},
|
|
86349
86932
|
{
|
|
86350
86933
|
kind: "numeric",
|
|
86351
|
-
field: "
|
|
86934
|
+
field: "current",
|
|
86352
86935
|
quantity: t("the current", "la corrente"),
|
|
86353
86936
|
label: t("Current", "Corrente"),
|
|
86354
86937
|
unit: "A",
|
|
@@ -86365,13 +86948,6 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86365
86948
|
label: t("Where", "Posizione"),
|
|
86366
86949
|
phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
|
|
86367
86950
|
icon: "map-pin"
|
|
86368
|
-
}, {
|
|
86369
|
-
kind: "numeric",
|
|
86370
|
-
field: "batteryPercent",
|
|
86371
|
-
quantity: t("the phone battery", "la batteria del telefono"),
|
|
86372
|
-
label: t("Battery", "Batteria"),
|
|
86373
|
-
unit: "%",
|
|
86374
|
-
icon: "battery"
|
|
86375
86951
|
}]
|
|
86376
86952
|
},
|
|
86377
86953
|
"pressure-sensor": {
|
|
@@ -86379,7 +86955,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86379
86955
|
noun: t("Pressure", "Pressione"),
|
|
86380
86956
|
state: [{
|
|
86381
86957
|
kind: "numeric",
|
|
86382
|
-
field: "
|
|
86958
|
+
field: "pressure",
|
|
86383
86959
|
quantity: t("the pressure", "la pressione"),
|
|
86384
86960
|
label: t("Pressure", "Pressione"),
|
|
86385
86961
|
unit: "hPa",
|
|
@@ -86415,7 +86991,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86415
86991
|
noun: t("Temperature", "Temperatura"),
|
|
86416
86992
|
state: [{
|
|
86417
86993
|
kind: "numeric",
|
|
86418
|
-
field: "
|
|
86994
|
+
field: "temperature",
|
|
86419
86995
|
quantity: t("the temperature", "la temperatura"),
|
|
86420
86996
|
label: t("Temperature", "Temperatura"),
|
|
86421
86997
|
unit: "°C",
|
|
@@ -86486,7 +87062,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86486
87062
|
state: [
|
|
86487
87063
|
{
|
|
86488
87064
|
kind: "numeric",
|
|
86489
|
-
field: "
|
|
87065
|
+
field: "level",
|
|
86490
87066
|
quantity: t("the battery level", "il livello della batteria"),
|
|
86491
87067
|
label: t("Battery", "Batteria"),
|
|
86492
87068
|
unit: "%",
|
|
@@ -86528,7 +87104,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86528
87104
|
icon: "battery-charging"
|
|
86529
87105
|
}
|
|
86530
87106
|
],
|
|
86531
|
-
events: { onStatusChanged: { notOperatorFacing: "the
|
|
87107
|
+
events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
|
|
86532
87108
|
extraEvents: [{
|
|
86533
87109
|
category: EventCategory.DeviceAwake,
|
|
86534
87110
|
label: t("Woke up", "Risvegliato"),
|
|
@@ -86546,7 +87122,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86546
87122
|
noun: t("Network link", "Collegamento di rete"),
|
|
86547
87123
|
state: [{
|
|
86548
87124
|
kind: "numeric",
|
|
86549
|
-
field: "
|
|
87125
|
+
field: "signal",
|
|
86550
87126
|
quantity: t("the signal strength", "l’intensità del segnale"),
|
|
86551
87127
|
label: t("Signal", "Segnale"),
|
|
86552
87128
|
unit: "%",
|
|
@@ -86639,6 +87215,8 @@ var ML = "model and training machinery — no device action";
|
|
|
86639
87215
|
var INTERNAL = "internal plumbing between addons — never operator-facing";
|
|
86640
87216
|
/** Every system-scoped cap, with why it is not a device's vocabulary. */
|
|
86641
87217
|
var SYSTEM_CAP_VOCABULARY = {
|
|
87218
|
+
"action-source": system(INTERNAL),
|
|
87219
|
+
actions: system("declared actions — run from the Actions page and from the cameras that link them"),
|
|
86642
87220
|
"addon-pages": system(UI_PLUMBING),
|
|
86643
87221
|
"addon-pages-source": system(UI_PLUMBING),
|
|
86644
87222
|
"addon-routes": system(UI_PLUMBING),
|
|
@@ -87053,6 +87631,31 @@ Object.freeze({
|
|
|
87053
87631
|
form: "single",
|
|
87054
87632
|
optional: false
|
|
87055
87633
|
}],
|
|
87634
|
+
"actions.get": [{
|
|
87635
|
+
name: "deviceId",
|
|
87636
|
+
form: "single",
|
|
87637
|
+
optional: true
|
|
87638
|
+
}],
|
|
87639
|
+
"actions.getLinks": [{
|
|
87640
|
+
name: "deviceId",
|
|
87641
|
+
form: "single",
|
|
87642
|
+
optional: false
|
|
87643
|
+
}],
|
|
87644
|
+
"actions.listForCamera": [{
|
|
87645
|
+
name: "deviceId",
|
|
87646
|
+
form: "single",
|
|
87647
|
+
optional: false
|
|
87648
|
+
}],
|
|
87649
|
+
"actions.run": [{
|
|
87650
|
+
name: "deviceId",
|
|
87651
|
+
form: "single",
|
|
87652
|
+
optional: true
|
|
87653
|
+
}],
|
|
87654
|
+
"actions.setLinks": [{
|
|
87655
|
+
name: "deviceId",
|
|
87656
|
+
form: "single",
|
|
87657
|
+
optional: false
|
|
87658
|
+
}],
|
|
87056
87659
|
"addonSettings.getDeviceSettings": [{
|
|
87057
87660
|
name: "deviceId",
|
|
87058
87661
|
form: "single",
|
|
@@ -91185,6 +91788,7 @@ DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
|
91185
91788
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
91186
91789
|
DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
|
|
91187
91790
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
91791
|
+
String.raw`(?<=^|["'(\s>,\[{])`;
|
|
91188
91792
|
var MB = 1024 * 1024;
|
|
91189
91793
|
1024 * MB, 3072 * MB;
|
|
91190
91794
|
/**
|
|
@@ -95934,7 +96538,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
95934
96538
|
}
|
|
95935
96539
|
brightnessView() {
|
|
95936
96540
|
return this.getCapSlice(brightnessCapability) ?? {
|
|
95937
|
-
|
|
96541
|
+
level: this.config.get("defaultBrightness") ?? 100,
|
|
95938
96542
|
lastChangedAt: 0
|
|
95939
96543
|
};
|
|
95940
96544
|
}
|
|
@@ -95955,9 +96559,9 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
95955
96559
|
});
|
|
95956
96560
|
if (typeof state.brightness === "number") {
|
|
95957
96561
|
const previousBrightness = this.brightnessView();
|
|
95958
|
-
const brightChangedAt = previousBrightness.
|
|
96562
|
+
const brightChangedAt = previousBrightness.level === state.brightness ? previousBrightness.lastChangedAt : ts;
|
|
95959
96563
|
this.setCapSlice(brightnessCapability, {
|
|
95960
|
-
|
|
96564
|
+
level: state.brightness,
|
|
95961
96565
|
lastChangedAt: brightChangedAt
|
|
95962
96566
|
});
|
|
95963
96567
|
}
|
|
@@ -95978,7 +96582,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
95978
96582
|
lastChangedAt: ts
|
|
95979
96583
|
});
|
|
95980
96584
|
if (on) this.setCapSlice(brightnessCapability, {
|
|
95981
|
-
|
|
96585
|
+
level: brightness,
|
|
95982
96586
|
lastChangedAt: ts
|
|
95983
96587
|
});
|
|
95984
96588
|
}
|
|
@@ -95999,7 +96603,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
95999
96603
|
getStatus: async () => this.switchView(),
|
|
96000
96604
|
setState: async ({ deviceId, on }) => {
|
|
96001
96605
|
if (deviceId !== this.id) return;
|
|
96002
|
-
const brightness = this.brightnessView().
|
|
96606
|
+
const brightness = this.brightnessView().level;
|
|
96003
96607
|
await this.applyOn(on, brightness);
|
|
96004
96608
|
}
|
|
96005
96609
|
});
|
|
@@ -96011,18 +96615,18 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
96011
96615
|
registerBrightnessCap() {
|
|
96012
96616
|
this.ctx.registerNativeCap(brightnessCapability, {
|
|
96013
96617
|
getStatus: async () => this.brightnessView(),
|
|
96014
|
-
setBrightness: async ({ deviceId, percentage }) => {
|
|
96618
|
+
setBrightness: async ({ deviceId, level: percentage }) => {
|
|
96015
96619
|
if (deviceId !== this.id) return;
|
|
96016
96620
|
const value = Math.max(0, Math.min(100, percentage));
|
|
96017
96621
|
if (this.switchView().on) await this.applyOn(true, value);
|
|
96018
96622
|
else this.setCapSlice(brightnessCapability, {
|
|
96019
|
-
|
|
96623
|
+
level: value,
|
|
96020
96624
|
lastChangedAt: Date.now()
|
|
96021
96625
|
});
|
|
96022
96626
|
}
|
|
96023
96627
|
});
|
|
96024
96628
|
this.setCapSlice(brightnessCapability, {
|
|
96025
|
-
|
|
96629
|
+
level: this.config.get("defaultBrightness") ?? 100,
|
|
96026
96630
|
lastChangedAt: 0
|
|
96027
96631
|
});
|
|
96028
96632
|
}
|
|
@@ -96070,10 +96674,10 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
96070
96674
|
const typed = lightAccessorySchema.partial().parse(patch);
|
|
96071
96675
|
await this.config.setAll(typed);
|
|
96072
96676
|
if (typed.defaultBrightness !== void 0 && !this.switchView().on) this.setCapSlice(brightnessCapability, {
|
|
96073
|
-
|
|
96677
|
+
level: typed.defaultBrightness,
|
|
96074
96678
|
lastChangedAt: Date.now()
|
|
96075
96679
|
});
|
|
96076
|
-
if (typed.mode !== void 0 && this.switchView().on) await this.applyOn(true, this.brightnessView().
|
|
96680
|
+
if (typed.mode !== void 0 && this.switchView().on) await this.applyOn(true, this.brightnessView().level).catch((err) => {
|
|
96077
96681
|
this.ctx.logger.warn("hikvision light: live mode switch failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
96078
96682
|
});
|
|
96079
96683
|
}
|