@camstack/addon-export-hap 1.2.180 → 1.2.181

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.
@@ -5484,7 +5484,7 @@ var ZodIssueCode = {
5484
5484
  var ZodFirstPartyTypeKind;
5485
5485
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5486
5486
  //#endregion
5487
- //#region ../types/dist/sleep-BErAxhul.mjs
5487
+ //#region ../types/dist/sleep-CARd6wZF.mjs
5488
5488
  /**
5489
5489
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5490
5490
  * window to float samples (D455).
@@ -7971,6 +7971,52 @@ var RecordKindDeclarationSchema = object({
7971
7971
  }).strict();
7972
7972
  /** The kind names: lower-case, dash separated, short enough for an index name. */
7973
7973
  var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
7974
+ var READING_QUANTITIES = [
7975
+ "temperature",
7976
+ "pressure",
7977
+ "speed",
7978
+ "precipitation",
7979
+ "precipitation-rate",
7980
+ "length",
7981
+ "area",
7982
+ "illuminance",
7983
+ "irradiance",
7984
+ "power",
7985
+ "energy",
7986
+ "voltage",
7987
+ "current",
7988
+ "apparent-power",
7989
+ "humidity",
7990
+ "percentage",
7991
+ "concentration-volume",
7992
+ "concentration-mass",
7993
+ "concentration-ppb",
7994
+ "volume",
7995
+ "duration",
7996
+ "duration-ms",
7997
+ "information",
7998
+ "sound-level",
7999
+ "signal-level",
8000
+ "colour-temperature",
8001
+ "angle",
8002
+ "bitrate",
8003
+ "rate",
8004
+ "mass",
8005
+ "index",
8006
+ "ratio",
8007
+ "count",
8008
+ "none",
8009
+ "device"
8010
+ ];
8011
+ var ReadingQuantitySchema = _enum(READING_QUANTITIES);
8012
+ new Set(READING_QUANTITIES);
8013
+ function readingMeta(quantity, extras) {
8014
+ return {
8015
+ quantity,
8016
+ ...extras?.precision !== void 0 ? { precision: extras.precision } : {},
8017
+ ...extras?.label !== void 0 ? { label: extras.label } : {}
8018
+ };
8019
+ }
7974
8020
  /** Shared Zod schemas used across streaming capabilities. */
7975
8021
  var CamProfileSchema = _enum([
7976
8022
  "high",
@@ -7998,8 +8044,8 @@ var CamStreamKindSchema = _enum([
7998
8044
  "derived"
7999
8045
  ]);
8000
8046
  var CamStreamResolutionSchema = object({
8001
- width: number().int().positive(),
8002
- height: number().int().positive()
8047
+ width: number().int().positive().meta(readingMeta("none")),
8048
+ height: number().int().positive().meta(readingMeta("none"))
8003
8049
  });
8004
8050
  var CameraStreamSchema = object({
8005
8051
  /** Stable, provider-assigned id unique within the (deviceId) scope. */
@@ -8701,14 +8747,6 @@ Object.freeze({
8701
8747
  {
8702
8748
  "path": "aqi",
8703
8749
  "valueType": "number"
8704
- },
8705
- {
8706
- "path": "unit",
8707
- "valueType": "string"
8708
- },
8709
- {
8710
- "path": "precision",
8711
- "valueType": "number"
8712
8750
  }
8713
8751
  ],
8714
8752
  "alarm-panel": [
@@ -8744,20 +8782,10 @@ Object.freeze({
8744
8782
  "valueType": "boolean"
8745
8783
  }
8746
8784
  ],
8747
- "ambient-light-sensor": [
8748
- {
8749
- "path": "lux",
8750
- "valueType": "number"
8751
- },
8752
- {
8753
- "path": "unit",
8754
- "valueType": "string"
8755
- },
8756
- {
8757
- "path": "precision",
8758
- "valueType": "number"
8759
- }
8760
- ],
8785
+ "ambient-light-sensor": [{
8786
+ "path": "lux",
8787
+ "valueType": "number"
8788
+ }],
8761
8789
  "audio-metrics": [
8762
8790
  {
8763
8791
  "path": "ts",
@@ -8837,6 +8865,10 @@ Object.freeze({
8837
8865
  "path": "lastUpdated",
8838
8866
  "valueType": "number"
8839
8867
  },
8868
+ {
8869
+ "path": "volts",
8870
+ "valueType": "number"
8871
+ },
8840
8872
  {
8841
8873
  "path": "lastContactAt",
8842
8874
  "valueType": "number"
@@ -9079,10 +9111,6 @@ Object.freeze({
9079
9111
  "datetime"
9080
9112
  ]
9081
9113
  },
9082
- {
9083
- "path": "unit",
9084
- "valueType": "string"
9085
- },
9086
9114
  {
9087
9115
  "path": "min",
9088
9116
  "valueType": "number"
@@ -9094,19 +9122,6 @@ Object.freeze({
9094
9122
  {
9095
9123
  "path": "step",
9096
9124
  "valueType": "number"
9097
- },
9098
- {
9099
- "path": "precision",
9100
- "valueType": "number"
9101
- },
9102
- {
9103
- "path": "format",
9104
- "valueType": "enum",
9105
- "enumValues": [
9106
- "date",
9107
- "time",
9108
- "datetime"
9109
- ]
9110
9125
  }
9111
9126
  ],
9112
9127
  "cover": [
@@ -9347,13 +9362,8 @@ Object.freeze({
9347
9362
  "path": "value",
9348
9363
  "valueType": "string"
9349
9364
  }, {
9350
- "path": "format",
9351
- "valueType": "enum",
9352
- "enumValues": [
9353
- "date",
9354
- "time",
9355
- "datetime"
9356
- ]
9365
+ "path": "timestamp",
9366
+ "valueType": "boolean"
9357
9367
  }],
9358
9368
  "event-emitter": [
9359
9369
  {
@@ -9460,20 +9470,10 @@ Object.freeze({
9460
9470
  "valueType": "number"
9461
9471
  }
9462
9472
  ],
9463
- "humidity-sensor": [
9464
- {
9465
- "path": "percent",
9466
- "valueType": "number"
9467
- },
9468
- {
9469
- "path": "unit",
9470
- "valueType": "string"
9471
- },
9472
- {
9473
- "path": "precision",
9474
- "valueType": "number"
9475
- }
9476
- ],
9473
+ "humidity-sensor": [{
9474
+ "path": "percent",
9475
+ "valueType": "number"
9476
+ }],
9477
9477
  "image": [{
9478
9478
  "path": "url",
9479
9479
  "valueType": "string"
@@ -9812,20 +9812,10 @@ Object.freeze({
9812
9812
  "valueType": "boolean"
9813
9813
  }
9814
9814
  ],
9815
- "numeric-sensor": [
9816
- {
9817
- "path": "value",
9818
- "valueType": "number"
9819
- },
9820
- {
9821
- "path": "unit",
9822
- "valueType": "string"
9823
- },
9824
- {
9825
- "path": "precision",
9826
- "valueType": "number"
9827
- }
9828
- ],
9815
+ "numeric-sensor": [{
9816
+ "path": "value",
9817
+ "valueType": "number"
9818
+ }],
9829
9819
  "pet-feeder": [
9830
9820
  {
9831
9821
  "path": "foodLevel",
@@ -9917,14 +9907,6 @@ Object.freeze({
9917
9907
  {
9918
9908
  "path": "powerFactor",
9919
9909
  "valueType": "number"
9920
- },
9921
- {
9922
- "path": "unit",
9923
- "valueType": "string"
9924
- },
9925
- {
9926
- "path": "precision",
9927
- "valueType": "number"
9928
9910
  }
9929
9911
  ],
9930
9912
  "presence": [
@@ -9953,20 +9935,10 @@ Object.freeze({
9953
9935
  "valueType": "number"
9954
9936
  }
9955
9937
  ],
9956
- "pressure-sensor": [
9957
- {
9958
- "path": "hpa",
9959
- "valueType": "number"
9960
- },
9961
- {
9962
- "path": "unit",
9963
- "valueType": "string"
9964
- },
9965
- {
9966
- "path": "precision",
9967
- "valueType": "number"
9968
- }
9969
- ],
9938
+ "pressure-sensor": [{
9939
+ "path": "hpa",
9940
+ "valueType": "number"
9941
+ }],
9970
9942
  "privacy-mask": [{
9971
9943
  "path": "enabled",
9972
9944
  "valueType": "boolean"
@@ -10277,20 +10249,10 @@ Object.freeze({
10277
10249
  "path": "tampered",
10278
10250
  "valueType": "boolean"
10279
10251
  }],
10280
- "temperature-sensor": [
10281
- {
10282
- "path": "celsius",
10283
- "valueType": "number"
10284
- },
10285
- {
10286
- "path": "unit",
10287
- "valueType": "string"
10288
- },
10289
- {
10290
- "path": "precision",
10291
- "valueType": "number"
10292
- }
10293
- ],
10252
+ "temperature-sensor": [{
10253
+ "path": "celsius",
10254
+ "valueType": "number"
10255
+ }],
10294
10256
  "update": [
10295
10257
  {
10296
10258
  "path": "currentVersion",
@@ -10401,10 +10363,6 @@ Object.freeze({
10401
10363
  "path": "temperature",
10402
10364
  "valueType": "number"
10403
10365
  },
10404
- {
10405
- "path": "temperatureUnit",
10406
- "valueType": "string"
10407
- },
10408
10366
  {
10409
10367
  "path": "humidity",
10410
10368
  "valueType": "number"
@@ -10413,18 +10371,10 @@ Object.freeze({
10413
10371
  "path": "pressure",
10414
10372
  "valueType": "number"
10415
10373
  },
10416
- {
10417
- "path": "pressureUnit",
10418
- "valueType": "string"
10419
- },
10420
10374
  {
10421
10375
  "path": "windSpeed",
10422
10376
  "valueType": "number"
10423
10377
  },
10424
- {
10425
- "path": "windSpeedUnit",
10426
- "valueType": "string"
10427
- },
10428
10378
  {
10429
10379
  "path": "windBearing",
10430
10380
  "valueType": "number"
@@ -18601,7 +18551,8 @@ var CompositionProblemSchema = object({
18601
18551
  "item-field-reserved",
18602
18552
  "target-missing",
18603
18553
  "target-unreadable",
18604
- "not-replaceable"
18554
+ "not-replaceable",
18555
+ "native-capability-replace"
18605
18556
  ]),
18606
18557
  path: string(),
18607
18558
  message: string()
@@ -18659,9 +18610,11 @@ var CompositionFieldPlanSchema = object({
18659
18610
  reads: array(CompositionFieldReadSchema)
18660
18611
  });
18661
18612
  /**
18662
- * What a feature does to its target (D663): `new` builds a capability on a new
18663
- * device; on an existing device it `add`s a capability the device lacks, or
18664
- * `replace`s named fields of one it has natively.
18613
+ * What a feature does to its target (D663, D944): `new` builds a capability on a
18614
+ * new device; on an existing device it `add`s a capability the device lacks.
18615
+ * Replacing a capability the device already serves is refused
18616
+ * (`native-capability-replace`), not planned. `replace` remains on the claim
18617
+ * wire for a claim the hub already holds.
18665
18618
  */
18666
18619
  var CompositionFeatureModeSchema = _enum([
18667
18620
  "new",
@@ -20603,12 +20556,12 @@ method(object({ deviceId: number().int().nonnegative() }), DeviceAdminLinkSchema
20603
20556
  * providers detect renames by matching `uniqueId` and patch `id`
20604
20557
  * in-place so dispatch keeps working.
20605
20558
  *
20606
- * **Rendering metadata is NOT stored here.** Display fields (`unit`,
20607
- * `precision`) live in the cap STATUS SLICE so they flow live with every
20608
- * state push and are the single source of truth. The `device_class` tag is
20609
- * an HA-specific input that is consumed at the discovery boundary
20610
- * (`ha-domain-mapping`) to derive the CamStack `DeviceRole`; it is never
20611
- * stored after that point.
20559
+ * **Display unit and precision are NOT stored here.** They are a read-time
20560
+ * preference (D944). A polymorphic reading stores its `quantity` here once,
20561
+ * at adopt, and a date/time value stores `dateTimeShape` the same way —
20562
+ * neither is repeated on each sample. The `device_class` tag is an
20563
+ * HA-specific input consumed at the discovery boundary (`ha-domain-mapping`)
20564
+ * to derive the CamStack `DeviceRole`; it is never stored after that point.
20612
20565
  *
20613
20566
  * The `raw` escape hatch carries provider-specific attributes that don't
20614
20567
  * fit the structured slots (HA `attributes` whitelist, Reolink `deviceCache`
@@ -20622,6 +20575,14 @@ var SourceInfoSchema = object({
20622
20575
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
20623
20576
  * Used to detect rename when `id` changes. */
20624
20577
  uniqueId: string().optional(),
20578
+ /** Quantity of a polymorphic reading, written once at adopt (D944). */
20579
+ quantity: ReadingQuantitySchema.optional(),
20580
+ /** Date / time / datetime shape of a string reading, written once at adopt. */
20581
+ dateTimeShape: _enum([
20582
+ "date",
20583
+ "time",
20584
+ "datetime"
20585
+ ]).optional(),
20625
20586
  /** Provider-specific extras that don't fit the structured slots.
20626
20587
  * Whitelist what goes here per provider — do NOT dump entire HA
20627
20588
  * attribute blobs (would explode the meta JSON column). */
@@ -41559,7 +41520,8 @@ method(object({
41559
41520
  "enum"
41560
41521
  ]),
41561
41522
  enumValues: array(string()).optional(),
41562
- item: boolean().optional()
41523
+ item: boolean().optional(),
41524
+ quantity: ReadingQuantitySchema.optional()
41563
41525
  })).readonly(),
41564
41526
  itemArray: object({
41565
41527
  path: string(),
@@ -45359,8 +45321,8 @@ var MaskPolygonShapeSchema = object({
45359
45321
  /** Boolean cell grid — row-major, length === gridWidth*gridHeight. */
45360
45322
  var MaskGridShapeSchema = object({
45361
45323
  kind: literal("grid"),
45362
- gridWidth: number(),
45363
- gridHeight: number(),
45324
+ gridWidth: number().meta(readingMeta("none")),
45325
+ gridHeight: number().meta(readingMeta("none")),
45364
45326
  cells: array(boolean())
45365
45327
  });
45366
45328
  discriminatedUnion("kind", [
@@ -56947,27 +56909,17 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
56947
56909
  }), LogStreamEntrySchema, { kind: "subscription" });
56948
56910
  object({
56949
56911
  /** Carbon dioxide concentration in ppm. */
56950
- co2Ppm: number().min(0).optional(),
56912
+ co2Ppm: number().min(0).optional().meta(readingMeta("concentration-volume")),
56951
56913
  /** Total volatile organic compounds in ppb. */
56952
- vocPpb: number().min(0).optional(),
56914
+ vocPpb: number().min(0).optional().meta(readingMeta("concentration-ppb")),
56953
56915
  /** Particulate matter ≤ 2.5 μm in µg/m³. */
56954
- pm25: number().min(0).optional(),
56916
+ pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
56955
56917
  /** Particulate matter ≤ 10 μm in µg/m³. */
56956
- pm10: number().min(0).optional(),
56918
+ pm10: number().min(0).optional().meta(readingMeta("concentration-mass")),
56957
56919
  /** Composite AQI value (typically 0..500). */
56958
- aqi: number().optional(),
56920
+ aqi: number().optional().meta(readingMeta("index")),
56959
56921
  /** Ms epoch when the slice was last updated. */
56960
- lastFetchedAt: number(),
56961
- /** Live display unit of the single metric this slice carries (e.g. HA
56962
- * `attributes.unit_of_measurement` → 'ppm' / 'ppb' / 'µg/m³'). Each
56963
- * upstream `sensor.*` entity surfaces ONE device_class, so one unit
56964
- * per slice is unambiguous. */
56965
- unit: string().optional(),
56966
- /** Suggested decimal places for numeric display.
56967
- * Populated live from the upstream source when provided (e.g. HA
56968
- * `attributes.suggested_display_precision`). Falls back to
56969
- * auto-formatting when absent. */
56970
- precision: number().int().min(0).max(10).optional()
56922
+ lastFetchedAt: number()
56971
56923
  });
56972
56924
  DeviceType.Sensor;
56973
56925
  /**
@@ -56975,22 +56927,13 @@ DeviceType.Sensor;
56975
56927
  * entries with `device_class: illuminance`.
56976
56928
  */
56977
56929
  var AmbientLightSensorStatusSchema = object({
56978
- /** Current illuminance in lux (lx). */
56979
- lux: number().min(0).meta({
56980
- unit: "lx",
56930
+ /** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
56931
+ lux: number().min(0).nullable().meta(readingMeta("illuminance", {
56932
+ precision: 0,
56981
56933
  label: "Illuminance"
56982
- }),
56934
+ })),
56983
56935
  /** Ms epoch when the slice was last updated. */
56984
- lastFetchedAt: number(),
56985
- /** Live display unit from the upstream source (e.g. HA
56986
- * `attributes.unit_of_measurement`). The UI prefers this over the
56987
- * role's canonical unit. Absent → fall back to the canonical unit. */
56988
- unit: string().optional(),
56989
- /** Suggested decimal places for numeric display.
56990
- * Populated live from the upstream source when provided (e.g. HA
56991
- * `attributes.suggested_display_precision`). Falls back to
56992
- * auto-formatting when absent. */
56993
- precision: number().int().min(0).max(10).optional()
56936
+ lastFetchedAt: number()
56994
56937
  });
56995
56938
  DeviceType.Sensor;
56996
56939
  /**
@@ -57135,10 +57078,7 @@ var BatteryStatusSchema = object({
57135
57078
  * Consumers must SKIP a null rather than coerce it — `battery-band` already
57136
57079
  * declines to band a non-finite reading, which is the correct shape.
57137
57080
  */
57138
- percentage: number().min(0).max(100).nullable().meta({
57139
- unit: "%",
57140
- label: "Charge"
57141
- }),
57081
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
57142
57082
  /**
57143
57083
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
57144
57084
  * Reolink-specific for the Solar Panel 2 accessory (will become
@@ -57165,7 +57105,14 @@ var BatteryStatusSchema = object({
57165
57105
  */
57166
57106
  sleeping: boolean().meta({ label: "Sleeping" }),
57167
57107
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
57168
- lastUpdated: number(),
57108
+ lastUpdated: number().meta(readingMeta("none")),
57109
+ /**
57110
+ * Battery voltage in volts, for a cell the firmware reports as voltage
57111
+ * rather than a percentage (Ecowitt capacitor packs). Absent on cameras
57112
+ * that only report charge. A second reading on this cap, not a second
57113
+ * `numeric-sensor` on the same device.
57114
+ */
57115
+ volts: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
57169
57116
  /**
57170
57117
  * Ms epoch of the last time the device PROVED it was reachable — a
57171
57118
  * completed firmware round-trip, an observed wake, or an inbound push
@@ -57225,7 +57172,7 @@ object({
57225
57172
  DeviceType.Sensor;
57226
57173
  object({
57227
57174
  /** Current level as 0..100 inclusive. Firmware-reported. */
57228
- percentage: number().min(0).max(100),
57175
+ percentage: number().min(0).max(100).meta(readingMeta("percentage")),
57229
57176
  /** Ms epoch of the last operator-driven change. Useful for UI freshness. */
57230
57177
  lastChangedAt: number()
57231
57178
  });
@@ -57614,21 +57561,21 @@ object({
57614
57561
  /** Single setpoint in Celsius. Used by single-target modes
57615
57562
  * (heat / cool / dry). Null when the device is in a range mode
57616
57563
  * (`heat_cool`) or has no setpoint at all (`fan_only`/`off`). */
57617
- target: number().nullable(),
57564
+ target: number().nullable().meta(readingMeta("temperature")),
57618
57565
  /** Upper bound of the dual setpoint in Celsius. Populated only
57619
57566
  * in `heat_cool` mode. */
57620
- targetHigh: number().nullable(),
57567
+ targetHigh: number().nullable().meta(readingMeta("temperature")),
57621
57568
  /** Lower bound of the dual setpoint in Celsius. Populated only
57622
57569
  * in `heat_cool` mode. */
57623
- targetLow: number().nullable(),
57570
+ targetLow: number().nullable().meta(readingMeta("temperature")),
57624
57571
  /** Target relative humidity (0..100). Null when the device has no
57625
57572
  * humidity control. */
57626
- targetHumidity: number().min(0).max(100).nullable(),
57573
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
57627
57574
  /** Current measured temperature in Celsius. Read-only — pushed by
57628
57575
  * the device's internal sensor. */
57629
- currentTemp: number().nullable(),
57576
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
57630
57577
  /** Current measured relative humidity (0..100). Read-only. */
57631
- currentHumidity: number().min(0).max(100).nullable(),
57578
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
57632
57579
  /** Vertical louver swing on/off. Null when the device has no vertical
57633
57580
  * swing surface (gate with `DeviceFeature.ClimateSwingVertical`). */
57634
57581
  swingVertical: boolean().nullable(),
@@ -57636,11 +57583,11 @@ object({
57636
57583
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
57637
57584
  swingHorizontal: boolean().nullable(),
57638
57585
  /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
57639
- minTemp: number().nullable().optional(),
57586
+ minTemp: number().nullable().optional().meta(readingMeta("temperature")),
57640
57587
  /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
57641
- maxTemp: number().nullable().optional(),
57588
+ maxTemp: number().nullable().optional().meta(readingMeta("temperature")),
57642
57589
  /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
57643
- tempStep: number().positive().nullable().optional(),
57590
+ tempStep: number().positive().nullable().optional().meta(readingMeta("temperature")),
57644
57591
  /** Ms epoch when the slice was last updated (push or command). */
57645
57592
  lastFetchedAt: number()
57646
57593
  });
@@ -57719,17 +57666,17 @@ DeviceType.Thermostat, DeviceType.Climate, method(object({
57719
57666
  * modes to expose in the picker without a slice fetch.
57720
57667
  */
57721
57668
  var RgbTripletSchema = object({
57722
- r: number().int().min(0).max(255),
57723
- g: number().int().min(0).max(255),
57724
- b: number().int().min(0).max(255)
57669
+ r: number().int().min(0).max(255).meta(readingMeta("none")),
57670
+ g: number().int().min(0).max(255).meta(readingMeta("none")),
57671
+ b: number().int().min(0).max(255).meta(readingMeta("none"))
57725
57672
  });
57726
57673
  var HsvTripletSchema = object({
57727
57674
  /** Hue in degrees, 0..360. */
57728
- h: number().min(0).max(360),
57675
+ h: number().min(0).max(360).meta(readingMeta("none")),
57729
57676
  /** Saturation as 0..100 inclusive. */
57730
- s: number().min(0).max(100),
57677
+ s: number().min(0).max(100).meta(readingMeta("none")),
57731
57678
  /** Value/brightness as 0..100 inclusive. */
57732
- v: number().min(0).max(100)
57679
+ v: number().min(0).max(100).meta(readingMeta("none"))
57733
57680
  });
57734
57681
  var ColorInputSchema = discriminatedUnion("mode", [
57735
57682
  object({
@@ -57758,7 +57705,7 @@ object({
57758
57705
  /** Populated when `mode === 'hsv'`. */
57759
57706
  hsv: HsvTripletSchema.optional(),
57760
57707
  /** Populated when `mode === 'mired'`. */
57761
- mireds: number().int().optional(),
57708
+ mireds: number().int().optional().meta(readingMeta("colour-temperature")),
57762
57709
  /** Ms epoch of the last operator-driven change. */
57763
57710
  lastChangedAt: number()
57764
57711
  });
@@ -57882,18 +57829,12 @@ _enum([
57882
57829
  "empty",
57883
57830
  "full"
57884
57831
  ]);
57885
- /** Units a remaining-life counter is reported in. Closed: the panel renders
57886
- * each. */
57887
- var ConsumableRemainingUnitSchema = _enum([
57888
- "days",
57889
- "hours",
57890
- "cycles"
57891
- ]);
57892
- /** Remaining life as a COUNT, not a percentage (the PetKit desiccant reports
57893
- * days). `value` null = unknown (D393). */
57832
+ /** Whether `remaining.value` is a duration in seconds or a dimensionless count. */
57833
+ var ConsumableRemainingKindSchema = _enum(["duration", "count"]);
57834
+ /** Remaining life. `value` null = unknown (D393). Duration is seconds. */
57894
57835
  var ConsumableRemainingSchema = object({
57895
- value: number().min(0).nullable(),
57896
- unit: ConsumableRemainingUnitSchema
57836
+ value: number().min(0).nullable().meta(readingMeta("device")),
57837
+ kind: ConsumableRemainingKindSchema
57897
57838
  });
57898
57839
  var ConsumablesStatusSchema = object({
57899
57840
  items: array(object({
@@ -57902,7 +57843,7 @@ var ConsumablesStatusSchema = object({
57902
57843
  /** Display name. */
57903
57844
  label: string().min(1),
57904
57845
  /** Remaining life % (`wear`) or fill % (`supply`, `waste`) when known (0..100). */
57905
- level: number().min(0).max(100).nullable(),
57846
+ level: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
57906
57847
  /** The provider's discrete verdict when known (binary mode). */
57907
57848
  status: ConsumableStatusSchema.nullable(),
57908
57849
  /** What the item is — decides whether low or full is bad. Absent = `wear`. */
@@ -57919,7 +57860,7 @@ var ConsumablesStatusSchema = object({
57919
57860
  })),
57920
57861
  lastChangedAt: number()
57921
57862
  });
57922
- Object.values(DeviceType), [...ConsumableRemainingUnitSchema.options], [...ConsumableStatusSchema.options], [...ConsumableKindSchema.options], [...ConsumableFormSchema.options];
57863
+ Object.values(DeviceType), [...ConsumableRemainingKindSchema.options], [...ConsumableStatusSchema.options], [...ConsumableKindSchema.options], [...ConsumableFormSchema.options];
57923
57864
  Object.values(DeviceType), method(object({
57924
57865
  deviceId: number().int().nonnegative(),
57925
57866
  key: string().min(1)
@@ -57956,39 +57897,17 @@ object({
57956
57897
  /** Current value. Numeric kind → number; select/text/datetime → string.
57957
57898
  * Datetime values are ISO 8601 strings (full timestamp, date-only,
57958
57899
  * or time-only — HA accepts all three forms). */
57959
- value: union([number(), string()]),
57900
+ value: union([number().meta(readingMeta("device")), string()]),
57960
57901
  /** Acceptable values when `kind === 'select'`. Empty for other kinds. */
57961
57902
  options: array(string()),
57962
57903
  /** Ms epoch when the slice was last updated. */
57963
57904
  lastChangedAt: number(),
57964
- /** Display unit-of-measurement (e.g. '°C', '%', 'lx').
57965
- * Populated live from HA `attributes.unit_of_measurement` on each push.
57966
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57967
- unit: string().optional(),
57968
- /** Minimum allowed value. Populated live from HA `attributes.min`.
57969
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57970
- min: number().optional(),
57971
- /** Maximum allowed value. Populated live from HA `attributes.max`.
57972
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57973
- max: number().optional(),
57974
- /** Step increment. Populated live from HA `attributes.step`.
57975
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57976
- step: number().optional(),
57977
- /** Suggested decimal places for numeric display. Populated live from HA
57978
- * `attributes.suggested_display_precision`, or derived from `step` when the
57979
- * HA attribute is absent. Meaningful for `kind === 'numeric'`; absent for
57980
- * other kinds. Falls back to auto-formatting when absent. */
57981
- precision: number().int().min(0).max(10).optional(),
57982
- /** Date-picker granularity for `kind === 'datetime'`. 'date' → date-only,
57983
- * 'time' → time-only, 'datetime' → full timestamp. Absent for other kinds
57984
- * (UI defaults to 'datetime'). Derived live from the device's HA domain
57985
- * (date.* / time.* / datetime.*) or, for input_datetime, from the entity's
57986
- * `has_date`/`has_time` attributes on each push. */
57987
- format: _enum([
57988
- "date",
57989
- "time",
57990
- "datetime"
57991
- ]).optional()
57905
+ /** Minimum allowed value, in the device quantity's base unit. */
57906
+ min: number().optional().meta(readingMeta("device")),
57907
+ /** Maximum allowed value, in the device quantity's base unit. */
57908
+ max: number().optional().meta(readingMeta("device")),
57909
+ /** Step increment, in the device quantity's base unit. */
57910
+ step: number().optional().meta(readingMeta("device"))
57992
57911
  });
57993
57912
  var ControlSetValueInputSchema = discriminatedUnion("kind", [
57994
57913
  object({
@@ -58026,9 +57945,9 @@ object({
58026
57945
  ]),
58027
57946
  /** 0 = fully closed, 100 = fully open. Null when the device has
58028
57947
  * no intermediate position surface. */
58029
- position: number().min(0).max(100).nullable(),
57948
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58030
57949
  /** 0 = closed slats, 100 = open slats. Null when no tilt support. */
58031
- tiltPosition: number().min(0).max(100).nullable(),
57950
+ tiltPosition: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58032
57951
  /** Ms epoch when the slice was last updated. */
58033
57952
  lastChangedAt: number()
58034
57953
  });
@@ -58086,9 +58005,9 @@ var NormalizedRangeSchema$1 = object({
58086
58005
  object({
58087
58006
  mode: DayNightModeSchema,
58088
58007
  /** IR-cut trigger sensitivity, NORMALIZED 0–100 (higher = switches to night sooner). */
58089
- sensitivity: number().optional(),
58008
+ sensitivity: number().optional().meta(readingMeta("none")),
58090
58009
  /** Delay before the IR-cut filter flips, in seconds. */
58091
- switchDelaySec: number().optional(),
58010
+ switchDelaySec: number().optional().meta(readingMeta("duration")),
58092
58011
  lastFetchedAt: number()
58093
58012
  });
58094
58013
  /**
@@ -58243,11 +58162,11 @@ object({
58243
58162
  /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
58244
58163
  availablePrograms: array(string()),
58245
58164
  /** Seconds remaining on the active cycle, or null when not running / not known. */
58246
- remainingSeconds: number().int().nonnegative().nullable(),
58165
+ remainingSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
58247
58166
  /** Seconds the delayed start is set to (time until the cycle starts), or null. */
58248
- delayedStartSeconds: number().int().nonnegative().nullable(),
58167
+ delayedStartSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
58249
58168
  /** Cycle completion 0..100, or null when not applicable. */
58250
- progressPercent: number().min(0).max(100).nullable(),
58169
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58251
58170
  /** True when the door is reported open; null when the door state is not known. */
58252
58171
  doorOpen: boolean().nullable(),
58253
58172
  /** True when the door is latched (locked) during a cycle; null when not reported. */
@@ -58271,7 +58190,7 @@ object({
58271
58190
  /** True while the machine-care (descaling / cleaning-program) reminder is raised; false when clear; null when not reported. */
58272
58191
  machineCareDue: boolean().nullable(),
58273
58192
  /** Program runs left before the machine-care reminder is due; null when the appliance does not say. */
58274
- machineCareRemainingRuns: number().int().nonnegative().nullable(),
58193
+ machineCareRemainingRuns: number().int().nonnegative().nullable().meta(readingMeta("count")),
58275
58194
  /** Option states: null when the appliance does not expose the option or has not said. */
58276
58195
  halfLoad: boolean().nullable(),
58277
58196
  hygienePlus: boolean().nullable(),
@@ -58286,7 +58205,7 @@ object({
58286
58205
  /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
58287
58206
  activeEvents: array(string()),
58288
58207
  /** Numeric error code when the appliance reports one; null otherwise. */
58289
- errorCode: number().nullable(),
58208
+ errorCode: number().nullable().meta(readingMeta("none")),
58290
58209
  /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
58291
58210
  errorLabel: string().nullable(),
58292
58211
  /** Ms epoch of the last value received from the appliance; 0 = never. */
@@ -58432,24 +58351,14 @@ object({
58432
58351
  /** Ms epoch of the last press. null = never observed since this provider started. */
58433
58352
  lastPressedAt: number().nullable(),
58434
58353
  /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
58435
- pressCountSinceStart: number()
58354
+ pressCountSinceStart: number().meta(readingMeta("count"))
58436
58355
  });
58437
58356
  object({
58438
58357
  deviceId: number(),
58439
58358
  timestamp: number()
58440
58359
  });
58441
58360
  DeviceType.Button, DeviceType.Camera;
58442
- /**
58443
- * Enum-state sensor — a string value picked from a finite option set.
58444
- * Drives HA `sensor` entries with `state_class: enum` (HVAC action
58445
- * states, weather conditions, contact-source channels, mode strings).
58446
- * The option set is stable across observations; it is persisted in the
58447
- * device config blob (via the control slice at adoption) and is NOT
58448
- * stored in `sourceInfo`.
58449
- */
58450
- /** Locale-render shape for an ISO `value` carried by a `DateTimeSensor`-role
58451
- * enum sensor: `date` (date-only), `time` (time-only), `datetime` (both). */
58452
- var EnumSensorDateTimeFormatSchema = _enum([
58361
+ _enum([
58453
58362
  "date",
58454
58363
  "time",
58455
58364
  "datetime"
@@ -58457,12 +58366,11 @@ var EnumSensorDateTimeFormatSchema = _enum([
58457
58366
  object({
58458
58367
  value: string(),
58459
58368
  /**
58460
- * Set for `DateTimeSensor`-role sensors so the UI renders the ISO `value`
58461
- * as a locale date/time/datetime; absent for plain enum sensors. HA
58462
- * `device_class=timestamp` → `'datetime'`, `device_class=date` → `'date'`,
58463
- * a time-only sensor → `'time'`.
58369
+ * Set when `value` is a timestamp rather than an enum state, so history
58370
+ * does not learn ISO strings as states. The display shape (date / time /
58371
+ * datetime) lives on `SourceInfo.dateTimeShape`, written once at adopt.
58464
58372
  */
58465
- format: EnumSensorDateTimeFormatSchema.optional(),
58373
+ timestamp: boolean().optional(),
58466
58374
  /** Ms epoch when the slice was last updated. */
58467
58375
  lastFetchedAt: number()
58468
58376
  });
@@ -58481,13 +58389,13 @@ var EventFireSchema = object({
58481
58389
  deviceId: number(),
58482
58390
  eventType: string(),
58483
58391
  data: record(string(), unknown()).nullable(),
58484
- timestamp: number(),
58485
- seq: number()
58392
+ timestamp: number().meta(readingMeta("none")),
58393
+ seq: number().meta(readingMeta("count"))
58486
58394
  });
58487
58395
  object({
58488
58396
  eventTypes: array(string()),
58489
58397
  lastEvent: EventFireSchema.nullable(),
58490
- eventCountSinceStart: number()
58398
+ eventCountSinceStart: number().meta(readingMeta("count"))
58491
58399
  });
58492
58400
  DeviceType.EventEmitter;
58493
58401
  var IdentitySchema = object({
@@ -58876,10 +58784,10 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
58876
58784
  object({
58877
58785
  /** Active speed as 0..100 inclusive. Null when the device has no
58878
58786
  * speed surface (single-speed fan). */
58879
- percentage: number().min(0).max(100).nullable(),
58787
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58880
58788
  /** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
58881
58789
  * a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
58882
- percentageStep: number().positive().optional(),
58790
+ percentageStep: number().positive().optional().meta(readingMeta("percentage")),
58883
58791
  /** Active preset mode (`auto` / `quiet` / `turbo` / vendor-specific)
58884
58792
  * — empty string when no preset is active or supported. */
58885
58793
  preset: string(),
@@ -58961,7 +58869,7 @@ var FeatureProbeStatusSchema = object({
58961
58869
  /** Camera/firmware model string. `null` when the firmware doesn't expose it. */
58962
58870
  model: string().nullable(),
58963
58871
  /** Channel count for NVR/Hub devices; `1` for standalone cameras; `null` pre-probe. */
58964
- channelCount: number().nullable(),
58872
+ channelCount: number().nullable().meta(readingMeta("count")),
58965
58873
  /**
58966
58874
  * Ms epoch of the last SUCCESSFUL probe. `0` before the first probe
58967
58875
  * completes — drivers' `getAccessoryChildren()` should treat zero as
@@ -59003,7 +58911,7 @@ object({
59003
58911
  DeviceType.Sensor;
59004
58912
  object({
59005
58913
  /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
59006
- position: number().min(0).max(100).nullable(),
58914
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59007
58915
  /** Ms epoch when the slice was last updated (push or poll). */
59008
58916
  lastFetchedAt: number()
59009
58917
  });
@@ -59012,9 +58920,9 @@ object({
59012
58920
  /** Whether the humidifier is currently on. */
59013
58921
  on: boolean(),
59014
58922
  /** Current measured relative humidity (0..100). Null when not reported. */
59015
- currentHumidity: number().min(0).max(100).nullable(),
58923
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
59016
58924
  /** Target relative humidity (0..100). Null when no setpoint surface. */
59017
- targetHumidity: number().min(0).max(100).nullable(),
58925
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
59018
58926
  /** Active mode (`auto` / `normal` / `baby` / vendor). Null when the
59019
58927
  * device has no mode surface. */
59020
58928
  mode: string().nullable(),
@@ -59024,9 +58932,9 @@ object({
59024
58932
  * `idle` / `off`). Null when the device doesn't report it. */
59025
58933
  action: string().nullable(),
59026
58934
  /** HA `min_humidity` attribute. Null → UI uses 0. */
59027
- minHumidity: number().nullable(),
58935
+ minHumidity: number().nullable().meta(readingMeta("humidity")),
59028
58936
  /** HA `max_humidity` attribute. Null → UI uses 100. */
59029
- maxHumidity: number().nullable(),
58937
+ maxHumidity: number().nullable().meta(readingMeta("humidity")),
59030
58938
  /** Ms epoch when the slice was last updated. */
59031
58939
  lastChangedAt: number()
59032
58940
  });
@@ -59058,22 +58966,13 @@ DeviceType.Humidifier, method(object({
59058
58966
  * `sourceInfo`.
59059
58967
  */
59060
58968
  var HumiditySensorStatusSchema = object({
59061
- /** Current relative humidity, 0..100. */
59062
- percent: number().min(0).max(100).meta({
59063
- unit: "%",
58969
+ /** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
58970
+ percent: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
58971
+ precision: 0,
59064
58972
  label: "Humidity"
59065
- }),
58973
+ })),
59066
58974
  /** Ms epoch when the slice was last updated. */
59067
- lastFetchedAt: number(),
59068
- /** Live display unit from the upstream source (e.g. HA
59069
- * `attributes.unit_of_measurement`). The UI prefers this over the
59070
- * role's canonical unit. Absent → fall back to the canonical unit. */
59071
- unit: string().optional(),
59072
- /** Suggested decimal places for numeric display.
59073
- * Populated live from the upstream source when provided (e.g. HA
59074
- * `attributes.suggested_display_precision`). Falls back to
59075
- * auto-formatting when absent. */
59076
- precision: number().int().min(0).max(10).optional()
58975
+ lastFetchedAt: number()
59077
58976
  });
59078
58977
  DeviceType.Sensor, DeviceType.Thermostat;
59079
58978
  object({
@@ -59081,7 +58980,7 @@ object({
59081
58980
  * entity exposes no `entity_picture` (yet). */
59082
58981
  url: string().nullable(),
59083
58982
  /** Ms epoch of the upstream last-updated timestamp. Null at cold-start. */
59084
- lastUpdated: number().nullable()
58983
+ lastUpdated: number().nullable().meta(readingMeta("none"))
59085
58984
  });
59086
58985
  DeviceType.Image;
59087
58986
  /**
@@ -59137,19 +59036,19 @@ var NormalizedRangeSchema = object({
59137
59036
  });
59138
59037
  object({
59139
59038
  /** Normalized 0–100. */
59140
- brightness: number().optional(),
59039
+ brightness: number().optional().meta(readingMeta("none")),
59141
59040
  /** Normalized 0–100. */
59142
- contrast: number().optional(),
59041
+ contrast: number().optional().meta(readingMeta("none")),
59143
59042
  /** Normalized 0–100. */
59144
- saturation: number().optional(),
59043
+ saturation: number().optional().meta(readingMeta("none")),
59145
59044
  /** Normalized 0–100. */
59146
- sharpness: number().optional(),
59045
+ sharpness: number().optional().meta(readingMeta("none")),
59147
59046
  mirror: boolean().optional(),
59148
59047
  flip: boolean().optional(),
59149
59048
  rotate: ImageRotateSchema.optional(),
59150
59049
  whiteBalance: WhiteBalanceModeSchema.optional(),
59151
59050
  /** Manual white-balance warmth, NORMALIZED 0–100. Meaningful only when `whiteBalance === 'manual'`. */
59152
- warmth: number().optional(),
59051
+ warmth: number().optional().meta(readingMeta("none")),
59153
59052
  exposureMode: ExposureModeSchema.optional(),
59154
59053
  backlightMode: BacklightModeSchema.optional(),
59155
59054
  lastFetchedAt: number()
@@ -59394,10 +59293,10 @@ var IntercomAbilitySchema = object({
59394
59293
  /** Codecs accepted by firmware, in preference order. Driver-authored strings. */
59395
59294
  codecs: array(string()),
59396
59295
  /** Sample rate (Hz) the firmware expects. Reolink typical: 16000. */
59397
- sampleRate: number(),
59296
+ sampleRate: number().meta(readingMeta("none")),
59398
59297
  duplex: _enum(["half", "full"]),
59399
59298
  /** Max in-flight audio backlog before drop (ms). Server uses this to bound latency. */
59400
- maxBacklogMs: number()
59299
+ maxBacklogMs: number().meta(readingMeta("duration-ms"))
59401
59300
  });
59402
59301
  var IntercomStatusSchema = object({
59403
59302
  /** True while a talk session is open. */
@@ -59508,13 +59407,13 @@ object({
59508
59407
  activity: LawnMowerActivitySchema,
59509
59408
  /** 0..100 battery percentage. Null when the device has no battery
59510
59409
  * reading. */
59511
- batteryLevel: number().min(0).max(100).nullable(),
59410
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59512
59411
  /** 0..100 mowing-completion percentage of the current task, or null when no
59513
59412
  * task is active / progress is unavailable. */
59514
- progressPercent: number().min(0).max(100).nullable(),
59413
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59515
59414
  /** Current device/event code (dynamic — mostly status, sometimes an error),
59516
59415
  * or null when unknown. */
59517
- currentCode: number().nullable(),
59416
+ currentCode: number().nullable().meta(readingMeta("none")),
59518
59417
  /** Human label for {@link currentCode}, or null when undecodable. */
59519
59418
  currentCodeLabel: string().nullable(),
59520
59419
  /** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
@@ -59976,7 +59875,7 @@ object({
59976
59875
  state: MediaPlayerStateSchema,
59977
59876
  /** Volume as 0..100 inclusive. Null when the device has no volume
59978
59877
  * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
59979
- volumeLevel: number().min(0).max(100).nullable(),
59878
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59980
59879
  /** Mute toggle distinct from volume=0. Null when no mute surface.
59981
59880
  * Pair with `DeviceFeature.MediaPlayerMute`. */
59982
59881
  isMuted: boolean().nullable(),
@@ -59989,10 +59888,10 @@ object({
59989
59888
  currentMedia: MediaInfoSchema.nullable(),
59990
59889
  /** Current playback position in ms. Null when not seekable or
59991
59890
  * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
59992
- positionMs: number().int().nonnegative().nullable(),
59891
+ positionMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
59993
59892
  /** Total duration of the current media in ms. Null when unknown
59994
59893
  * (live stream) or nothing is playing. */
59995
- durationMs: number().int().nonnegative().nullable(),
59894
+ durationMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
59996
59895
  /** Shuffle toggle. Null when no shuffle surface.
59997
59896
  * Pair with `DeviceFeature.MediaPlayerShuffle`. */
59998
59897
  shuffle: boolean().nullable(),
@@ -60292,7 +60191,7 @@ var MotionStatusSchema = object({
60292
60191
  * it, every provider seeded it at boot, and every session left it
60293
60192
  * `detected: true` after its detach.
60294
60193
  */
60295
- autoClearAfterMs: number().nullable()
60194
+ autoClearAfterMs: number().nullable().meta(readingMeta("duration-ms"))
60296
60195
  });
60297
60196
  /**
60298
60197
  * Payload of `motion.onMotionChanged` event + the corresponding bus
@@ -60342,7 +60241,7 @@ var MotionZoneRegionSchema = object({
60342
60241
  });
60343
60242
  object({
60344
60243
  enabled: boolean(),
60345
- sensitivity: number(),
60244
+ sensitivity: number().meta(readingMeta("none")),
60346
60245
  /** Grid region(s). Today exactly one `grid` shape. */
60347
60246
  regions: array(MotionZoneRegionSchema),
60348
60247
  lastFetchedAt: number()
@@ -60646,7 +60545,7 @@ var NavigationStatusSchema = object({
60646
60545
  following: boolean(),
60647
60546
  flash: boolean(),
60648
60547
  lightMode: NavigationLightModeSchema,
60649
- lightLevel: number().min(40).max(100),
60548
+ lightLevel: number().min(40).max(100).meta(readingMeta("none")),
60650
60549
  /** Ms epoch when the slice was last updated. */
60651
60550
  lastChangedAt: number()
60652
60551
  });
@@ -60692,13 +60591,13 @@ var NetworkLinkStatusSchema = object({
60692
60591
  * one whose reading has not landed must not be drawn at 0 %. Consumers
60693
60592
  * SKIP a null rather than coerce it.
60694
60593
  */
60695
- signalPercent: number().min(0).max(100).nullable(),
60594
+ signalPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60696
60595
  /** Raw received signal strength in dBm, when the firmware reports one. */
60697
- rssiDbm: number().optional(),
60596
+ rssiDbm: number().optional().meta(readingMeta("signal-level")),
60698
60597
  /** Network name of a wireless link, when the firmware reports it. */
60699
60598
  ssid: string().optional(),
60700
60599
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
60701
- lastUpdated: number()
60600
+ lastUpdated: number().meta(readingMeta("none"))
60702
60601
  });
60703
60602
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
60704
60603
  deviceId: number(),
@@ -61017,7 +60916,7 @@ object({
61017
60916
  lastError: string().nullable(),
61018
60917
  /** Number of deliveries currently buffered server-side (rate-limited
61019
60918
  * notifiers may queue). 0 when the provider sends synchronously. */
61020
- queueDepth: number().int().nonnegative(),
60919
+ queueDepth: number().int().nonnegative().meta(readingMeta("count")),
61021
60920
  /** Per-feature capability matrix — authoritative source for the
61022
60921
  * compose-form field gating. */
61023
60922
  supports: NotifierSupportsSchema
@@ -61067,15 +60966,8 @@ DeviceType.Notifier, method(NotifierSendInputSchema, NotifierSendResultSchema, {
61067
60966
  acceptedAt: number()
61068
60967
  });
61069
60968
  object({
61070
- value: number(),
61071
- /** Display unit-of-measurement (e.g. 'dBm', 's', 'rpm', 'steps').
61072
- * Populated live from the upstream source on each state push.
61073
- * Absent for unitless sensors. */
61074
- unit: string().optional(),
61075
- /** Suggested decimal places for numeric display.
61076
- * Populated live from the upstream source when provided.
61077
- * Falls back to auto-formatting when absent. */
61078
- precision: number().int().min(0).max(10).optional(),
60969
+ /** Reading in the device quantity's base unit. `null` when refused (D393). */
60970
+ value: number().nullable().meta(readingMeta("device")),
61079
60971
  /** Ms epoch when the slice was last updated. */
61080
60972
  lastFetchedAt: number()
61081
60973
  });
@@ -61365,23 +61257,26 @@ object({
61365
61257
  /** Food currently in the bowl (grams). Null when the device has not
61366
61258
  * reported a reading yet. On dual-hopper models this is the combined
61367
61259
  * bowl reading; per-hopper levels live in `food1`/`food2`. */
61368
- foodLevel: number().nullable(),
61260
+ foodLevel: number().nullable().meta(readingMeta("none")),
61369
61261
  /** Hopper-1 food level (grams) on dual-hopper feeders; null on
61370
61262
  * single-hopper models. */
61371
- food1: number().nullable(),
61263
+ food1: number().nullable().meta(readingMeta("none")),
61372
61264
  /** Hopper-2 food level (grams) on dual-hopper feeders; null on
61373
61265
  * single-hopper models. */
61374
- food2: number().nullable(),
61266
+ food2: number().nullable().meta(readingMeta("none")),
61375
61267
  /** Derived low-food flag — mirrors the HA `food_level` binary_sensor
61376
61268
  * (`device_class: problem`, on = low). True when the bowl is empty /
61377
61269
  * below the feeder's low threshold. */
61378
61270
  lowFood: boolean(),
61379
61271
  /** Battery charge 0..100 (%). Null on mains-powered models or when the
61380
61272
  * device has no battery reading. */
61381
- batteryPower: number().min(0).max(100).nullable(),
61382
- /** Days of desiccant life remaining. Null when the model has no
61383
- * desiccant sensor. */
61384
- desiccantLeftDays: number().nullable(),
61273
+ batteryPower: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61274
+ /**
61275
+ * Desiccant life remaining, stored in seconds (duration base, D944).
61276
+ * Providers convert from the days the feeder reports. Null when the
61277
+ * model has no desiccant sensor.
61278
+ */
61279
+ desiccantLeftDays: number().nullable().meta(readingMeta("duration")),
61385
61280
  /** True while a feed is in progress. */
61386
61281
  feeding: boolean(),
61387
61282
  /** Decoded connectivity / power status (HA petkit device-status enum).
@@ -61392,7 +61287,7 @@ object({
61392
61287
  * with `errorCode` for consumers that want the raw integer. */
61393
61288
  error: string().nullable(),
61394
61289
  /** Raw device error code (0 / null = no error). */
61395
- errorCode: number().nullable(),
61290
+ errorCode: number().nullable().meta(readingMeta("none")),
61396
61291
  /** True for D4S/D4SH dual-hopper hardware — gates the per-hopper UI. */
61397
61292
  isDualHopper: boolean(),
61398
61293
  /** Child-lock (manual-lock) setting — buttons on the unit are disabled. */
@@ -61402,7 +61297,7 @@ object({
61402
61297
  /** Play a chime when dispensing. */
61403
61298
  feedSound: boolean(),
61404
61299
  /** Speaker / prompt volume level (device-scaled integer). */
61405
- volume: number(),
61300
+ volume: number().meta(readingMeta("none")),
61406
61301
  /** Ms epoch when the slice was last refreshed from the cloud. */
61407
61302
  lastFetchedAt: number()
61408
61303
  });
@@ -61839,36 +61734,19 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
61839
61734
  });
61840
61735
  object({
61841
61736
  /** Instantaneous power draw in watts. */
61842
- watts: number().optional().meta({
61843
- unit: "W",
61844
- label: "Power"
61845
- }),
61737
+ watts: number().optional().meta(readingMeta("power", { label: "Power" })),
61846
61738
  /** Cumulative energy in kilowatt-hours since the meter was reset. */
61847
- kwhTotal: number().optional().meta({
61848
- unit: "kWh",
61849
- label: "Energy"
61850
- }),
61739
+ kwhTotal: number().optional().meta(readingMeta("energy", { label: "Energy" })),
61851
61740
  /** Voltage in volts. */
61852
- volts: number().optional(),
61741
+ volts: number().optional().meta(readingMeta("voltage")),
61853
61742
  /** Current in amperes. */
61854
- amps: number().optional(),
61855
- /** Apparent power in volt-amperes (W × power-factor reciprocal). */
61856
- va: number().optional(),
61743
+ amps: number().optional().meta(readingMeta("current")),
61744
+ /** Apparent power in volt-amperes. */
61745
+ va: number().optional().meta(readingMeta("apparent-power")),
61857
61746
  /** Power factor (0..1) if reported. */
61858
- powerFactor: number().min(0).max(1).optional(),
61747
+ powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
61859
61748
  /** Ms epoch when the slice was last updated. */
61860
- lastFetchedAt: number(),
61861
- /** Live display unit of the single metric this slice carries (e.g. HA
61862
- * `attributes.unit_of_measurement` → 'V' / 'A' / 'W' / 'kW' / 'kWh').
61863
- * Each upstream `sensor.*` entity surfaces ONE device_class, so one
61864
- * unit per slice is unambiguous. The UI prefers this over the role's
61865
- * canonical unit so a 'kW' / 'Wh' feed renders verbatim. */
61866
- unit: string().optional(),
61867
- /** Suggested decimal places for numeric display.
61868
- * Populated live from the upstream source when provided (e.g. HA
61869
- * `attributes.suggested_display_precision`). Falls back to
61870
- * auto-formatting when absent. */
61871
- precision: number().int().min(0).max(10).optional()
61749
+ lastFetchedAt: number()
61872
61750
  });
61873
61751
  DeviceType.Sensor;
61874
61752
  /**
@@ -61889,11 +61767,11 @@ DeviceType.Sensor;
61889
61767
  */
61890
61768
  var GpsLocationSchema = object({
61891
61769
  /** Latitude in decimal degrees, -90..90. */
61892
- latitude: number().min(-90).max(90),
61770
+ latitude: number().min(-90).max(90).meta(readingMeta("angle")),
61893
61771
  /** Longitude in decimal degrees, -180..180. */
61894
- longitude: number().min(-180).max(180),
61772
+ longitude: number().min(-180).max(180).meta(readingMeta("angle")),
61895
61773
  /** Reported accuracy in meters (lower = better). */
61896
- accuracyMeters: number().nonnegative()
61774
+ accuracyMeters: number().nonnegative().meta(readingMeta("length"))
61897
61775
  });
61898
61776
  var PresenceStatusSchema = object({
61899
61777
  /** `home` / `not_home` / any user-defined zone name. */
@@ -61905,25 +61783,16 @@ var PresenceStatusSchema = object({
61905
61783
  gps: GpsLocationSchema.nullable(),
61906
61784
  /** Optional battery level of the tracking device (0..100). Null
61907
61785
  * when not reported. */
61908
- batteryPercent: number().min(0).max(100).nullable(),
61786
+ batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61909
61787
  /** Ms epoch when the slice was last updated. */
61910
61788
  lastChangedAt: number()
61911
61789
  });
61912
61790
  DeviceType.Presence;
61913
61791
  object({
61914
- /** Current pressure in hPa. */
61915
- hpa: number(),
61792
+ /** Current pressure in hPa. `null` when the sample was refused (D393). */
61793
+ hpa: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
61916
61794
  /** Ms epoch when the slice was last updated. */
61917
- lastFetchedAt: number(),
61918
- /** Live display unit from the upstream source (e.g. HA
61919
- * `attributes.unit_of_measurement`). The UI prefers this over the
61920
- * role's canonical unit. Absent → fall back to the canonical unit. */
61921
- unit: string().optional(),
61922
- /** Suggested decimal places for numeric display.
61923
- * Populated live from the upstream source when provided (e.g. HA
61924
- * `attributes.suggested_display_precision`). Falls back to
61925
- * auto-formatting when absent. */
61926
- precision: number().int().min(0).max(10).optional()
61795
+ lastFetchedAt: number()
61927
61796
  });
61928
61797
  DeviceType.Sensor;
61929
61798
  /**
@@ -62256,8 +62125,8 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
62256
62125
  }), _void(), { kind: "mutation" });
62257
62126
  var PtzAutotrackSettingsSchema = object({
62258
62127
  targetType: string().describe("Vendor target string (people/vehicle/pet); empty = camera default"),
62259
- stopDelaySeconds: number().int().min(0).max(300),
62260
- disappearDelaySeconds: number().int().min(0).max(300)
62128
+ stopDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration")),
62129
+ disappearDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration"))
62261
62130
  });
62262
62131
  /**
62263
62132
  * One option the camera advertises as a valid `targetType`. Drivers
@@ -62314,7 +62183,7 @@ object({
62314
62183
  /** null = unknown — never coerced to false (D393). */
62315
62184
  running: boolean().nullable(),
62316
62185
  /** Epoch ms the current boolean began; null while `running` is null. */
62317
- since: number().nullable(),
62186
+ since: number().nullable().meta(readingMeta("none")),
62318
62187
  source: RunningStateSourceSchema.meta({ label: "Source" }),
62319
62188
  phase: string().nullable(),
62320
62189
  /** null until a reading has been published (D393). */
@@ -63512,9 +63381,9 @@ var RecordTriggerSchema = _enum([
63512
63381
  */
63513
63382
  var RecordWindowSchema = object({
63514
63383
  trigger: RecordTriggerSchema,
63515
- day: number().int().min(0).max(6),
63516
- startMinute: number().int().min(0).max(1439),
63517
- endMinute: number().int().min(1).max(1440)
63384
+ day: number().int().min(0).max(6).meta(readingMeta("none")),
63385
+ startMinute: number().int().min(0).max(1439).meta(readingMeta("none")),
63386
+ endMinute: number().int().min(1).max(1440).meta(readingMeta("none"))
63518
63387
  });
63519
63388
  /** Status of one physical volume, as the camera itself describes it. */
63520
63389
  var OnboardStorageVolumeSchema = object({
@@ -63583,10 +63452,10 @@ object({
63583
63452
  /** Master "record to the card at all" switch. */
63584
63453
  enabled: boolean().nullable(),
63585
63454
  overwriteWhenFull: boolean().nullable(),
63586
- preRecordSec: number().nullable(),
63587
- postRecordSec: number().nullable(),
63455
+ preRecordSec: number().nullable().meta(readingMeta("duration")),
63456
+ postRecordSec: number().nullable().meta(readingMeta("duration")),
63588
63457
  /** Length of one recorded file, in minutes. */
63589
- segmentMinutes: number().nullable(),
63458
+ segmentMinutes: number().nullable().meta(readingMeta("none")),
63590
63459
  /** The primary track's weekly windows, flattened. */
63591
63460
  windows: array(RecordWindowSchema),
63592
63461
  /**
@@ -63602,7 +63471,7 @@ object({
63602
63471
  * provider reporting a non-zero count also reports the schedule as not
63603
63472
  * writable.
63604
63473
  */
63605
- unreadableWindows: number(),
63474
+ unreadableWindows: number().meta(readingMeta("count")),
63606
63475
  /**
63607
63476
  * The camera is scheduled to record and has NO usable storage.
63608
63477
  *
@@ -64248,7 +64117,7 @@ var CamStreamDescriptorSchema = object({
64248
64117
  url: string().optional(),
64249
64118
  codec: string().optional(),
64250
64119
  resolution: CamStreamResolutionSchema.optional(),
64251
- fps: number().positive().optional(),
64120
+ fps: number().positive().optional().meta(readingMeta("rate")),
64252
64121
  label: string().optional(),
64253
64122
  /** Device-level features (e.g. `battery-operated`) — drives broker policy. */
64254
64123
  deviceFeatures: array(string()).optional(),
@@ -64278,18 +64147,18 @@ var StreamProfileSchema = _enum([
64278
64147
  ]);
64279
64148
  /** The current encoding config of one stream profile. */
64280
64149
  var StreamProfileConfigSchema = object({
64281
- width: number(),
64282
- height: number(),
64150
+ width: number().meta(readingMeta("none")),
64151
+ height: number().meta(readingMeta("none")),
64283
64152
  codec: _enum(["h264", "h265"]),
64284
- framerate: number(),
64285
- bitrate: number(),
64153
+ framerate: number().meta(readingMeta("rate")),
64154
+ bitrate: number().meta(readingMeta("bitrate")),
64286
64155
  bitrateMode: _enum(["vbr", "cbr"]).optional(),
64287
64156
  encoderProfile: _enum([
64288
64157
  "high",
64289
64158
  "main",
64290
64159
  "baseline"
64291
64160
  ]).optional(),
64292
- gop: number().optional(),
64161
+ gop: number().optional().meta(readingMeta("none")),
64293
64162
  /**
64294
64163
  * Whether THIS profile currently carries an audio track. READ-ONLY here.
64295
64164
  *
@@ -64936,35 +64805,21 @@ DeviceType.Sensor;
64936
64805
  * entries with `device_class: temperature` and any future native
64937
64806
  * thermometer.
64938
64807
  *
64939
- * Unit normalisation: providers convert to Celsius before storing.
64940
- * The slice value is always Celsius so cross-cap aggregators
64941
- * (climate-control's `currentTemp`, energy analytics) can compose
64942
- * without per-source unit fixups. The canonical display unit (`°C`) is
64943
- * a descriptor constant in the UI (ROLE_DESCRIPTOR), not stored in
64944
- * `sourceInfo`.
64808
+ * The number is Celsius (D944). Providers convert on ingest. A failed
64809
+ * conversion is `null`, never a guess. Display unit is a read-time preference.
64945
64810
  *
64946
64811
  * Status `lastFetchedAt` lets staleness-aware consumers detect a
64947
64812
  * frozen feed (provider hung) distinct from a "temperature hasn't
64948
64813
  * changed" steady state.
64949
64814
  */
64950
64815
  var TemperatureSensorStatusSchema = object({
64951
- /** Current temperature in Celsius. */
64952
- celsius: number().meta({
64953
- unit: "°C",
64816
+ /** Current temperature in Celsius. `null` when the sample was refused (D393). */
64817
+ celsius: number().nullable().meta(readingMeta("temperature", {
64818
+ precision: 1,
64954
64819
  label: "Temperature"
64955
- }),
64820
+ })),
64956
64821
  /** Ms epoch when the slice was last updated (push or poll). */
64957
- lastFetchedAt: number(),
64958
- /** Live display unit from the upstream source (e.g. HA
64959
- * `attributes.unit_of_measurement`). The UI prefers this over the
64960
- * role's canonical unit, so a Fahrenheit feed renders '°F' not '°C'.
64961
- * Absent → the UI falls back to the role's canonical unit. */
64962
- unit: string().optional(),
64963
- /** Suggested decimal places for numeric display.
64964
- * Populated live from the upstream source when provided (e.g. HA
64965
- * `attributes.suggested_display_precision`). Falls back to
64966
- * auto-formatting when absent. */
64967
- precision: number().int().min(0).max(10).optional()
64822
+ lastFetchedAt: number()
64968
64823
  });
64969
64824
  DeviceType.Sensor, DeviceType.Thermostat;
64970
64825
  /**
@@ -65216,16 +65071,16 @@ object({
65216
65071
  ]),
65217
65072
  /** 0..100 battery percentage. Null when the device has no battery
65218
65073
  * reading. */
65219
- batteryLevel: number().min(0).max(100).nullable(),
65074
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
65220
65075
  /** Current fan-speed token (provider-verbatim). Null when unknown or
65221
65076
  * the vacuum has no speed control. */
65222
65077
  fanSpeed: string().nullable(),
65223
65078
  /** Speed tokens the hardware accepts — drives the UI selector. */
65224
65079
  availableFanSpeeds: array(string()),
65225
65080
  /** 0..100 cleaning-completion percentage of the current task, or null. */
65226
- progressPercent: number().min(0).max(100).nullable(),
65081
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
65227
65082
  /** Current error code (0 / null = no error). */
65228
- errorCode: number().nullable(),
65083
+ errorCode: number().nullable().meta(readingMeta("none")),
65229
65084
  /** Human label for {@link errorCode}, or null when none / undecodable. */
65230
65085
  errorLabel: string().nullable(),
65231
65086
  /** Ms epoch when the slice was last updated. */
@@ -65264,7 +65119,7 @@ object({
65264
65119
  ]),
65265
65120
  /** 0 = fully closed, 100 = fully open. Null when the device has no
65266
65121
  * intermediate position surface. */
65267
- position: number().min(0).max(100).nullable(),
65122
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
65268
65123
  /** Ms epoch when the slice was last updated. */
65269
65124
  lastChangedAt: number()
65270
65125
  });
@@ -65292,9 +65147,9 @@ object({
65292
65147
  DeviceType.Sensor;
65293
65148
  object({
65294
65149
  /** Current measured temperature. Null when not reported. */
65295
- currentTemp: number().nullable(),
65150
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
65296
65151
  /** Target temperature setpoint. Null when no setpoint surface. */
65297
- targetTemp: number().nullable(),
65152
+ targetTemp: number().nullable().meta(readingMeta("temperature")),
65298
65153
  /** Active operation mode = HA `state` (`eco` / `electric` / `gas` /
65299
65154
  * `heat_pump` / `high_demand` / `performance` / `off`). Null when the
65300
65155
  * device reports an unknown state. */
@@ -65305,9 +65160,9 @@ object({
65305
65160
  * has no away surface. */
65306
65161
  away: boolean().nullable(),
65307
65162
  /** HA `min_temp` attribute. Null when not reported. */
65308
- minTemp: number().nullable(),
65163
+ minTemp: number().nullable().meta(readingMeta("temperature")),
65309
65164
  /** HA `max_temp` attribute. Null when not reported. */
65310
- maxTemp: number().nullable(),
65165
+ maxTemp: number().nullable().meta(readingMeta("temperature")),
65311
65166
  /** Ms epoch when the slice was last updated. */
65312
65167
  lastChangedAt: number()
65313
65168
  });
@@ -65331,25 +65186,18 @@ DeviceType.WaterHeater, method(object({
65331
65186
  auth: "protected"
65332
65187
  });
65333
65188
  object({
65334
- /** Verbatim HA condition state (`sunny`, `cloudy`, `rainy`, …). Null
65335
- * when no condition has been reported yet. */
65189
+ /** Verbatim condition state (`sunny`, `cloudy`, `rainy`, …). Null when none yet. */
65336
65190
  condition: string().nullable(),
65337
- /** Current temperature in the reported unit. Null when not provided. */
65338
- temperature: number().nullable(),
65339
- /** Temperature unit string (e.g. `°C` / `°F`). Null when not provided. */
65340
- temperatureUnit: string().nullable(),
65191
+ /** Current temperature in Celsius. Null when not provided or refused. */
65192
+ temperature: number().nullable().meta(readingMeta("temperature", { precision: 1 })),
65341
65193
  /** Relative humidity (0..100). Null when not provided. */
65342
- humidity: number().min(0).max(100).nullable(),
65343
- /** Barometric pressure in the reported unit. Null when not provided. */
65344
- pressure: number().nullable(),
65345
- /** Pressure unit string (e.g. `hPa` / `inHg`). Null when not provided. */
65346
- pressureUnit: string().nullable(),
65347
- /** Wind speed in the reported unit. Null when not provided. */
65348
- windSpeed: number().nullable(),
65349
- /** Wind-speed unit string (e.g. `km/h` / `mph`). Null when not provided. */
65350
- windSpeedUnit: string().nullable(),
65194
+ humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
65195
+ /** Barometric pressure in hPa. Null when not provided or refused. */
65196
+ pressure: number().nullable().meta(readingMeta("pressure")),
65197
+ /** Wind speed in metres per second. Null when not provided or refused. */
65198
+ windSpeed: number().nullable().meta(readingMeta("speed")),
65351
65199
  /** Wind bearing in degrees (0..360, meteorological). Null when not provided. */
65352
- windBearing: number().nullable(),
65200
+ windBearing: number().nullable().meta(readingMeta("angle")),
65353
65201
  /** Ms epoch when the slice was last updated. */
65354
65202
  lastFetchedAt: number()
65355
65203
  });
@@ -79224,7 +79072,6 @@ var SENSOR_CAP_VOCABULARY = {
79224
79072
  field: "value",
79225
79073
  quantity: t("the reading", "il valore"),
79226
79074
  label: t("Reading", "Valore"),
79227
- unitField: "unit",
79228
79075
  icon: "gauge"
79229
79076
  }]
79230
79077
  },
@@ -79360,7 +79207,7 @@ var SENSOR_CAP_VOCABULARY = {
79360
79207
  field: "temperature",
79361
79208
  quantity: t("the outdoor temperature", "la temperatura esterna"),
79362
79209
  label: t("Temperature", "Temperatura"),
79363
- unitField: "temperatureUnit",
79210
+ unit: "°C",
79364
79211
  icon: "thermometer"
79365
79212
  },
79366
79213
  {
@@ -79376,7 +79223,7 @@ var SENSOR_CAP_VOCABULARY = {
79376
79223
  field: "windSpeed",
79377
79224
  quantity: t("the wind speed", "la velocità del vento"),
79378
79225
  label: t("Wind", "Vento"),
79379
- unitField: "windSpeedUnit",
79226
+ unit: "m/s",
79380
79227
  icon: "wind"
79381
79228
  },
79382
79229
  {
@@ -79384,7 +79231,7 @@ var SENSOR_CAP_VOCABULARY = {
79384
79231
  field: "pressure",
79385
79232
  quantity: t("the air pressure", "la pressione atmosferica"),
79386
79233
  label: t("Pressure", "Pressione"),
79387
- unitField: "pressureUnit",
79234
+ unit: "hPa",
79388
79235
  icon: "gauge"
79389
79236
  }
79390
79237
  ]
@@ -133745,7 +133592,7 @@ var SENSOR_SPECS = {
133745
133592
  addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.TemperatureSensor, name, subtype),
133746
133593
  getStatus: (proxy) => proxy.temperatureSensor?.getStatus({}),
133747
133594
  subscribe: (proxy, onValue) => proxy.state.temperatureSensor?.subscribe(onValue) ?? null,
133748
- read: reader(TemperatureSensorStatusSchema.pick({ celsius: true }), (status) => [{
133595
+ read: reader(TemperatureSensorStatusSchema.pick({ celsius: true }), (status) => status.celsius === null ? [] : [{
133749
133596
  characteristic: import_dist.Characteristic.CurrentTemperature,
133750
133597
  value: status.celsius
133751
133598
  }])
@@ -133755,7 +133602,7 @@ var SENSOR_SPECS = {
133755
133602
  addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.HumiditySensor, name, subtype),
133756
133603
  getStatus: (proxy) => proxy.humiditySensor?.getStatus({}),
133757
133604
  subscribe: (proxy, onValue) => proxy.state.humiditySensor?.subscribe(onValue) ?? null,
133758
- read: reader(HumiditySensorStatusSchema.pick({ percent: true }), (status) => [{
133605
+ read: reader(HumiditySensorStatusSchema.pick({ percent: true }), (status) => status.percent === null ? [] : [{
133759
133606
  characteristic: import_dist.Characteristic.CurrentRelativeHumidity,
133760
133607
  value: status.percent
133761
133608
  }])
@@ -133765,7 +133612,7 @@ var SENSOR_SPECS = {
133765
133612
  addService: (accessory, name, subtype) => accessory.addService(import_dist.Service.LightSensor, name, subtype),
133766
133613
  getStatus: (proxy) => proxy.ambientLightSensor?.getStatus({}),
133767
133614
  subscribe: (proxy, onValue) => proxy.state.ambientLightSensor?.subscribe(onValue) ?? null,
133768
- read: reader(AmbientLightSensorStatusSchema.pick({ lux: true }), (status) => [{
133615
+ read: reader(AmbientLightSensorStatusSchema.pick({ lux: true }), (status) => status.lux === null ? [] : [{
133769
133616
  characteristic: import_dist.Characteristic.CurrentAmbientLightLevel,
133770
133617
  value: Math.max(MIN_LUX, status.lux)
133771
133618
  }])