@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.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { Agent as Agent$1, request as request$1 } from "node:https";
|
|
|
13
13
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
14
14
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region ../types/dist/event-category-
|
|
16
|
+
//#region ../types/dist/event-category-DmZDPDf_.mjs
|
|
17
17
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
18
18
|
EventCategory["SystemBoot"] = "system.boot";
|
|
19
19
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -640,7 +640,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
640
640
|
* (a track was promoted to a stationary-registry entry) or departs (the
|
|
641
641
|
* object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
|
|
642
642
|
* the dedicated "Stationary" section — never the live event feed. Payload:
|
|
643
|
-
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp }`.
|
|
643
|
+
* `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
|
|
644
644
|
*/
|
|
645
645
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
646
646
|
/**
|
|
@@ -778,6 +778,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
778
778
|
*/
|
|
779
779
|
EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
|
|
780
780
|
/**
|
|
781
|
+
* An action run started or ended. Emitted by the `actions` surface.
|
|
782
|
+
* Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
|
|
783
|
+
*/
|
|
784
|
+
EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
|
|
785
|
+
/**
|
|
781
786
|
* Progress update from a running model conversion job.
|
|
782
787
|
* Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
|
|
783
788
|
* Emitted by `addon-model-studio` on the converting node.
|
|
@@ -5456,7 +5461,7 @@ var ZodIssueCode = {
|
|
|
5456
5461
|
var ZodFirstPartyTypeKind;
|
|
5457
5462
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5458
5463
|
//#endregion
|
|
5459
|
-
//#region ../types/dist/sleep
|
|
5464
|
+
//#region ../types/dist/sleep-Crlmu_tO.mjs
|
|
5460
5465
|
/**
|
|
5461
5466
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5462
5467
|
* window to float samples (D455).
|
|
@@ -8588,6 +8593,8 @@ Object.freeze({ "doorbell": "lastPressedAt" });
|
|
|
8588
8593
|
/** Every capability name, so addon code can check a name without the schema graph. */
|
|
8589
8594
|
var CAP_NAMES = Object.freeze([
|
|
8590
8595
|
"accessories",
|
|
8596
|
+
"action-source",
|
|
8597
|
+
"actions",
|
|
8591
8598
|
"addon-pages",
|
|
8592
8599
|
"addon-pages-source",
|
|
8593
8600
|
"addon-routes",
|
|
@@ -8776,11 +8783,11 @@ var CAP_NAMES = Object.freeze([
|
|
|
8776
8783
|
Object.freeze({
|
|
8777
8784
|
"air-quality-sensor": [
|
|
8778
8785
|
{
|
|
8779
|
-
"path": "
|
|
8786
|
+
"path": "co2",
|
|
8780
8787
|
"valueType": "number"
|
|
8781
8788
|
},
|
|
8782
8789
|
{
|
|
8783
|
-
"path": "
|
|
8790
|
+
"path": "voc",
|
|
8784
8791
|
"valueType": "number"
|
|
8785
8792
|
},
|
|
8786
8793
|
{
|
|
@@ -8830,7 +8837,7 @@ Object.freeze({
|
|
|
8830
8837
|
}
|
|
8831
8838
|
],
|
|
8832
8839
|
"ambient-light-sensor": [{
|
|
8833
|
-
"path": "
|
|
8840
|
+
"path": "illuminance",
|
|
8834
8841
|
"valueType": "number"
|
|
8835
8842
|
}],
|
|
8836
8843
|
"audio-metrics": [
|
|
@@ -8891,7 +8898,7 @@ Object.freeze({
|
|
|
8891
8898
|
],
|
|
8892
8899
|
"battery": [
|
|
8893
8900
|
{
|
|
8894
|
-
"path": "
|
|
8901
|
+
"path": "level",
|
|
8895
8902
|
"valueType": "number"
|
|
8896
8903
|
},
|
|
8897
8904
|
{
|
|
@@ -8913,7 +8920,7 @@ Object.freeze({
|
|
|
8913
8920
|
"valueType": "number"
|
|
8914
8921
|
},
|
|
8915
8922
|
{
|
|
8916
|
-
"path": "
|
|
8923
|
+
"path": "voltage",
|
|
8917
8924
|
"valueType": "number"
|
|
8918
8925
|
},
|
|
8919
8926
|
{
|
|
@@ -8934,7 +8941,7 @@ Object.freeze({
|
|
|
8934
8941
|
"valueType": "boolean"
|
|
8935
8942
|
}],
|
|
8936
8943
|
"brightness": [{
|
|
8937
|
-
"path": "
|
|
8944
|
+
"path": "level",
|
|
8938
8945
|
"valueType": "number"
|
|
8939
8946
|
}],
|
|
8940
8947
|
"broker": [{
|
|
@@ -9135,7 +9142,7 @@ Object.freeze({
|
|
|
9135
9142
|
"valueType": "number"
|
|
9136
9143
|
},
|
|
9137
9144
|
{
|
|
9138
|
-
"path": "
|
|
9145
|
+
"path": "colorTemperature",
|
|
9139
9146
|
"valueType": "number"
|
|
9140
9147
|
}
|
|
9141
9148
|
],
|
|
@@ -9314,15 +9321,15 @@ Object.freeze({
|
|
|
9314
9321
|
"valueType": "string"
|
|
9315
9322
|
},
|
|
9316
9323
|
{
|
|
9317
|
-
"path": "
|
|
9324
|
+
"path": "remaining",
|
|
9318
9325
|
"valueType": "number"
|
|
9319
9326
|
},
|
|
9320
9327
|
{
|
|
9321
|
-
"path": "
|
|
9328
|
+
"path": "delayedStart",
|
|
9322
9329
|
"valueType": "number"
|
|
9323
9330
|
},
|
|
9324
9331
|
{
|
|
9325
|
-
"path": "
|
|
9332
|
+
"path": "progress",
|
|
9326
9333
|
"valueType": "number"
|
|
9327
9334
|
},
|
|
9328
9335
|
{
|
|
@@ -9436,7 +9443,7 @@ Object.freeze({
|
|
|
9436
9443
|
],
|
|
9437
9444
|
"fan-control": [
|
|
9438
9445
|
{
|
|
9439
|
-
"path": "
|
|
9446
|
+
"path": "speed",
|
|
9440
9447
|
"valueType": "number"
|
|
9441
9448
|
},
|
|
9442
9449
|
{
|
|
@@ -9536,7 +9543,7 @@ Object.freeze({
|
|
|
9536
9543
|
}
|
|
9537
9544
|
],
|
|
9538
9545
|
"humidity-sensor": [{
|
|
9539
|
-
"path": "
|
|
9546
|
+
"path": "humidity",
|
|
9540
9547
|
"valueType": "number"
|
|
9541
9548
|
}],
|
|
9542
9549
|
"image": [{
|
|
@@ -9646,7 +9653,7 @@ Object.freeze({
|
|
|
9646
9653
|
"valueType": "number"
|
|
9647
9654
|
},
|
|
9648
9655
|
{
|
|
9649
|
-
"path": "
|
|
9656
|
+
"path": "progress",
|
|
9650
9657
|
"valueType": "number"
|
|
9651
9658
|
},
|
|
9652
9659
|
{
|
|
@@ -9725,11 +9732,11 @@ Object.freeze({
|
|
|
9725
9732
|
"valueType": "string"
|
|
9726
9733
|
},
|
|
9727
9734
|
{
|
|
9728
|
-
"path": "
|
|
9735
|
+
"path": "position",
|
|
9729
9736
|
"valueType": "number"
|
|
9730
9737
|
},
|
|
9731
9738
|
{
|
|
9732
|
-
"path": "
|
|
9739
|
+
"path": "duration",
|
|
9733
9740
|
"valueType": "number"
|
|
9734
9741
|
},
|
|
9735
9742
|
{
|
|
@@ -9831,11 +9838,11 @@ Object.freeze({
|
|
|
9831
9838
|
]
|
|
9832
9839
|
},
|
|
9833
9840
|
{
|
|
9834
|
-
"path": "
|
|
9841
|
+
"path": "signal",
|
|
9835
9842
|
"valueType": "number"
|
|
9836
9843
|
},
|
|
9837
9844
|
{
|
|
9838
|
-
"path": "
|
|
9845
|
+
"path": "rssi",
|
|
9839
9846
|
"valueType": "number"
|
|
9840
9847
|
},
|
|
9841
9848
|
{
|
|
@@ -9890,6 +9897,18 @@ Object.freeze({
|
|
|
9890
9897
|
"path": "foodLevel",
|
|
9891
9898
|
"valueType": "number"
|
|
9892
9899
|
},
|
|
9900
|
+
{
|
|
9901
|
+
"path": "bowlFood",
|
|
9902
|
+
"valueType": "number"
|
|
9903
|
+
},
|
|
9904
|
+
{
|
|
9905
|
+
"path": "eating",
|
|
9906
|
+
"valueType": "boolean"
|
|
9907
|
+
},
|
|
9908
|
+
{
|
|
9909
|
+
"path": "supportsMarkRefilled",
|
|
9910
|
+
"valueType": "boolean"
|
|
9911
|
+
},
|
|
9893
9912
|
{
|
|
9894
9913
|
"path": "food1",
|
|
9895
9914
|
"valueType": "number"
|
|
@@ -9954,23 +9973,23 @@ Object.freeze({
|
|
|
9954
9973
|
],
|
|
9955
9974
|
"power-meter": [
|
|
9956
9975
|
{
|
|
9957
|
-
"path": "
|
|
9976
|
+
"path": "power",
|
|
9958
9977
|
"valueType": "number"
|
|
9959
9978
|
},
|
|
9960
9979
|
{
|
|
9961
|
-
"path": "
|
|
9980
|
+
"path": "energy",
|
|
9962
9981
|
"valueType": "number"
|
|
9963
9982
|
},
|
|
9964
9983
|
{
|
|
9965
|
-
"path": "
|
|
9984
|
+
"path": "voltage",
|
|
9966
9985
|
"valueType": "number"
|
|
9967
9986
|
},
|
|
9968
9987
|
{
|
|
9969
|
-
"path": "
|
|
9988
|
+
"path": "current",
|
|
9970
9989
|
"valueType": "number"
|
|
9971
9990
|
},
|
|
9972
9991
|
{
|
|
9973
|
-
"path": "
|
|
9992
|
+
"path": "apparentPower",
|
|
9974
9993
|
"valueType": "number"
|
|
9975
9994
|
},
|
|
9976
9995
|
{
|
|
@@ -9998,14 +10017,10 @@ Object.freeze({
|
|
|
9998
10017
|
{
|
|
9999
10018
|
"path": "gps.accuracyMeters",
|
|
10000
10019
|
"valueType": "number"
|
|
10001
|
-
},
|
|
10002
|
-
{
|
|
10003
|
-
"path": "batteryPercent",
|
|
10004
|
-
"valueType": "number"
|
|
10005
10020
|
}
|
|
10006
10021
|
],
|
|
10007
10022
|
"pressure-sensor": [{
|
|
10008
|
-
"path": "
|
|
10023
|
+
"path": "pressure",
|
|
10009
10024
|
"valueType": "number"
|
|
10010
10025
|
}],
|
|
10011
10026
|
"privacy-mask": [{
|
|
@@ -10319,7 +10334,7 @@ Object.freeze({
|
|
|
10319
10334
|
"valueType": "boolean"
|
|
10320
10335
|
}],
|
|
10321
10336
|
"temperature-sensor": [{
|
|
10322
|
-
"path": "
|
|
10337
|
+
"path": "temperature",
|
|
10323
10338
|
"valueType": "number"
|
|
10324
10339
|
}],
|
|
10325
10340
|
"update": [
|
|
@@ -10367,7 +10382,7 @@ Object.freeze({
|
|
|
10367
10382
|
"valueType": "string"
|
|
10368
10383
|
},
|
|
10369
10384
|
{
|
|
10370
|
-
"path": "
|
|
10385
|
+
"path": "progress",
|
|
10371
10386
|
"valueType": "number"
|
|
10372
10387
|
},
|
|
10373
10388
|
{
|
|
@@ -10856,7 +10871,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
10856
10871
|
return DeviceRole;
|
|
10857
10872
|
}({});
|
|
10858
10873
|
//#endregion
|
|
10859
|
-
//#region ../types/dist/composition-
|
|
10874
|
+
//#region ../types/dist/composition-CZImLpOI.mjs
|
|
10860
10875
|
/**
|
|
10861
10876
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
10862
10877
|
*
|
|
@@ -15695,6 +15710,14 @@ var AutomationConditionLeafSchema = object({
|
|
|
15695
15710
|
array(union([string(), number()]))
|
|
15696
15711
|
])
|
|
15697
15712
|
});
|
|
15713
|
+
var AutomationConditionStationaryPresentSchema = object({
|
|
15714
|
+
kind: literal("stationary-present"),
|
|
15715
|
+
deviceId: number().int().nonnegative(),
|
|
15716
|
+
/** Class names; a macro class matches every raw class that maps to it. */
|
|
15717
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
15718
|
+
/** The parked object must be in at least one of these zones. */
|
|
15719
|
+
zones: array(string().min(1)).min(1).optional()
|
|
15720
|
+
});
|
|
15698
15721
|
/**
|
|
15699
15722
|
* The expression leaf, declared as a plain object rather than an intersection
|
|
15700
15723
|
* with {@link ExpressionSourceSchema}: a discriminated union has to be able to
|
|
@@ -15728,7 +15751,8 @@ var AutomationConditionSchema = lazy(() => discriminatedUnion("kind", [
|
|
|
15728
15751
|
child: AutomationConditionSchema
|
|
15729
15752
|
}),
|
|
15730
15753
|
AutomationConditionLeafSchema,
|
|
15731
|
-
AutomationConditionExpressionSchema
|
|
15754
|
+
AutomationConditionExpressionSchema,
|
|
15755
|
+
AutomationConditionStationaryPresentSchema
|
|
15732
15756
|
]));
|
|
15733
15757
|
/**
|
|
15734
15758
|
* What starts a run.
|
|
@@ -15769,7 +15793,34 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
15769
15793
|
kind: literal("schedule"),
|
|
15770
15794
|
cron: string().min(1).max(120)
|
|
15771
15795
|
}),
|
|
15772
|
-
object({ kind: literal("manual") })
|
|
15796
|
+
object({ kind: literal("manual") }),
|
|
15797
|
+
object({
|
|
15798
|
+
kind: literal("detection"),
|
|
15799
|
+
/** Class names. A macro class (`animal`, `vehicle`, `person`, `package`)
|
|
15800
|
+
* matches every raw class that maps to it; any other name matches
|
|
15801
|
+
* exactly. */
|
|
15802
|
+
classes: array(string().min(1)).min(1),
|
|
15803
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
15804
|
+
/** The track must have visited at least one of these zones. */
|
|
15805
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
15806
|
+
/** Best-so-far confidence the track must reach. */
|
|
15807
|
+
minScore: number().min(0).max(1).optional()
|
|
15808
|
+
}),
|
|
15809
|
+
object({
|
|
15810
|
+
kind: literal("stationary"),
|
|
15811
|
+
deviceIds: array(number().int().nonnegative()).min(1),
|
|
15812
|
+
/** Class names; a macro class matches like the detection trigger. */
|
|
15813
|
+
classes: array(string().min(1)).min(1).optional(),
|
|
15814
|
+
/** The parked object must be in at least one of these zones. */
|
|
15815
|
+
zones: array(string().min(1)).min(1).optional(),
|
|
15816
|
+
/** `appeared`: it became parked. `departed`: the registry retired it.
|
|
15817
|
+
* The vocabulary of `PipelineAnalyticsStationaryChanged`. */
|
|
15818
|
+
phase: _enum(["appeared", "departed"])
|
|
15819
|
+
}),
|
|
15820
|
+
object({
|
|
15821
|
+
kind: literal("interval"),
|
|
15822
|
+
minutes: number().int().min(1).max(1440)
|
|
15823
|
+
})
|
|
15773
15824
|
]);
|
|
15774
15825
|
/**
|
|
15775
15826
|
* One action step.
|
|
@@ -15789,28 +15840,47 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
|
|
|
15789
15840
|
* is called. The runner still receives a number and is untouched; the
|
|
15790
15841
|
* resolution is the recipe's job, not the runner's.
|
|
15791
15842
|
*/
|
|
15843
|
+
var AutomationWaitStepSchema = object({
|
|
15844
|
+
kind: literal("wait"),
|
|
15845
|
+
seconds: number().min(0).max(300)
|
|
15846
|
+
});
|
|
15847
|
+
var AutomationCapStepSchema = object({
|
|
15848
|
+
kind: literal("cap"),
|
|
15849
|
+
/**
|
|
15850
|
+
* One device, several same-family devices (locks / climate family / …),
|
|
15851
|
+
* or `{ $var }` for the device that triggered the run. An array is
|
|
15852
|
+
* fan-out at codegen — each id gets the same cap.method call.
|
|
15853
|
+
*/
|
|
15854
|
+
deviceId: union([
|
|
15855
|
+
number().int(),
|
|
15856
|
+
array(number().int()).min(1),
|
|
15857
|
+
object({ $var: string().min(1) })
|
|
15858
|
+
]),
|
|
15859
|
+
cap: string().min(1),
|
|
15860
|
+
method: string().min(1),
|
|
15861
|
+
/** Values may carry `{{vars.x}}` slots, or be exactly `{ $var: 'name' }`, which
|
|
15862
|
+
* SUBSTITUTE and do not evaluate (§3.2.3). Anything beyond substitution is
|
|
15863
|
+
* the expression leaf. */
|
|
15864
|
+
args: record(string(), unknown()).optional()
|
|
15865
|
+
});
|
|
15866
|
+
/**
|
|
15867
|
+
* The steps an internal Action may contain: cap and wait, and nothing that can
|
|
15868
|
+
* call back into an Action — so an Action can never reach itself (no cycles).
|
|
15869
|
+
*/
|
|
15870
|
+
var ActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
|
|
15792
15871
|
var AutomationActionSchema = discriminatedUnion("kind", [
|
|
15872
|
+
AutomationWaitStepSchema,
|
|
15873
|
+
AutomationCapStepSchema,
|
|
15793
15874
|
object({
|
|
15794
|
-
kind: literal("
|
|
15795
|
-
|
|
15796
|
-
|
|
15797
|
-
|
|
15798
|
-
|
|
15799
|
-
|
|
15800
|
-
|
|
15801
|
-
|
|
15802
|
-
|
|
15803
|
-
*/
|
|
15804
|
-
deviceId: union([
|
|
15805
|
-
number().int(),
|
|
15806
|
-
array(number().int()).min(1),
|
|
15807
|
-
object({ $var: string().min(1) })
|
|
15808
|
-
]),
|
|
15809
|
-
cap: string().min(1),
|
|
15810
|
-
method: string().min(1),
|
|
15811
|
-
/** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
|
|
15812
|
-
* evaluate (§3.2.3). Anything beyond substitution is the expression leaf. */
|
|
15813
|
-
args: record(string(), unknown()).optional()
|
|
15875
|
+
kind: literal("action"),
|
|
15876
|
+
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
15877
|
+
actionId: string().min(1),
|
|
15878
|
+
/** Values for the action's declared variables; the others take their default. */
|
|
15879
|
+
variables: record(string(), union([
|
|
15880
|
+
string(),
|
|
15881
|
+
number(),
|
|
15882
|
+
boolean()
|
|
15883
|
+
])).optional()
|
|
15814
15884
|
}),
|
|
15815
15885
|
object({
|
|
15816
15886
|
kind: literal("code"),
|
|
@@ -15819,10 +15889,357 @@ var AutomationActionSchema = discriminatedUnion("kind", [
|
|
|
15819
15889
|
code: string().min(1).max(2e4)
|
|
15820
15890
|
})
|
|
15821
15891
|
]);
|
|
15892
|
+
/**
|
|
15893
|
+
* How a trigger that arrives while the automation is busy (or cooling down) is
|
|
15894
|
+
* handled. One of the automation's execution modes, never a property of its
|
|
15895
|
+
* actions. Absent means `single`.
|
|
15896
|
+
*
|
|
15897
|
+
* - `single` — drop the trigger while a run is in progress (traced + logged).
|
|
15898
|
+
* - `restart` — abort the run in progress (at its next step boundary), start fresh.
|
|
15899
|
+
* - `queued` — queue up to `max` triggers, drop the rest (traced).
|
|
15900
|
+
* - `parallel` — up to `max` runs at once, drop the rest (traced).
|
|
15901
|
+
* - `cooldown` — `single`, and no new run until `minutes` after the last run
|
|
15902
|
+
* STARTED; persisted across a restart. A manual trigger bypasses only this
|
|
15903
|
+
* wait, never the single/queued limits.
|
|
15904
|
+
*/
|
|
15905
|
+
var AutomationRunModeSchema = discriminatedUnion("mode", [
|
|
15906
|
+
object({ mode: literal("single") }),
|
|
15907
|
+
object({ mode: literal("restart") }),
|
|
15908
|
+
object({
|
|
15909
|
+
mode: literal("queued"),
|
|
15910
|
+
max: number().int().min(1).max(10)
|
|
15911
|
+
}),
|
|
15912
|
+
object({
|
|
15913
|
+
mode: literal("parallel"),
|
|
15914
|
+
max: number().int().min(1).max(10)
|
|
15915
|
+
}),
|
|
15916
|
+
object({
|
|
15917
|
+
mode: literal("cooldown"),
|
|
15918
|
+
minutes: number().int().min(1).max(1440)
|
|
15919
|
+
})
|
|
15920
|
+
]);
|
|
15822
15921
|
var AutomationRecipeSchema = object({
|
|
15823
15922
|
triggers: array(AutomationTriggerSchema),
|
|
15824
15923
|
conditions: AutomationConditionSchema.optional(),
|
|
15825
|
-
actions: array(AutomationActionSchema)
|
|
15924
|
+
actions: array(AutomationActionSchema),
|
|
15925
|
+
runMode: AutomationRunModeSchema.optional(),
|
|
15926
|
+
/** How many run traces the automation keeps (default {@link DEFAULT_TRACE_KEEP}). */
|
|
15927
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
15928
|
+
});
|
|
15929
|
+
new Set([
|
|
15930
|
+
{
|
|
15931
|
+
id: "person",
|
|
15932
|
+
name: "Person"
|
|
15933
|
+
},
|
|
15934
|
+
{
|
|
15935
|
+
id: "vehicle",
|
|
15936
|
+
name: "Vehicle"
|
|
15937
|
+
},
|
|
15938
|
+
{
|
|
15939
|
+
id: "animal",
|
|
15940
|
+
name: "Animal"
|
|
15941
|
+
},
|
|
15942
|
+
{
|
|
15943
|
+
id: "package",
|
|
15944
|
+
name: "Package"
|
|
15945
|
+
}
|
|
15946
|
+
].map((l) => l.id));
|
|
15947
|
+
var COCO_TO_MACRO = {
|
|
15948
|
+
mapping: {
|
|
15949
|
+
person: "person",
|
|
15950
|
+
bicycle: "vehicle",
|
|
15951
|
+
car: "vehicle",
|
|
15952
|
+
motorcycle: "vehicle",
|
|
15953
|
+
airplane: "vehicle",
|
|
15954
|
+
bus: "vehicle",
|
|
15955
|
+
train: "vehicle",
|
|
15956
|
+
truck: "vehicle",
|
|
15957
|
+
boat: "vehicle",
|
|
15958
|
+
bird: "animal",
|
|
15959
|
+
cat: "animal",
|
|
15960
|
+
dog: "animal",
|
|
15961
|
+
horse: "animal",
|
|
15962
|
+
sheep: "animal",
|
|
15963
|
+
cow: "animal",
|
|
15964
|
+
elephant: "animal",
|
|
15965
|
+
bear: "animal",
|
|
15966
|
+
zebra: "animal",
|
|
15967
|
+
giraffe: "animal",
|
|
15968
|
+
suitcase: "package",
|
|
15969
|
+
backpack: "package",
|
|
15970
|
+
handbag: "package"
|
|
15971
|
+
},
|
|
15972
|
+
preserveOriginal: false
|
|
15973
|
+
};
|
|
15974
|
+
new Set(Object.values(COCO_TO_MACRO.mapping));
|
|
15975
|
+
/**
|
|
15976
|
+
* Run traces — what an automation (or, later, an Action run) DID, node by node,
|
|
15977
|
+
* so the editor can paint every block green or red with its reason.
|
|
15978
|
+
*
|
|
15979
|
+
* A trace is data, not a log: it covers the WHOLE tree — the trigger stage,
|
|
15980
|
+
* every condition node (containers and leaves, including the ones a
|
|
15981
|
+
* short-circuit never reached), the run-mode verdict and every action step —
|
|
15982
|
+
* each addressed by a stable path (`conditions.0.1`, `actions.2`, or `steps.N`
|
|
15983
|
+
* for an Action run). Skipped
|
|
15984
|
+
* evaluations are traced too, and identical consecutive skips collapse into a
|
|
15985
|
+
* repeat count so a trigger that fails every 5 minutes cannot flush real runs.
|
|
15986
|
+
*
|
|
15987
|
+
* {@link AutomationStepTraceSchema} is deliberately free of automation
|
|
15988
|
+
* vocabulary so an Action run records the same step shape.
|
|
15989
|
+
*/
|
|
15990
|
+
/** A value a trace may show: JSON primitives and short lists, nothing deeper. */
|
|
15991
|
+
var TraceValueSchema = union([
|
|
15992
|
+
string(),
|
|
15993
|
+
number(),
|
|
15994
|
+
boolean(),
|
|
15995
|
+
_null(),
|
|
15996
|
+
array(union([string(), number()]))
|
|
15997
|
+
]);
|
|
15998
|
+
var AutomationRunOutcomeSchema = _enum([
|
|
15999
|
+
"ran",
|
|
16000
|
+
"skipped-trigger",
|
|
16001
|
+
"skipped-conditions",
|
|
16002
|
+
"skipped-cooldown",
|
|
16003
|
+
"skipped-overlap",
|
|
16004
|
+
"failed",
|
|
16005
|
+
"aborted"
|
|
16006
|
+
]);
|
|
16007
|
+
/** `not-evaluated` = a short-circuit never reached the node. */
|
|
16008
|
+
var TraceNodeOutcomeSchema = _enum([
|
|
16009
|
+
"pass",
|
|
16010
|
+
"fail",
|
|
16011
|
+
"not-evaluated"
|
|
16012
|
+
]);
|
|
16013
|
+
var AutomationTriggerTraceSchema = object({
|
|
16014
|
+
kind: string().min(1),
|
|
16015
|
+
outcome: _enum(["pass", "fail"]),
|
|
16016
|
+
/** Why an event was rejected ("class person not in [dog]") or what fired. */
|
|
16017
|
+
reason: string(),
|
|
16018
|
+
/** deviceId, className, trackId, score … — only what the trigger exposes. */
|
|
16019
|
+
vars: record(string(), TraceValueSchema)
|
|
16020
|
+
});
|
|
16021
|
+
var AutomationConditionTraceNodeSchema = object({
|
|
16022
|
+
/** `conditions` for the root, `conditions.<i>` for its i-th child, … */
|
|
16023
|
+
path: string().min(1),
|
|
16024
|
+
kind: _enum([
|
|
16025
|
+
"all",
|
|
16026
|
+
"any",
|
|
16027
|
+
"not",
|
|
16028
|
+
"condition",
|
|
16029
|
+
"expression",
|
|
16030
|
+
"stationary-present"
|
|
16031
|
+
]),
|
|
16032
|
+
outcome: TraceNodeOutcomeSchema,
|
|
16033
|
+
reason: string(),
|
|
16034
|
+
deviceId: number().int().optional(),
|
|
16035
|
+
cap: string().optional(),
|
|
16036
|
+
fieldPath: string().optional(),
|
|
16037
|
+
operator: string().optional(),
|
|
16038
|
+
expected: TraceValueSchema.optional(),
|
|
16039
|
+
/** What the mirror held; `null` when it held nothing (unknown). */
|
|
16040
|
+
observed: TraceValueSchema.optional()
|
|
16041
|
+
});
|
|
16042
|
+
var AutomationRunVerdictSchema = object({
|
|
16043
|
+
mode: AutomationRunModeSchema,
|
|
16044
|
+
decision: _enum([
|
|
16045
|
+
"run",
|
|
16046
|
+
"queued",
|
|
16047
|
+
"restart",
|
|
16048
|
+
"drop",
|
|
16049
|
+
"cooldown",
|
|
16050
|
+
"bypass"
|
|
16051
|
+
]),
|
|
16052
|
+
reason: string()
|
|
16053
|
+
});
|
|
16054
|
+
/** One executed (or not-run) step — shared by automations and Action runs. */
|
|
16055
|
+
var AutomationStepTraceSchema = object({
|
|
16056
|
+
/** `actions.<i>` */
|
|
16057
|
+
path: string().min(1),
|
|
16058
|
+
kind: string().min(1),
|
|
16059
|
+
cap: string().optional(),
|
|
16060
|
+
method: string().optional(),
|
|
16061
|
+
deviceId: number().int().optional(),
|
|
16062
|
+
startedAt: number().optional(),
|
|
16063
|
+
endedAt: number().optional(),
|
|
16064
|
+
outcome: _enum([
|
|
16065
|
+
"ok",
|
|
16066
|
+
"error",
|
|
16067
|
+
"not-run"
|
|
16068
|
+
]),
|
|
16069
|
+
message: string().optional()
|
|
16070
|
+
});
|
|
16071
|
+
var AutomationRunTraceSchema = object({
|
|
16072
|
+
runId: string().min(1),
|
|
16073
|
+
startedAt: number(),
|
|
16074
|
+
endedAt: number(),
|
|
16075
|
+
trigger: AutomationTriggerTraceSchema,
|
|
16076
|
+
conditions: array(AutomationConditionTraceNodeSchema),
|
|
16077
|
+
verdict: AutomationRunVerdictSchema.optional(),
|
|
16078
|
+
steps: array(AutomationStepTraceSchema),
|
|
16079
|
+
outcome: AutomationRunOutcomeSchema,
|
|
16080
|
+
/** How many identical consecutive skips this trace stands for (>= 1). */
|
|
16081
|
+
repeat: number().int().min(1),
|
|
16082
|
+
/** When the latest of those repeats happened. */
|
|
16083
|
+
lastAt: number()
|
|
16084
|
+
});
|
|
16085
|
+
/**
|
|
16086
|
+
* What the hub's `runs` ledger holds for one owner (`automation:<blockId>` or
|
|
16087
|
+
* `action:<actionId>`): the cooldown stamp and the trace ring.
|
|
16088
|
+
*/
|
|
16089
|
+
var AutomationStateDocSchema = object({
|
|
16090
|
+
version: literal(1),
|
|
16091
|
+
lastRunStartedAt: number().nullable(),
|
|
16092
|
+
traces: array(AutomationRunTraceSchema)
|
|
16093
|
+
});
|
|
16094
|
+
/**
|
|
16095
|
+
* Actions — named, runnable things an operator (or an automation) can start,
|
|
16096
|
+
* declared as LIST ENTRIES, never as devices.
|
|
16097
|
+
*
|
|
16098
|
+
* An entry is either **internal** (a short list of cap/wait steps kept in the
|
|
16099
|
+
* hub's `actions` record kind) or declared by an addon through the
|
|
16100
|
+
* `action-source` collection (a Home Assistant script, a scene …). The one
|
|
16101
|
+
* surface the UI and automations talk to is the `actions` cap; it keeps no
|
|
16102
|
+
* catalog of its own (D3) — every `list` asks the providers live.
|
|
16103
|
+
*
|
|
16104
|
+
* This file is the data half: the entry schema, the variables an entry may
|
|
16105
|
+
* declare, and the pure resolution of the values a run was given. It holds no
|
|
16106
|
+
* runtime.
|
|
16107
|
+
*/
|
|
16108
|
+
/** What a variable's value is. `select` takes one of `options`. */
|
|
16109
|
+
var ActionVariableTypeSchema = _enum([
|
|
16110
|
+
"string",
|
|
16111
|
+
"number",
|
|
16112
|
+
"boolean",
|
|
16113
|
+
"select"
|
|
16114
|
+
]);
|
|
16115
|
+
var ACTION_VARIABLE_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
16116
|
+
var ActionVariableValueSchema = union([
|
|
16117
|
+
string(),
|
|
16118
|
+
number(),
|
|
16119
|
+
boolean()
|
|
16120
|
+
]);
|
|
16121
|
+
/**
|
|
16122
|
+
* One declared variable. Steps reference it as `{ $var: 'name' }` (the whole
|
|
16123
|
+
* value) or `{{vars.name}}` (inside a string) in their args.
|
|
16124
|
+
*/
|
|
16125
|
+
var ActionVariableSchema = object({
|
|
16126
|
+
name: string().regex(ACTION_VARIABLE_NAME_RE),
|
|
16127
|
+
label: string().min(1).max(120).optional(),
|
|
16128
|
+
type: ActionVariableTypeSchema,
|
|
16129
|
+
required: boolean().optional(),
|
|
16130
|
+
default: ActionVariableValueSchema.optional(),
|
|
16131
|
+
/** The allowed values of a `select`. */
|
|
16132
|
+
options: array(string().min(1)).min(1).optional()
|
|
16133
|
+
}).superRefine((v, ctx) => {
|
|
16134
|
+
if (v.type === "select" && v.options === void 0) ctx.addIssue({
|
|
16135
|
+
code: "custom",
|
|
16136
|
+
message: "a select variable needs options",
|
|
16137
|
+
path: ["options"]
|
|
16138
|
+
});
|
|
16139
|
+
if (v.default !== void 0 && variableValueError(v, v.default) !== null) ctx.addIssue({
|
|
16140
|
+
code: "custom",
|
|
16141
|
+
message: variableValueError(v, v.default) ?? "invalid default",
|
|
16142
|
+
path: ["default"]
|
|
16143
|
+
});
|
|
16144
|
+
});
|
|
16145
|
+
/** Why `value` is not a legal value for the variable, or null when it is. */
|
|
16146
|
+
function variableValueError(variable, value) {
|
|
16147
|
+
switch (variable.type) {
|
|
16148
|
+
case "string": return typeof value === "string" ? null : `variable "${variable.name}" must be a string`;
|
|
16149
|
+
case "number": return typeof value === "number" && Number.isFinite(value) ? null : `variable "${variable.name}" must be a number`;
|
|
16150
|
+
case "boolean": return typeof value === "boolean" ? null : `variable "${variable.name}" must be true or false`;
|
|
16151
|
+
case "select": return typeof value === "string" && (variable.options ?? []).includes(value) ? null : `variable "${variable.name}" must be one of ${(variable.options ?? []).join(", ")}`;
|
|
16152
|
+
}
|
|
16153
|
+
}
|
|
16154
|
+
var ActionSourceKindSchema = _enum(["internal", "addon"]);
|
|
16155
|
+
function isInternalActionId(actionId) {
|
|
16156
|
+
return actionId.startsWith("internal:") && actionId.length > 9;
|
|
16157
|
+
}
|
|
16158
|
+
/** The addon behind a `<addonId>:<localId>` id, or null for anything else (internal included). */
|
|
16159
|
+
function addonIdOfActionId(actionId) {
|
|
16160
|
+
if (isInternalActionId(actionId)) return null;
|
|
16161
|
+
const at = actionId.indexOf(":");
|
|
16162
|
+
return at > 0 && at < actionId.length - 1 ? actionId.slice(0, at) : null;
|
|
16163
|
+
}
|
|
16164
|
+
var ActionStatusSchema = object({
|
|
16165
|
+
isRunning: boolean(),
|
|
16166
|
+
/** Ms epoch the latest run STARTED; null when it never ran. */
|
|
16167
|
+
lastRunAt: number().nullable(),
|
|
16168
|
+
/** The latest run's failure; null on success or when it never ran. */
|
|
16169
|
+
lastError: string().nullable()
|
|
16170
|
+
});
|
|
16171
|
+
var ActionEntrySchema = object({
|
|
16172
|
+
/** `internal:<uuid>` or `<addonId>:<localId>`. */
|
|
16173
|
+
id: string().min(3),
|
|
16174
|
+
name: string().min(1).max(120),
|
|
16175
|
+
/** The addon that declared it; `core-blocks` for an internal one. */
|
|
16176
|
+
addonId: string().min(1),
|
|
16177
|
+
source: ActionSourceKindSchema,
|
|
16178
|
+
/** An addon-declared entry is edited where it was declared. */
|
|
16179
|
+
readOnly: boolean(),
|
|
16180
|
+
/** Internal only: cap and wait steps. No action-in-action, so no cycles. */
|
|
16181
|
+
steps: array(ActionStepSchema).min(1).max(50).optional(),
|
|
16182
|
+
variables: array(ActionVariableSchema).max(20).optional(),
|
|
16183
|
+
status: ActionStatusSchema
|
|
16184
|
+
}).superRefine((entry, ctx) => {
|
|
16185
|
+
if (entry.source === "internal") {
|
|
16186
|
+
if (!isInternalActionId(entry.id)) ctx.addIssue({
|
|
16187
|
+
code: "custom",
|
|
16188
|
+
message: "an internal action id is internal:<uuid>",
|
|
16189
|
+
path: ["id"]
|
|
16190
|
+
});
|
|
16191
|
+
return;
|
|
16192
|
+
}
|
|
16193
|
+
if (entry.steps !== void 0) ctx.addIssue({
|
|
16194
|
+
code: "custom",
|
|
16195
|
+
message: "only an internal action carries steps",
|
|
16196
|
+
path: ["steps"]
|
|
16197
|
+
});
|
|
16198
|
+
if (!entry.readOnly) ctx.addIssue({
|
|
16199
|
+
code: "custom",
|
|
16200
|
+
message: "an addon action is read-only here",
|
|
16201
|
+
path: ["readOnly"]
|
|
16202
|
+
});
|
|
16203
|
+
if (addonIdOfActionId(entry.id) === null) ctx.addIssue({
|
|
16204
|
+
code: "custom",
|
|
16205
|
+
message: "an addon action id is <addonId>:<localId>",
|
|
16206
|
+
path: ["id"]
|
|
16207
|
+
});
|
|
16208
|
+
});
|
|
16209
|
+
/** What an operator writes for an internal action. */
|
|
16210
|
+
var ActionInputSchema = object({
|
|
16211
|
+
name: string().min(1).max(120),
|
|
16212
|
+
steps: array(ActionStepSchema).min(1).max(50),
|
|
16213
|
+
variables: array(ActionVariableSchema).max(20).optional()
|
|
16214
|
+
});
|
|
16215
|
+
/** Who started a run. Absent = the operator pressed it. */
|
|
16216
|
+
var ActionRunOriginSchema = object({
|
|
16217
|
+
/** The automation block whose step started it. */
|
|
16218
|
+
blockId: string().min(1).optional() });
|
|
16219
|
+
/** `started` = the caller did not ask to wait. */
|
|
16220
|
+
var ActionRunOutcomeSchema = union([AutomationRunOutcomeSchema, literal("started")]);
|
|
16221
|
+
var ActionRunResultSchema = object({
|
|
16222
|
+
runId: string().min(1),
|
|
16223
|
+
outcome: ActionRunOutcomeSchema,
|
|
16224
|
+
/** Why it did not run, or what failed. */
|
|
16225
|
+
message: string().optional()
|
|
16226
|
+
});
|
|
16227
|
+
_enum([
|
|
16228
|
+
"not-found",
|
|
16229
|
+
"read-only",
|
|
16230
|
+
"invalid-variables",
|
|
16231
|
+
"invalid-steps",
|
|
16232
|
+
"not-linked",
|
|
16233
|
+
"busy"
|
|
16234
|
+
]);
|
|
16235
|
+
object({
|
|
16236
|
+
actionId: string(),
|
|
16237
|
+
runId: string(),
|
|
16238
|
+
isRunning: boolean(),
|
|
16239
|
+
/** Set when the run ended. */
|
|
16240
|
+
outcome: AutomationRunOutcomeSchema.optional(),
|
|
16241
|
+
lastRunAt: number().nullable(),
|
|
16242
|
+
lastError: string().nullable()
|
|
15826
16243
|
});
|
|
15827
16244
|
/**
|
|
15828
16245
|
* `addon-pages` — system-scoped singleton aggregator cap. Public-facing
|
|
@@ -18509,7 +18926,7 @@ var CompositionEventPlanSchema = object({
|
|
|
18509
18926
|
stateField: string(),
|
|
18510
18927
|
fieldKey: string()
|
|
18511
18928
|
});
|
|
18512
|
-
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.
|
|
18929
|
+
/** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
|
|
18513
18930
|
var CompositionProblemSchema = object({
|
|
18514
18931
|
code: _enum([
|
|
18515
18932
|
"reserved-variant",
|
|
@@ -18828,7 +19245,7 @@ var GROUP_TEMPLATES = [
|
|
|
18828
19245
|
summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
|
|
18829
19246
|
role: DeviceRole.TemperatureSensor,
|
|
18830
19247
|
outputCap: "temperature-sensor",
|
|
18831
|
-
outputField: "
|
|
19248
|
+
outputField: "temperature",
|
|
18832
19249
|
quantity: "temperature",
|
|
18833
19250
|
defaultAggregate: "mean",
|
|
18834
19251
|
empty: "null",
|
|
@@ -18839,7 +19256,7 @@ var GROUP_TEMPLATES = [
|
|
|
18839
19256
|
summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
18840
19257
|
role: DeviceRole.HumiditySensor,
|
|
18841
19258
|
outputCap: "humidity-sensor",
|
|
18842
|
-
outputField: "
|
|
19259
|
+
outputField: "humidity",
|
|
18843
19260
|
quantity: "humidity",
|
|
18844
19261
|
defaultAggregate: "mean",
|
|
18845
19262
|
empty: "null",
|
|
@@ -18850,7 +19267,7 @@ var GROUP_TEMPLATES = [
|
|
|
18850
19267
|
summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
|
|
18851
19268
|
role: DeviceRole.PressureSensor,
|
|
18852
19269
|
outputCap: "pressure-sensor",
|
|
18853
|
-
outputField: "
|
|
19270
|
+
outputField: "pressure",
|
|
18854
19271
|
quantity: "pressure",
|
|
18855
19272
|
defaultAggregate: "mean",
|
|
18856
19273
|
empty: "null",
|
|
@@ -18861,7 +19278,7 @@ var GROUP_TEMPLATES = [
|
|
|
18861
19278
|
summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
|
|
18862
19279
|
role: DeviceRole.AmbientLightSensor,
|
|
18863
19280
|
outputCap: "ambient-light-sensor",
|
|
18864
|
-
outputField: "
|
|
19281
|
+
outputField: "illuminance",
|
|
18865
19282
|
quantity: "illuminance",
|
|
18866
19283
|
defaultAggregate: "mean",
|
|
18867
19284
|
empty: "null",
|
|
@@ -18872,7 +19289,7 @@ var GROUP_TEMPLATES = [
|
|
|
18872
19289
|
summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
|
|
18873
19290
|
role: DeviceRole.PowerSensor,
|
|
18874
19291
|
outputCap: "power-meter",
|
|
18875
|
-
outputField: "
|
|
19292
|
+
outputField: "power",
|
|
18876
19293
|
quantity: "power",
|
|
18877
19294
|
defaultAggregate: "sum",
|
|
18878
19295
|
empty: "omit",
|
|
@@ -18883,7 +19300,7 @@ var GROUP_TEMPLATES = [
|
|
|
18883
19300
|
summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
|
|
18884
19301
|
role: DeviceRole.EnergySensor,
|
|
18885
19302
|
outputCap: "power-meter",
|
|
18886
|
-
outputField: "
|
|
19303
|
+
outputField: "energy",
|
|
18887
19304
|
quantity: "energy",
|
|
18888
19305
|
defaultAggregate: "sum",
|
|
18889
19306
|
empty: "omit",
|
|
@@ -18894,7 +19311,7 @@ var GROUP_TEMPLATES = [
|
|
|
18894
19311
|
summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
|
|
18895
19312
|
role: DeviceRole.BatterySensor,
|
|
18896
19313
|
outputCap: "battery",
|
|
18897
|
-
outputField: "
|
|
19314
|
+
outputField: "level",
|
|
18898
19315
|
quantity: "percentage",
|
|
18899
19316
|
defaultAggregate: "mean",
|
|
18900
19317
|
empty: "null",
|
|
@@ -19472,7 +19889,18 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
19472
19889
|
kind: "mutation",
|
|
19473
19890
|
auth: "admin",
|
|
19474
19891
|
access: "view"
|
|
19475
|
-
})
|
|
19892
|
+
}), method(object({
|
|
19893
|
+
blockId: string().min(1),
|
|
19894
|
+
trace: AutomationRunTraceSchema.optional(),
|
|
19895
|
+
runStartedAt: number().optional(),
|
|
19896
|
+
keepTraces: number().int().min(1).max(100).optional()
|
|
19897
|
+
}), _void(), {
|
|
19898
|
+
kind: "mutation",
|
|
19899
|
+
auth: "admin"
|
|
19900
|
+
}), method(object({ blockId: string().min(1) }), AutomationStateDocSchema, { auth: "admin" }), method(object({ blockId: string().min(1) }), object({
|
|
19901
|
+
traces: array(AutomationRunTraceSchema),
|
|
19902
|
+
lastError: string().nullable()
|
|
19903
|
+
}), { auth: "admin" });
|
|
19476
19904
|
/**
|
|
19477
19905
|
* `custom-model-registry` — collection cap exposing operator-registered
|
|
19478
19906
|
* custom detection models. Each provider (today: `addon-model-studio`)
|
|
@@ -44889,51 +45317,6 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
|
|
|
44889
45317
|
kind: "mutation",
|
|
44890
45318
|
auth: "admin"
|
|
44891
45319
|
});
|
|
44892
|
-
new Set([
|
|
44893
|
-
{
|
|
44894
|
-
id: "person",
|
|
44895
|
-
name: "Person"
|
|
44896
|
-
},
|
|
44897
|
-
{
|
|
44898
|
-
id: "vehicle",
|
|
44899
|
-
name: "Vehicle"
|
|
44900
|
-
},
|
|
44901
|
-
{
|
|
44902
|
-
id: "animal",
|
|
44903
|
-
name: "Animal"
|
|
44904
|
-
},
|
|
44905
|
-
{
|
|
44906
|
-
id: "package",
|
|
44907
|
-
name: "Package"
|
|
44908
|
-
}
|
|
44909
|
-
].map((l) => l.id));
|
|
44910
|
-
var COCO_TO_MACRO = {
|
|
44911
|
-
mapping: {
|
|
44912
|
-
person: "person",
|
|
44913
|
-
bicycle: "vehicle",
|
|
44914
|
-
car: "vehicle",
|
|
44915
|
-
motorcycle: "vehicle",
|
|
44916
|
-
airplane: "vehicle",
|
|
44917
|
-
bus: "vehicle",
|
|
44918
|
-
train: "vehicle",
|
|
44919
|
-
truck: "vehicle",
|
|
44920
|
-
boat: "vehicle",
|
|
44921
|
-
bird: "animal",
|
|
44922
|
-
cat: "animal",
|
|
44923
|
-
dog: "animal",
|
|
44924
|
-
horse: "animal",
|
|
44925
|
-
sheep: "animal",
|
|
44926
|
-
cow: "animal",
|
|
44927
|
-
elephant: "animal",
|
|
44928
|
-
bear: "animal",
|
|
44929
|
-
zebra: "animal",
|
|
44930
|
-
giraffe: "animal",
|
|
44931
|
-
suitcase: "package",
|
|
44932
|
-
backpack: "package",
|
|
44933
|
-
handbag: "package"
|
|
44934
|
-
},
|
|
44935
|
-
preserveOriginal: false
|
|
44936
|
-
};
|
|
44937
45320
|
var AUDIO_MACRO_LABELS = [
|
|
44938
45321
|
{
|
|
44939
45322
|
id: "speech",
|
|
@@ -58022,9 +58405,9 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
|
|
|
58022
58405
|
*/
|
|
58023
58406
|
var AirQualitySensorStatusSchema = object({
|
|
58024
58407
|
/** Carbon dioxide concentration in ppm. */
|
|
58025
|
-
|
|
58408
|
+
co2: number().min(0).optional().meta(readingMeta("concentration-volume")),
|
|
58026
58409
|
/** Total volatile organic compounds in ppb. */
|
|
58027
|
-
|
|
58410
|
+
voc: number().min(0).optional().meta(readingMeta("concentration-ppb")),
|
|
58028
58411
|
/** Particulate matter ≤ 2.5 μm in µg/m³. */
|
|
58029
58412
|
pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
|
|
58030
58413
|
/** Particulate matter ≤ 10 μm in µg/m³. */
|
|
@@ -58057,12 +58440,12 @@ var airQualitySensorCapability = {
|
|
|
58057
58440
|
* History (D850): recorded series.
|
|
58058
58441
|
*/
|
|
58059
58442
|
history: { fields: {
|
|
58060
|
-
|
|
58443
|
+
co2: {
|
|
58061
58444
|
kind: "gauge",
|
|
58062
58445
|
unit: "ppm",
|
|
58063
58446
|
deadband: 5
|
|
58064
58447
|
},
|
|
58065
|
-
|
|
58448
|
+
voc: {
|
|
58066
58449
|
kind: "gauge",
|
|
58067
58450
|
unit: "ppb",
|
|
58068
58451
|
deadband: 5
|
|
@@ -58093,7 +58476,7 @@ var airQualitySensorCapability = {
|
|
|
58093
58476
|
*/
|
|
58094
58477
|
var AmbientLightSensorStatusSchema = object({
|
|
58095
58478
|
/** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
|
|
58096
|
-
|
|
58479
|
+
illuminance: number().min(0).nullable().meta(readingMeta("illuminance", {
|
|
58097
58480
|
precision: 0,
|
|
58098
58481
|
label: "Illuminance"
|
|
58099
58482
|
})),
|
|
@@ -58122,7 +58505,7 @@ var ambientLightSensorCapability = {
|
|
|
58122
58505
|
/**
|
|
58123
58506
|
* History (D850): recorded series. Wide range, so a RELATIVE deadband (10 %).
|
|
58124
58507
|
*/
|
|
58125
|
-
history: { fields: {
|
|
58508
|
+
history: { fields: { illuminance: {
|
|
58126
58509
|
kind: "gauge",
|
|
58127
58510
|
unit: "lx",
|
|
58128
58511
|
deadbandPct: 10,
|
|
@@ -58261,6 +58644,84 @@ var audioMetricsCapability = {
|
|
|
58261
58644
|
*/
|
|
58262
58645
|
history: "none"
|
|
58263
58646
|
};
|
|
58647
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
58648
|
+
actionId: string().min(1),
|
|
58649
|
+
variables: record(string(), ActionVariableValueSchema).optional()
|
|
58650
|
+
}), _void(), {
|
|
58651
|
+
kind: "mutation",
|
|
58652
|
+
auth: "admin"
|
|
58653
|
+
}), method(object({ actionId: string().min(1) }), _void(), {
|
|
58654
|
+
kind: "mutation",
|
|
58655
|
+
auth: "admin"
|
|
58656
|
+
});
|
|
58657
|
+
/**
|
|
58658
|
+
* actions — the ONE surface for runnable actions, for the UI and for
|
|
58659
|
+
* automations. Provided by the core-blocks builtin on the hub.
|
|
58660
|
+
*
|
|
58661
|
+
* An action is a LIST ENTRY, not a device (D883): either internal (cap and wait
|
|
58662
|
+
* steps, kept in the hub's `actions` record kind) or declared by an addon over
|
|
58663
|
+
* `action-source`. `list` asks every `action-source` provider LIVE and overlays
|
|
58664
|
+
* the run status from the hub's `runs` ledger; there is no catalog here to
|
|
58665
|
+
* drift (D3).
|
|
58666
|
+
*
|
|
58667
|
+
* **Permissions follow the camera, as linked devices do.** An action is linked
|
|
58668
|
+
* to cameras by the operator (`setLinks`, D356: nothing links itself). A
|
|
58669
|
+
* non-admin may `get` / `run` an action only through a camera they may see that
|
|
58670
|
+
* links it: they name the camera (`deviceId`, a top-level field so the scope
|
|
58671
|
+
* gate sees it) and the provider refuses an action that camera does not link.
|
|
58672
|
+
* An admin, and an in-process caller (an automation block), may run any action.
|
|
58673
|
+
* Every refusal is typed (`[not-linked] …`) and logged.
|
|
58674
|
+
*
|
|
58675
|
+
* A second `run` of an action that is already running is REFUSED — traced and
|
|
58676
|
+
* logged — never queued.
|
|
58677
|
+
*/
|
|
58678
|
+
var ActionIdInput = object({ actionId: string().min(1) });
|
|
58679
|
+
var ActionLinksSchema = object({
|
|
58680
|
+
deviceId: number().int().nonnegative(),
|
|
58681
|
+
actionIds: array(string().min(1)).max(100)
|
|
58682
|
+
});
|
|
58683
|
+
method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
58684
|
+
actionId: string().min(1),
|
|
58685
|
+
deviceId: number().int().nonnegative().optional()
|
|
58686
|
+
}), object({ action: ActionEntrySchema.nullable() }), {
|
|
58687
|
+
role: "viewer",
|
|
58688
|
+
auth: "protected",
|
|
58689
|
+
kind: "query",
|
|
58690
|
+
caller: "required"
|
|
58691
|
+
}), method(object({
|
|
58692
|
+
actionId: string().min(1),
|
|
58693
|
+
variables: record(string(), ActionVariableValueSchema).optional(),
|
|
58694
|
+
wait: boolean().optional(),
|
|
58695
|
+
origin: ActionRunOriginSchema.optional(),
|
|
58696
|
+
deviceId: number().int().nonnegative().optional()
|
|
58697
|
+
}), ActionRunResultSchema, {
|
|
58698
|
+
role: "viewer",
|
|
58699
|
+
auth: "protected",
|
|
58700
|
+
kind: "mutation",
|
|
58701
|
+
caller: "required"
|
|
58702
|
+
}), method(ActionIdInput, _void(), {
|
|
58703
|
+
kind: "mutation",
|
|
58704
|
+
auth: "admin"
|
|
58705
|
+
}), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({ action: ActionEntrySchema }), {
|
|
58706
|
+
kind: "mutation",
|
|
58707
|
+
auth: "admin"
|
|
58708
|
+
}), method(object({
|
|
58709
|
+
actionId: string().min(1),
|
|
58710
|
+
action: ActionInputSchema.partial()
|
|
58711
|
+
}), object({ action: ActionEntrySchema }), {
|
|
58712
|
+
kind: "mutation",
|
|
58713
|
+
auth: "admin"
|
|
58714
|
+
}), method(ActionIdInput, _void(), {
|
|
58715
|
+
kind: "mutation",
|
|
58716
|
+
auth: "admin"
|
|
58717
|
+
}), method(object({ deviceId: number().int().nonnegative() }), array(ActionEntrySchema), {
|
|
58718
|
+
role: "viewer",
|
|
58719
|
+
auth: "protected",
|
|
58720
|
+
kind: "query"
|
|
58721
|
+
}), method(object({ deviceId: number().int().nonnegative() }), ActionLinksSchema, { auth: "admin" }), method(ActionLinksSchema, ActionLinksSchema, {
|
|
58722
|
+
kind: "mutation",
|
|
58723
|
+
auth: "admin"
|
|
58724
|
+
});
|
|
58264
58725
|
/**
|
|
58265
58726
|
* Automation-control cap. Models HA `automation.*` entities on
|
|
58266
58727
|
* `DeviceType.Automation`. An automation is a trigger+condition+
|
|
@@ -58357,7 +58818,7 @@ var BatteryStatusSchema = object({
|
|
|
58357
58818
|
* Consumers must SKIP a null rather than coerce it — `battery-band` already
|
|
58358
58819
|
* declines to band a non-finite reading, which is the correct shape.
|
|
58359
58820
|
*/
|
|
58360
|
-
|
|
58821
|
+
level: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
|
|
58361
58822
|
/**
|
|
58362
58823
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
58363
58824
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
@@ -58367,7 +58828,7 @@ var BatteryStatusSchema = object({
|
|
|
58367
58828
|
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
58368
58829
|
* power fields yet, or the firmware reported neither. Before it existed,
|
|
58369
58830
|
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
58370
|
-
* was drawn "on battery alone" — the same D315 defect `
|
|
58831
|
+
* was drawn "on battery alone" — the same D315 defect `level` closed
|
|
58371
58832
|
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
58372
58833
|
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
58373
58834
|
*/
|
|
@@ -58391,7 +58852,7 @@ var BatteryStatusSchema = object({
|
|
|
58391
58852
|
* that only report charge. A second reading on this cap, not a second
|
|
58392
58853
|
* `numeric-sensor` on the same device.
|
|
58393
58854
|
*/
|
|
58394
|
-
|
|
58855
|
+
voltage: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
58395
58856
|
/**
|
|
58396
58857
|
* Ms epoch of the last time the device PROVED it was reachable — a
|
|
58397
58858
|
* completed firmware round-trip, an observed wake, or an inbound push
|
|
@@ -58425,7 +58886,7 @@ var BatteryStatusSchema = object({
|
|
|
58425
58886
|
/**
|
|
58426
58887
|
* True when the source is a BINARY low-battery indicator (HA
|
|
58427
58888
|
* `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
|
|
58428
|
-
* charge level — `
|
|
58889
|
+
* charge level — `level` is then a coarse stand-in (100 = normal,
|
|
58429
58890
|
* sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
|
|
58430
58891
|
* misleading exact percentage. Absent/false → genuine 0–100 % reading.
|
|
58431
58892
|
*/
|
|
@@ -58445,15 +58906,15 @@ var BATTERY_DEVICE_TYPES = [
|
|
|
58445
58906
|
var batteryCustomize = {
|
|
58446
58907
|
version: 1,
|
|
58447
58908
|
targets: [{
|
|
58448
|
-
id: "
|
|
58909
|
+
id: "level",
|
|
58449
58910
|
cardinality: "scalar",
|
|
58450
58911
|
vocabulary: {
|
|
58451
58912
|
cap: "battery",
|
|
58452
|
-
stateField: "
|
|
58913
|
+
stateField: "level"
|
|
58453
58914
|
},
|
|
58454
58915
|
deviceTypes: BATTERY_DEVICE_TYPES,
|
|
58455
58916
|
apply: "add",
|
|
58456
|
-
path: "
|
|
58917
|
+
path: "level",
|
|
58457
58918
|
sources: [{
|
|
58458
58919
|
kind: "field",
|
|
58459
58920
|
valueKinds: ["number", "string"],
|
|
@@ -58547,7 +59008,7 @@ onStatusChanged: { data: object({
|
|
|
58547
59008
|
schema: BatteryStatusSchema,
|
|
58548
59009
|
kind: "push",
|
|
58549
59010
|
empty: {
|
|
58550
|
-
|
|
59011
|
+
level: null,
|
|
58551
59012
|
charging: "unknown",
|
|
58552
59013
|
sleeping: false,
|
|
58553
59014
|
lastUpdated: 0
|
|
@@ -58574,11 +59035,11 @@ onStatusChanged: { data: object({
|
|
|
58574
59035
|
* History (D850): recorded series. The generic capture replaces the `battery` series of `pipeline-analytics:stats-5m`.
|
|
58575
59036
|
*/
|
|
58576
59037
|
history: { fields: {
|
|
58577
|
-
|
|
59038
|
+
level: {
|
|
58578
59039
|
kind: "gauge",
|
|
58579
59040
|
unit: "%"
|
|
58580
59041
|
},
|
|
58581
|
-
|
|
59042
|
+
voltage: {
|
|
58582
59043
|
kind: "gauge",
|
|
58583
59044
|
unit: "V"
|
|
58584
59045
|
}
|
|
@@ -58638,14 +59099,14 @@ var binaryCapability = {
|
|
|
58638
59099
|
* controls to this single-method surface.
|
|
58639
59100
|
*
|
|
58640
59101
|
* The cap is intentionally minimal: a single `setBrightness({deviceId,
|
|
58641
|
-
*
|
|
59102
|
+
* level})` mutation plus the auto-injected `getStatus`. Drivers
|
|
58642
59103
|
* that expose richer controls (color temperature, scenes, schedules)
|
|
58643
59104
|
* should surface those via the device's `getSettingsUISchema()`
|
|
58644
59105
|
* instead of bloating this cap.
|
|
58645
59106
|
*/
|
|
58646
59107
|
var BrightnessStatusSchema = object({
|
|
58647
59108
|
/** Current level as 0..100 inclusive. Firmware-reported. */
|
|
58648
|
-
|
|
59109
|
+
level: number().min(0).max(100).meta(readingMeta("percentage")),
|
|
58649
59110
|
/** Ms epoch of the last operator-driven change. Useful for UI freshness. */
|
|
58650
59111
|
lastChangedAt: number()
|
|
58651
59112
|
});
|
|
@@ -58657,7 +59118,7 @@ var brightnessCapability = {
|
|
|
58657
59118
|
deviceTypes: [DeviceType.Light],
|
|
58658
59119
|
methods: { setBrightness: method(object({
|
|
58659
59120
|
deviceId: number().int().nonnegative(),
|
|
58660
|
-
|
|
59121
|
+
level: number().min(0).max(100)
|
|
58661
59122
|
}), _void(), {
|
|
58662
59123
|
kind: "mutation",
|
|
58663
59124
|
auth: "protected"
|
|
@@ -58670,7 +59131,7 @@ var brightnessCapability = {
|
|
|
58670
59131
|
*/
|
|
58671
59132
|
onBrightnessChanged: { data: object({
|
|
58672
59133
|
deviceId: number(),
|
|
58673
|
-
|
|
59134
|
+
level: number().min(0).max(100),
|
|
58674
59135
|
lastChangedAt: number()
|
|
58675
59136
|
}) } },
|
|
58676
59137
|
status: {
|
|
@@ -58693,7 +59154,7 @@ onBrightnessChanged: { data: object({
|
|
|
58693
59154
|
/**
|
|
58694
59155
|
* History (D850): recorded series. Actuator tier: level keeps every change.
|
|
58695
59156
|
*/
|
|
58696
|
-
history: { fields: {
|
|
59157
|
+
history: { fields: { level: {
|
|
58697
59158
|
kind: "gauge",
|
|
58698
59159
|
unit: "%",
|
|
58699
59160
|
minIntervalMs: 0
|
|
@@ -59290,11 +59751,11 @@ var ColorInputSchema = discriminatedUnion("mode", [
|
|
|
59290
59751
|
}),
|
|
59291
59752
|
object({
|
|
59292
59753
|
mode: literal("mired"),
|
|
59293
|
-
|
|
59754
|
+
colorTemperature: number().int().min(50).max(1e3)
|
|
59294
59755
|
})
|
|
59295
59756
|
]);
|
|
59296
59757
|
var ColorStatusSchema = object({
|
|
59297
|
-
/** Active color mode — which of `rgb` / `hsv` / `
|
|
59758
|
+
/** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
|
|
59298
59759
|
* the bulb's current state. */
|
|
59299
59760
|
mode: _enum([
|
|
59300
59761
|
"rgb",
|
|
@@ -59306,7 +59767,7 @@ var ColorStatusSchema = object({
|
|
|
59306
59767
|
/** Populated when `mode === 'hsv'`. */
|
|
59307
59768
|
hsv: HsvTripletSchema.optional(),
|
|
59308
59769
|
/** Populated when `mode === 'mired'`. */
|
|
59309
|
-
|
|
59770
|
+
colorTemperature: number().int().optional().meta(readingMeta("colour-temperature")),
|
|
59310
59771
|
/** Ms epoch of the last operator-driven change. */
|
|
59311
59772
|
lastChangedAt: number()
|
|
59312
59773
|
});
|
|
@@ -59338,7 +59799,7 @@ onColorChanged: { data: object({
|
|
|
59338
59799
|
]),
|
|
59339
59800
|
rgb: RgbTripletSchema.optional(),
|
|
59340
59801
|
hsv: HsvTripletSchema.optional(),
|
|
59341
|
-
|
|
59802
|
+
colorTemperature: number().int().optional(),
|
|
59342
59803
|
lastChangedAt: number()
|
|
59343
59804
|
}) } },
|
|
59344
59805
|
status: {
|
|
@@ -60215,11 +60676,11 @@ var DishwasherStatusSchema = object({
|
|
|
60215
60676
|
/** Feature keys of the programs the appliance currently offers — drives the UI selector. */
|
|
60216
60677
|
availablePrograms: array(string()),
|
|
60217
60678
|
/** Seconds remaining on the active cycle, or null when not running / not known. */
|
|
60218
|
-
|
|
60679
|
+
remaining: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
60219
60680
|
/** Seconds the delayed start is set to (time until the cycle starts), or null. */
|
|
60220
|
-
|
|
60681
|
+
delayedStart: number().int().nonnegative().nullable().meta(readingMeta("duration")),
|
|
60221
60682
|
/** Cycle completion 0..100, or null when not applicable. */
|
|
60222
|
-
|
|
60683
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
60223
60684
|
/** True when the door is reported open; null when the door state is not known. */
|
|
60224
60685
|
doorOpen: boolean().nullable(),
|
|
60225
60686
|
/** True when the door is latched (locked) during a cycle; null when not reported. */
|
|
@@ -60438,14 +60899,14 @@ var dishwasherCapability = {
|
|
|
60438
60899
|
runtimeState: DishwasherStatusSchema,
|
|
60439
60900
|
durability: "session",
|
|
60440
60901
|
history: { fields: {
|
|
60441
|
-
|
|
60902
|
+
progress: {
|
|
60442
60903
|
kind: "gauge",
|
|
60443
60904
|
unit: "%",
|
|
60444
60905
|
deadband: 2
|
|
60445
60906
|
},
|
|
60446
60907
|
state: { kind: "enum" },
|
|
60447
60908
|
operationState: { kind: "enum" },
|
|
60448
|
-
|
|
60909
|
+
remaining: {
|
|
60449
60910
|
kind: "gauge",
|
|
60450
60911
|
unit: "s",
|
|
60451
60912
|
minIntervalMs: 6e4
|
|
@@ -61036,7 +61497,7 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
|
|
|
61036
61497
|
var FanControlStatusSchema = object({
|
|
61037
61498
|
/** Active speed as 0..100 inclusive. Null when the device has no
|
|
61038
61499
|
* speed surface (single-speed fan). */
|
|
61039
|
-
|
|
61500
|
+
speed: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
61040
61501
|
/** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
|
|
61041
61502
|
* a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
|
|
61042
61503
|
percentageStep: number().positive().optional().meta(readingMeta("percentage")),
|
|
@@ -61063,7 +61524,7 @@ var fanControlCapability = {
|
|
|
61063
61524
|
methods: {
|
|
61064
61525
|
setPercentage: method(object({
|
|
61065
61526
|
deviceId: number().int().nonnegative(),
|
|
61066
|
-
|
|
61527
|
+
speed: number().min(0).max(100)
|
|
61067
61528
|
}), _void(), {
|
|
61068
61529
|
kind: "mutation",
|
|
61069
61530
|
auth: "protected"
|
|
@@ -61096,7 +61557,7 @@ var fanControlCapability = {
|
|
|
61096
61557
|
},
|
|
61097
61558
|
/**
|
|
61098
61559
|
* Runtime-state slice — mirrored by the kernel. UI fan speed
|
|
61099
|
-
* sliders read `
|
|
61560
|
+
* sliders read `speed` for live updates.
|
|
61100
61561
|
*/
|
|
61101
61562
|
runtimeState: FanControlStatusSchema,
|
|
61102
61563
|
/**
|
|
@@ -61110,7 +61571,7 @@ var fanControlCapability = {
|
|
|
61110
61571
|
* History (D850): recorded series. Actuator tier: speed keeps every change.
|
|
61111
61572
|
*/
|
|
61112
61573
|
history: { fields: {
|
|
61113
|
-
|
|
61574
|
+
speed: {
|
|
61114
61575
|
kind: "gauge",
|
|
61115
61576
|
unit: "%",
|
|
61116
61577
|
minIntervalMs: 0
|
|
@@ -61555,7 +62016,7 @@ var humidifierCapability = {
|
|
|
61555
62016
|
*/
|
|
61556
62017
|
var HumiditySensorStatusSchema = object({
|
|
61557
62018
|
/** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
|
|
61558
|
-
|
|
62019
|
+
humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
|
|
61559
62020
|
precision: 0,
|
|
61560
62021
|
label: "Humidity"
|
|
61561
62022
|
})),
|
|
@@ -61584,7 +62045,7 @@ var humiditySensorCapability = {
|
|
|
61584
62045
|
/**
|
|
61585
62046
|
* History (D850): recorded series.
|
|
61586
62047
|
*/
|
|
61587
|
-
history: { fields: {
|
|
62048
|
+
history: { fields: { humidity: {
|
|
61588
62049
|
kind: "gauge",
|
|
61589
62050
|
unit: "%",
|
|
61590
62051
|
deadband: .5
|
|
@@ -62224,7 +62685,7 @@ var LawnMowerControlStatusSchema = object({
|
|
|
62224
62685
|
batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
62225
62686
|
/** 0..100 mowing-completion percentage of the current task, or null when no
|
|
62226
62687
|
* task is active / progress is unavailable. */
|
|
62227
|
-
|
|
62688
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
62228
62689
|
/** Current device/event code (dynamic — mostly status, sometimes an error),
|
|
62229
62690
|
* or null when unknown. */
|
|
62230
62691
|
currentCode: number().nullable().meta(readingMeta("none")),
|
|
@@ -62724,7 +63185,7 @@ var lockControlCapability = {
|
|
|
62724
63185
|
volatileStateFields: ["lastChangedAt"]
|
|
62725
63186
|
};
|
|
62726
63187
|
/**
|
|
62727
|
-
* A monotonic total between resets (D944). Energy uses `power-meter.
|
|
63188
|
+
* A monotonic total between resets (D944). Energy uses `power-meter.energy`
|
|
62728
63189
|
* so dashboards keep one series; every other instantaneous reading lands here.
|
|
62729
63190
|
* `value` is the time integral in the source quantity's accumulated base
|
|
62730
63191
|
* (base-unit seconds, or kWh on the power meter). `null` is a gap, never zero.
|
|
@@ -62818,10 +63279,10 @@ var MediaPlayerStatusSchema = object({
|
|
|
62818
63279
|
currentMedia: MediaInfoSchema.nullable(),
|
|
62819
63280
|
/** Current playback position in ms. Null when not seekable or
|
|
62820
63281
|
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
62821
|
-
|
|
63282
|
+
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
62822
63283
|
/** Total duration of the current media in ms. Null when unknown
|
|
62823
63284
|
* (live stream) or nothing is playing. */
|
|
62824
|
-
|
|
63285
|
+
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
62825
63286
|
/** Shuffle toggle. Null when no shuffle surface.
|
|
62826
63287
|
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
62827
63288
|
shuffle: boolean().nullable(),
|
|
@@ -62860,7 +63321,7 @@ var mediaPlayerCapability = {
|
|
|
62860
63321
|
}),
|
|
62861
63322
|
seek: method(object({
|
|
62862
63323
|
deviceId: number().int().nonnegative(),
|
|
62863
|
-
|
|
63324
|
+
position: number().int().nonnegative()
|
|
62864
63325
|
}), _void(), {
|
|
62865
63326
|
kind: "mutation",
|
|
62866
63327
|
auth: "protected"
|
|
@@ -62932,7 +63393,7 @@ var mediaPlayerCapability = {
|
|
|
62932
63393
|
/**
|
|
62933
63394
|
* History (D850): volume (a level an operator or an automation sets; the
|
|
62934
63395
|
* default 10 s floor folds a slider drag into its end value) and mute.
|
|
62935
|
-
* `
|
|
63396
|
+
* `position` is not recorded: it moves continuously while playing.
|
|
62936
63397
|
*/
|
|
62937
63398
|
history: { fields: {
|
|
62938
63399
|
volumeLevel: {
|
|
@@ -63894,9 +64355,9 @@ var NetworkLinkStatusSchema = object({
|
|
|
63894
64355
|
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
63895
64356
|
* SKIP a null rather than coerce it.
|
|
63896
64357
|
*/
|
|
63897
|
-
|
|
64358
|
+
signal: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
63898
64359
|
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
63899
|
-
|
|
64360
|
+
rssi: number().optional().meta(readingMeta("signal-level")),
|
|
63900
64361
|
/** Network name of a wireless link, when the firmware reports it. */
|
|
63901
64362
|
ssid: string().optional(),
|
|
63902
64363
|
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
@@ -63932,7 +64393,7 @@ onStatusChanged: { data: object({
|
|
|
63932
64393
|
kind: "push",
|
|
63933
64394
|
empty: {
|
|
63934
64395
|
type: "unknown",
|
|
63935
|
-
|
|
64396
|
+
signal: null,
|
|
63936
64397
|
lastUpdated: 0
|
|
63937
64398
|
}
|
|
63938
64399
|
},
|
|
@@ -63955,13 +64416,13 @@ onStatusChanged: { data: object({
|
|
|
63955
64416
|
* History (D850): recorded series.
|
|
63956
64417
|
*/
|
|
63957
64418
|
history: { fields: {
|
|
63958
|
-
|
|
64419
|
+
signal: {
|
|
63959
64420
|
kind: "gauge",
|
|
63960
64421
|
unit: "%",
|
|
63961
64422
|
deadband: 3,
|
|
63962
64423
|
minIntervalMs: 6e4
|
|
63963
64424
|
},
|
|
63964
|
-
|
|
64425
|
+
rssi: {
|
|
63965
64426
|
kind: "gauge",
|
|
63966
64427
|
unit: "dBm",
|
|
63967
64428
|
deadband: 2,
|
|
@@ -64752,10 +65213,20 @@ var PetFeederDeviceStatusSchema = _enum([
|
|
|
64752
65213
|
]);
|
|
64753
65214
|
var gramsPortion = number().int().min(4).max(200);
|
|
64754
65215
|
var PetFeederStatusSchema = object({
|
|
64755
|
-
/** Food
|
|
64756
|
-
*
|
|
64757
|
-
* bowl
|
|
65216
|
+
/** Food in the TANK (hopper), as the feeder's own sensor reports it
|
|
65217
|
+
* (`state.food`). A coarse level code, not grams — `0` is empty. The
|
|
65218
|
+
* amount in the bowl is `bowlFood`. On dual-hopper models this is the
|
|
65219
|
+
* combined reading; per-hopper levels live in `food1`/`food2`. Null when
|
|
65220
|
+
* the device has not reported yet. */
|
|
64758
65221
|
foodLevel: number().nullable().meta(readingMeta("none")),
|
|
65222
|
+
/** Food in the BOWL as the feeder reports it (`state.bowl`), in the
|
|
65223
|
+
* feeder's own units. Null when the model reports none. */
|
|
65224
|
+
bowlFood: number().nullable().meta(readingMeta("none")),
|
|
65225
|
+
/** True while the pet is eating (`state.eating`). */
|
|
65226
|
+
eating: boolean(),
|
|
65227
|
+
/** Whether `markFoodReplenished` does anything on this model. When false
|
|
65228
|
+
* the client must not offer it. */
|
|
65229
|
+
supportsMarkRefilled: boolean(),
|
|
64759
65230
|
/** Hopper-1 food level (grams) on dual-hopper feeders; null on
|
|
64760
65231
|
* single-hopper models. */
|
|
64761
65232
|
food1: number().nullable().meta(readingMeta("none")),
|
|
@@ -64763,8 +65234,8 @@ var PetFeederStatusSchema = object({
|
|
|
64763
65234
|
* single-hopper models. */
|
|
64764
65235
|
food2: number().nullable().meta(readingMeta("none")),
|
|
64765
65236
|
/** Derived low-food flag — mirrors the HA `food_level` binary_sensor
|
|
64766
|
-
* (`device_class: problem`, on = low). True when the
|
|
64767
|
-
*
|
|
65237
|
+
* (`device_class: problem`, on = low). True when the tank reports empty,
|
|
65238
|
+
* or, on a dual-hopper model, when EITHER hopper is empty. */
|
|
64768
65239
|
lowFood: boolean(),
|
|
64769
65240
|
/** Battery charge 0..100 (%). Null on mains-powered models or when the
|
|
64770
65241
|
* device has no battery reading. */
|
|
@@ -64832,7 +65303,9 @@ var petFeederCapability = {
|
|
|
64832
65303
|
kind: "mutation",
|
|
64833
65304
|
auth: "protected"
|
|
64834
65305
|
}),
|
|
64835
|
-
/**
|
|
65306
|
+
/** Tell the PetKit cloud a hopper was refilled so it stops its low-food
|
|
65307
|
+
* reminders (D4H/D4S/D4SH only — see `supportsMarkRefilled`). It does not
|
|
65308
|
+
* change any sensor reading. */
|
|
64836
65309
|
markFoodReplenished: method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
64837
65310
|
kind: "mutation",
|
|
64838
65311
|
auth: "protected"
|
|
@@ -64905,6 +65378,7 @@ var petFeederCapability = {
|
|
|
64905
65378
|
*/
|
|
64906
65379
|
history: { fields: {
|
|
64907
65380
|
foodLevel: { kind: "gauge" },
|
|
65381
|
+
bowlFood: { kind: "gauge" },
|
|
64908
65382
|
food1: { kind: "gauge" },
|
|
64909
65383
|
food2: { kind: "gauge" },
|
|
64910
65384
|
batteryPower: {
|
|
@@ -65314,16 +65788,16 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
|
|
|
65314
65788
|
* in real-world devices.
|
|
65315
65789
|
*/
|
|
65316
65790
|
var PowerMeterStatusSchema = object({
|
|
65317
|
-
/** Instantaneous power draw
|
|
65318
|
-
|
|
65791
|
+
/** Instantaneous power draw (watts). */
|
|
65792
|
+
power: number().optional().meta(readingMeta("power", { label: "Power" })),
|
|
65319
65793
|
/** Cumulative energy in kilowatt-hours since the meter was reset. */
|
|
65320
|
-
|
|
65321
|
-
/** Voltage
|
|
65322
|
-
|
|
65794
|
+
energy: number().optional().meta(readingMeta("energy", { label: "Energy" })),
|
|
65795
|
+
/** Voltage (volts). */
|
|
65796
|
+
voltage: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
|
|
65323
65797
|
/** Current in amperes. */
|
|
65324
|
-
|
|
65798
|
+
current: number().optional().meta(readingMeta("current", { label: "Current" })),
|
|
65325
65799
|
/** Apparent power in volt-amperes. */
|
|
65326
|
-
|
|
65800
|
+
apparentPower: number().optional().meta(readingMeta("apparent-power")),
|
|
65327
65801
|
/** Power factor (0..1) if reported. */
|
|
65328
65802
|
powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
|
|
65329
65803
|
/** Ms epoch when the slice was last updated. */
|
|
@@ -65381,14 +65855,14 @@ function powerTarget(id, unit) {
|
|
|
65381
65855
|
advancedExpression: true
|
|
65382
65856
|
};
|
|
65383
65857
|
}
|
|
65384
|
-
/** "Power and energy" extension:
|
|
65858
|
+
/** "Power and energy" extension: power, energy, voltage and current from other devices (D951). */
|
|
65385
65859
|
var powerMeterCustomize = {
|
|
65386
65860
|
version: 1,
|
|
65387
65861
|
targets: [
|
|
65388
|
-
powerTarget("
|
|
65389
|
-
powerTarget("
|
|
65390
|
-
powerTarget("
|
|
65391
|
-
powerTarget("
|
|
65862
|
+
powerTarget("power", "W"),
|
|
65863
|
+
powerTarget("energy", "kWh"),
|
|
65864
|
+
powerTarget("voltage", "V"),
|
|
65865
|
+
powerTarget("current", "A")
|
|
65392
65866
|
]
|
|
65393
65867
|
};
|
|
65394
65868
|
var powerMeterCapability = {
|
|
@@ -65404,41 +65878,41 @@ var powerMeterCapability = {
|
|
|
65404
65878
|
},
|
|
65405
65879
|
runtimeState: PowerMeterStatusSchema,
|
|
65406
65880
|
/**
|
|
65407
|
-
* Runtime-state durability: **restored** — as `numeric-sensor`; `
|
|
65881
|
+
* Runtime-state durability: **restored** — as `numeric-sensor`; `energy` is an accumulator whose restored value is the baseline.
|
|
65408
65882
|
*
|
|
65409
65883
|
* See `RuntimeStateDurability`. Enforced by
|
|
65410
65884
|
* `scripts/check-runtime-state-durability.ts`.
|
|
65411
65885
|
*/
|
|
65412
65886
|
durability: "restored",
|
|
65413
65887
|
/**
|
|
65414
|
-
* History (D850): recorded series. Gauges are floored at 30 s; `
|
|
65888
|
+
* History (D850): recorded series. Gauges are floored at 30 s; `energy` is the one monotonic meter (counter).
|
|
65415
65889
|
*/
|
|
65416
65890
|
history: { fields: {
|
|
65417
|
-
|
|
65891
|
+
power: {
|
|
65418
65892
|
kind: "gauge",
|
|
65419
65893
|
unit: "W",
|
|
65420
65894
|
deadband: 1,
|
|
65421
65895
|
minIntervalMs: 3e4
|
|
65422
65896
|
},
|
|
65423
|
-
|
|
65897
|
+
energy: {
|
|
65424
65898
|
kind: "counter",
|
|
65425
65899
|
unit: "kWh",
|
|
65426
65900
|
deadband: .01,
|
|
65427
65901
|
minIntervalMs: 6e4
|
|
65428
65902
|
},
|
|
65429
|
-
|
|
65903
|
+
voltage: {
|
|
65430
65904
|
kind: "gauge",
|
|
65431
65905
|
unit: "V",
|
|
65432
65906
|
deadband: 1,
|
|
65433
65907
|
minIntervalMs: 3e4
|
|
65434
65908
|
},
|
|
65435
|
-
|
|
65909
|
+
current: {
|
|
65436
65910
|
kind: "gauge",
|
|
65437
65911
|
unit: "A",
|
|
65438
65912
|
deadband: .05,
|
|
65439
65913
|
minIntervalMs: 3e4
|
|
65440
65914
|
},
|
|
65441
|
-
|
|
65915
|
+
apparentPower: {
|
|
65442
65916
|
kind: "gauge",
|
|
65443
65917
|
unit: "VA",
|
|
65444
65918
|
deadband: 1,
|
|
@@ -65488,9 +65962,6 @@ var PresenceStatusSchema = object({
|
|
|
65488
65962
|
location: string().nullable(),
|
|
65489
65963
|
/** GPS coordinates when available. Null otherwise. */
|
|
65490
65964
|
gps: GpsLocationSchema.nullable(),
|
|
65491
|
-
/** Optional battery level of the tracking device (0..100). Null
|
|
65492
|
-
* when not reported. */
|
|
65493
|
-
batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
65494
65965
|
/** Ms epoch when the slice was last updated. */
|
|
65495
65966
|
lastChangedAt: number()
|
|
65496
65967
|
});
|
|
@@ -65519,14 +65990,7 @@ var presenceCapability = {
|
|
|
65519
65990
|
* `scripts/check-runtime-state-durability.ts`.
|
|
65520
65991
|
*/
|
|
65521
65992
|
durability: "restored",
|
|
65522
|
-
|
|
65523
|
-
* History (D850): recorded series.
|
|
65524
|
-
*/
|
|
65525
|
-
history: { fields: { batteryPercent: {
|
|
65526
|
-
kind: "gauge",
|
|
65527
|
-
unit: "%",
|
|
65528
|
-
deadband: 1
|
|
65529
|
-
} } },
|
|
65993
|
+
history: "none",
|
|
65530
65994
|
/** Clock fields: written, but excluded from the compare that decides
|
|
65531
65995
|
* whether persisting is worth a SQLite commit. */
|
|
65532
65996
|
volatileStateFields: ["lastChangedAt"]
|
|
@@ -65541,7 +66005,7 @@ var presenceCapability = {
|
|
|
65541
66005
|
*/
|
|
65542
66006
|
var PressureSensorStatusSchema = object({
|
|
65543
66007
|
/** Current pressure in hPa. `null` when the sample was refused (D393). */
|
|
65544
|
-
|
|
66008
|
+
pressure: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
|
|
65545
66009
|
/** Ms epoch when the slice was last updated. */
|
|
65546
66010
|
lastFetchedAt: number()
|
|
65547
66011
|
});
|
|
@@ -65567,7 +66031,7 @@ var pressureSensorCapability = {
|
|
|
65567
66031
|
/**
|
|
65568
66032
|
* History (D850): recorded series.
|
|
65569
66033
|
*/
|
|
65570
|
-
history: { fields: {
|
|
66034
|
+
history: { fields: { pressure: {
|
|
65571
66035
|
kind: "gauge",
|
|
65572
66036
|
unit: "hPa",
|
|
65573
66037
|
deadband: .1
|
|
@@ -69781,7 +70245,7 @@ var tamperCapability = {
|
|
|
69781
70245
|
*/
|
|
69782
70246
|
var TemperatureSensorStatusSchema = object({
|
|
69783
70247
|
/** Current temperature in Celsius. `null` when the sample was refused (D393). */
|
|
69784
|
-
|
|
70248
|
+
temperature: number().nullable().meta(readingMeta("temperature", {
|
|
69785
70249
|
precision: 1,
|
|
69786
70250
|
label: "Temperature"
|
|
69787
70251
|
})),
|
|
@@ -69810,7 +70274,7 @@ var temperatureSensorCapability = {
|
|
|
69810
70274
|
/**
|
|
69811
70275
|
* History (D850): recorded series.
|
|
69812
70276
|
*/
|
|
69813
|
-
history: { fields: {
|
|
70277
|
+
history: { fields: { temperature: {
|
|
69814
70278
|
kind: "gauge",
|
|
69815
70279
|
unit: "°C",
|
|
69816
70280
|
deadband: .1
|
|
@@ -70107,7 +70571,7 @@ var VacuumControlStatusSchema = object({
|
|
|
70107
70571
|
/** Speed tokens the hardware accepts — drives the UI selector. */
|
|
70108
70572
|
availableFanSpeeds: array(string()),
|
|
70109
70573
|
/** 0..100 cleaning-completion percentage of the current task, or null. */
|
|
70110
|
-
|
|
70574
|
+
progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
70111
70575
|
/** Current error code (0 / null = no error). */
|
|
70112
70576
|
errorCode: number().nullable().meta(readingMeta("none")),
|
|
70113
70577
|
/** Human label for {@link errorCode}, or null when none / undecodable. */
|
|
@@ -71909,7 +72373,7 @@ var BaseDevice = class {
|
|
|
71909
72373
|
* `device-local-state.ts`. Drivers access via:
|
|
71910
72374
|
*
|
|
71911
72375
|
* `this.state.battery.sleeping = true` // patches the battery slice
|
|
71912
|
-
* `const pct = this.state.battery.
|
|
72376
|
+
* `const pct = this.state.battery.level` // reads the battery slice
|
|
71913
72377
|
* `this.state.deviceStatus.online = true` // mirrors `markOnline(true)`
|
|
71914
72378
|
*
|
|
71915
72379
|
* Adding a new cap with `runtimeState:` automatically extends this
|
|
@@ -71949,7 +72413,7 @@ var BaseDevice = class {
|
|
|
71949
72413
|
* shape; drivers don't redeclare it, they just write through.
|
|
71950
72414
|
*
|
|
71951
72415
|
* Read: `this.runtimeState.getCapState('battery')` →
|
|
71952
|
-
* `{
|
|
72416
|
+
* `{level, charging, sleeping, lastUpdated}` for any
|
|
71953
72417
|
* provider that registers `batteryCapability`.
|
|
71954
72418
|
* Write: `this.runtimeState.setCapState('battery', { … })`.
|
|
71955
72419
|
*
|
|
@@ -73127,6 +73591,104 @@ Object.freeze({
|
|
|
73127
73591
|
access: "create",
|
|
73128
73592
|
role: "admin"
|
|
73129
73593
|
},
|
|
73594
|
+
"actions.create": {
|
|
73595
|
+
capName: "actions",
|
|
73596
|
+
capScope: "system",
|
|
73597
|
+
addonId: null,
|
|
73598
|
+
access: "create",
|
|
73599
|
+
role: "admin"
|
|
73600
|
+
},
|
|
73601
|
+
"actions.delete": {
|
|
73602
|
+
capName: "actions",
|
|
73603
|
+
capScope: "system",
|
|
73604
|
+
addonId: null,
|
|
73605
|
+
access: "delete",
|
|
73606
|
+
role: "admin"
|
|
73607
|
+
},
|
|
73608
|
+
"actions.get": {
|
|
73609
|
+
capName: "actions",
|
|
73610
|
+
capScope: "system",
|
|
73611
|
+
addonId: null,
|
|
73612
|
+
access: "view",
|
|
73613
|
+
role: "viewer"
|
|
73614
|
+
},
|
|
73615
|
+
"actions.getLinks": {
|
|
73616
|
+
capName: "actions",
|
|
73617
|
+
capScope: "system",
|
|
73618
|
+
addonId: null,
|
|
73619
|
+
access: "view",
|
|
73620
|
+
role: "admin"
|
|
73621
|
+
},
|
|
73622
|
+
"actions.getTraces": {
|
|
73623
|
+
capName: "actions",
|
|
73624
|
+
capScope: "system",
|
|
73625
|
+
addonId: null,
|
|
73626
|
+
access: "view",
|
|
73627
|
+
role: "admin"
|
|
73628
|
+
},
|
|
73629
|
+
"actions.list": {
|
|
73630
|
+
capName: "actions",
|
|
73631
|
+
capScope: "system",
|
|
73632
|
+
addonId: null,
|
|
73633
|
+
access: "view",
|
|
73634
|
+
role: "admin"
|
|
73635
|
+
},
|
|
73636
|
+
"actions.listForCamera": {
|
|
73637
|
+
capName: "actions",
|
|
73638
|
+
capScope: "system",
|
|
73639
|
+
addonId: null,
|
|
73640
|
+
access: "view",
|
|
73641
|
+
role: "viewer"
|
|
73642
|
+
},
|
|
73643
|
+
"actions.run": {
|
|
73644
|
+
capName: "actions",
|
|
73645
|
+
capScope: "system",
|
|
73646
|
+
addonId: null,
|
|
73647
|
+
access: "create",
|
|
73648
|
+
role: "viewer"
|
|
73649
|
+
},
|
|
73650
|
+
"actions.setLinks": {
|
|
73651
|
+
capName: "actions",
|
|
73652
|
+
capScope: "system",
|
|
73653
|
+
addonId: null,
|
|
73654
|
+
access: "create",
|
|
73655
|
+
role: "admin"
|
|
73656
|
+
},
|
|
73657
|
+
"actions.stop": {
|
|
73658
|
+
capName: "actions",
|
|
73659
|
+
capScope: "system",
|
|
73660
|
+
addonId: null,
|
|
73661
|
+
access: "create",
|
|
73662
|
+
role: "admin"
|
|
73663
|
+
},
|
|
73664
|
+
"actions.update": {
|
|
73665
|
+
capName: "actions",
|
|
73666
|
+
capScope: "system",
|
|
73667
|
+
addonId: null,
|
|
73668
|
+
access: "create",
|
|
73669
|
+
role: "admin"
|
|
73670
|
+
},
|
|
73671
|
+
"actionSource.listActions": {
|
|
73672
|
+
capName: "action-source",
|
|
73673
|
+
capScope: "system",
|
|
73674
|
+
addonId: null,
|
|
73675
|
+
access: "view",
|
|
73676
|
+
role: "admin"
|
|
73677
|
+
},
|
|
73678
|
+
"actionSource.runAction": {
|
|
73679
|
+
capName: "action-source",
|
|
73680
|
+
capScope: "system",
|
|
73681
|
+
addonId: null,
|
|
73682
|
+
access: "create",
|
|
73683
|
+
role: "admin"
|
|
73684
|
+
},
|
|
73685
|
+
"actionSource.stopAction": {
|
|
73686
|
+
capName: "action-source",
|
|
73687
|
+
capScope: "system",
|
|
73688
|
+
addonId: null,
|
|
73689
|
+
access: "create",
|
|
73690
|
+
role: "admin"
|
|
73691
|
+
},
|
|
73130
73692
|
"addonPages.listPages": {
|
|
73131
73693
|
capName: "addon-pages",
|
|
73132
73694
|
capScope: "system",
|
|
@@ -74408,6 +74970,13 @@ Object.freeze({
|
|
|
74408
74970
|
access: "view",
|
|
74409
74971
|
role: "admin"
|
|
74410
74972
|
},
|
|
74973
|
+
"coreBlocks.getAutomationRunState": {
|
|
74974
|
+
capName: "core-blocks",
|
|
74975
|
+
capScope: "system",
|
|
74976
|
+
addonId: null,
|
|
74977
|
+
access: "view",
|
|
74978
|
+
role: "admin"
|
|
74979
|
+
},
|
|
74411
74980
|
"coreBlocks.getBlockSettings": {
|
|
74412
74981
|
capName: "core-blocks",
|
|
74413
74982
|
capScope: "system",
|
|
@@ -74429,6 +74998,13 @@ Object.freeze({
|
|
|
74429
74998
|
access: "view",
|
|
74430
74999
|
role: "admin"
|
|
74431
75000
|
},
|
|
75001
|
+
"coreBlocks.getTraces": {
|
|
75002
|
+
capName: "core-blocks",
|
|
75003
|
+
capScope: "system",
|
|
75004
|
+
addonId: null,
|
|
75005
|
+
access: "view",
|
|
75006
|
+
role: "admin"
|
|
75007
|
+
},
|
|
74432
75008
|
"coreBlocks.getTypeDefs": {
|
|
74433
75009
|
capName: "core-blocks",
|
|
74434
75010
|
capScope: "system",
|
|
@@ -74464,6 +75040,13 @@ Object.freeze({
|
|
|
74464
75040
|
access: "create",
|
|
74465
75041
|
role: "admin"
|
|
74466
75042
|
},
|
|
75043
|
+
"coreBlocks.reportAutomationRun": {
|
|
75044
|
+
capName: "core-blocks",
|
|
75045
|
+
capScope: "system",
|
|
75046
|
+
addonId: null,
|
|
75047
|
+
access: "create",
|
|
75048
|
+
role: "admin"
|
|
75049
|
+
},
|
|
74467
75050
|
"coreBlocks.restart": {
|
|
74468
75051
|
capName: "core-blocks",
|
|
74469
75052
|
capScope: "system",
|
|
@@ -83037,7 +83620,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83037
83620
|
label: t("Full brightness", "Luminosità massima"),
|
|
83038
83621
|
phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
|
|
83039
83622
|
icon: "sun",
|
|
83040
|
-
args: {
|
|
83623
|
+
args: { level: 100 }
|
|
83041
83624
|
},
|
|
83042
83625
|
{
|
|
83043
83626
|
id: "brightness.half",
|
|
@@ -83045,7 +83628,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83045
83628
|
label: t("Half brightness", "Luminosità a metà"),
|
|
83046
83629
|
phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
|
|
83047
83630
|
icon: "sun-dim",
|
|
83048
|
-
args: {
|
|
83631
|
+
args: { level: 50 }
|
|
83049
83632
|
},
|
|
83050
83633
|
{
|
|
83051
83634
|
id: "brightness.off",
|
|
@@ -83053,16 +83636,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83053
83636
|
label: t("Brightness off", "Luminosità a zero"),
|
|
83054
83637
|
phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
|
|
83055
83638
|
icon: "lightbulb-off",
|
|
83056
|
-
args: {
|
|
83639
|
+
args: { level: 0 }
|
|
83057
83640
|
},
|
|
83058
83641
|
{
|
|
83059
83642
|
id: "brightness.set",
|
|
83060
83643
|
method: "setBrightness",
|
|
83061
83644
|
label: t("Set brightness", "Imposta la luminosità"),
|
|
83062
|
-
phrase: t("Set the brightness of {device} to {
|
|
83645
|
+
phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
|
|
83063
83646
|
icon: "sun-medium",
|
|
83064
83647
|
openArgs: [{
|
|
83065
|
-
key: "
|
|
83648
|
+
key: "level",
|
|
83066
83649
|
label: PERCENT,
|
|
83067
83650
|
offer: {
|
|
83068
83651
|
kind: "number",
|
|
@@ -83076,13 +83659,13 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83076
83659
|
],
|
|
83077
83660
|
state: [{
|
|
83078
83661
|
kind: "numeric",
|
|
83079
|
-
field: "
|
|
83662
|
+
field: "level",
|
|
83080
83663
|
quantity: t("the brightness", "la luminosità"),
|
|
83081
83664
|
label: t("Brightness", "Luminosità"),
|
|
83082
83665
|
unit: "%",
|
|
83083
83666
|
icon: "sun"
|
|
83084
83667
|
}],
|
|
83085
|
-
events: { onBrightnessChanged: { notOperatorFacing: "the `
|
|
83668
|
+
events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
|
|
83086
83669
|
},
|
|
83087
83670
|
color: {
|
|
83088
83671
|
scope: "device",
|
|
@@ -83096,7 +83679,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83096
83679
|
icon: "sun",
|
|
83097
83680
|
args: { color: {
|
|
83098
83681
|
mode: "mired",
|
|
83099
|
-
|
|
83682
|
+
colorTemperature: 370
|
|
83100
83683
|
} }
|
|
83101
83684
|
},
|
|
83102
83685
|
{
|
|
@@ -83107,7 +83690,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83107
83690
|
icon: "snowflake",
|
|
83108
83691
|
args: { color: {
|
|
83109
83692
|
mode: "mired",
|
|
83110
|
-
|
|
83693
|
+
colorTemperature: 200
|
|
83111
83694
|
} }
|
|
83112
83695
|
},
|
|
83113
83696
|
{
|
|
@@ -83721,7 +84304,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83721
84304
|
label: t("Fan off", "Ventilatore spento"),
|
|
83722
84305
|
phrase: t("Stop {device}", "Ferma {device}"),
|
|
83723
84306
|
icon: "power-off",
|
|
83724
|
-
args: {
|
|
84307
|
+
args: { speed: 0 }
|
|
83725
84308
|
},
|
|
83726
84309
|
{
|
|
83727
84310
|
id: "fan.full",
|
|
@@ -83729,16 +84312,16 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83729
84312
|
label: t("Fan full", "Ventilatore al massimo"),
|
|
83730
84313
|
phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
|
|
83731
84314
|
icon: "fan",
|
|
83732
|
-
args: {
|
|
84315
|
+
args: { speed: 100 }
|
|
83733
84316
|
},
|
|
83734
84317
|
{
|
|
83735
84318
|
id: "fan.speed",
|
|
83736
84319
|
method: "setPercentage",
|
|
83737
84320
|
label: t("Set speed", "Imposta la velocità"),
|
|
83738
|
-
phrase: t("Set the speed of {device} to {
|
|
84321
|
+
phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
|
|
83739
84322
|
icon: "fan",
|
|
83740
84323
|
openArgs: [{
|
|
83741
|
-
key: "
|
|
84324
|
+
key: "speed",
|
|
83742
84325
|
label: t("Speed", "Velocità"),
|
|
83743
84326
|
offer: {
|
|
83744
84327
|
kind: "number",
|
|
@@ -83800,7 +84383,7 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
83800
84383
|
],
|
|
83801
84384
|
state: [{
|
|
83802
84385
|
kind: "numeric",
|
|
83803
|
-
field: "
|
|
84386
|
+
field: "speed",
|
|
83804
84387
|
quantity: t("the speed", "la velocità"),
|
|
83805
84388
|
label: t("Speed", "Velocità"),
|
|
83806
84389
|
unit: "%",
|
|
@@ -84598,7 +85181,7 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
84598
85181
|
},
|
|
84599
85182
|
{
|
|
84600
85183
|
kind: "numeric",
|
|
84601
|
-
field: "
|
|
85184
|
+
field: "progress",
|
|
84602
85185
|
quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
|
|
84603
85186
|
label: t("Progress", "Avanzamento"),
|
|
84604
85187
|
unit: "%",
|
|
@@ -84956,10 +85539,10 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
84956
85539
|
id: "media.seek",
|
|
84957
85540
|
method: "seek",
|
|
84958
85541
|
label: t("Seek", "Vai al punto"),
|
|
84959
|
-
phrase: t("Move {device} to {
|
|
85542
|
+
phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
|
|
84960
85543
|
icon: "fast-forward",
|
|
84961
85544
|
openArgs: [{
|
|
84962
|
-
key: "
|
|
85545
|
+
key: "position",
|
|
84963
85546
|
label: t("Position", "Posizione"),
|
|
84964
85547
|
offer: {
|
|
84965
85548
|
kind: "number",
|
|
@@ -86008,7 +86591,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86008
86591
|
state: [
|
|
86009
86592
|
{
|
|
86010
86593
|
kind: "numeric",
|
|
86011
|
-
field: "
|
|
86594
|
+
field: "co2",
|
|
86012
86595
|
quantity: t("the CO₂", "la CO₂"),
|
|
86013
86596
|
label: t("CO₂", "CO₂"),
|
|
86014
86597
|
unit: "ppm",
|
|
@@ -86016,7 +86599,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86016
86599
|
},
|
|
86017
86600
|
{
|
|
86018
86601
|
kind: "numeric",
|
|
86019
|
-
field: "
|
|
86602
|
+
field: "voc",
|
|
86020
86603
|
quantity: t("the VOC level", "il livello di COV"),
|
|
86021
86604
|
label: t("VOC", "COV"),
|
|
86022
86605
|
unit: "ppb",
|
|
@@ -86052,7 +86635,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86052
86635
|
noun: t("Light level", "Luminosità ambiente"),
|
|
86053
86636
|
state: [{
|
|
86054
86637
|
kind: "numeric",
|
|
86055
|
-
field: "
|
|
86638
|
+
field: "illuminance",
|
|
86056
86639
|
quantity: t("the light level", "la luminosità"),
|
|
86057
86640
|
label: t("Illuminance", "Illuminamento"),
|
|
86058
86641
|
unit: "lx",
|
|
@@ -86255,7 +86838,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86255
86838
|
noun: t("Humidity", "Umidità"),
|
|
86256
86839
|
state: [{
|
|
86257
86840
|
kind: "numeric",
|
|
86258
|
-
field: "
|
|
86841
|
+
field: "humidity",
|
|
86259
86842
|
quantity: t("the humidity", "l’umidità"),
|
|
86260
86843
|
label: t("Humidity", "Umidità"),
|
|
86261
86844
|
unit: "%",
|
|
@@ -86303,7 +86886,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86303
86886
|
state: [
|
|
86304
86887
|
{
|
|
86305
86888
|
kind: "numeric",
|
|
86306
|
-
field: "
|
|
86889
|
+
field: "power",
|
|
86307
86890
|
quantity: t("the power draw", "il consumo"),
|
|
86308
86891
|
label: t("Power", "Potenza"),
|
|
86309
86892
|
unit: "W",
|
|
@@ -86311,7 +86894,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86311
86894
|
},
|
|
86312
86895
|
{
|
|
86313
86896
|
kind: "numeric",
|
|
86314
|
-
field: "
|
|
86897
|
+
field: "energy",
|
|
86315
86898
|
quantity: t("the energy used", "l’energia consumata"),
|
|
86316
86899
|
label: t("Energy", "Energia"),
|
|
86317
86900
|
unit: "kWh",
|
|
@@ -86319,7 +86902,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86319
86902
|
},
|
|
86320
86903
|
{
|
|
86321
86904
|
kind: "numeric",
|
|
86322
|
-
field: "
|
|
86905
|
+
field: "voltage",
|
|
86323
86906
|
quantity: t("the voltage", "la tensione"),
|
|
86324
86907
|
label: t("Voltage", "Tensione"),
|
|
86325
86908
|
unit: "V",
|
|
@@ -86327,7 +86910,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86327
86910
|
},
|
|
86328
86911
|
{
|
|
86329
86912
|
kind: "numeric",
|
|
86330
|
-
field: "
|
|
86913
|
+
field: "current",
|
|
86331
86914
|
quantity: t("the current", "la corrente"),
|
|
86332
86915
|
label: t("Current", "Corrente"),
|
|
86333
86916
|
unit: "A",
|
|
@@ -86344,13 +86927,6 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86344
86927
|
label: t("Where", "Posizione"),
|
|
86345
86928
|
phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
|
|
86346
86929
|
icon: "map-pin"
|
|
86347
|
-
}, {
|
|
86348
|
-
kind: "numeric",
|
|
86349
|
-
field: "batteryPercent",
|
|
86350
|
-
quantity: t("the phone battery", "la batteria del telefono"),
|
|
86351
|
-
label: t("Battery", "Batteria"),
|
|
86352
|
-
unit: "%",
|
|
86353
|
-
icon: "battery"
|
|
86354
86930
|
}]
|
|
86355
86931
|
},
|
|
86356
86932
|
"pressure-sensor": {
|
|
@@ -86358,7 +86934,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86358
86934
|
noun: t("Pressure", "Pressione"),
|
|
86359
86935
|
state: [{
|
|
86360
86936
|
kind: "numeric",
|
|
86361
|
-
field: "
|
|
86937
|
+
field: "pressure",
|
|
86362
86938
|
quantity: t("the pressure", "la pressione"),
|
|
86363
86939
|
label: t("Pressure", "Pressione"),
|
|
86364
86940
|
unit: "hPa",
|
|
@@ -86394,7 +86970,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86394
86970
|
noun: t("Temperature", "Temperatura"),
|
|
86395
86971
|
state: [{
|
|
86396
86972
|
kind: "numeric",
|
|
86397
|
-
field: "
|
|
86973
|
+
field: "temperature",
|
|
86398
86974
|
quantity: t("the temperature", "la temperatura"),
|
|
86399
86975
|
label: t("Temperature", "Temperatura"),
|
|
86400
86976
|
unit: "°C",
|
|
@@ -86465,7 +87041,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86465
87041
|
state: [
|
|
86466
87042
|
{
|
|
86467
87043
|
kind: "numeric",
|
|
86468
|
-
field: "
|
|
87044
|
+
field: "level",
|
|
86469
87045
|
quantity: t("the battery level", "il livello della batteria"),
|
|
86470
87046
|
label: t("Battery", "Batteria"),
|
|
86471
87047
|
unit: "%",
|
|
@@ -86507,7 +87083,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86507
87083
|
icon: "battery-charging"
|
|
86508
87084
|
}
|
|
86509
87085
|
],
|
|
86510
|
-
events: { onStatusChanged: { notOperatorFacing: "the
|
|
87086
|
+
events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
|
|
86511
87087
|
extraEvents: [{
|
|
86512
87088
|
category: EventCategory.DeviceAwake,
|
|
86513
87089
|
label: t("Woke up", "Risvegliato"),
|
|
@@ -86525,7 +87101,7 @@ var SENSOR_CAP_VOCABULARY = {
|
|
|
86525
87101
|
noun: t("Network link", "Collegamento di rete"),
|
|
86526
87102
|
state: [{
|
|
86527
87103
|
kind: "numeric",
|
|
86528
|
-
field: "
|
|
87104
|
+
field: "signal",
|
|
86529
87105
|
quantity: t("the signal strength", "l’intensità del segnale"),
|
|
86530
87106
|
label: t("Signal", "Segnale"),
|
|
86531
87107
|
unit: "%",
|
|
@@ -86618,6 +87194,8 @@ var ML = "model and training machinery — no device action";
|
|
|
86618
87194
|
var INTERNAL = "internal plumbing between addons — never operator-facing";
|
|
86619
87195
|
/** Every system-scoped cap, with why it is not a device's vocabulary. */
|
|
86620
87196
|
var SYSTEM_CAP_VOCABULARY = {
|
|
87197
|
+
"action-source": system(INTERNAL),
|
|
87198
|
+
actions: system("declared actions — run from the Actions page and from the cameras that link them"),
|
|
86621
87199
|
"addon-pages": system(UI_PLUMBING),
|
|
86622
87200
|
"addon-pages-source": system(UI_PLUMBING),
|
|
86623
87201
|
"addon-routes": system(UI_PLUMBING),
|
|
@@ -87032,6 +87610,31 @@ Object.freeze({
|
|
|
87032
87610
|
form: "single",
|
|
87033
87611
|
optional: false
|
|
87034
87612
|
}],
|
|
87613
|
+
"actions.get": [{
|
|
87614
|
+
name: "deviceId",
|
|
87615
|
+
form: "single",
|
|
87616
|
+
optional: true
|
|
87617
|
+
}],
|
|
87618
|
+
"actions.getLinks": [{
|
|
87619
|
+
name: "deviceId",
|
|
87620
|
+
form: "single",
|
|
87621
|
+
optional: false
|
|
87622
|
+
}],
|
|
87623
|
+
"actions.listForCamera": [{
|
|
87624
|
+
name: "deviceId",
|
|
87625
|
+
form: "single",
|
|
87626
|
+
optional: false
|
|
87627
|
+
}],
|
|
87628
|
+
"actions.run": [{
|
|
87629
|
+
name: "deviceId",
|
|
87630
|
+
form: "single",
|
|
87631
|
+
optional: true
|
|
87632
|
+
}],
|
|
87633
|
+
"actions.setLinks": [{
|
|
87634
|
+
name: "deviceId",
|
|
87635
|
+
form: "single",
|
|
87636
|
+
optional: false
|
|
87637
|
+
}],
|
|
87035
87638
|
"addonSettings.getDeviceSettings": [{
|
|
87036
87639
|
name: "deviceId",
|
|
87037
87640
|
form: "single",
|
|
@@ -91164,6 +91767,7 @@ DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
|
91164
91767
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
91165
91768
|
DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
|
|
91166
91769
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
91770
|
+
String.raw`(?<=^|["'(\s>,\[{])`;
|
|
91167
91771
|
var MB = 1024 * 1024;
|
|
91168
91772
|
1024 * MB, 3072 * MB;
|
|
91169
91773
|
/**
|
|
@@ -95913,7 +96517,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
95913
96517
|
}
|
|
95914
96518
|
brightnessView() {
|
|
95915
96519
|
return this.getCapSlice(brightnessCapability) ?? {
|
|
95916
|
-
|
|
96520
|
+
level: this.config.get("defaultBrightness") ?? 100,
|
|
95917
96521
|
lastChangedAt: 0
|
|
95918
96522
|
};
|
|
95919
96523
|
}
|
|
@@ -95934,9 +96538,9 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
95934
96538
|
});
|
|
95935
96539
|
if (typeof state.brightness === "number") {
|
|
95936
96540
|
const previousBrightness = this.brightnessView();
|
|
95937
|
-
const brightChangedAt = previousBrightness.
|
|
96541
|
+
const brightChangedAt = previousBrightness.level === state.brightness ? previousBrightness.lastChangedAt : ts;
|
|
95938
96542
|
this.setCapSlice(brightnessCapability, {
|
|
95939
|
-
|
|
96543
|
+
level: state.brightness,
|
|
95940
96544
|
lastChangedAt: brightChangedAt
|
|
95941
96545
|
});
|
|
95942
96546
|
}
|
|
@@ -95957,7 +96561,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
95957
96561
|
lastChangedAt: ts
|
|
95958
96562
|
});
|
|
95959
96563
|
if (on) this.setCapSlice(brightnessCapability, {
|
|
95960
|
-
|
|
96564
|
+
level: brightness,
|
|
95961
96565
|
lastChangedAt: ts
|
|
95962
96566
|
});
|
|
95963
96567
|
}
|
|
@@ -95978,7 +96582,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
95978
96582
|
getStatus: async () => this.switchView(),
|
|
95979
96583
|
setState: async ({ deviceId, on }) => {
|
|
95980
96584
|
if (deviceId !== this.id) return;
|
|
95981
|
-
const brightness = this.brightnessView().
|
|
96585
|
+
const brightness = this.brightnessView().level;
|
|
95982
96586
|
await this.applyOn(on, brightness);
|
|
95983
96587
|
}
|
|
95984
96588
|
});
|
|
@@ -95990,18 +96594,18 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
95990
96594
|
registerBrightnessCap() {
|
|
95991
96595
|
this.ctx.registerNativeCap(brightnessCapability, {
|
|
95992
96596
|
getStatus: async () => this.brightnessView(),
|
|
95993
|
-
setBrightness: async ({ deviceId, percentage }) => {
|
|
96597
|
+
setBrightness: async ({ deviceId, level: percentage }) => {
|
|
95994
96598
|
if (deviceId !== this.id) return;
|
|
95995
96599
|
const value = Math.max(0, Math.min(100, percentage));
|
|
95996
96600
|
if (this.switchView().on) await this.applyOn(true, value);
|
|
95997
96601
|
else this.setCapSlice(brightnessCapability, {
|
|
95998
|
-
|
|
96602
|
+
level: value,
|
|
95999
96603
|
lastChangedAt: Date.now()
|
|
96000
96604
|
});
|
|
96001
96605
|
}
|
|
96002
96606
|
});
|
|
96003
96607
|
this.setCapSlice(brightnessCapability, {
|
|
96004
|
-
|
|
96608
|
+
level: this.config.get("defaultBrightness") ?? 100,
|
|
96005
96609
|
lastChangedAt: 0
|
|
96006
96610
|
});
|
|
96007
96611
|
}
|
|
@@ -96049,10 +96653,10 @@ var HikvisionLightAccessory = class extends BaseDevice {
|
|
|
96049
96653
|
const typed = lightAccessorySchema.partial().parse(patch);
|
|
96050
96654
|
await this.config.setAll(typed);
|
|
96051
96655
|
if (typed.defaultBrightness !== void 0 && !this.switchView().on) this.setCapSlice(brightnessCapability, {
|
|
96052
|
-
|
|
96656
|
+
level: typed.defaultBrightness,
|
|
96053
96657
|
lastChangedAt: Date.now()
|
|
96054
96658
|
});
|
|
96055
|
-
if (typed.mode !== void 0 && this.switchView().on) await this.applyOn(true, this.brightnessView().
|
|
96659
|
+
if (typed.mode !== void 0 && this.switchView().on) await this.applyOn(true, this.brightnessView().level).catch((err) => {
|
|
96056
96660
|
this.ctx.logger.warn("hikvision light: live mode switch failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
|
|
96057
96661
|
});
|
|
96058
96662
|
}
|