@camstack/addon-export-google 0.1.113 → 0.1.115

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.
@@ -73,7 +73,7 @@ function createApiDeviceGateway(deps) {
73
73
  };
74
74
  }
75
75
  //#endregion
76
- //#region ../types/dist/event-category-DHXxB8t9.mjs
76
+ //#region ../types/dist/event-category-CT-hz5Rb.mjs
77
77
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
78
78
  EventCategory["SystemBoot"] = "system.boot";
79
79
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -399,6 +399,14 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
399
399
  /** The recovery edge of {@link PipelineMotionNoisy}: the motion fell back, or a detection arrived. */
400
400
  EventCategory["PipelineMotionCalm"] = "pipeline.motion-calm";
401
401
  /**
402
+ * A camera's package LLM confirm has failed closed three times in a row
403
+ * (D931, 2026-10-26). One edge per camera until
404
+ * {@link PipelinePackageLlmAnswered}.
405
+ */
406
+ EventCategory["PipelinePackageLlmSilent"] = "pipeline.package-llm-silent";
407
+ /** The recovery edge of {@link PipelinePackageLlmSilent}: a confirm returned yes or no. */
408
+ EventCategory["PipelinePackageLlmAnswered"] = "pipeline.package-llm-answered";
409
+ /**
402
410
  * Per-camera pipeline config was mutated by the orchestrator
403
411
  * (a settings change via `setAgentInferenceDevices` /
404
412
  * `setCameraStepToggle` / `setCameraStepSettings`). Orchestrator
@@ -5508,7 +5516,7 @@ var ZodIssueCode = {
5508
5516
  var ZodFirstPartyTypeKind;
5509
5517
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5510
5518
  //#endregion
5511
- //#region ../types/dist/sleep-BErAxhul.mjs
5519
+ //#region ../types/dist/sleep-bykKrTgu.mjs
5512
5520
  /**
5513
5521
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5514
5522
  * window to float samples (D455).
@@ -7995,6 +8003,99 @@ var RecordKindDeclarationSchema = object({
7995
8003
  }).strict();
7996
8004
  /** The kind names: lower-case, dash separated, short enough for an index name. */
7997
8005
  var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
8006
+ var READING_QUANTITIES = [
8007
+ "temperature",
8008
+ "pressure",
8009
+ "speed",
8010
+ "precipitation",
8011
+ "precipitation-rate",
8012
+ "length",
8013
+ "area",
8014
+ "illuminance",
8015
+ "irradiance",
8016
+ "power",
8017
+ "energy",
8018
+ "voltage",
8019
+ "current",
8020
+ "apparent-power",
8021
+ "humidity",
8022
+ "percentage",
8023
+ "concentration-volume",
8024
+ "concentration-mass",
8025
+ "concentration-ppb",
8026
+ "volume",
8027
+ "duration",
8028
+ "duration-ms",
8029
+ "information",
8030
+ "sound-level",
8031
+ "signal-level",
8032
+ "colour-temperature",
8033
+ "angle",
8034
+ "bitrate",
8035
+ "rate",
8036
+ "mass",
8037
+ "index",
8038
+ "ratio",
8039
+ "count",
8040
+ "none",
8041
+ "device"
8042
+ ];
8043
+ var ReadingQuantitySchema = _enum(READING_QUANTITIES);
8044
+ new Set(READING_QUANTITIES);
8045
+ /**
8046
+ * Stored unit symbol for a quantity. `none` means the number is dimensionless
8047
+ * (or an index / ratio / count). `device` means the cap has no single unit.
8048
+ */
8049
+ var QUANTITY_BASE = {
8050
+ temperature: "°C",
8051
+ pressure: "hPa",
8052
+ speed: "m/s",
8053
+ precipitation: "mm",
8054
+ "precipitation-rate": "mm/h",
8055
+ length: "m",
8056
+ area: "m²",
8057
+ illuminance: "lx",
8058
+ irradiance: "W/m²",
8059
+ power: "W",
8060
+ energy: "kWh",
8061
+ voltage: "V",
8062
+ current: "A",
8063
+ "apparent-power": "VA",
8064
+ humidity: "%",
8065
+ percentage: "%",
8066
+ "concentration-volume": "ppm",
8067
+ "concentration-mass": "µg/m³",
8068
+ "concentration-ppb": "ppb",
8069
+ volume: "L",
8070
+ duration: "s",
8071
+ "duration-ms": "ms",
8072
+ information: "B",
8073
+ "sound-level": "dBFS",
8074
+ "signal-level": "dBm",
8075
+ "colour-temperature": "mired",
8076
+ angle: "°",
8077
+ bitrate: "kbps",
8078
+ rate: "fps",
8079
+ mass: "kg",
8080
+ index: "none",
8081
+ ratio: "none",
8082
+ count: "none",
8083
+ none: "none",
8084
+ device: "device"
8085
+ };
8086
+ /** The stored unit, or `undefined` when the quantity has no unit symbol. */
8087
+ function baseUnitOf(quantity) {
8088
+ const symbol = QUANTITY_BASE[quantity];
8089
+ if (symbol === "none" || symbol === "device") return void 0;
8090
+ return symbol;
8091
+ }
8092
+ function readingMeta(quantity, extras) {
8093
+ return {
8094
+ quantity,
8095
+ ...extras?.precision !== void 0 ? { precision: extras.precision } : {},
8096
+ ...extras?.label !== void 0 ? { label: extras.label } : {}
8097
+ };
8098
+ }
7998
8099
  /** Shared Zod schemas used across streaming capabilities. */
7999
8100
  var CamProfileSchema = _enum([
8000
8101
  "high",
@@ -8022,8 +8123,8 @@ var CamStreamKindSchema = _enum([
8022
8123
  "derived"
8023
8124
  ]);
8024
8125
  var CamStreamResolutionSchema = object({
8025
- width: number().int().positive(),
8026
- height: number().int().positive()
8126
+ width: number().int().positive().meta(readingMeta("none")),
8127
+ height: number().int().positive().meta(readingMeta("none"))
8027
8128
  });
8028
8129
  var CameraStreamSchema = object({
8029
8130
  /** Stable, provider-assigned id unique within the (deviceId) scope. */
@@ -8559,6 +8660,8 @@ var CAP_NAMES = Object.freeze([
8559
8660
  "filesystem-browse",
8560
8661
  "flood",
8561
8662
  "gas",
8663
+ "group-commands",
8664
+ "group-status",
8562
8665
  "heating-valve",
8563
8666
  "humidifier",
8564
8667
  "humidity-sensor",
@@ -8688,14 +8791,6 @@ Object.freeze({
8688
8791
  {
8689
8792
  "path": "aqi",
8690
8793
  "valueType": "number"
8691
- },
8692
- {
8693
- "path": "unit",
8694
- "valueType": "string"
8695
- },
8696
- {
8697
- "path": "precision",
8698
- "valueType": "number"
8699
8794
  }
8700
8795
  ],
8701
8796
  "alarm-panel": [
@@ -8731,20 +8826,10 @@ Object.freeze({
8731
8826
  "valueType": "boolean"
8732
8827
  }
8733
8828
  ],
8734
- "ambient-light-sensor": [
8735
- {
8736
- "path": "lux",
8737
- "valueType": "number"
8738
- },
8739
- {
8740
- "path": "unit",
8741
- "valueType": "string"
8742
- },
8743
- {
8744
- "path": "precision",
8745
- "valueType": "number"
8746
- }
8747
- ],
8829
+ "ambient-light-sensor": [{
8830
+ "path": "lux",
8831
+ "valueType": "number"
8832
+ }],
8748
8833
  "audio-metrics": [
8749
8834
  {
8750
8835
  "path": "ts",
@@ -8824,6 +8909,10 @@ Object.freeze({
8824
8909
  "path": "lastUpdated",
8825
8910
  "valueType": "number"
8826
8911
  },
8912
+ {
8913
+ "path": "volts",
8914
+ "valueType": "number"
8915
+ },
8827
8916
  {
8828
8917
  "path": "lastContactAt",
8829
8918
  "valueType": "number"
@@ -9066,10 +9155,6 @@ Object.freeze({
9066
9155
  "datetime"
9067
9156
  ]
9068
9157
  },
9069
- {
9070
- "path": "unit",
9071
- "valueType": "string"
9072
- },
9073
9158
  {
9074
9159
  "path": "min",
9075
9160
  "valueType": "number"
@@ -9081,19 +9166,6 @@ Object.freeze({
9081
9166
  {
9082
9167
  "path": "step",
9083
9168
  "valueType": "number"
9084
- },
9085
- {
9086
- "path": "precision",
9087
- "valueType": "number"
9088
- },
9089
- {
9090
- "path": "format",
9091
- "valueType": "enum",
9092
- "enumValues": [
9093
- "date",
9094
- "time",
9095
- "datetime"
9096
- ]
9097
9169
  }
9098
9170
  ],
9099
9171
  "cover": [
@@ -9334,13 +9406,8 @@ Object.freeze({
9334
9406
  "path": "value",
9335
9407
  "valueType": "string"
9336
9408
  }, {
9337
- "path": "format",
9338
- "valueType": "enum",
9339
- "enumValues": [
9340
- "date",
9341
- "time",
9342
- "datetime"
9343
- ]
9409
+ "path": "timestamp",
9410
+ "valueType": "boolean"
9344
9411
  }],
9345
9412
  "event-emitter": [
9346
9413
  {
@@ -9413,6 +9480,20 @@ Object.freeze({
9413
9480
  "path": "detected",
9414
9481
  "valueType": "boolean"
9415
9482
  }],
9483
+ "group-status": [
9484
+ {
9485
+ "path": "included",
9486
+ "valueType": "number"
9487
+ },
9488
+ {
9489
+ "path": "excluded",
9490
+ "valueType": "number"
9491
+ },
9492
+ {
9493
+ "path": "total",
9494
+ "valueType": "number"
9495
+ }
9496
+ ],
9416
9497
  "heating-valve": [{
9417
9498
  "path": "position",
9418
9499
  "valueType": "number"
@@ -9447,20 +9528,10 @@ Object.freeze({
9447
9528
  "valueType": "number"
9448
9529
  }
9449
9530
  ],
9450
- "humidity-sensor": [
9451
- {
9452
- "path": "percent",
9453
- "valueType": "number"
9454
- },
9455
- {
9456
- "path": "unit",
9457
- "valueType": "string"
9458
- },
9459
- {
9460
- "path": "precision",
9461
- "valueType": "number"
9462
- }
9463
- ],
9531
+ "humidity-sensor": [{
9532
+ "path": "percent",
9533
+ "valueType": "number"
9534
+ }],
9464
9535
  "image": [{
9465
9536
  "path": "url",
9466
9537
  "valueType": "string"
@@ -9799,20 +9870,10 @@ Object.freeze({
9799
9870
  "valueType": "boolean"
9800
9871
  }
9801
9872
  ],
9802
- "numeric-sensor": [
9803
- {
9804
- "path": "value",
9805
- "valueType": "number"
9806
- },
9807
- {
9808
- "path": "unit",
9809
- "valueType": "string"
9810
- },
9811
- {
9812
- "path": "precision",
9813
- "valueType": "number"
9814
- }
9815
- ],
9873
+ "numeric-sensor": [{
9874
+ "path": "value",
9875
+ "valueType": "number"
9876
+ }],
9816
9877
  "pet-feeder": [
9817
9878
  {
9818
9879
  "path": "foodLevel",
@@ -9904,14 +9965,6 @@ Object.freeze({
9904
9965
  {
9905
9966
  "path": "powerFactor",
9906
9967
  "valueType": "number"
9907
- },
9908
- {
9909
- "path": "unit",
9910
- "valueType": "string"
9911
- },
9912
- {
9913
- "path": "precision",
9914
- "valueType": "number"
9915
9968
  }
9916
9969
  ],
9917
9970
  "presence": [
@@ -9940,20 +9993,10 @@ Object.freeze({
9940
9993
  "valueType": "number"
9941
9994
  }
9942
9995
  ],
9943
- "pressure-sensor": [
9944
- {
9945
- "path": "hpa",
9946
- "valueType": "number"
9947
- },
9948
- {
9949
- "path": "unit",
9950
- "valueType": "string"
9951
- },
9952
- {
9953
- "path": "precision",
9954
- "valueType": "number"
9955
- }
9956
- ],
9996
+ "pressure-sensor": [{
9997
+ "path": "hpa",
9998
+ "valueType": "number"
9999
+ }],
9957
10000
  "privacy-mask": [{
9958
10001
  "path": "enabled",
9959
10002
  "valueType": "boolean"
@@ -10264,20 +10307,10 @@ Object.freeze({
10264
10307
  "path": "tampered",
10265
10308
  "valueType": "boolean"
10266
10309
  }],
10267
- "temperature-sensor": [
10268
- {
10269
- "path": "celsius",
10270
- "valueType": "number"
10271
- },
10272
- {
10273
- "path": "unit",
10274
- "valueType": "string"
10275
- },
10276
- {
10277
- "path": "precision",
10278
- "valueType": "number"
10279
- }
10280
- ],
10310
+ "temperature-sensor": [{
10311
+ "path": "celsius",
10312
+ "valueType": "number"
10313
+ }],
10281
10314
  "update": [
10282
10315
  {
10283
10316
  "path": "currentVersion",
@@ -10388,10 +10421,6 @@ Object.freeze({
10388
10421
  "path": "temperature",
10389
10422
  "valueType": "number"
10390
10423
  },
10391
- {
10392
- "path": "temperatureUnit",
10393
- "valueType": "string"
10394
- },
10395
10424
  {
10396
10425
  "path": "humidity",
10397
10426
  "valueType": "number"
@@ -10400,18 +10429,10 @@ Object.freeze({
10400
10429
  "path": "pressure",
10401
10430
  "valueType": "number"
10402
10431
  },
10403
- {
10404
- "path": "pressureUnit",
10405
- "valueType": "string"
10406
- },
10407
10432
  {
10408
10433
  "path": "windSpeed",
10409
10434
  "valueType": "number"
10410
10435
  },
10411
- {
10412
- "path": "windSpeedUnit",
10413
- "valueType": "string"
10414
- },
10415
10436
  {
10416
10437
  "path": "windBearing",
10417
10438
  "valueType": "number"
@@ -10461,7 +10482,7 @@ object({
10461
10482
  params: record(string(), union([string(), number()])).optional()
10462
10483
  });
10463
10484
  //#endregion
10464
- //#region ../types/dist/err-msg-BXKzRBwg.mjs
10485
+ //#region ../types/dist/err-msg-DIorGYeC.mjs
10465
10486
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
10466
10487
  DeviceType["Camera"] = "camera";
10467
10488
  DeviceType["Hub"] = "hub";
@@ -10555,8 +10576,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
10555
10576
  DeviceType["PetFeeder"] = "pet-feeder";
10556
10577
  /** Built-in dishwasher — program lifecycle, door / remote-start gates,
10557
10578
  * salt and rinse-aid levels. Installed with the `dishwasher` cap.
10558
- * Sources: native Bosch Home Connect, reusable by similar integrations. */
10579
+ * Sources: native Bosch Home Connect, reusable by similar integrations.
10580
+ * A plug-built dishwasher carries running-state and power instead. */
10559
10581
  DeviceType["Dishwasher"] = "dishwasher";
10582
+ /** Washing machine. A plug-built one is running while its power stays
10583
+ * above a threshold. No program cap — that surface is the dishwasher's. */
10584
+ DeviceType["Washer"] = "washer";
10585
+ /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
10586
+ DeviceType["Dryer"] = "dryer";
10560
10587
  return DeviceType;
10561
10588
  }({});
10562
10589
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -10814,7 +10841,7 @@ function errMsg(err) {
10814
10841
  return String(err);
10815
10842
  }
10816
10843
  //#endregion
10817
- //#region ../types/dist/composition-kEl9mevu.mjs
10844
+ //#region ../types/dist/composition-B2rw5L29.mjs
10818
10845
  /**
10819
10846
  * The ffmpeg build every CamStack node downloads, per platform and arch.
10820
10847
  *
@@ -11569,15 +11596,102 @@ function validateExpressionSource(src) {
11569
11596
  }
11570
11597
  return null;
11571
11598
  }
11572
- /** A composed device's stableId is this prefix plus the block id. */
11573
- var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
11574
- /** Longest snippet a `code` source may carry (slice 4). */
11575
- var MAX_COMPOSITION_CODE_LENGTH = 2e4;
11599
+ /**
11600
+ * One power reading becomes a washer, dryer or dishwasher (D944 helper).
11601
+ *
11602
+ * Standby of the control board is under 5 W; a motor or a heater is far
11603
+ * above that, so 5 W is the line. A door lock or a short pump spike is not
11604
+ * a cycle, so running starts only after 30 s above the line.
11605
+ *
11606
+ * A wash, dry or dishwasher pause (soak, heat-wait, heater off between
11607
+ * bursts) lasts several minutes. Ending the cycle on the first dip would
11608
+ * report "finished" in the middle of the program, so the stop dwell is
11609
+ * 10 minutes on every type. The number is stored per type so one machine
11610
+ * can move later without moving the others.
11611
+ */
11612
+ var APPLIANCE_TEMPLATE_ID = "appliance";
11613
+ var APPLIANCE_KINDS = [
11614
+ "washer",
11615
+ "dryer",
11616
+ "dishwasher"
11617
+ ];
11618
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
11619
+ /**
11620
+ * A composition source identity: `(addonId, stableId)`, never a numeric device
11621
+ * id. Split out so helper schemas can name it without a cycle through
11622
+ * `composition.ts` (D659).
11623
+ */
11576
11624
  var CompositionSourceRefSchema = object({
11577
11625
  /** The owning addon; `stableId` is unique only within it. */
11578
11626
  addonId: string().min(1),
11579
11627
  stableId: string().min(1)
11580
11628
  });
11629
+ var GROUP_TEMPLATE_IDS = [
11630
+ "temperature",
11631
+ "humidity",
11632
+ "pressure",
11633
+ "illuminance",
11634
+ "power",
11635
+ "energy",
11636
+ "battery",
11637
+ "numeric",
11638
+ "motion",
11639
+ "contact",
11640
+ "leak",
11641
+ "smoke",
11642
+ "occupancy",
11643
+ "binary",
11644
+ "switch",
11645
+ "light"
11646
+ ];
11647
+ var NUMERIC_AGGREGATES = [
11648
+ "mean",
11649
+ "median",
11650
+ "min",
11651
+ "max",
11652
+ "sum"
11653
+ ];
11654
+ var BINARY_AGGREGATES = ["any", "all"];
11655
+ /** How an actuator group decides it is on. Unknown members never count as off. */
11656
+ var ACTIVE_CRITERIA = ["at-least-one", "all"];
11657
+ var AGGREGATE_REDUCERS = [
11658
+ "mean",
11659
+ "median",
11660
+ "min",
11661
+ "max",
11662
+ "sum",
11663
+ "any",
11664
+ "all"
11665
+ ];
11666
+ var GroupTemplateIdSchema = _enum(GROUP_TEMPLATE_IDS);
11667
+ var AggregateReducerSchema = _enum(AGGREGATE_REDUCERS);
11668
+ var ActiveCriterionSchema = _enum(ACTIVE_CRITERIA);
11669
+ /** One member. The field is stored so occupancy can name motion or binary. */
11670
+ var HelperMemberSchema = object({
11671
+ source: CompositionSourceRefSchema,
11672
+ cap: string().min(1),
11673
+ fieldPath: string().min(1)
11674
+ });
11675
+ var HelperSpecSchema = discriminatedUnion("kind", [object({
11676
+ kind: literal("group"),
11677
+ templateId: GroupTemplateIdSchema,
11678
+ aggregate: AggregateReducerSchema,
11679
+ members: array(HelperMemberSchema).min(1).max(64),
11680
+ /** Actuator groups only. Readings leave this unset. */
11681
+ active: ActiveCriterionSchema.optional()
11682
+ }), object({
11683
+ kind: literal("appliance"),
11684
+ templateId: literal(APPLIANCE_TEMPLATE_ID),
11685
+ appliance: _enum(APPLIANCE_KINDS),
11686
+ thresholdWatts: number().positive(),
11687
+ startDwellMs: number().int().nonnegative(),
11688
+ stopDwellMs: number().int().nonnegative(),
11689
+ member: HelperMemberSchema
11690
+ })]);
11691
+ /** A composed device's stableId is this prefix plus the block id. */
11692
+ var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
11693
+ /** Longest snippet a `code` source may carry (slice 4). */
11694
+ var MAX_COMPOSITION_CODE_LENGTH = 2e4;
11581
11695
  /** One field of one capability of one source device. */
11582
11696
  var CompositionFieldReadSchema = object({
11583
11697
  source: CompositionSourceRefSchema,
@@ -11621,7 +11735,33 @@ var CompositionCodeSourceSchema = object({
11621
11735
  var CompositionFieldSourceSchema = discriminatedUnion("kind", [
11622
11736
  CompositionFromSourceSchema,
11623
11737
  CompositionExpressionSourceSchema,
11624
- CompositionCodeSourceSchema
11738
+ CompositionCodeSourceSchema,
11739
+ object({
11740
+ kind: literal("aggregate"),
11741
+ reducer: _enum([
11742
+ "mean",
11743
+ "median",
11744
+ "min",
11745
+ "max",
11746
+ "sum",
11747
+ "any",
11748
+ "all"
11749
+ ]),
11750
+ reads: array(CompositionFieldReadSchema).min(1).max(64),
11751
+ /** `value` is the reading; the others are the member counts. */
11752
+ publish: _enum([
11753
+ "value",
11754
+ "included",
11755
+ "excluded",
11756
+ "total"
11757
+ ]),
11758
+ /** What a `value` publish does when nobody is included. Counts ignore this. */
11759
+ empty: _enum([
11760
+ "null",
11761
+ "omit",
11762
+ "offline"
11763
+ ])
11764
+ })
11625
11765
  ]);
11626
11766
  var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
11627
11767
  kind: literal("forward"),
@@ -11667,7 +11807,13 @@ var CompositionSchema = object({
11667
11807
  kind: literal("existing"),
11668
11808
  device: CompositionSourceRefSchema
11669
11809
  })]),
11670
- features: array(CompositionFeatureSchema).min(1).max(16)
11810
+ features: array(CompositionFeatureSchema).min(1).max(16),
11811
+ /**
11812
+ * Present when the block is a helper template. Absent on a free
11813
+ * composition (the room example, device 4603). The editor reads this,
11814
+ * never the compiled features.
11815
+ */
11816
+ helper: HelperSpecSchema.optional()
11671
11817
  }).superRefine((composition, ctx) => {
11672
11818
  const seen = /* @__PURE__ */ new Set();
11673
11819
  composition.features.forEach((feature, index) => {
@@ -17912,7 +18058,11 @@ var CompositionProblemSchema = object({
17912
18058
  "item-field-reserved",
17913
18059
  "target-missing",
17914
18060
  "target-unreadable",
17915
- "not-replaceable"
18061
+ "not-replaceable",
18062
+ "native-capability-replace",
18063
+ "mixed-quantity",
18064
+ "helper-mismatch",
18065
+ "member-constraint"
17916
18066
  ]),
17917
18067
  path: string(),
17918
18068
  message: string()
@@ -17933,7 +18083,8 @@ var CompositionUnavailableModeSchema = _enum([
17933
18083
  "null",
17934
18084
  "offline",
17935
18085
  "unknown",
17936
- "release"
18086
+ "release",
18087
+ "omit"
17937
18088
  ]);
17938
18089
  /**
17939
18090
  * `derived` reads a source · `clock` reads only `now`, recomputed when a sibling
@@ -17970,9 +18121,11 @@ var CompositionFieldPlanSchema = object({
17970
18121
  reads: array(CompositionFieldReadSchema)
17971
18122
  });
17972
18123
  /**
17973
- * What a feature does to its target (D663): `new` builds a capability on a new
17974
- * device; on an existing device it `add`s a capability the device lacks, or
17975
- * `replace`s named fields of one it has natively.
18124
+ * What a feature does to its target (D663, D944): `new` builds a capability on a
18125
+ * new device; on an existing device it `add`s a capability the device lacks.
18126
+ * Replacing a capability the device already serves is refused
18127
+ * (`native-capability-replace`), not planned. `replace` remains on the claim
18128
+ * wire for a claim the hub already holds.
17976
18129
  */
17977
18130
  var CompositionFeatureModeSchema = _enum([
17978
18131
  "new",
@@ -18145,6 +18298,275 @@ Object.freeze({
18145
18298
  result: ["number", "null"]
18146
18299
  }
18147
18300
  });
18301
+ /**
18302
+ * One catalog row per base reading a group helper can build (D944 §3).
18303
+ * Data, not a form default written into the block.
18304
+ */
18305
+ var NOW = {
18306
+ fieldPath: "lastFetchedAt",
18307
+ expr: "now"
18308
+ };
18309
+ var CHANGED = {
18310
+ fieldPath: "lastChangedAt",
18311
+ expr: "now"
18312
+ };
18313
+ function numeric(input) {
18314
+ return {
18315
+ ...input,
18316
+ family: "numeric",
18317
+ deviceType: DeviceType.Sensor,
18318
+ memberDeviceType: DeviceType.Sensor,
18319
+ commandCaps: [],
18320
+ baseUnit: baseUnitOf(input.quantity),
18321
+ aggregates: NUMERIC_AGGREGATES,
18322
+ accept: [{
18323
+ cap: input.outputCap,
18324
+ fieldPath: input.outputField
18325
+ }]
18326
+ };
18327
+ }
18328
+ function binary(input) {
18329
+ return {
18330
+ ...input,
18331
+ family: "binary",
18332
+ deviceType: DeviceType.Sensor,
18333
+ memberDeviceType: DeviceType.Sensor,
18334
+ commandCaps: [],
18335
+ quantity: "none",
18336
+ baseUnit: void 0,
18337
+ aggregates: BINARY_AGGREGATES,
18338
+ empty: "offline"
18339
+ };
18340
+ }
18341
+ var GROUP_TEMPLATES = [
18342
+ numeric({
18343
+ id: "temperature",
18344
+ summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
18345
+ role: DeviceRole.TemperatureSensor,
18346
+ outputCap: "temperature-sensor",
18347
+ outputField: "celsius",
18348
+ quantity: "temperature",
18349
+ defaultAggregate: "mean",
18350
+ empty: "null",
18351
+ companions: [NOW]
18352
+ }),
18353
+ numeric({
18354
+ id: "humidity",
18355
+ summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
18356
+ role: DeviceRole.HumiditySensor,
18357
+ outputCap: "humidity-sensor",
18358
+ outputField: "percent",
18359
+ quantity: "humidity",
18360
+ defaultAggregate: "mean",
18361
+ empty: "null",
18362
+ companions: [NOW]
18363
+ }),
18364
+ numeric({
18365
+ id: "pressure",
18366
+ summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
18367
+ role: DeviceRole.PressureSensor,
18368
+ outputCap: "pressure-sensor",
18369
+ outputField: "hpa",
18370
+ quantity: "pressure",
18371
+ defaultAggregate: "mean",
18372
+ empty: "null",
18373
+ companions: [NOW]
18374
+ }),
18375
+ numeric({
18376
+ id: "illuminance",
18377
+ summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
18378
+ role: DeviceRole.AmbientLightSensor,
18379
+ outputCap: "ambient-light-sensor",
18380
+ outputField: "lux",
18381
+ quantity: "illuminance",
18382
+ defaultAggregate: "mean",
18383
+ empty: "null",
18384
+ companions: [NOW]
18385
+ }),
18386
+ numeric({
18387
+ id: "power",
18388
+ summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
18389
+ role: DeviceRole.PowerSensor,
18390
+ outputCap: "power-meter",
18391
+ outputField: "watts",
18392
+ quantity: "power",
18393
+ defaultAggregate: "sum",
18394
+ empty: "omit",
18395
+ companions: [NOW]
18396
+ }),
18397
+ numeric({
18398
+ id: "energy",
18399
+ summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
18400
+ role: DeviceRole.EnergySensor,
18401
+ outputCap: "power-meter",
18402
+ outputField: "kwhTotal",
18403
+ quantity: "energy",
18404
+ defaultAggregate: "sum",
18405
+ empty: "omit",
18406
+ companions: [NOW]
18407
+ }),
18408
+ numeric({
18409
+ id: "battery",
18410
+ summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
18411
+ role: DeviceRole.BatterySensor,
18412
+ outputCap: "battery",
18413
+ outputField: "percentage",
18414
+ quantity: "percentage",
18415
+ defaultAggregate: "mean",
18416
+ empty: "null",
18417
+ companions: [
18418
+ {
18419
+ fieldPath: "charging",
18420
+ expr: "\"unknown\""
18421
+ },
18422
+ {
18423
+ fieldPath: "sleeping",
18424
+ expr: "false"
18425
+ },
18426
+ {
18427
+ fieldPath: "lastUpdated",
18428
+ expr: "now"
18429
+ }
18430
+ ]
18431
+ }),
18432
+ numeric({
18433
+ id: "numeric",
18434
+ summary: "A numeric reading in the members’ shared quantity. Mixed quantities are refused. Nobody reporting publishes null, not 0.",
18435
+ role: DeviceRole.NumericSensor,
18436
+ outputCap: "numeric-sensor",
18437
+ outputField: "value",
18438
+ quantity: "device",
18439
+ defaultAggregate: "mean",
18440
+ empty: "null",
18441
+ companions: [NOW]
18442
+ }),
18443
+ binary({
18444
+ id: "motion",
18445
+ summary: "Any or all motion. Offline and unknown members are left out, never read as off. Nobody reporting takes the device offline.",
18446
+ role: DeviceRole.MotionSensor,
18447
+ outputCap: "motion",
18448
+ outputField: "detected",
18449
+ defaultAggregate: "any",
18450
+ accept: [{
18451
+ cap: "motion",
18452
+ fieldPath: "detected"
18453
+ }],
18454
+ companions: [{
18455
+ fieldPath: "lastDetectedAt",
18456
+ expr: "null"
18457
+ }, {
18458
+ fieldPath: "autoClearAfterMs",
18459
+ expr: "null"
18460
+ }]
18461
+ }),
18462
+ binary({
18463
+ id: "contact",
18464
+ summary: "Any or all open contacts. Offline and unknown members are left out, never read as closed.",
18465
+ role: DeviceRole.ContactSensor,
18466
+ outputCap: "contact",
18467
+ outputField: "entryOpen",
18468
+ defaultAggregate: "any",
18469
+ accept: [{
18470
+ cap: "contact",
18471
+ fieldPath: "entryOpen"
18472
+ }],
18473
+ companions: [CHANGED]
18474
+ }),
18475
+ binary({
18476
+ id: "leak",
18477
+ summary: "Any or all leak detections. Offline and unknown members are left out, never read as dry.",
18478
+ role: DeviceRole.LeakSensor,
18479
+ outputCap: "flood",
18480
+ outputField: "flooded",
18481
+ defaultAggregate: "any",
18482
+ accept: [{
18483
+ cap: "flood",
18484
+ fieldPath: "flooded"
18485
+ }],
18486
+ companions: [CHANGED]
18487
+ }),
18488
+ binary({
18489
+ id: "smoke",
18490
+ summary: "Any or all smoke detections. Offline and unknown members are left out, never read as clear.",
18491
+ role: DeviceRole.SmokeSensor,
18492
+ outputCap: "smoke",
18493
+ outputField: "detected",
18494
+ defaultAggregate: "any",
18495
+ accept: [{
18496
+ cap: "smoke",
18497
+ fieldPath: "detected"
18498
+ }],
18499
+ companions: [CHANGED]
18500
+ }),
18501
+ binary({
18502
+ id: "occupancy",
18503
+ summary: "Any or all of motion or binary sensors, published as a binary. Presence zones are not aggregated. Nobody reporting is offline, not off.",
18504
+ role: DeviceRole.BinarySensor,
18505
+ outputCap: "binary",
18506
+ outputField: "on",
18507
+ defaultAggregate: "any",
18508
+ accept: [{
18509
+ cap: "motion",
18510
+ fieldPath: "detected"
18511
+ }, {
18512
+ cap: "binary",
18513
+ fieldPath: "on"
18514
+ }],
18515
+ companions: [CHANGED]
18516
+ }),
18517
+ binary({
18518
+ id: "binary",
18519
+ summary: "Any or all generic binary sensors. Offline and unknown members are left out, never read as off.",
18520
+ role: DeviceRole.BinarySensor,
18521
+ outputCap: "binary",
18522
+ outputField: "on",
18523
+ defaultAggregate: "any",
18524
+ accept: [{
18525
+ cap: "binary",
18526
+ fieldPath: "on"
18527
+ }],
18528
+ companions: [CHANGED]
18529
+ }),
18530
+ actuator({
18531
+ id: "switch",
18532
+ 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.",
18533
+ deviceType: DeviceType.Switch,
18534
+ outputCap: "switch",
18535
+ commandCaps: ["switch"]
18536
+ }),
18537
+ actuator({
18538
+ id: "light",
18539
+ 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.",
18540
+ deviceType: DeviceType.Light,
18541
+ outputCap: "switch",
18542
+ commandCaps: [
18543
+ "switch",
18544
+ "brightness",
18545
+ "color"
18546
+ ]
18547
+ })
18548
+ ];
18549
+ function actuator(input) {
18550
+ return {
18551
+ ...input,
18552
+ family: "actuator",
18553
+ role: void 0,
18554
+ memberDeviceType: input.deviceType,
18555
+ outputField: "on",
18556
+ quantity: "none",
18557
+ baseUnit: void 0,
18558
+ aggregates: BINARY_AGGREGATES,
18559
+ defaultAggregate: "any",
18560
+ empty: "offline",
18561
+ accept: [{
18562
+ cap: "switch",
18563
+ fieldPath: "on"
18564
+ }],
18565
+ companions: [CHANGED]
18566
+ };
18567
+ }
18568
+ new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
18569
+ DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
18148
18570
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
18149
18571
  /**
18150
18572
  * What a composition may BUILD on a device type (G2, D676): the caps a new
@@ -19858,12 +20280,12 @@ method(object({ deviceId: number().int().nonnegative() }), DeviceAdminLinkSchema
19858
20280
  * providers detect renames by matching `uniqueId` and patch `id`
19859
20281
  * in-place so dispatch keeps working.
19860
20282
  *
19861
- * **Rendering metadata is NOT stored here.** Display fields (`unit`,
19862
- * `precision`) live in the cap STATUS SLICE so they flow live with every
19863
- * state push and are the single source of truth. The `device_class` tag is
19864
- * an HA-specific input that is consumed at the discovery boundary
19865
- * (`ha-domain-mapping`) to derive the CamStack `DeviceRole`; it is never
19866
- * stored after that point.
20283
+ * **Display unit and precision are NOT stored here.** They are a read-time
20284
+ * preference (D944). A polymorphic reading stores its `quantity` here once,
20285
+ * at adopt, and a date/time value stores `dateTimeShape` the same way —
20286
+ * neither is repeated on each sample. The `device_class` tag is an
20287
+ * HA-specific input consumed at the discovery boundary (`ha-domain-mapping`)
20288
+ * to derive the CamStack `DeviceRole`; it is never stored after that point.
19867
20289
  *
19868
20290
  * The `raw` escape hatch carries provider-specific attributes that don't
19869
20291
  * fit the structured slots (HA `attributes` whitelist, Reolink `deviceCache`
@@ -19877,6 +20299,14 @@ var SourceInfoSchema = object({
19877
20299
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
19878
20300
  * Used to detect rename when `id` changes. */
19879
20301
  uniqueId: string().optional(),
20302
+ /** Quantity of a polymorphic reading, written once at adopt (D944). */
20303
+ quantity: ReadingQuantitySchema.optional(),
20304
+ /** Date / time / datetime shape of a string reading, written once at adopt. */
20305
+ dateTimeShape: _enum([
20306
+ "date",
20307
+ "time",
20308
+ "datetime"
20309
+ ]).optional(),
19880
20310
  /** Provider-specific extras that don't fit the structured slots.
19881
20311
  * Whitelist what goes here per provider — do NOT dump entire HA
19882
20312
  * attribute blobs (would explode the meta JSON column). */
@@ -40814,7 +41244,8 @@ method(object({
40814
41244
  "enum"
40815
41245
  ]),
40816
41246
  enumValues: array(string()).optional(),
40817
- item: boolean().optional()
41247
+ item: boolean().optional(),
41248
+ quantity: ReadingQuantitySchema.optional()
40818
41249
  })).readonly(),
40819
41250
  itemArray: object({
40820
41251
  path: string(),
@@ -44614,8 +45045,8 @@ var MaskPolygonShapeSchema = object({
44614
45045
  /** Boolean cell grid — row-major, length === gridWidth*gridHeight. */
44615
45046
  var MaskGridShapeSchema = object({
44616
45047
  kind: literal("grid"),
44617
- gridWidth: number(),
44618
- gridHeight: number(),
45048
+ gridWidth: number().meta(readingMeta("none")),
45049
+ gridHeight: number().meta(readingMeta("none")),
44619
45050
  cells: array(boolean())
44620
45051
  });
44621
45052
  discriminatedUnion("kind", [
@@ -44727,6 +45158,8 @@ var NcSystemEventKindSchema = _enum([
44727
45158
  "detection-blind",
44728
45159
  "motion-noisy",
44729
45160
  "motion-calm",
45161
+ "package-llm-silent",
45162
+ "package-llm-answered",
44730
45163
  "recording-stalled",
44731
45164
  "recording-healthy",
44732
45165
  "recording-degraded",
@@ -55757,6 +56190,28 @@ var PackageVersionInfoSchema = object({
55757
56190
  deprecated: string().optional(),
55758
56191
  distTags: array(string()).readonly()
55759
56192
  });
56193
+ /**
56194
+ * One published document. `ok` is markdown from the registry. `missing` means
56195
+ * the registry answered and the file was not there. `error` is a registry or
56196
+ * tarball failure — never an empty string standing in for either.
56197
+ */
56198
+ var PackageDocBodySchema = discriminatedUnion("status", [
56199
+ object({
56200
+ status: literal("ok"),
56201
+ markdown: string()
56202
+ }),
56203
+ object({ status: literal("missing") }),
56204
+ object({
56205
+ status: literal("error"),
56206
+ message: string()
56207
+ })
56208
+ ]);
56209
+ var PackageDocsSchema = object({
56210
+ name: string(),
56211
+ version: string(),
56212
+ readme: PackageDocBodySchema,
56213
+ changelog: PackageDocBodySchema
56214
+ });
55760
56215
  var SearchResultSchema = object({
55761
56216
  name: string(),
55762
56217
  version: string(),
@@ -55975,7 +56430,10 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
55975
56430
  }), object({ success: literal(true) }), {
55976
56431
  kind: "mutation",
55977
56432
  auth: "admin"
55978
- }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
56433
+ }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({
56434
+ name: string().min(1),
56435
+ version: string().min(1).optional()
56436
+ }), PackageDocsSchema, { auth: "admin" }), method(object({ addonId: string() }), RestartAddonResultSchema, {
55979
56437
  kind: "mutation",
55980
56438
  auth: "admin"
55981
56439
  }), method(object({ packageName: string() }), object({ success: literal(true) }), {
@@ -56025,46 +56483,27 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
56025
56483
  }), LogStreamEntrySchema, { kind: "subscription" });
56026
56484
  object({
56027
56485
  /** Carbon dioxide concentration in ppm. */
56028
- co2Ppm: number().min(0).optional(),
56486
+ co2Ppm: number().min(0).optional().meta(readingMeta("concentration-volume")),
56029
56487
  /** Total volatile organic compounds in ppb. */
56030
- vocPpb: number().min(0).optional(),
56488
+ vocPpb: number().min(0).optional().meta(readingMeta("concentration-ppb")),
56031
56489
  /** Particulate matter ≤ 2.5 μm in µg/m³. */
56032
- pm25: number().min(0).optional(),
56490
+ pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
56033
56491
  /** Particulate matter ≤ 10 μm in µg/m³. */
56034
- pm10: number().min(0).optional(),
56492
+ pm10: number().min(0).optional().meta(readingMeta("concentration-mass")),
56035
56493
  /** Composite AQI value (typically 0..500). */
56036
- aqi: number().optional(),
56494
+ aqi: number().optional().meta(readingMeta("index")),
56037
56495
  /** Ms epoch when the slice was last updated. */
56038
- lastFetchedAt: number(),
56039
- /** Live display unit of the single metric this slice carries (e.g. HA
56040
- * `attributes.unit_of_measurement` → 'ppm' / 'ppb' / 'µg/m³'). Each
56041
- * upstream `sensor.*` entity surfaces ONE device_class, so one unit
56042
- * per slice is unambiguous. */
56043
- unit: string().optional(),
56044
- /** Suggested decimal places for numeric display.
56045
- * Populated live from the upstream source when provided (e.g. HA
56046
- * `attributes.suggested_display_precision`). Falls back to
56047
- * auto-formatting when absent. */
56048
- precision: number().int().min(0).max(10).optional()
56496
+ lastFetchedAt: number()
56049
56497
  });
56050
56498
  DeviceType.Sensor;
56051
56499
  object({
56052
- /** Current illuminance in lux (lx). */
56053
- lux: number().min(0).meta({
56054
- unit: "lx",
56500
+ /** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
56501
+ lux: number().min(0).nullable().meta(readingMeta("illuminance", {
56502
+ precision: 0,
56055
56503
  label: "Illuminance"
56056
- }),
56504
+ })),
56057
56505
  /** Ms epoch when the slice was last updated. */
56058
- lastFetchedAt: number(),
56059
- /** Live display unit from the upstream source (e.g. HA
56060
- * `attributes.unit_of_measurement`). The UI prefers this over the
56061
- * role's canonical unit. Absent → fall back to the canonical unit. */
56062
- unit: string().optional(),
56063
- /** Suggested decimal places for numeric display.
56064
- * Populated live from the upstream source when provided (e.g. HA
56065
- * `attributes.suggested_display_precision`). Falls back to
56066
- * auto-formatting when absent. */
56067
- precision: number().int().min(0).max(10).optional()
56506
+ lastFetchedAt: number()
56068
56507
  });
56069
56508
  DeviceType.Sensor;
56070
56509
  /**
@@ -56209,10 +56648,7 @@ var BatteryStatusSchema = object({
56209
56648
  * Consumers must SKIP a null rather than coerce it — `battery-band` already
56210
56649
  * declines to band a non-finite reading, which is the correct shape.
56211
56650
  */
56212
- percentage: number().min(0).max(100).nullable().meta({
56213
- unit: "%",
56214
- label: "Charge"
56215
- }),
56651
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
56216
56652
  /**
56217
56653
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
56218
56654
  * Reolink-specific for the Solar Panel 2 accessory (will become
@@ -56239,7 +56675,14 @@ var BatteryStatusSchema = object({
56239
56675
  */
56240
56676
  sleeping: boolean().meta({ label: "Sleeping" }),
56241
56677
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
56242
- lastUpdated: number(),
56678
+ lastUpdated: number().meta(readingMeta("none")),
56679
+ /**
56680
+ * Battery voltage in volts, for a cell the firmware reports as voltage
56681
+ * rather than a percentage (Ecowitt capacitor packs). Absent on cameras
56682
+ * that only report charge. A second reading on this cap, not a second
56683
+ * `numeric-sensor` on the same device.
56684
+ */
56685
+ volts: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
56243
56686
  /**
56244
56687
  * Ms epoch of the last time the device PROVED it was reachable — a
56245
56688
  * completed firmware round-trip, an observed wake, or an inbound push
@@ -56311,7 +56754,7 @@ DeviceType.Sensor;
56311
56754
  */
56312
56755
  var BrightnessStatusSchema = object({
56313
56756
  /** Current level as 0..100 inclusive. Firmware-reported. */
56314
- percentage: number().min(0).max(100),
56757
+ percentage: number().min(0).max(100).meta(readingMeta("percentage")),
56315
56758
  /** Ms epoch of the last operator-driven change. Useful for UI freshness. */
56316
56759
  lastChangedAt: number()
56317
56760
  });
@@ -56696,21 +57139,21 @@ object({
56696
57139
  /** Single setpoint in Celsius. Used by single-target modes
56697
57140
  * (heat / cool / dry). Null when the device is in a range mode
56698
57141
  * (`heat_cool`) or has no setpoint at all (`fan_only`/`off`). */
56699
- target: number().nullable(),
57142
+ target: number().nullable().meta(readingMeta("temperature")),
56700
57143
  /** Upper bound of the dual setpoint in Celsius. Populated only
56701
57144
  * in `heat_cool` mode. */
56702
- targetHigh: number().nullable(),
57145
+ targetHigh: number().nullable().meta(readingMeta("temperature")),
56703
57146
  /** Lower bound of the dual setpoint in Celsius. Populated only
56704
57147
  * in `heat_cool` mode. */
56705
- targetLow: number().nullable(),
57148
+ targetLow: number().nullable().meta(readingMeta("temperature")),
56706
57149
  /** Target relative humidity (0..100). Null when the device has no
56707
57150
  * humidity control. */
56708
- targetHumidity: number().min(0).max(100).nullable(),
57151
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
56709
57152
  /** Current measured temperature in Celsius. Read-only — pushed by
56710
57153
  * the device's internal sensor. */
56711
- currentTemp: number().nullable(),
57154
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
56712
57155
  /** Current measured relative humidity (0..100). Read-only. */
56713
- currentHumidity: number().min(0).max(100).nullable(),
57156
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
56714
57157
  /** Vertical louver swing on/off. Null when the device has no vertical
56715
57158
  * swing surface (gate with `DeviceFeature.ClimateSwingVertical`). */
56716
57159
  swingVertical: boolean().nullable(),
@@ -56718,11 +57161,11 @@ object({
56718
57161
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
56719
57162
  swingHorizontal: boolean().nullable(),
56720
57163
  /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
56721
- minTemp: number().nullable().optional(),
57164
+ minTemp: number().nullable().optional().meta(readingMeta("temperature")),
56722
57165
  /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
56723
- maxTemp: number().nullable().optional(),
57166
+ maxTemp: number().nullable().optional().meta(readingMeta("temperature")),
56724
57167
  /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
56725
- tempStep: number().positive().nullable().optional(),
57168
+ tempStep: number().positive().nullable().optional().meta(readingMeta("temperature")),
56726
57169
  /** Ms epoch when the slice was last updated (push or command). */
56727
57170
  lastFetchedAt: number()
56728
57171
  });
@@ -56801,17 +57244,17 @@ DeviceType.Thermostat, DeviceType.Climate, method(object({
56801
57244
  * modes to expose in the picker without a slice fetch.
56802
57245
  */
56803
57246
  var RgbTripletSchema = object({
56804
- r: number().int().min(0).max(255),
56805
- g: number().int().min(0).max(255),
56806
- b: number().int().min(0).max(255)
57247
+ r: number().int().min(0).max(255).meta(readingMeta("none")),
57248
+ g: number().int().min(0).max(255).meta(readingMeta("none")),
57249
+ b: number().int().min(0).max(255).meta(readingMeta("none"))
56807
57250
  });
56808
57251
  var HsvTripletSchema = object({
56809
57252
  /** Hue in degrees, 0..360. */
56810
- h: number().min(0).max(360),
57253
+ h: number().min(0).max(360).meta(readingMeta("none")),
56811
57254
  /** Saturation as 0..100 inclusive. */
56812
- s: number().min(0).max(100),
57255
+ s: number().min(0).max(100).meta(readingMeta("none")),
56813
57256
  /** Value/brightness as 0..100 inclusive. */
56814
- v: number().min(0).max(100)
57257
+ v: number().min(0).max(100).meta(readingMeta("none"))
56815
57258
  });
56816
57259
  var ColorInputSchema = discriminatedUnion("mode", [
56817
57260
  object({
@@ -56840,7 +57283,7 @@ object({
56840
57283
  /** Populated when `mode === 'hsv'`. */
56841
57284
  hsv: HsvTripletSchema.optional(),
56842
57285
  /** Populated when `mode === 'mired'`. */
56843
- mireds: number().int().optional(),
57286
+ mireds: number().int().optional().meta(readingMeta("colour-temperature")),
56844
57287
  /** Ms epoch of the last operator-driven change. */
56845
57288
  lastChangedAt: number()
56846
57289
  });
@@ -56964,18 +57407,12 @@ _enum([
56964
57407
  "empty",
56965
57408
  "full"
56966
57409
  ]);
56967
- /** Units a remaining-life counter is reported in. Closed: the panel renders
56968
- * each. */
56969
- var ConsumableRemainingUnitSchema = _enum([
56970
- "days",
56971
- "hours",
56972
- "cycles"
56973
- ]);
56974
- /** Remaining life as a COUNT, not a percentage (the PetKit desiccant reports
56975
- * days). `value` null = unknown (D393). */
57410
+ /** Whether `remaining.value` is a duration in seconds or a dimensionless count. */
57411
+ var ConsumableRemainingKindSchema = _enum(["duration", "count"]);
57412
+ /** Remaining life. `value` null = unknown (D393). Duration is seconds. */
56976
57413
  var ConsumableRemainingSchema = object({
56977
- value: number().min(0).nullable(),
56978
- unit: ConsumableRemainingUnitSchema
57414
+ value: number().min(0).nullable().meta(readingMeta("device")),
57415
+ kind: ConsumableRemainingKindSchema
56979
57416
  });
56980
57417
  var ConsumablesStatusSchema = object({
56981
57418
  items: array(object({
@@ -56984,7 +57421,7 @@ var ConsumablesStatusSchema = object({
56984
57421
  /** Display name. */
56985
57422
  label: string().min(1),
56986
57423
  /** Remaining life % (`wear`) or fill % (`supply`, `waste`) when known (0..100). */
56987
- level: number().min(0).max(100).nullable(),
57424
+ level: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
56988
57425
  /** The provider's discrete verdict when known (binary mode). */
56989
57426
  status: ConsumableStatusSchema.nullable(),
56990
57427
  /** What the item is — decides whether low or full is bad. Absent = `wear`. */
@@ -57001,7 +57438,7 @@ var ConsumablesStatusSchema = object({
57001
57438
  })),
57002
57439
  lastChangedAt: number()
57003
57440
  });
57004
- Object.values(DeviceType), [...ConsumableRemainingUnitSchema.options], [...ConsumableStatusSchema.options], [...ConsumableKindSchema.options], [...ConsumableFormSchema.options];
57441
+ Object.values(DeviceType), [...ConsumableRemainingKindSchema.options], [...ConsumableStatusSchema.options], [...ConsumableKindSchema.options], [...ConsumableFormSchema.options];
57005
57442
  Object.values(DeviceType), method(object({
57006
57443
  deviceId: number().int().nonnegative(),
57007
57444
  key: string().min(1)
@@ -57026,39 +57463,17 @@ object({
57026
57463
  /** Current value. Numeric kind → number; select/text/datetime → string.
57027
57464
  * Datetime values are ISO 8601 strings (full timestamp, date-only,
57028
57465
  * or time-only — HA accepts all three forms). */
57029
- value: union([number(), string()]),
57466
+ value: union([number().meta(readingMeta("device")), string()]),
57030
57467
  /** Acceptable values when `kind === 'select'`. Empty for other kinds. */
57031
57468
  options: array(string()),
57032
57469
  /** Ms epoch when the slice was last updated. */
57033
57470
  lastChangedAt: number(),
57034
- /** Display unit-of-measurement (e.g. '°C', '%', 'lx').
57035
- * Populated live from HA `attributes.unit_of_measurement` on each push.
57036
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57037
- unit: string().optional(),
57038
- /** Minimum allowed value. Populated live from HA `attributes.min`.
57039
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57040
- min: number().optional(),
57041
- /** Maximum allowed value. Populated live from HA `attributes.max`.
57042
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57043
- max: number().optional(),
57044
- /** Step increment. Populated live from HA `attributes.step`.
57045
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57046
- step: number().optional(),
57047
- /** Suggested decimal places for numeric display. Populated live from HA
57048
- * `attributes.suggested_display_precision`, or derived from `step` when the
57049
- * HA attribute is absent. Meaningful for `kind === 'numeric'`; absent for
57050
- * other kinds. Falls back to auto-formatting when absent. */
57051
- precision: number().int().min(0).max(10).optional(),
57052
- /** Date-picker granularity for `kind === 'datetime'`. 'date' → date-only,
57053
- * 'time' → time-only, 'datetime' → full timestamp. Absent for other kinds
57054
- * (UI defaults to 'datetime'). Derived live from the device's HA domain
57055
- * (date.* / time.* / datetime.*) or, for input_datetime, from the entity's
57056
- * `has_date`/`has_time` attributes on each push. */
57057
- format: _enum([
57058
- "date",
57059
- "time",
57060
- "datetime"
57061
- ]).optional()
57471
+ /** Minimum allowed value, in the device quantity's base unit. */
57472
+ min: number().optional().meta(readingMeta("device")),
57473
+ /** Maximum allowed value, in the device quantity's base unit. */
57474
+ max: number().optional().meta(readingMeta("device")),
57475
+ /** Step increment, in the device quantity's base unit. */
57476
+ step: number().optional().meta(readingMeta("device"))
57062
57477
  });
57063
57478
  var ControlSetValueInputSchema = discriminatedUnion("kind", [
57064
57479
  object({
@@ -57096,9 +57511,9 @@ var CoverStatusSchema = object({
57096
57511
  ]),
57097
57512
  /** 0 = fully closed, 100 = fully open. Null when the device has
57098
57513
  * no intermediate position surface. */
57099
- position: number().min(0).max(100).nullable(),
57514
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
57100
57515
  /** 0 = closed slats, 100 = open slats. Null when no tilt support. */
57101
- tiltPosition: number().min(0).max(100).nullable(),
57516
+ tiltPosition: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
57102
57517
  /** Ms epoch when the slice was last updated. */
57103
57518
  lastChangedAt: number()
57104
57519
  });
@@ -57156,9 +57571,9 @@ var NormalizedRangeSchema$1 = object({
57156
57571
  object({
57157
57572
  mode: DayNightModeSchema,
57158
57573
  /** IR-cut trigger sensitivity, NORMALIZED 0–100 (higher = switches to night sooner). */
57159
- sensitivity: number().optional(),
57574
+ sensitivity: number().optional().meta(readingMeta("none")),
57160
57575
  /** Delay before the IR-cut filter flips, in seconds. */
57161
- switchDelaySec: number().optional(),
57576
+ switchDelaySec: number().optional().meta(readingMeta("duration")),
57162
57577
  lastFetchedAt: number()
57163
57578
  });
57164
57579
  /**
@@ -57313,11 +57728,11 @@ object({
57313
57728
  /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
57314
57729
  availablePrograms: array(string()),
57315
57730
  /** Seconds remaining on the active cycle, or null when not running / not known. */
57316
- remainingSeconds: number().int().nonnegative().nullable(),
57731
+ remainingSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
57317
57732
  /** Seconds the delayed start is set to (time until the cycle starts), or null. */
57318
- delayedStartSeconds: number().int().nonnegative().nullable(),
57733
+ delayedStartSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
57319
57734
  /** Cycle completion 0..100, or null when not applicable. */
57320
- progressPercent: number().min(0).max(100).nullable(),
57735
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
57321
57736
  /** True when the door is reported open; null when the door state is not known. */
57322
57737
  doorOpen: boolean().nullable(),
57323
57738
  /** True when the door is latched (locked) during a cycle; null when not reported. */
@@ -57341,7 +57756,7 @@ object({
57341
57756
  /** True while the machine-care (descaling / cleaning-program) reminder is raised; false when clear; null when not reported. */
57342
57757
  machineCareDue: boolean().nullable(),
57343
57758
  /** Program runs left before the machine-care reminder is due; null when the appliance does not say. */
57344
- machineCareRemainingRuns: number().int().nonnegative().nullable(),
57759
+ machineCareRemainingRuns: number().int().nonnegative().nullable().meta(readingMeta("count")),
57345
57760
  /** Option states: null when the appliance does not expose the option or has not said. */
57346
57761
  halfLoad: boolean().nullable(),
57347
57762
  hygienePlus: boolean().nullable(),
@@ -57356,7 +57771,7 @@ object({
57356
57771
  /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
57357
57772
  activeEvents: array(string()),
57358
57773
  /** Numeric error code when the appliance reports one; null otherwise. */
57359
- errorCode: number().nullable(),
57774
+ errorCode: number().nullable().meta(readingMeta("none")),
57360
57775
  /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
57361
57776
  errorLabel: string().nullable(),
57362
57777
  /** Ms epoch of the last value received from the appliance; 0 = never. */
@@ -57502,24 +57917,14 @@ object({
57502
57917
  /** Ms epoch of the last press. null = never observed since this provider started. */
57503
57918
  lastPressedAt: number().nullable(),
57504
57919
  /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
57505
- pressCountSinceStart: number()
57920
+ pressCountSinceStart: number().meta(readingMeta("count"))
57506
57921
  });
57507
57922
  object({
57508
57923
  deviceId: number(),
57509
57924
  timestamp: number()
57510
57925
  });
57511
57926
  DeviceType.Button, DeviceType.Camera;
57512
- /**
57513
- * Enum-state sensor — a string value picked from a finite option set.
57514
- * Drives HA `sensor` entries with `state_class: enum` (HVAC action
57515
- * states, weather conditions, contact-source channels, mode strings).
57516
- * The option set is stable across observations; it is persisted in the
57517
- * device config blob (via the control slice at adoption) and is NOT
57518
- * stored in `sourceInfo`.
57519
- */
57520
- /** Locale-render shape for an ISO `value` carried by a `DateTimeSensor`-role
57521
- * enum sensor: `date` (date-only), `time` (time-only), `datetime` (both). */
57522
- var EnumSensorDateTimeFormatSchema = _enum([
57927
+ _enum([
57523
57928
  "date",
57524
57929
  "time",
57525
57930
  "datetime"
@@ -57527,12 +57932,11 @@ var EnumSensorDateTimeFormatSchema = _enum([
57527
57932
  object({
57528
57933
  value: string(),
57529
57934
  /**
57530
- * Set for `DateTimeSensor`-role sensors so the UI renders the ISO `value`
57531
- * as a locale date/time/datetime; absent for plain enum sensors. HA
57532
- * `device_class=timestamp` → `'datetime'`, `device_class=date` → `'date'`,
57533
- * a time-only sensor → `'time'`.
57935
+ * Set when `value` is a timestamp rather than an enum state, so history
57936
+ * does not learn ISO strings as states. The display shape (date / time /
57937
+ * datetime) lives on `SourceInfo.dateTimeShape`, written once at adopt.
57534
57938
  */
57535
- format: EnumSensorDateTimeFormatSchema.optional(),
57939
+ timestamp: boolean().optional(),
57536
57940
  /** Ms epoch when the slice was last updated. */
57537
57941
  lastFetchedAt: number()
57538
57942
  });
@@ -57551,13 +57955,13 @@ var EventFireSchema = object({
57551
57955
  deviceId: number(),
57552
57956
  eventType: string(),
57553
57957
  data: record(string(), unknown()).nullable(),
57554
- timestamp: number(),
57555
- seq: number()
57958
+ timestamp: number().meta(readingMeta("none")),
57959
+ seq: number().meta(readingMeta("count"))
57556
57960
  });
57557
57961
  object({
57558
57962
  eventTypes: array(string()),
57559
57963
  lastEvent: EventFireSchema.nullable(),
57560
- eventCountSinceStart: number()
57964
+ eventCountSinceStart: number().meta(readingMeta("count"))
57561
57965
  });
57562
57966
  DeviceType.EventEmitter;
57563
57967
  var IdentitySchema = object({
@@ -57946,10 +58350,10 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
57946
58350
  object({
57947
58351
  /** Active speed as 0..100 inclusive. Null when the device has no
57948
58352
  * speed surface (single-speed fan). */
57949
- percentage: number().min(0).max(100).nullable(),
58353
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
57950
58354
  /** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
57951
58355
  * a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
57952
- percentageStep: number().positive().optional(),
58356
+ percentageStep: number().positive().optional().meta(readingMeta("percentage")),
57953
58357
  /** Active preset mode (`auto` / `quiet` / `turbo` / vendor-specific)
57954
58358
  * — empty string when no preset is active or supported. */
57955
58359
  preset: string(),
@@ -58031,7 +58435,7 @@ var FeatureProbeStatusSchema = object({
58031
58435
  /** Camera/firmware model string. `null` when the firmware doesn't expose it. */
58032
58436
  model: string().nullable(),
58033
58437
  /** Channel count for NVR/Hub devices; `1` for standalone cameras; `null` pre-probe. */
58034
- channelCount: number().nullable(),
58438
+ channelCount: number().nullable().meta(readingMeta("count")),
58035
58439
  /**
58036
58440
  * Ms epoch of the last SUCCESSFUL probe. `0` before the first probe
58037
58441
  * completes — drivers' `getAccessoryChildren()` should treat zero as
@@ -58063,9 +58467,39 @@ object({
58063
58467
  lastChangedAt: number()
58064
58468
  });
58065
58469
  DeviceType.Sensor;
58470
+ object({
58471
+ /** One row per member that has been commanded. A later command replaces that member's row. */
58472
+ results: array(object({
58473
+ deviceId: number().int().nonnegative(),
58474
+ cap: string().min(1),
58475
+ method: string().min(1),
58476
+ ok: boolean(),
58477
+ error: string().optional(),
58478
+ /** Ms epoch of the attempt. */
58479
+ at: number()
58480
+ })) });
58481
+ DeviceType.Switch, DeviceType.Light;
58482
+ object({
58483
+ /** Members whose current value entered the aggregate. */
58484
+ included: number().int().nonnegative().meta(readingMeta("count", {
58485
+ precision: 0,
58486
+ label: "Reporting"
58487
+ })),
58488
+ /** Members left out: offline, unknown, or not a finite reading (D393). */
58489
+ excluded: number().int().nonnegative().meta(readingMeta("count", {
58490
+ precision: 0,
58491
+ label: "Excluded"
58492
+ })),
58493
+ /** `included` + `excluded`. */
58494
+ total: number().int().nonnegative().meta(readingMeta("count", {
58495
+ precision: 0,
58496
+ label: "Members"
58497
+ }))
58498
+ });
58499
+ DeviceType.Sensor, DeviceType.Switch, DeviceType.Light;
58066
58500
  object({
58067
58501
  /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
58068
- position: number().min(0).max(100).nullable(),
58502
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58069
58503
  /** Ms epoch when the slice was last updated (push or poll). */
58070
58504
  lastFetchedAt: number()
58071
58505
  });
@@ -58074,9 +58508,9 @@ object({
58074
58508
  /** Whether the humidifier is currently on. */
58075
58509
  on: boolean(),
58076
58510
  /** Current measured relative humidity (0..100). Null when not reported. */
58077
- currentHumidity: number().min(0).max(100).nullable(),
58511
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
58078
58512
  /** Target relative humidity (0..100). Null when no setpoint surface. */
58079
- targetHumidity: number().min(0).max(100).nullable(),
58513
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
58080
58514
  /** Active mode (`auto` / `normal` / `baby` / vendor). Null when the
58081
58515
  * device has no mode surface. */
58082
58516
  mode: string().nullable(),
@@ -58086,9 +58520,9 @@ object({
58086
58520
  * `idle` / `off`). Null when the device doesn't report it. */
58087
58521
  action: string().nullable(),
58088
58522
  /** HA `min_humidity` attribute. Null → UI uses 0. */
58089
- minHumidity: number().nullable(),
58523
+ minHumidity: number().nullable().meta(readingMeta("humidity")),
58090
58524
  /** HA `max_humidity` attribute. Null → UI uses 100. */
58091
- maxHumidity: number().nullable(),
58525
+ maxHumidity: number().nullable().meta(readingMeta("humidity")),
58092
58526
  /** Ms epoch when the slice was last updated. */
58093
58527
  lastChangedAt: number()
58094
58528
  });
@@ -58112,22 +58546,13 @@ DeviceType.Humidifier, method(object({
58112
58546
  auth: "protected"
58113
58547
  });
58114
58548
  object({
58115
- /** Current relative humidity, 0..100. */
58116
- percent: number().min(0).max(100).meta({
58117
- unit: "%",
58549
+ /** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
58550
+ percent: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
58551
+ precision: 0,
58118
58552
  label: "Humidity"
58119
- }),
58553
+ })),
58120
58554
  /** Ms epoch when the slice was last updated. */
58121
- lastFetchedAt: number(),
58122
- /** Live display unit from the upstream source (e.g. HA
58123
- * `attributes.unit_of_measurement`). The UI prefers this over the
58124
- * role's canonical unit. Absent → fall back to the canonical unit. */
58125
- unit: string().optional(),
58126
- /** Suggested decimal places for numeric display.
58127
- * Populated live from the upstream source when provided (e.g. HA
58128
- * `attributes.suggested_display_precision`). Falls back to
58129
- * auto-formatting when absent. */
58130
- precision: number().int().min(0).max(10).optional()
58555
+ lastFetchedAt: number()
58131
58556
  });
58132
58557
  DeviceType.Sensor, DeviceType.Thermostat;
58133
58558
  object({
@@ -58135,7 +58560,7 @@ object({
58135
58560
  * entity exposes no `entity_picture` (yet). */
58136
58561
  url: string().nullable(),
58137
58562
  /** Ms epoch of the upstream last-updated timestamp. Null at cold-start. */
58138
- lastUpdated: number().nullable()
58563
+ lastUpdated: number().nullable().meta(readingMeta("none"))
58139
58564
  });
58140
58565
  DeviceType.Image;
58141
58566
  /**
@@ -58191,19 +58616,19 @@ var NormalizedRangeSchema = object({
58191
58616
  });
58192
58617
  object({
58193
58618
  /** Normalized 0–100. */
58194
- brightness: number().optional(),
58619
+ brightness: number().optional().meta(readingMeta("none")),
58195
58620
  /** Normalized 0–100. */
58196
- contrast: number().optional(),
58621
+ contrast: number().optional().meta(readingMeta("none")),
58197
58622
  /** Normalized 0–100. */
58198
- saturation: number().optional(),
58623
+ saturation: number().optional().meta(readingMeta("none")),
58199
58624
  /** Normalized 0–100. */
58200
- sharpness: number().optional(),
58625
+ sharpness: number().optional().meta(readingMeta("none")),
58201
58626
  mirror: boolean().optional(),
58202
58627
  flip: boolean().optional(),
58203
58628
  rotate: ImageRotateSchema.optional(),
58204
58629
  whiteBalance: WhiteBalanceModeSchema.optional(),
58205
58630
  /** Manual white-balance warmth, NORMALIZED 0–100. Meaningful only when `whiteBalance === 'manual'`. */
58206
- warmth: number().optional(),
58631
+ warmth: number().optional().meta(readingMeta("none")),
58207
58632
  exposureMode: ExposureModeSchema.optional(),
58208
58633
  backlightMode: BacklightModeSchema.optional(),
58209
58634
  lastFetchedAt: number()
@@ -58448,10 +58873,10 @@ var IntercomAbilitySchema = object({
58448
58873
  /** Codecs accepted by firmware, in preference order. Driver-authored strings. */
58449
58874
  codecs: array(string()),
58450
58875
  /** Sample rate (Hz) the firmware expects. Reolink typical: 16000. */
58451
- sampleRate: number(),
58876
+ sampleRate: number().meta(readingMeta("none")),
58452
58877
  duplex: _enum(["half", "full"]),
58453
58878
  /** Max in-flight audio backlog before drop (ms). Server uses this to bound latency. */
58454
- maxBacklogMs: number()
58879
+ maxBacklogMs: number().meta(readingMeta("duration-ms"))
58455
58880
  });
58456
58881
  var IntercomStatusSchema = object({
58457
58882
  /** True while a talk session is open. */
@@ -58562,13 +58987,13 @@ object({
58562
58987
  activity: LawnMowerActivitySchema,
58563
58988
  /** 0..100 battery percentage. Null when the device has no battery
58564
58989
  * reading. */
58565
- batteryLevel: number().min(0).max(100).nullable(),
58990
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58566
58991
  /** 0..100 mowing-completion percentage of the current task, or null when no
58567
58992
  * task is active / progress is unavailable. */
58568
- progressPercent: number().min(0).max(100).nullable(),
58993
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58569
58994
  /** Current device/event code (dynamic — mostly status, sometimes an error),
58570
58995
  * or null when unknown. */
58571
- currentCode: number().nullable(),
58996
+ currentCode: number().nullable().meta(readingMeta("none")),
58572
58997
  /** Human label for {@link currentCode}, or null when undecodable. */
58573
58998
  currentCodeLabel: string().nullable(),
58574
58999
  /** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
@@ -59030,7 +59455,7 @@ object({
59030
59455
  state: MediaPlayerStateSchema,
59031
59456
  /** Volume as 0..100 inclusive. Null when the device has no volume
59032
59457
  * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
59033
- volumeLevel: number().min(0).max(100).nullable(),
59458
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59034
59459
  /** Mute toggle distinct from volume=0. Null when no mute surface.
59035
59460
  * Pair with `DeviceFeature.MediaPlayerMute`. */
59036
59461
  isMuted: boolean().nullable(),
@@ -59043,10 +59468,10 @@ object({
59043
59468
  currentMedia: MediaInfoSchema.nullable(),
59044
59469
  /** Current playback position in ms. Null when not seekable or
59045
59470
  * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
59046
- positionMs: number().int().nonnegative().nullable(),
59471
+ positionMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
59047
59472
  /** Total duration of the current media in ms. Null when unknown
59048
59473
  * (live stream) or nothing is playing. */
59049
- durationMs: number().int().nonnegative().nullable(),
59474
+ durationMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
59050
59475
  /** Shuffle toggle. Null when no shuffle surface.
59051
59476
  * Pair with `DeviceFeature.MediaPlayerShuffle`. */
59052
59477
  shuffle: boolean().nullable(),
@@ -59346,7 +59771,7 @@ object({
59346
59771
  * it, every provider seeded it at boot, and every session left it
59347
59772
  * `detected: true` after its detach.
59348
59773
  */
59349
- autoClearAfterMs: number().nullable()
59774
+ autoClearAfterMs: number().nullable().meta(readingMeta("duration-ms"))
59350
59775
  });
59351
59776
  /**
59352
59777
  * Payload of `motion.onMotionChanged` event + the corresponding bus
@@ -59396,7 +59821,7 @@ var MotionZoneRegionSchema = object({
59396
59821
  });
59397
59822
  object({
59398
59823
  enabled: boolean(),
59399
- sensitivity: number(),
59824
+ sensitivity: number().meta(readingMeta("none")),
59400
59825
  /** Grid region(s). Today exactly one `grid` shape. */
59401
59826
  regions: array(MotionZoneRegionSchema),
59402
59827
  lastFetchedAt: number()
@@ -59700,7 +60125,7 @@ var NavigationStatusSchema = object({
59700
60125
  following: boolean(),
59701
60126
  flash: boolean(),
59702
60127
  lightMode: NavigationLightModeSchema,
59703
- lightLevel: number().min(40).max(100),
60128
+ lightLevel: number().min(40).max(100).meta(readingMeta("none")),
59704
60129
  /** Ms epoch when the slice was last updated. */
59705
60130
  lastChangedAt: number()
59706
60131
  });
@@ -59746,13 +60171,13 @@ var NetworkLinkStatusSchema = object({
59746
60171
  * one whose reading has not landed must not be drawn at 0 %. Consumers
59747
60172
  * SKIP a null rather than coerce it.
59748
60173
  */
59749
- signalPercent: number().min(0).max(100).nullable(),
60174
+ signalPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59750
60175
  /** Raw received signal strength in dBm, when the firmware reports one. */
59751
- rssiDbm: number().optional(),
60176
+ rssiDbm: number().optional().meta(readingMeta("signal-level")),
59752
60177
  /** Network name of a wireless link, when the firmware reports it. */
59753
60178
  ssid: string().optional(),
59754
60179
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
59755
- lastUpdated: number()
60180
+ lastUpdated: number().meta(readingMeta("none"))
59756
60181
  });
59757
60182
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
59758
60183
  deviceId: number(),
@@ -60071,7 +60496,7 @@ object({
60071
60496
  lastError: string().nullable(),
60072
60497
  /** Number of deliveries currently buffered server-side (rate-limited
60073
60498
  * notifiers may queue). 0 when the provider sends synchronously. */
60074
- queueDepth: number().int().nonnegative(),
60499
+ queueDepth: number().int().nonnegative().meta(readingMeta("count")),
60075
60500
  /** Per-feature capability matrix — authoritative source for the
60076
60501
  * compose-form field gating. */
60077
60502
  supports: NotifierSupportsSchema
@@ -60121,15 +60546,8 @@ DeviceType.Notifier, method(NotifierSendInputSchema, NotifierSendResultSchema, {
60121
60546
  acceptedAt: number()
60122
60547
  });
60123
60548
  object({
60124
- value: number(),
60125
- /** Display unit-of-measurement (e.g. 'dBm', 's', 'rpm', 'steps').
60126
- * Populated live from the upstream source on each state push.
60127
- * Absent for unitless sensors. */
60128
- unit: string().optional(),
60129
- /** Suggested decimal places for numeric display.
60130
- * Populated live from the upstream source when provided.
60131
- * Falls back to auto-formatting when absent. */
60132
- precision: number().int().min(0).max(10).optional(),
60549
+ /** Reading in the device quantity's base unit. `null` when refused (D393). */
60550
+ value: number().nullable().meta(readingMeta("device")),
60133
60551
  /** Ms epoch when the slice was last updated. */
60134
60552
  lastFetchedAt: number()
60135
60553
  });
@@ -60419,23 +60837,26 @@ object({
60419
60837
  /** Food currently in the bowl (grams). Null when the device has not
60420
60838
  * reported a reading yet. On dual-hopper models this is the combined
60421
60839
  * bowl reading; per-hopper levels live in `food1`/`food2`. */
60422
- foodLevel: number().nullable(),
60840
+ foodLevel: number().nullable().meta(readingMeta("none")),
60423
60841
  /** Hopper-1 food level (grams) on dual-hopper feeders; null on
60424
60842
  * single-hopper models. */
60425
- food1: number().nullable(),
60843
+ food1: number().nullable().meta(readingMeta("none")),
60426
60844
  /** Hopper-2 food level (grams) on dual-hopper feeders; null on
60427
60845
  * single-hopper models. */
60428
- food2: number().nullable(),
60846
+ food2: number().nullable().meta(readingMeta("none")),
60429
60847
  /** Derived low-food flag — mirrors the HA `food_level` binary_sensor
60430
60848
  * (`device_class: problem`, on = low). True when the bowl is empty /
60431
60849
  * below the feeder's low threshold. */
60432
60850
  lowFood: boolean(),
60433
60851
  /** Battery charge 0..100 (%). Null on mains-powered models or when the
60434
60852
  * device has no battery reading. */
60435
- batteryPower: number().min(0).max(100).nullable(),
60436
- /** Days of desiccant life remaining. Null when the model has no
60437
- * desiccant sensor. */
60438
- desiccantLeftDays: number().nullable(),
60853
+ batteryPower: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60854
+ /**
60855
+ * Desiccant life remaining, stored in seconds (duration base, D944).
60856
+ * Providers convert from the days the feeder reports. Null when the
60857
+ * model has no desiccant sensor.
60858
+ */
60859
+ desiccantLeftDays: number().nullable().meta(readingMeta("duration")),
60439
60860
  /** True while a feed is in progress. */
60440
60861
  feeding: boolean(),
60441
60862
  /** Decoded connectivity / power status (HA petkit device-status enum).
@@ -60446,7 +60867,7 @@ object({
60446
60867
  * with `errorCode` for consumers that want the raw integer. */
60447
60868
  error: string().nullable(),
60448
60869
  /** Raw device error code (0 / null = no error). */
60449
- errorCode: number().nullable(),
60870
+ errorCode: number().nullable().meta(readingMeta("none")),
60450
60871
  /** True for D4S/D4SH dual-hopper hardware — gates the per-hopper UI. */
60451
60872
  isDualHopper: boolean(),
60452
60873
  /** Child-lock (manual-lock) setting — buttons on the unit are disabled. */
@@ -60456,7 +60877,7 @@ object({
60456
60877
  /** Play a chime when dispensing. */
60457
60878
  feedSound: boolean(),
60458
60879
  /** Speaker / prompt volume level (device-scaled integer). */
60459
- volume: number(),
60880
+ volume: number().meta(readingMeta("none")),
60460
60881
  /** Ms epoch when the slice was last refreshed from the cloud. */
60461
60882
  lastFetchedAt: number()
60462
60883
  });
@@ -60893,38 +61314,21 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
60893
61314
  });
60894
61315
  object({
60895
61316
  /** Instantaneous power draw in watts. */
60896
- watts: number().optional().meta({
60897
- unit: "W",
60898
- label: "Power"
60899
- }),
61317
+ watts: number().optional().meta(readingMeta("power", { label: "Power" })),
60900
61318
  /** Cumulative energy in kilowatt-hours since the meter was reset. */
60901
- kwhTotal: number().optional().meta({
60902
- unit: "kWh",
60903
- label: "Energy"
60904
- }),
61319
+ kwhTotal: number().optional().meta(readingMeta("energy", { label: "Energy" })),
60905
61320
  /** Voltage in volts. */
60906
- volts: number().optional(),
61321
+ volts: number().optional().meta(readingMeta("voltage")),
60907
61322
  /** Current in amperes. */
60908
- amps: number().optional(),
60909
- /** Apparent power in volt-amperes (W × power-factor reciprocal). */
60910
- va: number().optional(),
61323
+ amps: number().optional().meta(readingMeta("current")),
61324
+ /** Apparent power in volt-amperes. */
61325
+ va: number().optional().meta(readingMeta("apparent-power")),
60911
61326
  /** Power factor (0..1) if reported. */
60912
- powerFactor: number().min(0).max(1).optional(),
61327
+ powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
60913
61328
  /** Ms epoch when the slice was last updated. */
60914
- lastFetchedAt: number(),
60915
- /** Live display unit of the single metric this slice carries (e.g. HA
60916
- * `attributes.unit_of_measurement` → 'V' / 'A' / 'W' / 'kW' / 'kWh').
60917
- * Each upstream `sensor.*` entity surfaces ONE device_class, so one
60918
- * unit per slice is unambiguous. The UI prefers this over the role's
60919
- * canonical unit so a 'kW' / 'Wh' feed renders verbatim. */
60920
- unit: string().optional(),
60921
- /** Suggested decimal places for numeric display.
60922
- * Populated live from the upstream source when provided (e.g. HA
60923
- * `attributes.suggested_display_precision`). Falls back to
60924
- * auto-formatting when absent. */
60925
- precision: number().int().min(0).max(10).optional()
61329
+ lastFetchedAt: number()
60926
61330
  });
60927
- DeviceType.Sensor;
61331
+ DeviceType.Sensor, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
60928
61332
  /**
60929
61333
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
60930
61334
  * on `DeviceType.Presence`. Read-only — no setters: presence is
@@ -60943,11 +61347,11 @@ DeviceType.Sensor;
60943
61347
  */
60944
61348
  var GpsLocationSchema = object({
60945
61349
  /** Latitude in decimal degrees, -90..90. */
60946
- latitude: number().min(-90).max(90),
61350
+ latitude: number().min(-90).max(90).meta(readingMeta("angle")),
60947
61351
  /** Longitude in decimal degrees, -180..180. */
60948
- longitude: number().min(-180).max(180),
61352
+ longitude: number().min(-180).max(180).meta(readingMeta("angle")),
60949
61353
  /** Reported accuracy in meters (lower = better). */
60950
- accuracyMeters: number().nonnegative()
61354
+ accuracyMeters: number().nonnegative().meta(readingMeta("length"))
60951
61355
  });
60952
61356
  object({
60953
61357
  /** `home` / `not_home` / any user-defined zone name. */
@@ -60959,25 +61363,16 @@ object({
60959
61363
  gps: GpsLocationSchema.nullable(),
60960
61364
  /** Optional battery level of the tracking device (0..100). Null
60961
61365
  * when not reported. */
60962
- batteryPercent: number().min(0).max(100).nullable(),
61366
+ batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60963
61367
  /** Ms epoch when the slice was last updated. */
60964
61368
  lastChangedAt: number()
60965
61369
  });
60966
61370
  DeviceType.Presence;
60967
61371
  object({
60968
- /** Current pressure in hPa. */
60969
- hpa: number(),
61372
+ /** Current pressure in hPa. `null` when the sample was refused (D393). */
61373
+ hpa: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
60970
61374
  /** Ms epoch when the slice was last updated. */
60971
- lastFetchedAt: number(),
60972
- /** Live display unit from the upstream source (e.g. HA
60973
- * `attributes.unit_of_measurement`). The UI prefers this over the
60974
- * role's canonical unit. Absent → fall back to the canonical unit. */
60975
- unit: string().optional(),
60976
- /** Suggested decimal places for numeric display.
60977
- * Populated live from the upstream source when provided (e.g. HA
60978
- * `attributes.suggested_display_precision`). Falls back to
60979
- * auto-formatting when absent. */
60980
- precision: number().int().min(0).max(10).optional()
61375
+ lastFetchedAt: number()
60981
61376
  });
60982
61377
  DeviceType.Sensor;
60983
61378
  /**
@@ -61310,8 +61705,8 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
61310
61705
  }), _void(), { kind: "mutation" });
61311
61706
  var PtzAutotrackSettingsSchema = object({
61312
61707
  targetType: string().describe("Vendor target string (people/vehicle/pet); empty = camera default"),
61313
- stopDelaySeconds: number().int().min(0).max(300),
61314
- disappearDelaySeconds: number().int().min(0).max(300)
61708
+ stopDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration")),
61709
+ disappearDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration"))
61315
61710
  });
61316
61711
  /**
61317
61712
  * One option the camera advertises as a valid `targetType`. Drivers
@@ -61368,7 +61763,7 @@ object({
61368
61763
  /** null = unknown — never coerced to false (D393). */
61369
61764
  running: boolean().nullable(),
61370
61765
  /** Epoch ms the current boolean began; null while `running` is null. */
61371
- since: number().nullable(),
61766
+ since: number().nullable().meta(readingMeta("none")),
61372
61767
  source: RunningStateSourceSchema.meta({ label: "Source" }),
61373
61768
  phase: string().nullable(),
61374
61769
  /** null until a reading has been published (D393). */
@@ -61380,7 +61775,7 @@ object({
61380
61775
  phase: string().nullable()
61381
61776
  });
61382
61777
  Object.values(DeviceType);
61383
- DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
61778
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
61384
61779
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
61385
61780
  kind: "mutation",
61386
61781
  auth: "admin"
@@ -62566,9 +62961,9 @@ var RecordTriggerSchema = _enum([
62566
62961
  */
62567
62962
  var RecordWindowSchema = object({
62568
62963
  trigger: RecordTriggerSchema,
62569
- day: number().int().min(0).max(6),
62570
- startMinute: number().int().min(0).max(1439),
62571
- endMinute: number().int().min(1).max(1440)
62964
+ day: number().int().min(0).max(6).meta(readingMeta("none")),
62965
+ startMinute: number().int().min(0).max(1439).meta(readingMeta("none")),
62966
+ endMinute: number().int().min(1).max(1440).meta(readingMeta("none"))
62572
62967
  });
62573
62968
  /** Status of one physical volume, as the camera itself describes it. */
62574
62969
  var OnboardStorageVolumeSchema = object({
@@ -62637,10 +63032,10 @@ object({
62637
63032
  /** Master "record to the card at all" switch. */
62638
63033
  enabled: boolean().nullable(),
62639
63034
  overwriteWhenFull: boolean().nullable(),
62640
- preRecordSec: number().nullable(),
62641
- postRecordSec: number().nullable(),
63035
+ preRecordSec: number().nullable().meta(readingMeta("duration")),
63036
+ postRecordSec: number().nullable().meta(readingMeta("duration")),
62642
63037
  /** Length of one recorded file, in minutes. */
62643
- segmentMinutes: number().nullable(),
63038
+ segmentMinutes: number().nullable().meta(readingMeta("none")),
62644
63039
  /** The primary track's weekly windows, flattened. */
62645
63040
  windows: array(RecordWindowSchema),
62646
63041
  /**
@@ -62656,7 +63051,7 @@ object({
62656
63051
  * provider reporting a non-zero count also reports the schedule as not
62657
63052
  * writable.
62658
63053
  */
62659
- unreadableWindows: number(),
63054
+ unreadableWindows: number().meta(readingMeta("count")),
62660
63055
  /**
62661
63056
  * The camera is scheduled to record and has NO usable storage.
62662
63057
  *
@@ -63293,7 +63688,7 @@ var CamStreamDescriptorSchema = object({
63293
63688
  url: string().optional(),
63294
63689
  codec: string().optional(),
63295
63690
  resolution: CamStreamResolutionSchema.optional(),
63296
- fps: number().positive().optional(),
63691
+ fps: number().positive().optional().meta(readingMeta("rate")),
63297
63692
  label: string().optional(),
63298
63693
  /** Device-level features (e.g. `battery-operated`) — drives broker policy. */
63299
63694
  deviceFeatures: array(string()).optional(),
@@ -63323,18 +63718,18 @@ var StreamProfileSchema = _enum([
63323
63718
  ]);
63324
63719
  /** The current encoding config of one stream profile. */
63325
63720
  var StreamProfileConfigSchema = object({
63326
- width: number(),
63327
- height: number(),
63721
+ width: number().meta(readingMeta("none")),
63722
+ height: number().meta(readingMeta("none")),
63328
63723
  codec: _enum(["h264", "h265"]),
63329
- framerate: number(),
63330
- bitrate: number(),
63724
+ framerate: number().meta(readingMeta("rate")),
63725
+ bitrate: number().meta(readingMeta("bitrate")),
63331
63726
  bitrateMode: _enum(["vbr", "cbr"]).optional(),
63332
63727
  encoderProfile: _enum([
63333
63728
  "high",
63334
63729
  "main",
63335
63730
  "baseline"
63336
63731
  ]).optional(),
63337
- gop: number().optional(),
63732
+ gop: number().optional().meta(readingMeta("none")),
63338
63733
  /**
63339
63734
  * Whether THIS profile currently carries an audio track. READ-ONLY here.
63340
63735
  *
@@ -63984,23 +64379,13 @@ object({
63984
64379
  });
63985
64380
  DeviceType.Sensor;
63986
64381
  object({
63987
- /** Current temperature in Celsius. */
63988
- celsius: number().meta({
63989
- unit: "°C",
64382
+ /** Current temperature in Celsius. `null` when the sample was refused (D393). */
64383
+ celsius: number().nullable().meta(readingMeta("temperature", {
64384
+ precision: 1,
63990
64385
  label: "Temperature"
63991
- }),
64386
+ })),
63992
64387
  /** Ms epoch when the slice was last updated (push or poll). */
63993
- lastFetchedAt: number(),
63994
- /** Live display unit from the upstream source (e.g. HA
63995
- * `attributes.unit_of_measurement`). The UI prefers this over the
63996
- * role's canonical unit, so a Fahrenheit feed renders '°F' not '°C'.
63997
- * Absent → the UI falls back to the role's canonical unit. */
63998
- unit: string().optional(),
63999
- /** Suggested decimal places for numeric display.
64000
- * Populated live from the upstream source when provided (e.g. HA
64001
- * `attributes.suggested_display_precision`). Falls back to
64002
- * auto-formatting when absent. */
64003
- precision: number().int().min(0).max(10).optional()
64388
+ lastFetchedAt: number()
64004
64389
  });
64005
64390
  DeviceType.Sensor, DeviceType.Thermostat;
64006
64391
  /**
@@ -64252,16 +64637,16 @@ object({
64252
64637
  ]),
64253
64638
  /** 0..100 battery percentage. Null when the device has no battery
64254
64639
  * reading. */
64255
- batteryLevel: number().min(0).max(100).nullable(),
64640
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64256
64641
  /** Current fan-speed token (provider-verbatim). Null when unknown or
64257
64642
  * the vacuum has no speed control. */
64258
64643
  fanSpeed: string().nullable(),
64259
64644
  /** Speed tokens the hardware accepts — drives the UI selector. */
64260
64645
  availableFanSpeeds: array(string()),
64261
64646
  /** 0..100 cleaning-completion percentage of the current task, or null. */
64262
- progressPercent: number().min(0).max(100).nullable(),
64647
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64263
64648
  /** Current error code (0 / null = no error). */
64264
- errorCode: number().nullable(),
64649
+ errorCode: number().nullable().meta(readingMeta("none")),
64265
64650
  /** Human label for {@link errorCode}, or null when none / undecodable. */
64266
64651
  errorLabel: string().nullable(),
64267
64652
  /** Ms epoch when the slice was last updated. */
@@ -64300,7 +64685,7 @@ object({
64300
64685
  ]),
64301
64686
  /** 0 = fully closed, 100 = fully open. Null when the device has no
64302
64687
  * intermediate position surface. */
64303
- position: number().min(0).max(100).nullable(),
64688
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64304
64689
  /** Ms epoch when the slice was last updated. */
64305
64690
  lastChangedAt: number()
64306
64691
  });
@@ -64328,9 +64713,9 @@ object({
64328
64713
  DeviceType.Sensor;
64329
64714
  object({
64330
64715
  /** Current measured temperature. Null when not reported. */
64331
- currentTemp: number().nullable(),
64716
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
64332
64717
  /** Target temperature setpoint. Null when no setpoint surface. */
64333
- targetTemp: number().nullable(),
64718
+ targetTemp: number().nullable().meta(readingMeta("temperature")),
64334
64719
  /** Active operation mode = HA `state` (`eco` / `electric` / `gas` /
64335
64720
  * `heat_pump` / `high_demand` / `performance` / `off`). Null when the
64336
64721
  * device reports an unknown state. */
@@ -64341,9 +64726,9 @@ object({
64341
64726
  * has no away surface. */
64342
64727
  away: boolean().nullable(),
64343
64728
  /** HA `min_temp` attribute. Null when not reported. */
64344
- minTemp: number().nullable(),
64729
+ minTemp: number().nullable().meta(readingMeta("temperature")),
64345
64730
  /** HA `max_temp` attribute. Null when not reported. */
64346
- maxTemp: number().nullable(),
64731
+ maxTemp: number().nullable().meta(readingMeta("temperature")),
64347
64732
  /** Ms epoch when the slice was last updated. */
64348
64733
  lastChangedAt: number()
64349
64734
  });
@@ -64367,25 +64752,18 @@ DeviceType.WaterHeater, method(object({
64367
64752
  auth: "protected"
64368
64753
  });
64369
64754
  object({
64370
- /** Verbatim HA condition state (`sunny`, `cloudy`, `rainy`, …). Null
64371
- * when no condition has been reported yet. */
64755
+ /** Verbatim condition state (`sunny`, `cloudy`, `rainy`, …). Null when none yet. */
64372
64756
  condition: string().nullable(),
64373
- /** Current temperature in the reported unit. Null when not provided. */
64374
- temperature: number().nullable(),
64375
- /** Temperature unit string (e.g. `°C` / `°F`). Null when not provided. */
64376
- temperatureUnit: string().nullable(),
64757
+ /** Current temperature in Celsius. Null when not provided or refused. */
64758
+ temperature: number().nullable().meta(readingMeta("temperature", { precision: 1 })),
64377
64759
  /** Relative humidity (0..100). Null when not provided. */
64378
- humidity: number().min(0).max(100).nullable(),
64379
- /** Barometric pressure in the reported unit. Null when not provided. */
64380
- pressure: number().nullable(),
64381
- /** Pressure unit string (e.g. `hPa` / `inHg`). Null when not provided. */
64382
- pressureUnit: string().nullable(),
64383
- /** Wind speed in the reported unit. Null when not provided. */
64384
- windSpeed: number().nullable(),
64385
- /** Wind-speed unit string (e.g. `km/h` / `mph`). Null when not provided. */
64386
- windSpeedUnit: string().nullable(),
64760
+ humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
64761
+ /** Barometric pressure in hPa. Null when not provided or refused. */
64762
+ pressure: number().nullable().meta(readingMeta("pressure")),
64763
+ /** Wind speed in metres per second. Null when not provided or refused. */
64764
+ windSpeed: number().nullable().meta(readingMeta("speed")),
64387
64765
  /** Wind bearing in degrees (0..360, meteorological). Null when not provided. */
64388
- windBearing: number().nullable(),
64766
+ windBearing: number().nullable().meta(readingMeta("angle")),
64389
64767
  /** Ms epoch when the slice was last updated. */
64390
64768
  lastFetchedAt: number()
64391
64769
  });
@@ -65136,7 +65514,7 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
65136
65514
  auth: "admin"
65137
65515
  });
65138
65516
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
65139
- 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;
65517
+ 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.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
65140
65518
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
65141
65519
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
65142
65520
  new Set(CAP_NAMES);
@@ -65189,7 +65567,7 @@ var AccessoryKind = {
65189
65567
  PrivacyMask: DeviceRole.PrivacyMask
65190
65568
  };
65191
65569
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
65192
- 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;
65570
+ 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;
65193
65571
  new Set(Object.values(DeviceType));
65194
65572
  Object.freeze({
65195
65573
  "accessories.getStatus": {
@@ -65297,6 +65675,13 @@ Object.freeze({
65297
65675
  access: "view",
65298
65676
  role: "admin"
65299
65677
  },
65678
+ "addons.getPackageDocs": {
65679
+ capName: "addons",
65680
+ capScope: "system",
65681
+ addonId: null,
65682
+ access: "view",
65683
+ role: "admin"
65684
+ },
65300
65685
  "addons.getVersions": {
65301
65686
  capName: "addons",
65302
65687
  capScope: "system",
@@ -68405,6 +68790,20 @@ Object.freeze({
68405
68790
  access: "view",
68406
68791
  role: "viewer"
68407
68792
  },
68793
+ "groupCommands.getStatus": {
68794
+ capName: "group-commands",
68795
+ capScope: "device",
68796
+ addonId: null,
68797
+ access: "view",
68798
+ role: "viewer"
68799
+ },
68800
+ "groupStatus.getStatus": {
68801
+ capName: "group-status",
68802
+ capScope: "device",
68803
+ addonId: null,
68804
+ access: "view",
68805
+ role: "viewer"
68806
+ },
68408
68807
  "heatingValve.getStatus": {
68409
68808
  capName: "heating-valve",
68410
68809
  capScope: "device",
@@ -77455,7 +77854,39 @@ var APPLIANCE_CAP_VOCABULARY = {
77455
77854
  phrase: t("When {device} finishes", "Quando {device} finisce"),
77456
77855
  icon: "square"
77457
77856
  }
77458
- }
77857
+ },
77858
+ overrides: { byType: {
77859
+ [DeviceType.Washer]: {
77860
+ state: { running: {
77861
+ whenTrue: t("When the washing machine starts", "Quando la lavatrice inizia"),
77862
+ whenFalse: t("When the washing machine has finished", "Quando la lavatrice ha finito")
77863
+ } },
77864
+ events: {
77865
+ onStarted: { phrase: t("When the washing machine starts", "Quando la lavatrice inizia") },
77866
+ onFinished: { phrase: t("When the washing machine has finished", "Quando la lavatrice ha finito") }
77867
+ }
77868
+ },
77869
+ [DeviceType.Dryer]: {
77870
+ state: { running: {
77871
+ whenTrue: t("When the dryer starts", "Quando l'asciugatrice inizia"),
77872
+ whenFalse: t("When the dryer has finished", "Quando l'asciugatrice ha finito")
77873
+ } },
77874
+ events: {
77875
+ onStarted: { phrase: t("When the dryer starts", "Quando l'asciugatrice inizia") },
77876
+ onFinished: { phrase: t("When the dryer has finished", "Quando l'asciugatrice ha finito") }
77877
+ }
77878
+ },
77879
+ [DeviceType.Dishwasher]: {
77880
+ state: { running: {
77881
+ whenTrue: t("When the dishwasher starts", "Quando la lavastoviglie inizia"),
77882
+ whenFalse: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito")
77883
+ } },
77884
+ events: {
77885
+ onStarted: { phrase: t("When the dishwasher starts", "Quando la lavastoviglie inizia") },
77886
+ onFinished: { phrase: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito") }
77887
+ }
77888
+ }
77889
+ } }
77459
77890
  },
77460
77891
  update: {
77461
77892
  scope: "device",
@@ -78227,6 +78658,37 @@ var SENSOR_CAP_VOCABULARY = {
78227
78658
  icon: "flame"
78228
78659
  }]
78229
78660
  },
78661
+ "group-commands": {
78662
+ scope: "device",
78663
+ noun: t("Group command", "Comando di gruppo")
78664
+ },
78665
+ "group-status": {
78666
+ scope: "device",
78667
+ noun: t("Group", "Gruppo"),
78668
+ state: [
78669
+ {
78670
+ kind: "numeric",
78671
+ field: "included",
78672
+ quantity: t("the members reporting", "i membri che rispondono"),
78673
+ label: t("Reporting", "Rispondono"),
78674
+ icon: "users"
78675
+ },
78676
+ {
78677
+ kind: "numeric",
78678
+ field: "excluded",
78679
+ quantity: t("the members left out", "i membri esclusi"),
78680
+ label: t("Excluded", "Esclusi"),
78681
+ icon: "users"
78682
+ },
78683
+ {
78684
+ kind: "numeric",
78685
+ field: "total",
78686
+ quantity: t("the member count", "il numero di membri"),
78687
+ label: t("Members", "Membri"),
78688
+ icon: "sigma"
78689
+ }
78690
+ ]
78691
+ },
78230
78692
  "humidity-sensor": {
78231
78693
  scope: "device",
78232
78694
  noun: t("Humidity", "Umidità"),
@@ -78260,7 +78722,6 @@ var SENSOR_CAP_VOCABULARY = {
78260
78722
  field: "value",
78261
78723
  quantity: t("the reading", "il valore"),
78262
78724
  label: t("Reading", "Valore"),
78263
- unitField: "unit",
78264
78725
  icon: "gauge"
78265
78726
  }]
78266
78727
  },
@@ -78396,7 +78857,7 @@ var SENSOR_CAP_VOCABULARY = {
78396
78857
  field: "temperature",
78397
78858
  quantity: t("the outdoor temperature", "la temperatura esterna"),
78398
78859
  label: t("Temperature", "Temperatura"),
78399
- unitField: "temperatureUnit",
78860
+ unit: "°C",
78400
78861
  icon: "thermometer"
78401
78862
  },
78402
78863
  {
@@ -78412,7 +78873,7 @@ var SENSOR_CAP_VOCABULARY = {
78412
78873
  field: "windSpeed",
78413
78874
  quantity: t("the wind speed", "la velocità del vento"),
78414
78875
  label: t("Wind", "Vento"),
78415
- unitField: "windSpeedUnit",
78876
+ unit: "m/s",
78416
78877
  icon: "wind"
78417
78878
  },
78418
78879
  {
@@ -78420,7 +78881,7 @@ var SENSOR_CAP_VOCABULARY = {
78420
78881
  field: "pressure",
78421
78882
  quantity: t("the air pressure", "la pressione atmosferica"),
78422
78883
  label: t("Pressure", "Pressione"),
78423
- unitField: "pressureUnit",
78884
+ unit: "hPa",
78424
78885
  icon: "gauge"
78425
78886
  }
78426
78887
  ]
@@ -78725,8 +79186,72 @@ function projectAction(cap, action) {
78725
79186
  };
78726
79187
  }
78727
79188
  Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
78728
- 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;
79189
+ 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;
78729
79190
  DeviceFeature.BatteryOperated;
79191
+ /**
79192
+ * How a washer, dryer or dishwasher leaves CamStack.
79193
+ *
79194
+ * Home Assistant has no laundry domain: the device is offered, and what
79195
+ * travels is its power reading. The others have a laundry type that this
79196
+ * export cannot honour yet, so they are named and withheld.
79197
+ */
79198
+ var PLUG_APPLIANCE_TYPES = [
79199
+ DeviceType.Washer,
79200
+ DeviceType.Dryer,
79201
+ DeviceType.Dishwasher
79202
+ ];
79203
+ 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.";
79204
+ 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.";
79205
+ var ALEXA_REASON = "Alexa has no laundry category in this export, and neither power nor running has an Alexa interface.";
79206
+ var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A power threshold is not that trait, and this export does not publish RunCycle.";
79207
+ 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.";
79208
+ function withheld(reason) {
79209
+ return {
79210
+ [DeviceType.Washer]: {
79211
+ exported: false,
79212
+ reason
79213
+ },
79214
+ [DeviceType.Dryer]: {
79215
+ exported: false,
79216
+ reason
79217
+ },
79218
+ [DeviceType.Dishwasher]: {
79219
+ exported: false,
79220
+ reason
79221
+ }
79222
+ };
79223
+ }
79224
+ function offered(received) {
79225
+ return {
79226
+ [DeviceType.Washer]: {
79227
+ exported: true,
79228
+ as: received
79229
+ },
79230
+ [DeviceType.Dryer]: {
79231
+ exported: true,
79232
+ as: received
79233
+ },
79234
+ [DeviceType.Dishwasher]: {
79235
+ exported: true,
79236
+ as: received
79237
+ }
79238
+ };
79239
+ }
79240
+ var APPLIANCE_EXPORT = {
79241
+ ha: offered(HA_AS),
79242
+ homekit: withheld(HOMEKIT_REASON),
79243
+ alexa: withheld(ALEXA_REASON),
79244
+ google: withheld(GOOGLE_REASON),
79245
+ matter: withheld(MATTER_REASON)
79246
+ };
79247
+ function isPlugApplianceType(deviceType) {
79248
+ return PLUG_APPLIANCE_TYPES.some((type) => type === deviceType);
79249
+ }
79250
+ /** The decision for this ecosystem, or null when the type is not an appliance. */
79251
+ function applianceExport(ecosystem, deviceType) {
79252
+ if (!isPlugApplianceType(deviceType)) return null;
79253
+ return APPLIANCE_EXPORT[ecosystem][deviceType];
79254
+ }
78730
79255
  Object.freeze({
78731
79256
  "accessories.getStatus": [{
78732
79257
  name: "deviceId",
@@ -79693,6 +80218,16 @@ Object.freeze({
79693
80218
  form: "single",
79694
80219
  optional: false
79695
80220
  }],
80221
+ "groupCommands.getStatus": [{
80222
+ name: "deviceId",
80223
+ form: "single",
80224
+ optional: false
80225
+ }],
80226
+ "groupStatus.getStatus": [{
80227
+ name: "deviceId",
80228
+ form: "single",
80229
+ optional: false
80230
+ }],
79696
80231
  "heatingValve.getStatus": [{
79697
80232
  name: "deviceId",
79698
80233
  form: "single",
@@ -81677,6 +82212,8 @@ new Map(Object.entries({
81677
82212
  "detection-blind": "device-events",
81678
82213
  "motion-noisy": "device-events",
81679
82214
  "motion-calm": "device-events",
82215
+ "package-llm-silent": "device-events",
82216
+ "package-llm-answered": "device-events",
81680
82217
  "recording-stalled": "device-events",
81681
82218
  "recording-healthy": "device-events",
81682
82219
  "recording-degraded": "device-events",
@@ -81760,6 +82297,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
81760
82297
  label: "Motion without a subject",
81761
82298
  kinds: ["motion-noisy", "motion-calm"]
81762
82299
  },
82300
+ {
82301
+ id: "package-llm",
82302
+ family: "device-events",
82303
+ label: "Package confirm",
82304
+ kinds: ["package-llm-silent", "package-llm-answered"]
82305
+ },
81763
82306
  {
81764
82307
  id: "recording",
81765
82308
  family: "device-events",
@@ -81941,6 +82484,8 @@ var DEVICE_EVENTS = [
81941
82484
  "detection-blind",
81942
82485
  "motion-noisy",
81943
82486
  "motion-calm",
82487
+ "package-llm-silent",
82488
+ "package-llm-answered",
81944
82489
  "recording-stalled",
81945
82490
  "recording-healthy",
81946
82491
  "recording-degraded",
@@ -82209,6 +82754,15 @@ new Map([
82209
82754
  snapshotLabel: "Cameras with constant motion now",
82210
82755
  snapshotSection: null
82211
82756
  },
82757
+ {
82758
+ id: "package-llm-confirm",
82759
+ family: "device-events",
82760
+ label: "Package confirm (not answering / answering again)",
82761
+ bad: ["package-llm-silent"],
82762
+ recovery: ["package-llm-answered"],
82763
+ snapshotLabel: "Cameras whose package confirm is not answering",
82764
+ snapshotSection: null
82765
+ },
82212
82766
  {
82213
82767
  id: "recording-health",
82214
82768
  family: "device-events",
@@ -83066,8 +83620,9 @@ function traitForCommand(capNames, command) {
83066
83620
  * (`SUPPORTED_DEVICE_KINDS` in `ha-export.addon.ts`) and it is what kept the
83067
83621
  * previous exporter confined to cameras. `DeviceType` is consulted for exactly
83068
83622
  * one thing here — picking between two Google types that carry the SAME traits
83069
- * (a LIGHT and a SWITCH are both OnOff) — and never to decide whether a device
83070
- * exports at all.
83623
+ * (a LIGHT and a SWITCH are both OnOff). A washer, dryer or dishwasher is
83624
+ * withheld even when some other trait would match: Google's laundry types
83625
+ * require RunCycle, and this export does not publish that trait.
83071
83626
  */
83072
83627
  var MANUFACTURER = "CamStack";
83073
83628
  /**
@@ -83083,6 +83638,8 @@ var MANUFACTURER = "CamStack";
83083
83638
  * A SECURITYSYSTEM would promise `ArmDisarm`, which nothing here answers.
83084
83639
  */
83085
83640
  function resolveGoogleDeviceType(deviceType, traits) {
83641
+ const withheld = applianceExport("google", deviceType);
83642
+ if (withheld !== null && !withheld.exported) return null;
83086
83643
  if (traits.includes("action.devices.traits.LockUnlock")) return "action.devices.types.LOCK";
83087
83644
  if (traits.includes("action.devices.traits.OpenClose")) return "action.devices.types.SHUTTER";
83088
83645
  if (!traits.includes("action.devices.traits.OnOff") && !traits.includes("action.devices.traits.Brightness")) return null;