@camstack/addon-provider-hikvision 1.2.176 → 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/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-CT-hz5Rb.mjs
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-bykKrTgu.mjs
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",
@@ -8661,6 +8668,7 @@ var CAP_NAMES = Object.freeze([
8661
8668
  "filesystem-browse",
8662
8669
  "flood",
8663
8670
  "gas",
8671
+ "group-active",
8664
8672
  "group-commands",
8665
8673
  "group-status",
8666
8674
  "heating-valve",
@@ -8683,6 +8691,7 @@ var CAP_NAMES = Object.freeze([
8683
8691
  "login-method",
8684
8692
  "media-player",
8685
8693
  "mesh-network",
8694
+ "meter",
8686
8695
  "metrics-provider",
8687
8696
  "model-convert",
8688
8697
  "model-distributor",
@@ -8774,11 +8783,11 @@ var CAP_NAMES = Object.freeze([
8774
8783
  Object.freeze({
8775
8784
  "air-quality-sensor": [
8776
8785
  {
8777
- "path": "co2Ppm",
8786
+ "path": "co2",
8778
8787
  "valueType": "number"
8779
8788
  },
8780
8789
  {
8781
- "path": "vocPpb",
8790
+ "path": "voc",
8782
8791
  "valueType": "number"
8783
8792
  },
8784
8793
  {
@@ -8828,7 +8837,7 @@ Object.freeze({
8828
8837
  }
8829
8838
  ],
8830
8839
  "ambient-light-sensor": [{
8831
- "path": "lux",
8840
+ "path": "illuminance",
8832
8841
  "valueType": "number"
8833
8842
  }],
8834
8843
  "audio-metrics": [
@@ -8889,7 +8898,7 @@ Object.freeze({
8889
8898
  ],
8890
8899
  "battery": [
8891
8900
  {
8892
- "path": "percentage",
8901
+ "path": "level",
8893
8902
  "valueType": "number"
8894
8903
  },
8895
8904
  {
@@ -8911,7 +8920,7 @@ Object.freeze({
8911
8920
  "valueType": "number"
8912
8921
  },
8913
8922
  {
8914
- "path": "volts",
8923
+ "path": "voltage",
8915
8924
  "valueType": "number"
8916
8925
  },
8917
8926
  {
@@ -8932,7 +8941,7 @@ Object.freeze({
8932
8941
  "valueType": "boolean"
8933
8942
  }],
8934
8943
  "brightness": [{
8935
- "path": "percentage",
8944
+ "path": "level",
8936
8945
  "valueType": "number"
8937
8946
  }],
8938
8947
  "broker": [{
@@ -9133,7 +9142,7 @@ Object.freeze({
9133
9142
  "valueType": "number"
9134
9143
  },
9135
9144
  {
9136
- "path": "mireds",
9145
+ "path": "colorTemperature",
9137
9146
  "valueType": "number"
9138
9147
  }
9139
9148
  ],
@@ -9312,15 +9321,15 @@ Object.freeze({
9312
9321
  "valueType": "string"
9313
9322
  },
9314
9323
  {
9315
- "path": "remainingSeconds",
9324
+ "path": "remaining",
9316
9325
  "valueType": "number"
9317
9326
  },
9318
9327
  {
9319
- "path": "delayedStartSeconds",
9328
+ "path": "delayedStart",
9320
9329
  "valueType": "number"
9321
9330
  },
9322
9331
  {
9323
- "path": "progressPercent",
9332
+ "path": "progress",
9324
9333
  "valueType": "number"
9325
9334
  },
9326
9335
  {
@@ -9434,7 +9443,7 @@ Object.freeze({
9434
9443
  ],
9435
9444
  "fan-control": [
9436
9445
  {
9437
- "path": "percentage",
9446
+ "path": "speed",
9438
9447
  "valueType": "number"
9439
9448
  },
9440
9449
  {
@@ -9481,6 +9490,10 @@ Object.freeze({
9481
9490
  "path": "detected",
9482
9491
  "valueType": "boolean"
9483
9492
  }],
9493
+ "group-active": [{
9494
+ "path": "active",
9495
+ "valueType": "boolean"
9496
+ }],
9484
9497
  "group-status": [
9485
9498
  {
9486
9499
  "path": "included",
@@ -9530,7 +9543,7 @@ Object.freeze({
9530
9543
  }
9531
9544
  ],
9532
9545
  "humidity-sensor": [{
9533
- "path": "percent",
9546
+ "path": "humidity",
9534
9547
  "valueType": "number"
9535
9548
  }],
9536
9549
  "image": [{
@@ -9640,7 +9653,7 @@ Object.freeze({
9640
9653
  "valueType": "number"
9641
9654
  },
9642
9655
  {
9643
- "path": "progressPercent",
9656
+ "path": "progress",
9644
9657
  "valueType": "number"
9645
9658
  },
9646
9659
  {
@@ -9719,11 +9732,11 @@ Object.freeze({
9719
9732
  "valueType": "string"
9720
9733
  },
9721
9734
  {
9722
- "path": "positionMs",
9735
+ "path": "position",
9723
9736
  "valueType": "number"
9724
9737
  },
9725
9738
  {
9726
- "path": "durationMs",
9739
+ "path": "duration",
9727
9740
  "valueType": "number"
9728
9741
  },
9729
9742
  {
@@ -9740,6 +9753,10 @@ Object.freeze({
9740
9753
  ]
9741
9754
  }
9742
9755
  ],
9756
+ "meter": [{
9757
+ "path": "value",
9758
+ "valueType": "number"
9759
+ }],
9743
9760
  "motion": [
9744
9761
  {
9745
9762
  "path": "detected",
@@ -9821,11 +9838,11 @@ Object.freeze({
9821
9838
  ]
9822
9839
  },
9823
9840
  {
9824
- "path": "signalPercent",
9841
+ "path": "signal",
9825
9842
  "valueType": "number"
9826
9843
  },
9827
9844
  {
9828
- "path": "rssiDbm",
9845
+ "path": "rssi",
9829
9846
  "valueType": "number"
9830
9847
  },
9831
9848
  {
@@ -9880,6 +9897,18 @@ Object.freeze({
9880
9897
  "path": "foodLevel",
9881
9898
  "valueType": "number"
9882
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
+ },
9883
9912
  {
9884
9913
  "path": "food1",
9885
9914
  "valueType": "number"
@@ -9944,23 +9973,23 @@ Object.freeze({
9944
9973
  ],
9945
9974
  "power-meter": [
9946
9975
  {
9947
- "path": "watts",
9976
+ "path": "power",
9948
9977
  "valueType": "number"
9949
9978
  },
9950
9979
  {
9951
- "path": "kwhTotal",
9980
+ "path": "energy",
9952
9981
  "valueType": "number"
9953
9982
  },
9954
9983
  {
9955
- "path": "volts",
9984
+ "path": "voltage",
9956
9985
  "valueType": "number"
9957
9986
  },
9958
9987
  {
9959
- "path": "amps",
9988
+ "path": "current",
9960
9989
  "valueType": "number"
9961
9990
  },
9962
9991
  {
9963
- "path": "va",
9992
+ "path": "apparentPower",
9964
9993
  "valueType": "number"
9965
9994
  },
9966
9995
  {
@@ -9988,14 +10017,10 @@ Object.freeze({
9988
10017
  {
9989
10018
  "path": "gps.accuracyMeters",
9990
10019
  "valueType": "number"
9991
- },
9992
- {
9993
- "path": "batteryPercent",
9994
- "valueType": "number"
9995
10020
  }
9996
10021
  ],
9997
10022
  "pressure-sensor": [{
9998
- "path": "hpa",
10023
+ "path": "pressure",
9999
10024
  "valueType": "number"
10000
10025
  }],
10001
10026
  "privacy-mask": [{
@@ -10309,7 +10334,7 @@ Object.freeze({
10309
10334
  "valueType": "boolean"
10310
10335
  }],
10311
10336
  "temperature-sensor": [{
10312
- "path": "celsius",
10337
+ "path": "temperature",
10313
10338
  "valueType": "number"
10314
10339
  }],
10315
10340
  "update": [
@@ -10357,7 +10382,7 @@ Object.freeze({
10357
10382
  "valueType": "string"
10358
10383
  },
10359
10384
  {
10360
- "path": "progressPercent",
10385
+ "path": "progress",
10361
10386
  "valueType": "number"
10362
10387
  },
10363
10388
  {
@@ -10497,7 +10522,7 @@ function userError(code, params, englishFallback) {
10497
10522
  return new CamstackError(code, params, englishFallback);
10498
10523
  }
10499
10524
  //#endregion
10500
- //#region ../types/dist/err-msg-BXKzRBwg.mjs
10525
+ //#region ../types/dist/err-msg-DIorGYeC.mjs
10501
10526
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
10502
10527
  DeviceType["Camera"] = "camera";
10503
10528
  DeviceType["Hub"] = "hub";
@@ -10591,8 +10616,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
10591
10616
  DeviceType["PetFeeder"] = "pet-feeder";
10592
10617
  /** Built-in dishwasher — program lifecycle, door / remote-start gates,
10593
10618
  * salt and rinse-aid levels. Installed with the `dishwasher` cap.
10594
- * Sources: native Bosch Home Connect, reusable by similar integrations. */
10619
+ * Sources: native Bosch Home Connect, reusable by similar integrations.
10620
+ * A plug-built dishwasher carries running-state and power instead. */
10595
10621
  DeviceType["Dishwasher"] = "dishwasher";
10622
+ /** Washing machine. A plug-built one is running while its power stays
10623
+ * above a threshold. No program cap — that surface is the dishwasher's. */
10624
+ DeviceType["Washer"] = "washer";
10625
+ /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
10626
+ DeviceType["Dryer"] = "dryer";
10596
10627
  return DeviceType;
10597
10628
  }({});
10598
10629
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -10840,7 +10871,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
10840
10871
  return DeviceRole;
10841
10872
  }({});
10842
10873
  //#endregion
10843
- //#region ../types/dist/composition-OhpuespA.mjs
10874
+ //#region ../types/dist/composition-CZImLpOI.mjs
10844
10875
  /**
10845
10876
  * The ffmpeg build every CamStack node downloads, per platform and arch.
10846
10877
  *
@@ -11155,6 +11186,13 @@ var table = {
11155
11186
  apply: () => {
11156
11187
  throw new ExpressionEvalError("latchedAt: stateful evaluation context is required");
11157
11188
  }
11189
+ },
11190
+ schmitt: {
11191
+ minArgs: 3,
11192
+ maxArgs: 5,
11193
+ apply: () => {
11194
+ throw new ExpressionEvalError("schmitt: stateful evaluation context is required");
11195
+ }
11158
11196
  }
11159
11197
  };
11160
11198
  Object.freeze(Object.assign(Object.create(null), table));
@@ -11596,6 +11634,99 @@ function validateExpressionSource(src) {
11596
11634
  return null;
11597
11635
  }
11598
11636
  /**
11637
+ * One power reading becomes a washer, dryer or dishwasher (D944 helper).
11638
+ *
11639
+ * Standby of the control board is under 5 W; a motor or a heater is far
11640
+ * above that, so 5 W is the line. A door lock or a short pump spike is not
11641
+ * a cycle, so running starts only after 30 s above the line.
11642
+ *
11643
+ * A wash, dry or dishwasher pause (soak, heat-wait, heater off between
11644
+ * bursts) lasts several minutes. Ending the cycle on the first dip would
11645
+ * report "finished" in the middle of the program, so the stop dwell is
11646
+ * 10 minutes on every type. The number is stored per type so one machine
11647
+ * can move later without moving the others.
11648
+ */
11649
+ var APPLIANCE_TEMPLATE_ID = "appliance";
11650
+ var APPLIANCE_KINDS = [
11651
+ "washer",
11652
+ "dryer",
11653
+ "dishwasher"
11654
+ ];
11655
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
11656
+ /**
11657
+ * Statistics and integrals over a history read (D944).
11658
+ *
11659
+ * Pure: the same points always give the same answer, so a restart recomputes
11660
+ * rather than trusting a buffer. A gauge mean is time-weighted (value × ms),
11661
+ * never the mean of the samples. A hole with no held value is not integrated
11662
+ * as zero. A truncated read is not published.
11663
+ */
11664
+ var STATISTIC_STATS = [
11665
+ "min",
11666
+ "max",
11667
+ "mean",
11668
+ "sum",
11669
+ "count",
11670
+ "change"
11671
+ ];
11672
+ /**
11673
+ * The range a statistics or integral helper asks history for (D944).
11674
+ *
11675
+ * Calendar edges are the hub's timezone, never UTC midnight: a day is 23, 24
11676
+ * or 25 hours across a DST change. A tier is eligible only when its retention
11677
+ * is strictly longer than the longest that range can be. Forever qualifies.
11678
+ * Equal to a tier's retention is a refusal, not a short answer.
11679
+ */
11680
+ var MINUTE_MS = 6e4;
11681
+ var HOUR_MS = 60 * MINUTE_MS;
11682
+ var DAY_MS = 24 * HOUR_MS;
11683
+ var ROLLING_SPANS = [
11684
+ "1h",
11685
+ "24h",
11686
+ "2d",
11687
+ "7d",
11688
+ "30d",
11689
+ "custom"
11690
+ ];
11691
+ var CALENDAR_PERIODS = [
11692
+ "today",
11693
+ "yesterday",
11694
+ "this-week",
11695
+ "this-month"
11696
+ ];
11697
+ var RESET_PERIODS = [
11698
+ "never",
11699
+ "daily",
11700
+ "weekly",
11701
+ "monthly"
11702
+ ];
11703
+ 5 * MINUTE_MS;
11704
+ 24 * HOUR_MS, 2 * DAY_MS, 7 * DAY_MS, 30 * DAY_MS;
11705
+ 7 * DAY_MS, 30 * DAY_MS, 365 * DAY_MS;
11706
+ var rollingWindowObject = object({
11707
+ kind: literal("rolling"),
11708
+ span: _enum(ROLLING_SPANS),
11709
+ customMinutes: number().int().min(5).optional()
11710
+ }).check((payload) => {
11711
+ if (payload.value.span === "custom" && payload.value.customMinutes === void 0) payload.issues.push({
11712
+ code: "custom",
11713
+ message: "a custom range needs a duration in minutes",
11714
+ path: ["customMinutes"],
11715
+ input: payload.value
11716
+ });
11717
+ if (payload.value.span !== "custom" && payload.value.customMinutes !== void 0) payload.issues.push({
11718
+ code: "custom",
11719
+ message: "only a custom range carries a duration",
11720
+ path: ["customMinutes"],
11721
+ input: payload.value
11722
+ });
11723
+ });
11724
+ var RollingWindowSchema = rollingWindowObject;
11725
+ var StatisticWindowSchema = discriminatedUnion("kind", [rollingWindowObject, object({
11726
+ kind: literal("calendar"),
11727
+ period: _enum(CALENDAR_PERIODS)
11728
+ })]);
11729
+ /**
11599
11730
  * A composition source identity: `(addonId, stableId)`, never a numeric device
11600
11731
  * id. Split out so helper schemas can name it without a cycle through
11601
11732
  * `composition.ts` (D659).
@@ -11621,7 +11752,13 @@ var GROUP_TEMPLATE_IDS = [
11621
11752
  "occupancy",
11622
11753
  "binary",
11623
11754
  "switch",
11624
- "light"
11755
+ "light",
11756
+ "fan",
11757
+ "cover",
11758
+ "valve",
11759
+ "lock",
11760
+ "media-player",
11761
+ "climate"
11625
11762
  ];
11626
11763
  var NUMERIC_AGGREGATES = [
11627
11764
  "mean",
@@ -11651,14 +11788,73 @@ var HelperMemberSchema = object({
11651
11788
  cap: string().min(1),
11652
11789
  fieldPath: string().min(1)
11653
11790
  });
11654
- var HelperSpecSchema = discriminatedUnion("kind", [object({
11655
- kind: literal("group"),
11656
- templateId: GroupTemplateIdSchema,
11657
- aggregate: AggregateReducerSchema,
11658
- members: array(HelperMemberSchema).min(1).max(64),
11659
- /** Actuator groups only. Readings leave this unset. */
11660
- active: ActiveCriterionSchema.optional()
11661
- })]);
11791
+ var HelperSpecSchema = discriminatedUnion("kind", [
11792
+ object({
11793
+ kind: literal("group"),
11794
+ templateId: GroupTemplateIdSchema,
11795
+ aggregate: AggregateReducerSchema,
11796
+ members: array(HelperMemberSchema).min(1).max(64),
11797
+ /** Actuator groups only. Readings leave this unset. */
11798
+ active: ActiveCriterionSchema.optional()
11799
+ }),
11800
+ object({
11801
+ kind: literal("appliance"),
11802
+ templateId: literal(APPLIANCE_TEMPLATE_ID),
11803
+ appliance: _enum(APPLIANCE_KINDS),
11804
+ thresholdWatts: number().positive(),
11805
+ startDwellMs: number().int().nonnegative(),
11806
+ stopDwellMs: number().int().nonnegative(),
11807
+ member: HelperMemberSchema
11808
+ }),
11809
+ object({
11810
+ kind: literal("statistic"),
11811
+ stat: _enum(STATISTIC_STATS),
11812
+ window: StatisticWindowSchema,
11813
+ source: HelperMemberSchema
11814
+ }),
11815
+ object({
11816
+ kind: literal("integral"),
11817
+ reset: _enum(RESET_PERIODS),
11818
+ output: _enum(["energy", "meter"]),
11819
+ source: HelperMemberSchema
11820
+ }),
11821
+ object({
11822
+ kind: literal("threshold"),
11823
+ source: HelperMemberSchema,
11824
+ high: number(),
11825
+ low: number(),
11826
+ onForMs: number().int().nonnegative(),
11827
+ offForMs: number().int().nonnegative()
11828
+ }),
11829
+ object({
11830
+ kind: literal("arithmetic"),
11831
+ op: _enum([
11832
+ "sum",
11833
+ "difference",
11834
+ "ratio"
11835
+ ]),
11836
+ inputs: array(HelperMemberSchema).min(2).max(64)
11837
+ }),
11838
+ object({
11839
+ kind: literal("expression"),
11840
+ expr: string().min(1),
11841
+ inputs: array(object({
11842
+ name: string().min(1),
11843
+ member: HelperMemberSchema
11844
+ })).min(1).max(64),
11845
+ output: _enum(["number", "boolean"])
11846
+ }),
11847
+ object({
11848
+ kind: literal("derivative"),
11849
+ window: RollingWindowSchema,
11850
+ per: _enum([
11851
+ "second",
11852
+ "minute",
11853
+ "hour"
11854
+ ]),
11855
+ source: HelperMemberSchema
11856
+ })
11857
+ ]);
11662
11858
  /** A composed device's stableId is this prefix plus the block id. */
11663
11859
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
11664
11860
  /** Longest snippet a `code` source may carry (slice 4). */
@@ -11719,6 +11915,12 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
11719
11915
  "all"
11720
11916
  ]),
11721
11917
  reads: array(CompositionFieldReadSchema).min(1).max(64),
11918
+ /**
11919
+ * Set when the reads are an enum state, not a yes/no: the listed states
11920
+ * count as active (a cover is `open`). A state outside the list is inactive;
11921
+ * a read that is not a state at all is left out. Only `any` / `all` use it.
11922
+ */
11923
+ activeWhen: array(string().min(1)).min(1).optional(),
11722
11924
  /** `value` is the reading; the others are the member counts. */
11723
11925
  publish: _enum([
11724
11926
  "value",
@@ -11732,6 +11934,26 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
11732
11934
  "omit",
11733
11935
  "offline"
11734
11936
  ])
11937
+ }),
11938
+ object({
11939
+ kind: literal("series"),
11940
+ read: CompositionFieldReadSchema,
11941
+ /** `value` is the statistic or the integral. The others are the gap counts. */
11942
+ publish: _enum([
11943
+ "value",
11944
+ "included",
11945
+ "excluded",
11946
+ "total"
11947
+ ]),
11948
+ /**
11949
+ * What an unanswered `value` does. Counts ignore this. `offline` leaves the
11950
+ * device unseeded until history answers, so a restart cannot publish 0.
11951
+ */
11952
+ empty: _enum([
11953
+ "null",
11954
+ "omit",
11955
+ "offline"
11956
+ ])
11735
11957
  })
11736
11958
  ]);
11737
11959
  var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
@@ -15488,6 +15710,14 @@ var AutomationConditionLeafSchema = object({
15488
15710
  array(union([string(), number()]))
15489
15711
  ])
15490
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
+ });
15491
15721
  /**
15492
15722
  * The expression leaf, declared as a plain object rather than an intersection
15493
15723
  * with {@link ExpressionSourceSchema}: a discriminated union has to be able to
@@ -15521,7 +15751,8 @@ var AutomationConditionSchema = lazy(() => discriminatedUnion("kind", [
15521
15751
  child: AutomationConditionSchema
15522
15752
  }),
15523
15753
  AutomationConditionLeafSchema,
15524
- AutomationConditionExpressionSchema
15754
+ AutomationConditionExpressionSchema,
15755
+ AutomationConditionStationaryPresentSchema
15525
15756
  ]));
15526
15757
  /**
15527
15758
  * What starts a run.
@@ -15562,7 +15793,34 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
15562
15793
  kind: literal("schedule"),
15563
15794
  cron: string().min(1).max(120)
15564
15795
  }),
15565
- 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
+ })
15566
15824
  ]);
15567
15825
  /**
15568
15826
  * One action step.
@@ -15582,28 +15840,47 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
15582
15840
  * is called. The runner still receives a number and is untouched; the
15583
15841
  * resolution is the recipe's job, not the runner's.
15584
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]);
15585
15871
  var AutomationActionSchema = discriminatedUnion("kind", [
15872
+ AutomationWaitStepSchema,
15873
+ AutomationCapStepSchema,
15586
15874
  object({
15587
- kind: literal("wait"),
15588
- seconds: number().min(0).max(300)
15589
- }),
15590
- object({
15591
- kind: literal("cap"),
15592
- /**
15593
- * One device, several same-family devices (locks / climate family / …),
15594
- * or `{ $var }` for the device that triggered the run. An array is
15595
- * fan-out at codegen — each id gets the same cap.method call.
15596
- */
15597
- deviceId: union([
15598
- number().int(),
15599
- array(number().int()).min(1),
15600
- object({ $var: string().min(1) })
15601
- ]),
15602
- cap: string().min(1),
15603
- method: string().min(1),
15604
- /** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
15605
- * evaluate (§3.2.3). Anything beyond substitution is the expression leaf. */
15606
- 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()
15607
15884
  }),
15608
15885
  object({
15609
15886
  kind: literal("code"),
@@ -15612,10 +15889,357 @@ var AutomationActionSchema = discriminatedUnion("kind", [
15612
15889
  code: string().min(1).max(2e4)
15613
15890
  })
15614
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
+ ]);
15615
15921
  var AutomationRecipeSchema = object({
15616
15922
  triggers: array(AutomationTriggerSchema),
15617
15923
  conditions: AutomationConditionSchema.optional(),
15618
- 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()
15619
16243
  });
15620
16244
  /**
15621
16245
  * `addon-pages` — system-scoped singleton aggregator cap. Public-facing
@@ -17210,7 +17834,22 @@ var BrokerProviderInfoSchema = object({
17210
17834
  */
17211
17835
  interactiveConnectPath: string().min(1).optional(),
17212
17836
  /** Relative hub path to disconnect the linked account (same popup pattern). */
17213
- interactiveDisconnectPath: string().min(1).optional()
17837
+ interactiveDisconnectPath: string().min(1).optional(),
17838
+ /**
17839
+ * The kind signs in through a server-held interactive session instead of
17840
+ * (or before) typed credentials. `basePath` is a hub-relative route set
17841
+ * served by the owning addon (`/addon/<id>/...`) speaking the sign-in
17842
+ * contract: `POST {basePath}/start` (body: the form's settings) answers
17843
+ * `{ sessionId, loginUrl }`; `GET {basePath}/status?sessionId=` answers
17844
+ * `{ phase: 'starting' | 'awaiting-login' | 'captured' | 'error' |
17845
+ * 'cancelled', loginUrl, error }`; `POST {basePath}/commit`
17846
+ * (`{ sessionId, name, brokerId? }`) stores the credentials on a new or
17847
+ * existing broker and answers `{ brokerId }`; `POST {basePath}/cancel`
17848
+ * (`{ sessionId }`) drops the session. The dialog that edits a broker
17849
+ * offers it as the default path; the fields the session fills are
17850
+ * marked `filledBySignIn` in the kind's settings schema.
17851
+ */
17852
+ signIn: object({ basePath: string().min(1) }).optional()
17214
17853
  }))
17215
17854
  });
17216
17855
  var ListInputSchema = object({
@@ -18287,7 +18926,7 @@ var CompositionEventPlanSchema = object({
18287
18926
  stateField: string(),
18288
18927
  fieldKey: string()
18289
18928
  });
18290
- /** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.celsius`. */
18929
+ /** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
18291
18930
  var CompositionProblemSchema = object({
18292
18931
  code: _enum([
18293
18932
  "reserved-variant",
@@ -18315,7 +18954,8 @@ var CompositionProblemSchema = object({
18315
18954
  "native-capability-replace",
18316
18955
  "mixed-quantity",
18317
18956
  "helper-mismatch",
18318
- "member-constraint"
18957
+ "member-constraint",
18958
+ "retention"
18319
18959
  ]),
18320
18960
  path: string(),
18321
18961
  message: string()
@@ -18549,13 +19189,17 @@ Object.freeze({
18549
19189
  latchedAt: {
18550
19190
  kind: "fixed",
18551
19191
  result: ["number", "null"]
19192
+ },
19193
+ schmitt: {
19194
+ kind: "fixed",
19195
+ result: ["boolean", "null"]
18552
19196
  }
18553
19197
  });
18554
19198
  /**
18555
19199
  * One catalog row per base reading a group helper can build (D944 §3).
18556
19200
  * Data, not a form default written into the block.
18557
19201
  */
18558
- var NOW = {
19202
+ var NOW$2 = {
18559
19203
  fieldPath: "lastFetchedAt",
18560
19204
  expr: "now"
18561
19205
  };
@@ -18569,6 +19213,8 @@ function numeric(input) {
18569
19213
  family: "numeric",
18570
19214
  deviceType: DeviceType.Sensor,
18571
19215
  memberDeviceType: DeviceType.Sensor,
19216
+ memberDeviceTypes: [DeviceType.Sensor],
19217
+ activeWhen: void 0,
18572
19218
  commandCaps: [],
18573
19219
  baseUnit: baseUnitOf(input.quantity),
18574
19220
  aggregates: NUMERIC_AGGREGATES,
@@ -18584,6 +19230,8 @@ function binary(input) {
18584
19230
  family: "binary",
18585
19231
  deviceType: DeviceType.Sensor,
18586
19232
  memberDeviceType: DeviceType.Sensor,
19233
+ memberDeviceTypes: [DeviceType.Sensor],
19234
+ activeWhen: void 0,
18587
19235
  commandCaps: [],
18588
19236
  quantity: "none",
18589
19237
  baseUnit: void 0,
@@ -18597,73 +19245,73 @@ var GROUP_TEMPLATES = [
18597
19245
  summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
18598
19246
  role: DeviceRole.TemperatureSensor,
18599
19247
  outputCap: "temperature-sensor",
18600
- outputField: "celsius",
19248
+ outputField: "temperature",
18601
19249
  quantity: "temperature",
18602
19250
  defaultAggregate: "mean",
18603
19251
  empty: "null",
18604
- companions: [NOW]
19252
+ companions: [NOW$2]
18605
19253
  }),
18606
19254
  numeric({
18607
19255
  id: "humidity",
18608
19256
  summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
18609
19257
  role: DeviceRole.HumiditySensor,
18610
19258
  outputCap: "humidity-sensor",
18611
- outputField: "percent",
19259
+ outputField: "humidity",
18612
19260
  quantity: "humidity",
18613
19261
  defaultAggregate: "mean",
18614
19262
  empty: "null",
18615
- companions: [NOW]
19263
+ companions: [NOW$2]
18616
19264
  }),
18617
19265
  numeric({
18618
19266
  id: "pressure",
18619
19267
  summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
18620
19268
  role: DeviceRole.PressureSensor,
18621
19269
  outputCap: "pressure-sensor",
18622
- outputField: "hpa",
19270
+ outputField: "pressure",
18623
19271
  quantity: "pressure",
18624
19272
  defaultAggregate: "mean",
18625
19273
  empty: "null",
18626
- companions: [NOW]
19274
+ companions: [NOW$2]
18627
19275
  }),
18628
19276
  numeric({
18629
19277
  id: "illuminance",
18630
19278
  summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
18631
19279
  role: DeviceRole.AmbientLightSensor,
18632
19280
  outputCap: "ambient-light-sensor",
18633
- outputField: "lux",
19281
+ outputField: "illuminance",
18634
19282
  quantity: "illuminance",
18635
19283
  defaultAggregate: "mean",
18636
19284
  empty: "null",
18637
- companions: [NOW]
19285
+ companions: [NOW$2]
18638
19286
  }),
18639
19287
  numeric({
18640
19288
  id: "power",
18641
19289
  summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
18642
19290
  role: DeviceRole.PowerSensor,
18643
19291
  outputCap: "power-meter",
18644
- outputField: "watts",
19292
+ outputField: "power",
18645
19293
  quantity: "power",
18646
19294
  defaultAggregate: "sum",
18647
19295
  empty: "omit",
18648
- companions: [NOW]
19296
+ companions: [NOW$2]
18649
19297
  }),
18650
19298
  numeric({
18651
19299
  id: "energy",
18652
19300
  summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
18653
19301
  role: DeviceRole.EnergySensor,
18654
19302
  outputCap: "power-meter",
18655
- outputField: "kwhTotal",
19303
+ outputField: "energy",
18656
19304
  quantity: "energy",
18657
19305
  defaultAggregate: "sum",
18658
19306
  empty: "omit",
18659
- companions: [NOW]
19307
+ companions: [NOW$2]
18660
19308
  }),
18661
19309
  numeric({
18662
19310
  id: "battery",
18663
19311
  summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
18664
19312
  role: DeviceRole.BatterySensor,
18665
19313
  outputCap: "battery",
18666
- outputField: "percentage",
19314
+ outputField: "level",
18667
19315
  quantity: "percentage",
18668
19316
  defaultAggregate: "mean",
18669
19317
  empty: "null",
@@ -18691,7 +19339,7 @@ var GROUP_TEMPLATES = [
18691
19339
  quantity: "device",
18692
19340
  defaultAggregate: "mean",
18693
19341
  empty: "null",
18694
- companions: [NOW]
19342
+ companions: [NOW$2]
18695
19343
  }),
18696
19344
  binary({
18697
19345
  id: "motion",
@@ -18785,6 +19433,11 @@ var GROUP_TEMPLATES = [
18785
19433
  summary: "On when at least one switch is on, or when all of them are. Offline and unknown members are left out of that decision, never read as off, and still receive the command.",
18786
19434
  deviceType: DeviceType.Switch,
18787
19435
  outputCap: "switch",
19436
+ outputField: "on",
19437
+ member: {
19438
+ cap: "switch",
19439
+ fieldPath: "on"
19440
+ },
18788
19441
  commandCaps: ["switch"]
18789
19442
  }),
18790
19443
  actuator({
@@ -18792,34 +19445,136 @@ var GROUP_TEMPLATES = [
18792
19445
  summary: "On when at least one light is on, or when all of them are. Brightness and colour are offered only when every member has them. A command is not sent to a member that lacks it.",
18793
19446
  deviceType: DeviceType.Light,
18794
19447
  outputCap: "switch",
19448
+ outputField: "on",
19449
+ member: {
19450
+ cap: "switch",
19451
+ fieldPath: "on"
19452
+ },
18795
19453
  commandCaps: [
18796
19454
  "switch",
18797
19455
  "brightness",
18798
19456
  "color"
18799
19457
  ]
19458
+ }),
19459
+ actuator({
19460
+ id: "fan",
19461
+ summary: "On when at least one fan is on, or when all of them are. Speed, preset, direction and oscillation are offered only when every fan has them. A command is not sent to a fan that lacks it.",
19462
+ deviceType: DeviceType.Fan,
19463
+ outputCap: "switch",
19464
+ outputField: "on",
19465
+ member: {
19466
+ cap: "switch",
19467
+ fieldPath: "on"
19468
+ },
19469
+ commandCaps: ["switch", "fan-control"]
19470
+ }),
19471
+ actuator({
19472
+ id: "cover",
19473
+ summary: "Open when at least one cover is open or part-open, or only when all of them are. Position and tilt are offered only when every cover has them. A cover that reports nothing is left out, never read as closed.",
19474
+ deviceType: DeviceType.Cover,
19475
+ outputCap: "group-active",
19476
+ outputField: "active",
19477
+ member: {
19478
+ cap: "cover",
19479
+ fieldPath: "state"
19480
+ },
19481
+ activeWhen: [
19482
+ "open",
19483
+ "opening",
19484
+ "stopped"
19485
+ ],
19486
+ commandCaps: ["cover"]
19487
+ }),
19488
+ actuator({
19489
+ id: "valve",
19490
+ summary: "Open when at least one valve is open or part-open, or only when all of them are. Position is offered only when every valve has it. A valve that reports nothing is left out, never read as closed.",
19491
+ deviceType: DeviceType.Valve,
19492
+ outputCap: "group-active",
19493
+ outputField: "active",
19494
+ member: {
19495
+ cap: "valve",
19496
+ fieldPath: "state"
19497
+ },
19498
+ activeWhen: [
19499
+ "open",
19500
+ "opening",
19501
+ "stopped"
19502
+ ],
19503
+ commandCaps: ["valve"]
19504
+ }),
19505
+ actuator({
19506
+ id: "lock",
19507
+ summary: "Locked when at least one lock is locked, or only when all of them are. A jammed or moving lock is not locked. Locking is one tap; unlocking the group needs a confirmation every time, and nothing is sent without it.",
19508
+ deviceType: DeviceType.Lock,
19509
+ outputCap: "group-active",
19510
+ outputField: "active",
19511
+ member: {
19512
+ cap: "lock-control",
19513
+ fieldPath: "state"
19514
+ },
19515
+ activeWhen: ["locked"],
19516
+ commandCaps: ["lock-control"]
19517
+ }),
19518
+ actuator({
19519
+ id: "media-player",
19520
+ summary: "Playing when at least one player is playing, or only when all of them are. Volume is offered only when every player has it. A player that reports nothing is left out, never read as stopped.",
19521
+ deviceType: DeviceType.MediaPlayer,
19522
+ outputCap: "group-active",
19523
+ outputField: "active",
19524
+ member: {
19525
+ cap: "media-player",
19526
+ fieldPath: "state"
19527
+ },
19528
+ activeWhen: ["playing", "buffering"],
19529
+ commandCaps: ["media-player"]
19530
+ }),
19531
+ actuator({
19532
+ id: "climate",
19533
+ summary: "Running when at least one thermostat or air conditioner is not off, or only when all of them are. Target temperature and fan are offered only when every device has them. A device that reports nothing is left out, never read as off.",
19534
+ deviceType: DeviceType.Thermostat,
19535
+ memberDeviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
19536
+ outputCap: "group-active",
19537
+ outputField: "active",
19538
+ member: {
19539
+ cap: "climate-control",
19540
+ fieldPath: "mode"
19541
+ },
19542
+ activeWhen: [
19543
+ "heat",
19544
+ "cool",
19545
+ "auto",
19546
+ "heat_cool",
19547
+ "fan_only",
19548
+ "dry"
19549
+ ],
19550
+ commandCaps: ["climate-control"]
18800
19551
  })
18801
19552
  ];
18802
19553
  function actuator(input) {
18803
19554
  return {
18804
- ...input,
19555
+ id: input.id,
19556
+ summary: input.summary,
19557
+ deviceType: input.deviceType,
19558
+ outputCap: input.outputCap,
19559
+ outputField: input.outputField,
19560
+ commandCaps: input.commandCaps,
18805
19561
  family: "actuator",
18806
19562
  role: void 0,
18807
19563
  memberDeviceType: input.deviceType,
18808
- outputField: "on",
19564
+ memberDeviceTypes: input.memberDeviceTypes ?? [input.deviceType],
19565
+ activeWhen: input.activeWhen,
18809
19566
  quantity: "none",
18810
19567
  baseUnit: void 0,
18811
19568
  aggregates: BINARY_AGGREGATES,
18812
19569
  defaultAggregate: "any",
18813
19570
  empty: "offline",
18814
- accept: [{
18815
- cap: "switch",
18816
- fieldPath: "on"
18817
- }],
19571
+ accept: [input.member],
18818
19572
  companions: [CHANGED]
18819
19573
  };
18820
19574
  }
18821
19575
  new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
18822
19576
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
19577
+ DeviceType.Camera;
18823
19578
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
18824
19579
  /**
18825
19580
  * What a composition may BUILD on a device type (G2, D676): the caps a new
@@ -19134,7 +19889,18 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
19134
19889
  kind: "mutation",
19135
19890
  auth: "admin",
19136
19891
  access: "view"
19137
- });
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" });
19138
19904
  /**
19139
19905
  * `custom-model-registry` — collection cap exposing operator-registered
19140
19906
  * custom detection models. Each provider (today: `addon-model-studio`)
@@ -44158,7 +44924,7 @@ var NetworkAccessStatusSchema = object({
44158
44924
  });
44159
44925
  /**
44160
44926
  * Optional, richer endpoint shape returned by providers that expose
44161
- * MORE than one ingress concurrently (Tailscale Ingress with mixed
44927
+ * MORE than one ingress concurrently (Tailscale Funnel with mixed
44162
44928
  * serve+funnel rules, future ngrok multi-tunnel, …). Each entry carries
44163
44929
  * the originating provider config (mode + sourcePort) so the
44164
44930
  * orchestrator UI can label rows distinctly. Providers that expose only
@@ -44551,51 +45317,6 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
44551
45317
  kind: "mutation",
44552
45318
  auth: "admin"
44553
45319
  });
44554
- new Set([
44555
- {
44556
- id: "person",
44557
- name: "Person"
44558
- },
44559
- {
44560
- id: "vehicle",
44561
- name: "Vehicle"
44562
- },
44563
- {
44564
- id: "animal",
44565
- name: "Animal"
44566
- },
44567
- {
44568
- id: "package",
44569
- name: "Package"
44570
- }
44571
- ].map((l) => l.id));
44572
- var COCO_TO_MACRO = {
44573
- mapping: {
44574
- person: "person",
44575
- bicycle: "vehicle",
44576
- car: "vehicle",
44577
- motorcycle: "vehicle",
44578
- airplane: "vehicle",
44579
- bus: "vehicle",
44580
- train: "vehicle",
44581
- truck: "vehicle",
44582
- boat: "vehicle",
44583
- bird: "animal",
44584
- cat: "animal",
44585
- dog: "animal",
44586
- horse: "animal",
44587
- sheep: "animal",
44588
- cow: "animal",
44589
- elephant: "animal",
44590
- bear: "animal",
44591
- zebra: "animal",
44592
- giraffe: "animal",
44593
- suitcase: "package",
44594
- backpack: "package",
44595
- handbag: "package"
44596
- },
44597
- preserveOriginal: false
44598
- };
44599
45320
  var AUDIO_MACRO_LABELS = [
44600
45321
  {
44601
45322
  id: "speech",
@@ -46845,7 +47566,20 @@ var NcRuleInputSchema = object({
46845
47566
  * save by the hub's grouping guard). `.optional()`, never `.default()`: the addon cap
46846
47567
  * path does not run Zod defaults.
46847
47568
  */
46848
- groupingSec: number().int().min(5).max(60).optional()
47569
+ groupingSec: number().int().min(5).max(60).optional(),
47570
+ /**
47571
+ * ASK ME TO CONFIRM DETECTIONS (#243): a DETECTION notification of this rule
47572
+ * carries "Correct" / "Wrong" buttons (and, where the channel has room, a
47573
+ * "Wrong, it is a <class>" choice). A tap marks the track for retraining, the
47574
+ * same mark the Library writes, and records whose notification it was and
47575
+ * when. A channel with no buttons gets the same two choices as links.
47576
+ *
47577
+ * `.optional()`, never `.default()` (a Zod default does not run on the addon
47578
+ * cap path): absent and `false` both mean off, which is what every rule
47579
+ * authored before this field meant. An editor turns it off by writing
47580
+ * `false`, so it needs no `clear` key.
47581
+ */
47582
+ askVerdict: boolean().optional()
46849
47583
  });
46850
47584
  /**
46851
47585
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -57671,9 +58405,9 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
57671
58405
  */
57672
58406
  var AirQualitySensorStatusSchema = object({
57673
58407
  /** Carbon dioxide concentration in ppm. */
57674
- co2Ppm: number().min(0).optional().meta(readingMeta("concentration-volume")),
58408
+ co2: number().min(0).optional().meta(readingMeta("concentration-volume")),
57675
58409
  /** Total volatile organic compounds in ppb. */
57676
- vocPpb: number().min(0).optional().meta(readingMeta("concentration-ppb")),
58410
+ voc: number().min(0).optional().meta(readingMeta("concentration-ppb")),
57677
58411
  /** Particulate matter ≤ 2.5 μm in µg/m³. */
57678
58412
  pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
57679
58413
  /** Particulate matter ≤ 10 μm in µg/m³. */
@@ -57706,12 +58440,12 @@ var airQualitySensorCapability = {
57706
58440
  * History (D850): recorded series.
57707
58441
  */
57708
58442
  history: { fields: {
57709
- co2Ppm: {
58443
+ co2: {
57710
58444
  kind: "gauge",
57711
58445
  unit: "ppm",
57712
58446
  deadband: 5
57713
58447
  },
57714
- vocPpb: {
58448
+ voc: {
57715
58449
  kind: "gauge",
57716
58450
  unit: "ppb",
57717
58451
  deadband: 5
@@ -57742,7 +58476,7 @@ var airQualitySensorCapability = {
57742
58476
  */
57743
58477
  var AmbientLightSensorStatusSchema = object({
57744
58478
  /** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
57745
- lux: number().min(0).nullable().meta(readingMeta("illuminance", {
58479
+ illuminance: number().min(0).nullable().meta(readingMeta("illuminance", {
57746
58480
  precision: 0,
57747
58481
  label: "Illuminance"
57748
58482
  })),
@@ -57771,7 +58505,7 @@ var ambientLightSensorCapability = {
57771
58505
  /**
57772
58506
  * History (D850): recorded series. Wide range, so a RELATIVE deadband (10 %).
57773
58507
  */
57774
- history: { fields: { lux: {
58508
+ history: { fields: { illuminance: {
57775
58509
  kind: "gauge",
57776
58510
  unit: "lx",
57777
58511
  deadbandPct: 10,
@@ -57910,6 +58644,84 @@ var audioMetricsCapability = {
57910
58644
  */
57911
58645
  history: "none"
57912
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
+ });
57913
58725
  /**
57914
58726
  * Automation-control cap. Models HA `automation.*` entities on
57915
58727
  * `DeviceType.Automation`. An automation is a trigger+condition+
@@ -58006,7 +58818,7 @@ var BatteryStatusSchema = object({
58006
58818
  * Consumers must SKIP a null rather than coerce it — `battery-band` already
58007
58819
  * declines to band a non-finite reading, which is the correct shape.
58008
58820
  */
58009
- percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
58821
+ level: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
58010
58822
  /**
58011
58823
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
58012
58824
  * Reolink-specific for the Solar Panel 2 accessory (will become
@@ -58016,7 +58828,7 @@ var BatteryStatusSchema = object({
58016
58828
  * `'unknown'` is the absence of an answer: the provider has not read the
58017
58829
  * power fields yet, or the firmware reported neither. Before it existed,
58018
58830
  * two unreadable fields produced `'none'`, and a camera nobody had reached
58019
- * was drawn "on battery alone" — the same D315 defect `percentage` closed
58831
+ * was drawn "on battery alone" — the same D315 defect `level` closed
58020
58832
  * by going nullable. Consumers SKIP it (no charger state published, no
58021
58833
  * glyph, no HomeKit ChargingState) rather than coerce it either way.
58022
58834
  */
@@ -58040,7 +58852,7 @@ var BatteryStatusSchema = object({
58040
58852
  * that only report charge. A second reading on this cap, not a second
58041
58853
  * `numeric-sensor` on the same device.
58042
58854
  */
58043
- volts: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
58855
+ voltage: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
58044
58856
  /**
58045
58857
  * Ms epoch of the last time the device PROVED it was reachable — a
58046
58858
  * completed firmware round-trip, an observed wake, or an inbound push
@@ -58074,7 +58886,7 @@ var BatteryStatusSchema = object({
58074
58886
  /**
58075
58887
  * True when the source is a BINARY low-battery indicator (HA
58076
58888
  * `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
58077
- * charge level — `percentage` is then a coarse stand-in (100 = normal,
58889
+ * charge level — `level` is then a coarse stand-in (100 = normal,
58078
58890
  * sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
58079
58891
  * misleading exact percentage. Absent/false → genuine 0–100 % reading.
58080
58892
  */
@@ -58087,21 +58899,22 @@ var BATTERY_DEVICE_TYPES = [
58087
58899
  DeviceType.Switch,
58088
58900
  DeviceType.PetFeeder,
58089
58901
  DeviceType.Container,
58090
- DeviceType.Thermostat
58902
+ DeviceType.Thermostat,
58903
+ DeviceType.EventEmitter
58091
58904
  ];
58092
58905
  /** Generic Customize target for the percentage reading (D936). */
58093
58906
  var batteryCustomize = {
58094
58907
  version: 1,
58095
58908
  targets: [{
58096
- id: "percentage",
58909
+ id: "level",
58097
58910
  cardinality: "scalar",
58098
58911
  vocabulary: {
58099
58912
  cap: "battery",
58100
- stateField: "percentage"
58913
+ stateField: "level"
58101
58914
  },
58102
58915
  deviceTypes: BATTERY_DEVICE_TYPES,
58103
58916
  apply: "add",
58104
- path: "percentage",
58917
+ path: "level",
58105
58918
  sources: [{
58106
58919
  kind: "field",
58107
58920
  valueKinds: ["number", "string"],
@@ -58195,7 +59008,7 @@ onStatusChanged: { data: object({
58195
59008
  schema: BatteryStatusSchema,
58196
59009
  kind: "push",
58197
59010
  empty: {
58198
- percentage: null,
59011
+ level: null,
58199
59012
  charging: "unknown",
58200
59013
  sleeping: false,
58201
59014
  lastUpdated: 0
@@ -58222,11 +59035,11 @@ onStatusChanged: { data: object({
58222
59035
  * History (D850): recorded series. The generic capture replaces the `battery` series of `pipeline-analytics:stats-5m`.
58223
59036
  */
58224
59037
  history: { fields: {
58225
- percentage: {
59038
+ level: {
58226
59039
  kind: "gauge",
58227
59040
  unit: "%"
58228
59041
  },
58229
- volts: {
59042
+ voltage: {
58230
59043
  kind: "gauge",
58231
59044
  unit: "V"
58232
59045
  }
@@ -58286,14 +59099,14 @@ var binaryCapability = {
58286
59099
  * controls to this single-method surface.
58287
59100
  *
58288
59101
  * The cap is intentionally minimal: a single `setBrightness({deviceId,
58289
- * percentage})` mutation plus the auto-injected `getStatus`. Drivers
59102
+ * level})` mutation plus the auto-injected `getStatus`. Drivers
58290
59103
  * that expose richer controls (color temperature, scenes, schedules)
58291
59104
  * should surface those via the device's `getSettingsUISchema()`
58292
59105
  * instead of bloating this cap.
58293
59106
  */
58294
59107
  var BrightnessStatusSchema = object({
58295
59108
  /** Current level as 0..100 inclusive. Firmware-reported. */
58296
- percentage: number().min(0).max(100).meta(readingMeta("percentage")),
59109
+ level: number().min(0).max(100).meta(readingMeta("percentage")),
58297
59110
  /** Ms epoch of the last operator-driven change. Useful for UI freshness. */
58298
59111
  lastChangedAt: number()
58299
59112
  });
@@ -58305,7 +59118,7 @@ var brightnessCapability = {
58305
59118
  deviceTypes: [DeviceType.Light],
58306
59119
  methods: { setBrightness: method(object({
58307
59120
  deviceId: number().int().nonnegative(),
58308
- percentage: number().min(0).max(100)
59121
+ level: number().min(0).max(100)
58309
59122
  }), _void(), {
58310
59123
  kind: "mutation",
58311
59124
  auth: "protected"
@@ -58318,7 +59131,7 @@ var brightnessCapability = {
58318
59131
  */
58319
59132
  onBrightnessChanged: { data: object({
58320
59133
  deviceId: number(),
58321
- percentage: number().min(0).max(100),
59134
+ level: number().min(0).max(100),
58322
59135
  lastChangedAt: number()
58323
59136
  }) } },
58324
59137
  status: {
@@ -58341,7 +59154,7 @@ onBrightnessChanged: { data: object({
58341
59154
  /**
58342
59155
  * History (D850): recorded series. Actuator tier: level keeps every change.
58343
59156
  */
58344
- history: { fields: { percentage: {
59157
+ history: { fields: { level: {
58345
59158
  kind: "gauge",
58346
59159
  unit: "%",
58347
59160
  minIntervalMs: 0
@@ -58938,11 +59751,11 @@ var ColorInputSchema = discriminatedUnion("mode", [
58938
59751
  }),
58939
59752
  object({
58940
59753
  mode: literal("mired"),
58941
- mireds: number().int().min(50).max(1e3)
59754
+ colorTemperature: number().int().min(50).max(1e3)
58942
59755
  })
58943
59756
  ]);
58944
59757
  var ColorStatusSchema = object({
58945
- /** Active color mode — which of `rgb` / `hsv` / `mireds` reflects
59758
+ /** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
58946
59759
  * the bulb's current state. */
58947
59760
  mode: _enum([
58948
59761
  "rgb",
@@ -58954,7 +59767,7 @@ var ColorStatusSchema = object({
58954
59767
  /** Populated when `mode === 'hsv'`. */
58955
59768
  hsv: HsvTripletSchema.optional(),
58956
59769
  /** Populated when `mode === 'mired'`. */
58957
- mireds: number().int().optional().meta(readingMeta("colour-temperature")),
59770
+ colorTemperature: number().int().optional().meta(readingMeta("colour-temperature")),
58958
59771
  /** Ms epoch of the last operator-driven change. */
58959
59772
  lastChangedAt: number()
58960
59773
  });
@@ -58986,7 +59799,7 @@ onColorChanged: { data: object({
58986
59799
  ]),
58987
59800
  rgb: RgbTripletSchema.optional(),
58988
59801
  hsv: HsvTripletSchema.optional(),
58989
- mireds: number().int().optional(),
59802
+ colorTemperature: number().int().optional(),
58990
59803
  lastChangedAt: number()
58991
59804
  }) } },
58992
59805
  status: {
@@ -59863,11 +60676,11 @@ var DishwasherStatusSchema = object({
59863
60676
  /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
59864
60677
  availablePrograms: array(string()),
59865
60678
  /** Seconds remaining on the active cycle, or null when not running / not known. */
59866
- remainingSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
60679
+ remaining: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59867
60680
  /** Seconds the delayed start is set to (time until the cycle starts), or null. */
59868
- delayedStartSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
60681
+ delayedStart: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59869
60682
  /** Cycle completion 0..100, or null when not applicable. */
59870
- progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60683
+ progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59871
60684
  /** True when the door is reported open; null when the door state is not known. */
59872
60685
  doorOpen: boolean().nullable(),
59873
60686
  /** True when the door is latched (locked) during a cycle; null when not reported. */
@@ -60086,14 +60899,14 @@ var dishwasherCapability = {
60086
60899
  runtimeState: DishwasherStatusSchema,
60087
60900
  durability: "session",
60088
60901
  history: { fields: {
60089
- progressPercent: {
60902
+ progress: {
60090
60903
  kind: "gauge",
60091
60904
  unit: "%",
60092
60905
  deadband: 2
60093
60906
  },
60094
60907
  state: { kind: "enum" },
60095
60908
  operationState: { kind: "enum" },
60096
- remainingSeconds: {
60909
+ remaining: {
60097
60910
  kind: "gauge",
60098
60911
  unit: "s",
60099
60912
  minIntervalMs: 6e4
@@ -60684,7 +61497,7 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
60684
61497
  var FanControlStatusSchema = object({
60685
61498
  /** Active speed as 0..100 inclusive. Null when the device has no
60686
61499
  * speed surface (single-speed fan). */
60687
- percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61500
+ speed: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60688
61501
  /** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
60689
61502
  * a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
60690
61503
  percentageStep: number().positive().optional().meta(readingMeta("percentage")),
@@ -60711,7 +61524,7 @@ var fanControlCapability = {
60711
61524
  methods: {
60712
61525
  setPercentage: method(object({
60713
61526
  deviceId: number().int().nonnegative(),
60714
- percentage: number().min(0).max(100)
61527
+ speed: number().min(0).max(100)
60715
61528
  }), _void(), {
60716
61529
  kind: "mutation",
60717
61530
  auth: "protected"
@@ -60744,7 +61557,7 @@ var fanControlCapability = {
60744
61557
  },
60745
61558
  /**
60746
61559
  * Runtime-state slice — mirrored by the kernel. UI fan speed
60747
- * sliders read `percentage` for live updates.
61560
+ * sliders read `speed` for live updates.
60748
61561
  */
60749
61562
  runtimeState: FanControlStatusSchema,
60750
61563
  /**
@@ -60758,7 +61571,7 @@ var fanControlCapability = {
60758
61571
  * History (D850): recorded series. Actuator tier: speed keeps every change.
60759
61572
  */
60760
61573
  history: { fields: {
60761
- percentage: {
61574
+ speed: {
60762
61575
  kind: "gauge",
60763
61576
  unit: "%",
60764
61577
  minIntervalMs: 0
@@ -60947,7 +61760,17 @@ var groupCommandsCapability = {
60947
61760
  scope: "device",
60948
61761
  deviceNative: true,
60949
61762
  mode: "singleton",
60950
- deviceTypes: [DeviceType.Switch, DeviceType.Light],
61763
+ deviceTypes: [
61764
+ DeviceType.Switch,
61765
+ DeviceType.Light,
61766
+ DeviceType.Fan,
61767
+ DeviceType.Cover,
61768
+ DeviceType.Valve,
61769
+ DeviceType.Lock,
61770
+ DeviceType.MediaPlayer,
61771
+ DeviceType.Thermostat,
61772
+ DeviceType.Climate
61773
+ ],
60951
61774
  methods: {},
60952
61775
  status: {
60953
61776
  schema: GroupCommandsSchema,
@@ -60965,6 +61788,49 @@ var groupCommandsCapability = {
60965
61788
  history: "none"
60966
61789
  };
60967
61790
  /**
61791
+ * Whether a helper actuator group counts as active (D944): at least one
61792
+ * included member is, or every included member is. What "active" means is the
61793
+ * type's: a cover is open, a lock is locked, a media player is playing, a
61794
+ * climate device is not off. A group of lights, switches and fans reports
61795
+ * `switch.on` instead; this cap is for the types whose own state is not a
61796
+ * yes/no. Unknown members are left out (`group-status` counts them) and an
61797
+ * empty included set takes the device offline, never `active: false`.
61798
+ */
61799
+ var GroupActiveSchema = object({
61800
+ active: boolean().meta({ label: "Active" }),
61801
+ /** Ms epoch when the slice was last updated. */
61802
+ lastChangedAt: number()
61803
+ });
61804
+ var groupActiveCapability = {
61805
+ name: "group-active",
61806
+ scope: "device",
61807
+ deviceNative: true,
61808
+ mode: "singleton",
61809
+ deviceTypes: [
61810
+ DeviceType.Cover,
61811
+ DeviceType.Valve,
61812
+ DeviceType.Lock,
61813
+ DeviceType.MediaPlayer,
61814
+ DeviceType.Climate,
61815
+ DeviceType.Thermostat
61816
+ ],
61817
+ methods: {},
61818
+ status: {
61819
+ schema: GroupActiveSchema,
61820
+ kind: "push"
61821
+ },
61822
+ runtimeState: GroupActiveSchema,
61823
+ /**
61824
+ * Runtime-state durability: **session** — recomputed from the members on the
61825
+ * next source event; a restored value would outlive the members it named.
61826
+ *
61827
+ * See `RuntimeStateDurability`. Enforced by
61828
+ * `scripts/check-runtime-state-durability.ts`.
61829
+ */
61830
+ durability: "session",
61831
+ history: "none"
61832
+ };
61833
+ /**
60968
61834
  * How many members of a helper group answered (D944). Counts are integers,
60969
61835
  * not measurements: zero included is a real count, never a stand-in reading.
60970
61836
  * The reading itself stays on the output capability. History is none — the
@@ -60995,7 +61861,14 @@ var groupStatusCapability = {
60995
61861
  deviceTypes: [
60996
61862
  DeviceType.Sensor,
60997
61863
  DeviceType.Switch,
60998
- DeviceType.Light
61864
+ DeviceType.Light,
61865
+ DeviceType.Fan,
61866
+ DeviceType.Cover,
61867
+ DeviceType.Valve,
61868
+ DeviceType.Lock,
61869
+ DeviceType.MediaPlayer,
61870
+ DeviceType.Thermostat,
61871
+ DeviceType.Climate
60999
61872
  ],
61000
61873
  methods: {},
61001
61874
  status: {
@@ -61143,7 +62016,7 @@ var humidifierCapability = {
61143
62016
  */
61144
62017
  var HumiditySensorStatusSchema = object({
61145
62018
  /** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
61146
- percent: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
62019
+ humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
61147
62020
  precision: 0,
61148
62021
  label: "Humidity"
61149
62022
  })),
@@ -61172,7 +62045,7 @@ var humiditySensorCapability = {
61172
62045
  /**
61173
62046
  * History (D850): recorded series.
61174
62047
  */
61175
- history: { fields: { percent: {
62048
+ history: { fields: { humidity: {
61176
62049
  kind: "gauge",
61177
62050
  unit: "%",
61178
62051
  deadband: .5
@@ -61812,7 +62685,7 @@ var LawnMowerControlStatusSchema = object({
61812
62685
  batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61813
62686
  /** 0..100 mowing-completion percentage of the current task, or null when no
61814
62687
  * task is active / progress is unavailable. */
61815
- progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
62688
+ progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61816
62689
  /** Current device/event code (dynamic — mostly status, sometimes an error),
61817
62690
  * or null when unknown. */
61818
62691
  currentCode: number().nullable().meta(readingMeta("none")),
@@ -62268,7 +63141,14 @@ var lockControlCapability = {
62268
63141
  }),
62269
63142
  unlock: method(object({
62270
63143
  deviceId: number().int().nonnegative(),
62271
- code: string().min(1).optional()
63144
+ code: string().min(1).optional(),
63145
+ /**
63146
+ * Honoured by a helper lock GROUP only (D944): unlocking several doors
63147
+ * with one call is refused unless the caller says it was confirmed. A
63148
+ * single lock ignores it. The refusal lives in the callee, so no
63149
+ * automation or API caller reaches the doors by skipping a dialog.
63150
+ */
63151
+ confirm: boolean().optional()
62272
63152
  }), _void(), {
62273
63153
  kind: "mutation",
62274
63154
  auth: "protected"
@@ -62305,6 +63185,44 @@ var lockControlCapability = {
62305
63185
  volatileStateFields: ["lastChangedAt"]
62306
63186
  };
62307
63187
  /**
63188
+ * A monotonic total between resets (D944). Energy uses `power-meter.energy`
63189
+ * so dashboards keep one series; every other instantaneous reading lands here.
63190
+ * `value` is the time integral in the source quantity's accumulated base
63191
+ * (base-unit seconds, or kWh on the power meter). `null` is a gap, never zero.
63192
+ */
63193
+ var MeterStatusSchema = object({
63194
+ value: number().nullable().meta(readingMeta("device", { label: "Total" })),
63195
+ lastFetchedAt: number()
63196
+ });
63197
+ var meterCapability = {
63198
+ name: "meter",
63199
+ scope: "device",
63200
+ deviceNative: true,
63201
+ mode: "singleton",
63202
+ deviceTypes: [DeviceType.Sensor],
63203
+ methods: {},
63204
+ status: {
63205
+ schema: MeterStatusSchema,
63206
+ kind: "push"
63207
+ },
63208
+ runtimeState: MeterStatusSchema,
63209
+ /**
63210
+ * Runtime-state durability: **restored** — the total is a cache of the
63211
+ * history integral. A restart shows it only until the history pass
63212
+ * recomputes the open period; it is not an in-memory buffer.
63213
+ *
63214
+ * See `RuntimeStateDurability`. Enforced by
63215
+ * `scripts/check-runtime-state-durability.ts`.
63216
+ */
63217
+ durability: "restored",
63218
+ history: { fields: { value: {
63219
+ kind: "counter",
63220
+ deadband: .001,
63221
+ minIntervalMs: 6e4
63222
+ } } },
63223
+ volatileStateFields: ["lastFetchedAt"]
63224
+ };
63225
+ /**
62308
63226
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
62309
63227
  * Apple TV, Spotify, Roku, generic OTT receivers, …) on
62310
63228
  * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
@@ -62361,10 +63279,10 @@ var MediaPlayerStatusSchema = object({
62361
63279
  currentMedia: MediaInfoSchema.nullable(),
62362
63280
  /** Current playback position in ms. Null when not seekable or
62363
63281
  * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
62364
- positionMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
63282
+ position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
62365
63283
  /** Total duration of the current media in ms. Null when unknown
62366
63284
  * (live stream) or nothing is playing. */
62367
- durationMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
63285
+ duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
62368
63286
  /** Shuffle toggle. Null when no shuffle surface.
62369
63287
  * Pair with `DeviceFeature.MediaPlayerShuffle`. */
62370
63288
  shuffle: boolean().nullable(),
@@ -62403,7 +63321,7 @@ var mediaPlayerCapability = {
62403
63321
  }),
62404
63322
  seek: method(object({
62405
63323
  deviceId: number().int().nonnegative(),
62406
- positionMs: number().int().nonnegative()
63324
+ position: number().int().nonnegative()
62407
63325
  }), _void(), {
62408
63326
  kind: "mutation",
62409
63327
  auth: "protected"
@@ -62475,7 +63393,7 @@ var mediaPlayerCapability = {
62475
63393
  /**
62476
63394
  * History (D850): volume (a level an operator or an automation sets; the
62477
63395
  * default 10 s floor folds a slider drag into its end value) and mute.
62478
- * `positionMs` is not recorded: it moves continuously while playing.
63396
+ * `position` is not recorded: it moves continuously while playing.
62479
63397
  */
62480
63398
  history: { fields: {
62481
63399
  volumeLevel: {
@@ -63437,9 +64355,9 @@ var NetworkLinkStatusSchema = object({
63437
64355
  * one whose reading has not landed must not be drawn at 0 %. Consumers
63438
64356
  * SKIP a null rather than coerce it.
63439
64357
  */
63440
- signalPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64358
+ signal: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
63441
64359
  /** Raw received signal strength in dBm, when the firmware reports one. */
63442
- rssiDbm: number().optional().meta(readingMeta("signal-level")),
64360
+ rssi: number().optional().meta(readingMeta("signal-level")),
63443
64361
  /** Network name of a wireless link, when the firmware reports it. */
63444
64362
  ssid: string().optional(),
63445
64363
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
@@ -63475,7 +64393,7 @@ onStatusChanged: { data: object({
63475
64393
  kind: "push",
63476
64394
  empty: {
63477
64395
  type: "unknown",
63478
- signalPercent: null,
64396
+ signal: null,
63479
64397
  lastUpdated: 0
63480
64398
  }
63481
64399
  },
@@ -63498,13 +64416,13 @@ onStatusChanged: { data: object({
63498
64416
  * History (D850): recorded series.
63499
64417
  */
63500
64418
  history: { fields: {
63501
- signalPercent: {
64419
+ signal: {
63502
64420
  kind: "gauge",
63503
64421
  unit: "%",
63504
64422
  deadband: 3,
63505
64423
  minIntervalMs: 6e4
63506
64424
  },
63507
- rssiDbm: {
64425
+ rssi: {
63508
64426
  kind: "gauge",
63509
64427
  unit: "dBm",
63510
64428
  deadband: 2,
@@ -64295,10 +65213,20 @@ var PetFeederDeviceStatusSchema = _enum([
64295
65213
  ]);
64296
65214
  var gramsPortion = number().int().min(4).max(200);
64297
65215
  var PetFeederStatusSchema = object({
64298
- /** Food currently in the bowl (grams). Null when the device has not
64299
- * reported a reading yet. On dual-hopper models this is the combined
64300
- * bowl reading; per-hopper levels live in `food1`/`food2`. */
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. */
64301
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(),
64302
65230
  /** Hopper-1 food level (grams) on dual-hopper feeders; null on
64303
65231
  * single-hopper models. */
64304
65232
  food1: number().nullable().meta(readingMeta("none")),
@@ -64306,8 +65234,8 @@ var PetFeederStatusSchema = object({
64306
65234
  * single-hopper models. */
64307
65235
  food2: number().nullable().meta(readingMeta("none")),
64308
65236
  /** Derived low-food flag — mirrors the HA `food_level` binary_sensor
64309
- * (`device_class: problem`, on = low). True when the bowl is empty /
64310
- * below the feeder's low threshold. */
65237
+ * (`device_class: problem`, on = low). True when the tank reports empty,
65238
+ * or, on a dual-hopper model, when EITHER hopper is empty. */
64311
65239
  lowFood: boolean(),
64312
65240
  /** Battery charge 0..100 (%). Null on mains-powered models or when the
64313
65241
  * device has no battery reading. */
@@ -64375,7 +65303,9 @@ var petFeederCapability = {
64375
65303
  kind: "mutation",
64376
65304
  auth: "protected"
64377
65305
  }),
64378
- /** Mark a hopper as refilled (D4H/D4S/D4SH). */
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. */
64379
65309
  markFoodReplenished: method(object({ deviceId: number().int().nonnegative() }), _void(), {
64380
65310
  kind: "mutation",
64381
65311
  auth: "protected"
@@ -64448,6 +65378,7 @@ var petFeederCapability = {
64448
65378
  */
64449
65379
  history: { fields: {
64450
65380
  foodLevel: { kind: "gauge" },
65381
+ bowlFood: { kind: "gauge" },
64451
65382
  food1: { kind: "gauge" },
64452
65383
  food2: { kind: "gauge" },
64453
65384
  batteryPower: {
@@ -64857,27 +65788,89 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
64857
65788
  * in real-world devices.
64858
65789
  */
64859
65790
  var PowerMeterStatusSchema = object({
64860
- /** Instantaneous power draw in watts. */
64861
- watts: number().optional().meta(readingMeta("power", { label: "Power" })),
65791
+ /** Instantaneous power draw (watts). */
65792
+ power: number().optional().meta(readingMeta("power", { label: "Power" })),
64862
65793
  /** Cumulative energy in kilowatt-hours since the meter was reset. */
64863
- kwhTotal: number().optional().meta(readingMeta("energy", { label: "Energy" })),
64864
- /** Voltage in volts. */
64865
- volts: number().optional().meta(readingMeta("voltage")),
65794
+ energy: number().optional().meta(readingMeta("energy", { label: "Energy" })),
65795
+ /** Voltage (volts). */
65796
+ voltage: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
64866
65797
  /** Current in amperes. */
64867
- amps: number().optional().meta(readingMeta("current")),
65798
+ current: number().optional().meta(readingMeta("current", { label: "Current" })),
64868
65799
  /** Apparent power in volt-amperes. */
64869
- va: number().optional().meta(readingMeta("apparent-power")),
65800
+ apparentPower: number().optional().meta(readingMeta("apparent-power")),
64870
65801
  /** Power factor (0..1) if reported. */
64871
65802
  powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
64872
65803
  /** Ms epoch when the slice was last updated. */
64873
65804
  lastFetchedAt: number()
64874
65805
  });
65806
+ /**
65807
+ * Loads that draw metered mains power (D951). The reading is a feature of the
65808
+ * device itself — a plug, a lamp, a fan, an air conditioner, a boiler, a
65809
+ * vacuum dock — not a separate sensor beside it. A `Sensor` stays: a clamp
65810
+ * meter or a standalone energy monitor IS the device. Cover, lock, valve,
65811
+ * camera and the like are left out: their draw is not what anyone meters.
65812
+ */
65813
+ var POWER_METER_DEVICE_TYPES = [
65814
+ DeviceType.Sensor,
65815
+ DeviceType.Switch,
65816
+ DeviceType.Light,
65817
+ DeviceType.Fan,
65818
+ DeviceType.Climate,
65819
+ DeviceType.Thermostat,
65820
+ DeviceType.Humidifier,
65821
+ DeviceType.WaterHeater,
65822
+ DeviceType.MediaPlayer,
65823
+ DeviceType.Washer,
65824
+ DeviceType.Dryer,
65825
+ DeviceType.Dishwasher,
65826
+ DeviceType.Vacuum,
65827
+ DeviceType.LawnMower,
65828
+ DeviceType.PetFeeder
65829
+ ];
65830
+ /** Everything but a bare `Sensor`: a sensor that takes its reading from another sensor adds nothing. */
65831
+ var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== DeviceType.Sensor);
65832
+ /** One scalar target per reading; each is sourced from a device of its own (D951). */
65833
+ function powerTarget(id, unit) {
65834
+ return {
65835
+ id,
65836
+ cardinality: "scalar",
65837
+ vocabulary: {
65838
+ cap: "power-meter",
65839
+ stateField: id
65840
+ },
65841
+ deviceTypes: POWER_METER_CUSTOMIZE_DEVICE_TYPES,
65842
+ apply: "add",
65843
+ path: id,
65844
+ sources: [{
65845
+ kind: "numeric",
65846
+ requiredUnit: unit,
65847
+ transforms: [{ kind: "identity" }]
65848
+ }],
65849
+ companions: [{
65850
+ kind: "clock",
65851
+ path: "lastFetchedAt",
65852
+ when: "always"
65853
+ }],
65854
+ sourceReport: { status: "assignment-status" },
65855
+ advancedExpression: true
65856
+ };
65857
+ }
65858
+ /** "Power and energy" extension: power, energy, voltage and current from other devices (D951). */
65859
+ var powerMeterCustomize = {
65860
+ version: 1,
65861
+ targets: [
65862
+ powerTarget("power", "W"),
65863
+ powerTarget("energy", "kWh"),
65864
+ powerTarget("voltage", "V"),
65865
+ powerTarget("current", "A")
65866
+ ]
65867
+ };
64875
65868
  var powerMeterCapability = {
64876
65869
  name: "power-meter",
64877
65870
  scope: "device",
64878
65871
  deviceNative: true,
64879
65872
  mode: "singleton",
64880
- deviceTypes: [DeviceType.Sensor],
65873
+ deviceTypes: POWER_METER_DEVICE_TYPES,
64881
65874
  methods: {},
64882
65875
  status: {
64883
65876
  schema: PowerMeterStatusSchema,
@@ -64885,41 +65878,41 @@ var powerMeterCapability = {
64885
65878
  },
64886
65879
  runtimeState: PowerMeterStatusSchema,
64887
65880
  /**
64888
- * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
65881
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `energy` is an accumulator whose restored value is the baseline.
64889
65882
  *
64890
65883
  * See `RuntimeStateDurability`. Enforced by
64891
65884
  * `scripts/check-runtime-state-durability.ts`.
64892
65885
  */
64893
65886
  durability: "restored",
64894
65887
  /**
64895
- * History (D850): recorded series. Gauges are floored at 30 s; `kwhTotal` is the one monotonic meter (counter).
65888
+ * History (D850): recorded series. Gauges are floored at 30 s; `energy` is the one monotonic meter (counter).
64896
65889
  */
64897
65890
  history: { fields: {
64898
- watts: {
65891
+ power: {
64899
65892
  kind: "gauge",
64900
65893
  unit: "W",
64901
65894
  deadband: 1,
64902
65895
  minIntervalMs: 3e4
64903
65896
  },
64904
- kwhTotal: {
65897
+ energy: {
64905
65898
  kind: "counter",
64906
65899
  unit: "kWh",
64907
65900
  deadband: .01,
64908
65901
  minIntervalMs: 6e4
64909
65902
  },
64910
- volts: {
65903
+ voltage: {
64911
65904
  kind: "gauge",
64912
65905
  unit: "V",
64913
65906
  deadband: 1,
64914
65907
  minIntervalMs: 3e4
64915
65908
  },
64916
- amps: {
65909
+ current: {
64917
65910
  kind: "gauge",
64918
65911
  unit: "A",
64919
65912
  deadband: .05,
64920
65913
  minIntervalMs: 3e4
64921
65914
  },
64922
- va: {
65915
+ apparentPower: {
64923
65916
  kind: "gauge",
64924
65917
  unit: "VA",
64925
65918
  deadband: 1,
@@ -64934,7 +65927,8 @@ var powerMeterCapability = {
64934
65927
  } },
64935
65928
  /** Clock fields: written, but excluded from the compare that decides
64936
65929
  * whether persisting is worth a SQLite commit. */
64937
- volatileStateFields: ["lastFetchedAt"]
65930
+ volatileStateFields: ["lastFetchedAt"],
65931
+ customize: powerMeterCustomize
64938
65932
  };
64939
65933
  /**
64940
65934
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -64968,9 +65962,6 @@ var PresenceStatusSchema = object({
64968
65962
  location: string().nullable(),
64969
65963
  /** GPS coordinates when available. Null otherwise. */
64970
65964
  gps: GpsLocationSchema.nullable(),
64971
- /** Optional battery level of the tracking device (0..100). Null
64972
- * when not reported. */
64973
- batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64974
65965
  /** Ms epoch when the slice was last updated. */
64975
65966
  lastChangedAt: number()
64976
65967
  });
@@ -64999,14 +65990,7 @@ var presenceCapability = {
64999
65990
  * `scripts/check-runtime-state-durability.ts`.
65000
65991
  */
65001
65992
  durability: "restored",
65002
- /**
65003
- * History (D850): recorded series.
65004
- */
65005
- history: { fields: { batteryPercent: {
65006
- kind: "gauge",
65007
- unit: "%",
65008
- deadband: 1
65009
- } } },
65993
+ history: "none",
65010
65994
  /** Clock fields: written, but excluded from the compare that decides
65011
65995
  * whether persisting is worth a SQLite commit. */
65012
65996
  volatileStateFields: ["lastChangedAt"]
@@ -65021,7 +66005,7 @@ var presenceCapability = {
65021
66005
  */
65022
66006
  var PressureSensorStatusSchema = object({
65023
66007
  /** Current pressure in hPa. `null` when the sample was refused (D393). */
65024
- hpa: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
66008
+ pressure: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
65025
66009
  /** Ms epoch when the slice was last updated. */
65026
66010
  lastFetchedAt: number()
65027
66011
  });
@@ -65047,7 +66031,7 @@ var pressureSensorCapability = {
65047
66031
  /**
65048
66032
  * History (D850): recorded series.
65049
66033
  */
65050
- history: { fields: { hpa: {
66034
+ history: { fields: { pressure: {
65051
66035
  kind: "gauge",
65052
66036
  unit: "hPa",
65053
66037
  deadband: .1
@@ -65727,6 +66711,8 @@ var runningCustomize = {
65727
66711
  stateField: "running"
65728
66712
  },
65729
66713
  deviceTypes: [
66714
+ DeviceType.Washer,
66715
+ DeviceType.Dryer,
65730
66716
  DeviceType.Dishwasher,
65731
66717
  DeviceType.Vacuum,
65732
66718
  DeviceType.LawnMower,
@@ -68619,7 +69605,8 @@ var switchCapability = {
68619
69605
  deviceTypes: [
68620
69606
  DeviceType.Switch,
68621
69607
  DeviceType.Siren,
68622
- DeviceType.Light
69608
+ DeviceType.Light,
69609
+ DeviceType.Fan
68623
69610
  ],
68624
69611
  methods: { setState: method(object({
68625
69612
  deviceId: number(),
@@ -69258,7 +70245,7 @@ var tamperCapability = {
69258
70245
  */
69259
70246
  var TemperatureSensorStatusSchema = object({
69260
70247
  /** Current temperature in Celsius. `null` when the sample was refused (D393). */
69261
- celsius: number().nullable().meta(readingMeta("temperature", {
70248
+ temperature: number().nullable().meta(readingMeta("temperature", {
69262
70249
  precision: 1,
69263
70250
  label: "Temperature"
69264
70251
  })),
@@ -69287,7 +70274,7 @@ var temperatureSensorCapability = {
69287
70274
  /**
69288
70275
  * History (D850): recorded series.
69289
70276
  */
69290
- history: { fields: { celsius: {
70277
+ history: { fields: { temperature: {
69291
70278
  kind: "gauge",
69292
70279
  unit: "°C",
69293
70280
  deadband: .1
@@ -69584,7 +70571,7 @@ var VacuumControlStatusSchema = object({
69584
70571
  /** Speed tokens the hardware accepts — drives the UI selector. */
69585
70572
  availableFanSpeeds: array(string()),
69586
70573
  /** 0..100 cleaning-completion percentage of the current task, or null. */
69587
- progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
70574
+ progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
69588
70575
  /** Current error code (0 / null = no error). */
69589
70576
  errorCode: number().nullable().meta(readingMeta("none")),
69590
70577
  /** Human label for {@link errorCode}, or null when none / undecodable. */
@@ -70965,8 +71952,9 @@ function withClipEventLabels(provider, deps) {
70965
71952
  listClips
70966
71953
  };
70967
71954
  }
71955
+ DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
70968
71956
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
70969
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Camera, DeviceType.Camera, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
71957
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
70970
71958
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
70971
71959
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
70972
71960
  new Set(CAP_NAMES);
@@ -71310,6 +72298,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
71310
72298
  featureProbe: featureProbeCapability,
71311
72299
  flood: floodCapability,
71312
72300
  gas: gasCapability,
72301
+ groupActive: groupActiveCapability,
71313
72302
  groupCommands: groupCommandsCapability,
71314
72303
  groupStatus: groupStatusCapability,
71315
72304
  heatingValve: heatingValveCapability,
@@ -71321,6 +72310,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
71321
72310
  lawnMowerControl: lawnMowerControlCapability,
71322
72311
  lockControl: lockControlCapability,
71323
72312
  mediaPlayer: mediaPlayerCapability,
72313
+ meter: meterCapability,
71324
72314
  motion: motionCapability,
71325
72315
  motionTrigger: motionTriggerCapability,
71326
72316
  motionZones: motionZonesCapability,
@@ -71383,7 +72373,7 @@ var BaseDevice = class {
71383
72373
  * `device-local-state.ts`. Drivers access via:
71384
72374
  *
71385
72375
  * `this.state.battery.sleeping = true` // patches the battery slice
71386
- * `const pct = this.state.battery.percentage` // reads the battery slice
72376
+ * `const pct = this.state.battery.level` // reads the battery slice
71387
72377
  * `this.state.deviceStatus.online = true` // mirrors `markOnline(true)`
71388
72378
  *
71389
72379
  * Adding a new cap with `runtimeState:` automatically extends this
@@ -71423,7 +72413,7 @@ var BaseDevice = class {
71423
72413
  * shape; drivers don't redeclare it, they just write through.
71424
72414
  *
71425
72415
  * Read: `this.runtimeState.getCapState('battery')` →
71426
- * `{percentage, charging, sleeping, lastUpdated}` for any
72416
+ * `{level, charging, sleeping, lastUpdated}` for any
71427
72417
  * provider that registers `batteryCapability`.
71428
72418
  * Write: `this.runtimeState.setCapState('battery', { … })`.
71429
72419
  *
@@ -72584,7 +73574,7 @@ var BaseDeviceProvider = class extends BaseAddon {
72584
73574
  function widenDeviceConstructor(ctor) {
72585
73575
  return ctor;
72586
73576
  }
72587
- DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher;
73577
+ DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
72588
73578
  new Set(Object.values(DeviceType));
72589
73579
  Object.freeze({
72590
73580
  "accessories.getStatus": {
@@ -72601,6 +73591,104 @@ Object.freeze({
72601
73591
  access: "create",
72602
73592
  role: "admin"
72603
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
+ },
72604
73692
  "addonPages.listPages": {
72605
73693
  capName: "addon-pages",
72606
73694
  capScope: "system",
@@ -73882,6 +74970,13 @@ Object.freeze({
73882
74970
  access: "view",
73883
74971
  role: "admin"
73884
74972
  },
74973
+ "coreBlocks.getAutomationRunState": {
74974
+ capName: "core-blocks",
74975
+ capScope: "system",
74976
+ addonId: null,
74977
+ access: "view",
74978
+ role: "admin"
74979
+ },
73885
74980
  "coreBlocks.getBlockSettings": {
73886
74981
  capName: "core-blocks",
73887
74982
  capScope: "system",
@@ -73903,6 +74998,13 @@ Object.freeze({
73903
74998
  access: "view",
73904
74999
  role: "admin"
73905
75000
  },
75001
+ "coreBlocks.getTraces": {
75002
+ capName: "core-blocks",
75003
+ capScope: "system",
75004
+ addonId: null,
75005
+ access: "view",
75006
+ role: "admin"
75007
+ },
73906
75008
  "coreBlocks.getTypeDefs": {
73907
75009
  capName: "core-blocks",
73908
75010
  capScope: "system",
@@ -73938,6 +75040,13 @@ Object.freeze({
73938
75040
  access: "create",
73939
75041
  role: "admin"
73940
75042
  },
75043
+ "coreBlocks.reportAutomationRun": {
75044
+ capName: "core-blocks",
75045
+ capScope: "system",
75046
+ addonId: null,
75047
+ access: "create",
75048
+ role: "admin"
75049
+ },
73941
75050
  "coreBlocks.restart": {
73942
75051
  capName: "core-blocks",
73943
75052
  capScope: "system",
@@ -75807,6 +76916,13 @@ Object.freeze({
75807
76916
  access: "view",
75808
76917
  role: "viewer"
75809
76918
  },
76919
+ "groupActive.getStatus": {
76920
+ capName: "group-active",
76921
+ capScope: "device",
76922
+ addonId: null,
76923
+ access: "view",
76924
+ role: "viewer"
76925
+ },
75810
76926
  "groupCommands.getStatus": {
75811
76927
  capName: "group-commands",
75812
76928
  capScope: "device",
@@ -76773,6 +77889,13 @@ Object.freeze({
76773
77889
  access: "create",
76774
77890
  role: "admin"
76775
77891
  },
77892
+ "meter.getStatus": {
77893
+ capName: "meter",
77894
+ capScope: "device",
77895
+ addonId: null,
77896
+ access: "view",
77897
+ role: "viewer"
77898
+ },
76776
77899
  "metricsProvider.collectSnapshot": {
76777
77900
  capName: "metrics-provider",
76778
77901
  capScope: "system",
@@ -82497,7 +83620,7 @@ var ACTUATOR_CAP_VOCABULARY = {
82497
83620
  label: t("Full brightness", "Luminosità massima"),
82498
83621
  phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
82499
83622
  icon: "sun",
82500
- args: { percentage: 100 }
83623
+ args: { level: 100 }
82501
83624
  },
82502
83625
  {
82503
83626
  id: "brightness.half",
@@ -82505,7 +83628,7 @@ var ACTUATOR_CAP_VOCABULARY = {
82505
83628
  label: t("Half brightness", "Luminosità a metà"),
82506
83629
  phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
82507
83630
  icon: "sun-dim",
82508
- args: { percentage: 50 }
83631
+ args: { level: 50 }
82509
83632
  },
82510
83633
  {
82511
83634
  id: "brightness.off",
@@ -82513,16 +83636,16 @@ var ACTUATOR_CAP_VOCABULARY = {
82513
83636
  label: t("Brightness off", "Luminosità a zero"),
82514
83637
  phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
82515
83638
  icon: "lightbulb-off",
82516
- args: { percentage: 0 }
83639
+ args: { level: 0 }
82517
83640
  },
82518
83641
  {
82519
83642
  id: "brightness.set",
82520
83643
  method: "setBrightness",
82521
83644
  label: t("Set brightness", "Imposta la luminosità"),
82522
- phrase: t("Set the brightness of {device} to {percentage}", "Imposta la luminosità di {device} a {percentage}"),
83645
+ phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
82523
83646
  icon: "sun-medium",
82524
83647
  openArgs: [{
82525
- key: "percentage",
83648
+ key: "level",
82526
83649
  label: PERCENT,
82527
83650
  offer: {
82528
83651
  kind: "number",
@@ -82536,13 +83659,13 @@ var ACTUATOR_CAP_VOCABULARY = {
82536
83659
  ],
82537
83660
  state: [{
82538
83661
  kind: "numeric",
82539
- field: "percentage",
83662
+ field: "level",
82540
83663
  quantity: t("the brightness", "la luminosità"),
82541
83664
  label: t("Brightness", "Luminosità"),
82542
83665
  unit: "%",
82543
83666
  icon: "sun"
82544
83667
  }],
82545
- events: { onBrightnessChanged: { notOperatorFacing: "the `percentage` state trigger reads the same change" } }
83668
+ events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
82546
83669
  },
82547
83670
  color: {
82548
83671
  scope: "device",
@@ -82556,7 +83679,7 @@ var ACTUATOR_CAP_VOCABULARY = {
82556
83679
  icon: "sun",
82557
83680
  args: { color: {
82558
83681
  mode: "mired",
82559
- mireds: 370
83682
+ colorTemperature: 370
82560
83683
  } }
82561
83684
  },
82562
83685
  {
@@ -82567,7 +83690,7 @@ var ACTUATOR_CAP_VOCABULARY = {
82567
83690
  icon: "snowflake",
82568
83691
  args: { color: {
82569
83692
  mode: "mired",
82570
- mireds: 200
83693
+ colorTemperature: 200
82571
83694
  } }
82572
83695
  },
82573
83696
  {
@@ -83181,7 +84304,7 @@ var ACTUATOR_CAP_VOCABULARY = {
83181
84304
  label: t("Fan off", "Ventilatore spento"),
83182
84305
  phrase: t("Stop {device}", "Ferma {device}"),
83183
84306
  icon: "power-off",
83184
- args: { percentage: 0 }
84307
+ args: { speed: 0 }
83185
84308
  },
83186
84309
  {
83187
84310
  id: "fan.full",
@@ -83189,16 +84312,16 @@ var ACTUATOR_CAP_VOCABULARY = {
83189
84312
  label: t("Fan full", "Ventilatore al massimo"),
83190
84313
  phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
83191
84314
  icon: "fan",
83192
- args: { percentage: 100 }
84315
+ args: { speed: 100 }
83193
84316
  },
83194
84317
  {
83195
84318
  id: "fan.speed",
83196
84319
  method: "setPercentage",
83197
84320
  label: t("Set speed", "Imposta la velocità"),
83198
- phrase: t("Set the speed of {device} to {percentage}", "Imposta la velocità di {device} al {percentage}"),
84321
+ phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
83199
84322
  icon: "fan",
83200
84323
  openArgs: [{
83201
- key: "percentage",
84324
+ key: "speed",
83202
84325
  label: t("Speed", "Velocità"),
83203
84326
  offer: {
83204
84327
  kind: "number",
@@ -83260,7 +84383,7 @@ var ACTUATOR_CAP_VOCABULARY = {
83260
84383
  ],
83261
84384
  state: [{
83262
84385
  kind: "numeric",
83263
- field: "percentage",
84386
+ field: "speed",
83264
84387
  quantity: t("the speed", "la velocità"),
83265
84388
  label: t("Speed", "Velocità"),
83266
84389
  unit: "%",
@@ -84058,7 +85181,7 @@ var APPLIANCE_CAP_VOCABULARY = {
84058
85181
  },
84059
85182
  {
84060
85183
  kind: "numeric",
84061
- field: "progressPercent",
85184
+ field: "progress",
84062
85185
  quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
84063
85186
  label: t("Progress", "Avanzamento"),
84064
85187
  unit: "%",
@@ -84416,10 +85539,10 @@ var APPLIANCE_CAP_VOCABULARY = {
84416
85539
  id: "media.seek",
84417
85540
  method: "seek",
84418
85541
  label: t("Seek", "Vai al punto"),
84419
- phrase: t("Move {device} to {positionMs}", "Porta {device} al punto {positionMs}"),
85542
+ phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
84420
85543
  icon: "fast-forward",
84421
85544
  openArgs: [{
84422
- key: "positionMs",
85545
+ key: "position",
84423
85546
  label: t("Position", "Posizione"),
84424
85547
  offer: {
84425
85548
  kind: "number",
@@ -84871,7 +85994,39 @@ var APPLIANCE_CAP_VOCABULARY = {
84871
85994
  phrase: t("When {device} finishes", "Quando {device} finisce"),
84872
85995
  icon: "square"
84873
85996
  }
84874
- }
85997
+ },
85998
+ overrides: { byType: {
85999
+ [DeviceType.Washer]: {
86000
+ state: { running: {
86001
+ whenTrue: t("When the washing machine starts", "Quando la lavatrice inizia"),
86002
+ whenFalse: t("When the washing machine has finished", "Quando la lavatrice ha finito")
86003
+ } },
86004
+ events: {
86005
+ onStarted: { phrase: t("When the washing machine starts", "Quando la lavatrice inizia") },
86006
+ onFinished: { phrase: t("When the washing machine has finished", "Quando la lavatrice ha finito") }
86007
+ }
86008
+ },
86009
+ [DeviceType.Dryer]: {
86010
+ state: { running: {
86011
+ whenTrue: t("When the dryer starts", "Quando l'asciugatrice inizia"),
86012
+ whenFalse: t("When the dryer has finished", "Quando l'asciugatrice ha finito")
86013
+ } },
86014
+ events: {
86015
+ onStarted: { phrase: t("When the dryer starts", "Quando l'asciugatrice inizia") },
86016
+ onFinished: { phrase: t("When the dryer has finished", "Quando l'asciugatrice ha finito") }
86017
+ }
86018
+ },
86019
+ [DeviceType.Dishwasher]: {
86020
+ state: { running: {
86021
+ whenTrue: t("When the dishwasher starts", "Quando la lavastoviglie inizia"),
86022
+ whenFalse: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito")
86023
+ } },
86024
+ events: {
86025
+ onStarted: { phrase: t("When the dishwasher starts", "Quando la lavastoviglie inizia") },
86026
+ onFinished: { phrase: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito") }
86027
+ }
86028
+ }
86029
+ } }
84875
86030
  },
84876
86031
  update: {
84877
86032
  scope: "device",
@@ -85436,7 +86591,7 @@ var SENSOR_CAP_VOCABULARY = {
85436
86591
  state: [
85437
86592
  {
85438
86593
  kind: "numeric",
85439
- field: "co2Ppm",
86594
+ field: "co2",
85440
86595
  quantity: t("the CO₂", "la CO₂"),
85441
86596
  label: t("CO₂", "CO₂"),
85442
86597
  unit: "ppm",
@@ -85444,7 +86599,7 @@ var SENSOR_CAP_VOCABULARY = {
85444
86599
  },
85445
86600
  {
85446
86601
  kind: "numeric",
85447
- field: "vocPpb",
86602
+ field: "voc",
85448
86603
  quantity: t("the VOC level", "il livello di COV"),
85449
86604
  label: t("VOC", "COV"),
85450
86605
  unit: "ppb",
@@ -85480,7 +86635,7 @@ var SENSOR_CAP_VOCABULARY = {
85480
86635
  noun: t("Light level", "Luminosità ambiente"),
85481
86636
  state: [{
85482
86637
  kind: "numeric",
85483
- field: "lux",
86638
+ field: "illuminance",
85484
86639
  quantity: t("the light level", "la luminosità"),
85485
86640
  label: t("Illuminance", "Illuminamento"),
85486
86641
  unit: "lx",
@@ -85643,6 +86798,10 @@ var SENSOR_CAP_VOCABULARY = {
85643
86798
  icon: "flame"
85644
86799
  }]
85645
86800
  },
86801
+ "group-active": {
86802
+ scope: "device",
86803
+ noun: t("Group state", "Stato del gruppo")
86804
+ },
85646
86805
  "group-commands": {
85647
86806
  scope: "device",
85648
86807
  noun: t("Group command", "Comando di gruppo")
@@ -85679,7 +86838,7 @@ var SENSOR_CAP_VOCABULARY = {
85679
86838
  noun: t("Humidity", "Umidità"),
85680
86839
  state: [{
85681
86840
  kind: "numeric",
85682
- field: "percent",
86841
+ field: "humidity",
85683
86842
  quantity: t("the humidity", "l’umidità"),
85684
86843
  label: t("Humidity", "Umidità"),
85685
86844
  unit: "%",
@@ -85699,6 +86858,17 @@ var SENSOR_CAP_VOCABULARY = {
85699
86858
  }],
85700
86859
  events: { onMotionChanged: { notOperatorFacing: "the `detected` state trigger phrases both edges, from the mirror that survives a dropped event (D49)" } }
85701
86860
  },
86861
+ meter: {
86862
+ scope: "device",
86863
+ noun: t("Meter", "Contatore"),
86864
+ state: [{
86865
+ kind: "numeric",
86866
+ field: "value",
86867
+ quantity: t("the total", "il totale"),
86868
+ label: t("Total", "Totale"),
86869
+ icon: "gauge"
86870
+ }]
86871
+ },
85702
86872
  "numeric-sensor": {
85703
86873
  scope: "device",
85704
86874
  noun: t("Sensor", "Sensore"),
@@ -85716,7 +86886,7 @@ var SENSOR_CAP_VOCABULARY = {
85716
86886
  state: [
85717
86887
  {
85718
86888
  kind: "numeric",
85719
- field: "watts",
86889
+ field: "power",
85720
86890
  quantity: t("the power draw", "il consumo"),
85721
86891
  label: t("Power", "Potenza"),
85722
86892
  unit: "W",
@@ -85724,7 +86894,7 @@ var SENSOR_CAP_VOCABULARY = {
85724
86894
  },
85725
86895
  {
85726
86896
  kind: "numeric",
85727
- field: "kwhTotal",
86897
+ field: "energy",
85728
86898
  quantity: t("the energy used", "l’energia consumata"),
85729
86899
  label: t("Energy", "Energia"),
85730
86900
  unit: "kWh",
@@ -85732,7 +86902,7 @@ var SENSOR_CAP_VOCABULARY = {
85732
86902
  },
85733
86903
  {
85734
86904
  kind: "numeric",
85735
- field: "volts",
86905
+ field: "voltage",
85736
86906
  quantity: t("the voltage", "la tensione"),
85737
86907
  label: t("Voltage", "Tensione"),
85738
86908
  unit: "V",
@@ -85740,7 +86910,7 @@ var SENSOR_CAP_VOCABULARY = {
85740
86910
  },
85741
86911
  {
85742
86912
  kind: "numeric",
85743
- field: "amps",
86913
+ field: "current",
85744
86914
  quantity: t("the current", "la corrente"),
85745
86915
  label: t("Current", "Corrente"),
85746
86916
  unit: "A",
@@ -85757,13 +86927,6 @@ var SENSOR_CAP_VOCABULARY = {
85757
86927
  label: t("Where", "Posizione"),
85758
86928
  phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
85759
86929
  icon: "map-pin"
85760
- }, {
85761
- kind: "numeric",
85762
- field: "batteryPercent",
85763
- quantity: t("the phone battery", "la batteria del telefono"),
85764
- label: t("Battery", "Batteria"),
85765
- unit: "%",
85766
- icon: "battery"
85767
86930
  }]
85768
86931
  },
85769
86932
  "pressure-sensor": {
@@ -85771,7 +86934,7 @@ var SENSOR_CAP_VOCABULARY = {
85771
86934
  noun: t("Pressure", "Pressione"),
85772
86935
  state: [{
85773
86936
  kind: "numeric",
85774
- field: "hpa",
86937
+ field: "pressure",
85775
86938
  quantity: t("the pressure", "la pressione"),
85776
86939
  label: t("Pressure", "Pressione"),
85777
86940
  unit: "hPa",
@@ -85807,7 +86970,7 @@ var SENSOR_CAP_VOCABULARY = {
85807
86970
  noun: t("Temperature", "Temperatura"),
85808
86971
  state: [{
85809
86972
  kind: "numeric",
85810
- field: "celsius",
86973
+ field: "temperature",
85811
86974
  quantity: t("the temperature", "la temperatura"),
85812
86975
  label: t("Temperature", "Temperatura"),
85813
86976
  unit: "°C",
@@ -85878,7 +87041,7 @@ var SENSOR_CAP_VOCABULARY = {
85878
87041
  state: [
85879
87042
  {
85880
87043
  kind: "numeric",
85881
- field: "percentage",
87044
+ field: "level",
85882
87045
  quantity: t("the battery level", "il livello della batteria"),
85883
87046
  label: t("Battery", "Batteria"),
85884
87047
  unit: "%",
@@ -85920,7 +87083,7 @@ var SENSOR_CAP_VOCABULARY = {
85920
87083
  icon: "battery-charging"
85921
87084
  }
85922
87085
  ],
85923
- events: { onStatusChanged: { notOperatorFacing: "the percentage / sleeping / charging state triggers each read one field of this change" } },
87086
+ events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
85924
87087
  extraEvents: [{
85925
87088
  category: EventCategory.DeviceAwake,
85926
87089
  label: t("Woke up", "Risvegliato"),
@@ -85938,7 +87101,7 @@ var SENSOR_CAP_VOCABULARY = {
85938
87101
  noun: t("Network link", "Collegamento di rete"),
85939
87102
  state: [{
85940
87103
  kind: "numeric",
85941
- field: "signalPercent",
87104
+ field: "signal",
85942
87105
  quantity: t("the signal strength", "l’intensità del segnale"),
85943
87106
  label: t("Signal", "Segnale"),
85944
87107
  unit: "%",
@@ -86031,6 +87194,8 @@ var ML = "model and training machinery — no device action";
86031
87194
  var INTERNAL = "internal plumbing between addons — never operator-facing";
86032
87195
  /** Every system-scoped cap, with why it is not a device's vocabulary. */
86033
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"),
86034
87199
  "addon-pages": system(UI_PLUMBING),
86035
87200
  "addon-pages-source": system(UI_PLUMBING),
86036
87201
  "addon-routes": system(UI_PLUMBING),
@@ -86171,8 +87336,47 @@ function projectAction(cap, action) {
86171
87336
  };
86172
87337
  }
86173
87338
  Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
86174
- DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher;
87339
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
86175
87340
  DeviceFeature.BatteryOperated;
87341
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
87342
+ var HA_AS = "a power sensor (device_class power). Home Assistant has no laundry domain. running-state stays unexported until a null reading can be published as unavailable.";
87343
+ var HOMEKIT_REASON = "HomeKit has no laundry-appliance service. The export tab would pair an accessory with nothing on it: running-state is withheld until a null reading can be unavailable, and power is not a HomeKit service this export honours.";
87344
+ var ALEXA_REASON = "Alexa has no laundry category in this export, and neither power nor running has an Alexa interface.";
87345
+ var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A power threshold is not that trait, and this export does not publish RunCycle.";
87346
+ var MATTER_REASON = "No Matter export is built. The closest device types are Laundry Washer (0x0073) and Laundry Dryer (0x0074); a power threshold is not the Laundry Washer Mode cluster.";
87347
+ function withheld(reason) {
87348
+ return {
87349
+ [DeviceType.Washer]: {
87350
+ exported: false,
87351
+ reason
87352
+ },
87353
+ [DeviceType.Dryer]: {
87354
+ exported: false,
87355
+ reason
87356
+ },
87357
+ [DeviceType.Dishwasher]: {
87358
+ exported: false,
87359
+ reason
87360
+ }
87361
+ };
87362
+ }
87363
+ function offered(received) {
87364
+ return {
87365
+ [DeviceType.Washer]: {
87366
+ exported: true,
87367
+ as: received
87368
+ },
87369
+ [DeviceType.Dryer]: {
87370
+ exported: true,
87371
+ as: received
87372
+ },
87373
+ [DeviceType.Dishwasher]: {
87374
+ exported: true,
87375
+ as: received
87376
+ }
87377
+ };
87378
+ }
87379
+ offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
86176
87380
  /** Reject after `ms`; always clears its own timer. */
86177
87381
  async function withTimeout$1(promise, ms, label) {
86178
87382
  let timer;
@@ -86406,6 +87610,31 @@ Object.freeze({
86406
87610
  form: "single",
86407
87611
  optional: false
86408
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
+ }],
86409
87638
  "addonSettings.getDeviceSettings": [{
86410
87639
  name: "deviceId",
86411
87640
  form: "single",
@@ -87357,6 +88586,11 @@ Object.freeze({
87357
88586
  form: "single",
87358
88587
  optional: false
87359
88588
  }],
88589
+ "groupActive.getStatus": [{
88590
+ name: "deviceId",
88591
+ form: "single",
88592
+ optional: false
88593
+ }],
87360
88594
  "groupCommands.getStatus": [{
87361
88595
  name: "deviceId",
87362
88596
  form: "single",
@@ -87567,6 +88801,11 @@ Object.freeze({
87567
88801
  form: "single",
87568
88802
  optional: false
87569
88803
  }],
88804
+ "meter.getStatus": [{
88805
+ name: "deviceId",
88806
+ form: "single",
88807
+ optional: false
88808
+ }],
87570
88809
  "motion.getStatus": [{
87571
88810
  name: "deviceId",
87572
88811
  form: "single",
@@ -89174,7 +90413,6 @@ Object.freeze({
89174
90413
  "network-access": "ingress",
89175
90414
  "smtp-provider": "email"
89176
90415
  });
89177
- DeviceType.Camera;
89178
90416
  /**
89179
90417
  * A saved Customize assignment (D936). The schema is the type: callers use
89180
90418
  * `z.infer`, they do not restate the shape.
@@ -90529,6 +91767,7 @@ DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
90529
91767
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
90530
91768
  DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
90531
91769
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
91770
+ String.raw`(?<=^|["'(\s>,\[{])`;
90532
91771
  var MB = 1024 * 1024;
90533
91772
  1024 * MB, 3072 * MB;
90534
91773
  /**
@@ -95278,7 +96517,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
95278
96517
  }
95279
96518
  brightnessView() {
95280
96519
  return this.getCapSlice(brightnessCapability) ?? {
95281
- percentage: this.config.get("defaultBrightness") ?? 100,
96520
+ level: this.config.get("defaultBrightness") ?? 100,
95282
96521
  lastChangedAt: 0
95283
96522
  };
95284
96523
  }
@@ -95299,9 +96538,9 @@ var HikvisionLightAccessory = class extends BaseDevice {
95299
96538
  });
95300
96539
  if (typeof state.brightness === "number") {
95301
96540
  const previousBrightness = this.brightnessView();
95302
- const brightChangedAt = previousBrightness.percentage === state.brightness ? previousBrightness.lastChangedAt : ts;
96541
+ const brightChangedAt = previousBrightness.level === state.brightness ? previousBrightness.lastChangedAt : ts;
95303
96542
  this.setCapSlice(brightnessCapability, {
95304
- percentage: state.brightness,
96543
+ level: state.brightness,
95305
96544
  lastChangedAt: brightChangedAt
95306
96545
  });
95307
96546
  }
@@ -95322,7 +96561,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
95322
96561
  lastChangedAt: ts
95323
96562
  });
95324
96563
  if (on) this.setCapSlice(brightnessCapability, {
95325
- percentage: brightness,
96564
+ level: brightness,
95326
96565
  lastChangedAt: ts
95327
96566
  });
95328
96567
  }
@@ -95343,7 +96582,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
95343
96582
  getStatus: async () => this.switchView(),
95344
96583
  setState: async ({ deviceId, on }) => {
95345
96584
  if (deviceId !== this.id) return;
95346
- const brightness = this.brightnessView().percentage;
96585
+ const brightness = this.brightnessView().level;
95347
96586
  await this.applyOn(on, brightness);
95348
96587
  }
95349
96588
  });
@@ -95355,18 +96594,18 @@ var HikvisionLightAccessory = class extends BaseDevice {
95355
96594
  registerBrightnessCap() {
95356
96595
  this.ctx.registerNativeCap(brightnessCapability, {
95357
96596
  getStatus: async () => this.brightnessView(),
95358
- setBrightness: async ({ deviceId, percentage }) => {
96597
+ setBrightness: async ({ deviceId, level: percentage }) => {
95359
96598
  if (deviceId !== this.id) return;
95360
96599
  const value = Math.max(0, Math.min(100, percentage));
95361
96600
  if (this.switchView().on) await this.applyOn(true, value);
95362
96601
  else this.setCapSlice(brightnessCapability, {
95363
- percentage: value,
96602
+ level: value,
95364
96603
  lastChangedAt: Date.now()
95365
96604
  });
95366
96605
  }
95367
96606
  });
95368
96607
  this.setCapSlice(brightnessCapability, {
95369
- percentage: this.config.get("defaultBrightness") ?? 100,
96608
+ level: this.config.get("defaultBrightness") ?? 100,
95370
96609
  lastChangedAt: 0
95371
96610
  });
95372
96611
  }
@@ -95414,10 +96653,10 @@ var HikvisionLightAccessory = class extends BaseDevice {
95414
96653
  const typed = lightAccessorySchema.partial().parse(patch);
95415
96654
  await this.config.setAll(typed);
95416
96655
  if (typed.defaultBrightness !== void 0 && !this.switchView().on) this.setCapSlice(brightnessCapability, {
95417
- percentage: typed.defaultBrightness,
96656
+ level: typed.defaultBrightness,
95418
96657
  lastChangedAt: Date.now()
95419
96658
  });
95420
- if (typed.mode !== void 0 && this.switchView().on) await this.applyOn(true, this.brightnessView().percentage).catch((err) => {
96659
+ if (typed.mode !== void 0 && this.switchView().on) await this.applyOn(true, this.brightnessView().level).catch((err) => {
95421
96660
  this.ctx.logger.warn("hikvision light: live mode switch failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
95422
96661
  });
95423
96662
  }