@camstack/addon-export-alexa 1.2.168 → 1.2.169

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.
@@ -5440,7 +5440,7 @@ var ZodIssueCode = {
5440
5440
  var ZodFirstPartyTypeKind;
5441
5441
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5442
5442
  //#endregion
5443
- //#region ../types/dist/sleep-BErAxhul.mjs
5443
+ //#region ../types/dist/sleep-CARd6wZF.mjs
5444
5444
  /**
5445
5445
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5446
5446
  * window to float samples (D455).
@@ -7927,6 +7927,52 @@ var RecordKindDeclarationSchema = object({
7927
7927
  }).strict();
7928
7928
  /** The kind names: lower-case, dash separated, short enough for an index name. */
7929
7929
  var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
7930
+ var READING_QUANTITIES = [
7931
+ "temperature",
7932
+ "pressure",
7933
+ "speed",
7934
+ "precipitation",
7935
+ "precipitation-rate",
7936
+ "length",
7937
+ "area",
7938
+ "illuminance",
7939
+ "irradiance",
7940
+ "power",
7941
+ "energy",
7942
+ "voltage",
7943
+ "current",
7944
+ "apparent-power",
7945
+ "humidity",
7946
+ "percentage",
7947
+ "concentration-volume",
7948
+ "concentration-mass",
7949
+ "concentration-ppb",
7950
+ "volume",
7951
+ "duration",
7952
+ "duration-ms",
7953
+ "information",
7954
+ "sound-level",
7955
+ "signal-level",
7956
+ "colour-temperature",
7957
+ "angle",
7958
+ "bitrate",
7959
+ "rate",
7960
+ "mass",
7961
+ "index",
7962
+ "ratio",
7963
+ "count",
7964
+ "none",
7965
+ "device"
7966
+ ];
7967
+ var ReadingQuantitySchema = _enum(READING_QUANTITIES);
7968
+ new Set(READING_QUANTITIES);
7969
+ function readingMeta(quantity, extras) {
7970
+ return {
7971
+ quantity,
7972
+ ...extras?.precision !== void 0 ? { precision: extras.precision } : {},
7973
+ ...extras?.label !== void 0 ? { label: extras.label } : {}
7974
+ };
7975
+ }
7930
7976
  /** Shared Zod schemas used across streaming capabilities. */
7931
7977
  var CamProfileSchema = _enum([
7932
7978
  "high",
@@ -7954,8 +8000,8 @@ var CamStreamKindSchema = _enum([
7954
8000
  "derived"
7955
8001
  ]);
7956
8002
  var CamStreamResolutionSchema = object({
7957
- width: number().int().positive(),
7958
- height: number().int().positive()
8003
+ width: number().int().positive().meta(readingMeta("none")),
8004
+ height: number().int().positive().meta(readingMeta("none"))
7959
8005
  });
7960
8006
  var CameraStreamSchema = object({
7961
8007
  /** Stable, provider-assigned id unique within the (deviceId) scope. */
@@ -8620,14 +8666,6 @@ Object.freeze({
8620
8666
  {
8621
8667
  "path": "aqi",
8622
8668
  "valueType": "number"
8623
- },
8624
- {
8625
- "path": "unit",
8626
- "valueType": "string"
8627
- },
8628
- {
8629
- "path": "precision",
8630
- "valueType": "number"
8631
8669
  }
8632
8670
  ],
8633
8671
  "alarm-panel": [
@@ -8663,20 +8701,10 @@ Object.freeze({
8663
8701
  "valueType": "boolean"
8664
8702
  }
8665
8703
  ],
8666
- "ambient-light-sensor": [
8667
- {
8668
- "path": "lux",
8669
- "valueType": "number"
8670
- },
8671
- {
8672
- "path": "unit",
8673
- "valueType": "string"
8674
- },
8675
- {
8676
- "path": "precision",
8677
- "valueType": "number"
8678
- }
8679
- ],
8704
+ "ambient-light-sensor": [{
8705
+ "path": "lux",
8706
+ "valueType": "number"
8707
+ }],
8680
8708
  "audio-metrics": [
8681
8709
  {
8682
8710
  "path": "ts",
@@ -8756,6 +8784,10 @@ Object.freeze({
8756
8784
  "path": "lastUpdated",
8757
8785
  "valueType": "number"
8758
8786
  },
8787
+ {
8788
+ "path": "volts",
8789
+ "valueType": "number"
8790
+ },
8759
8791
  {
8760
8792
  "path": "lastContactAt",
8761
8793
  "valueType": "number"
@@ -8998,10 +9030,6 @@ Object.freeze({
8998
9030
  "datetime"
8999
9031
  ]
9000
9032
  },
9001
- {
9002
- "path": "unit",
9003
- "valueType": "string"
9004
- },
9005
9033
  {
9006
9034
  "path": "min",
9007
9035
  "valueType": "number"
@@ -9013,19 +9041,6 @@ Object.freeze({
9013
9041
  {
9014
9042
  "path": "step",
9015
9043
  "valueType": "number"
9016
- },
9017
- {
9018
- "path": "precision",
9019
- "valueType": "number"
9020
- },
9021
- {
9022
- "path": "format",
9023
- "valueType": "enum",
9024
- "enumValues": [
9025
- "date",
9026
- "time",
9027
- "datetime"
9028
- ]
9029
9044
  }
9030
9045
  ],
9031
9046
  "cover": [
@@ -9266,13 +9281,8 @@ Object.freeze({
9266
9281
  "path": "value",
9267
9282
  "valueType": "string"
9268
9283
  }, {
9269
- "path": "format",
9270
- "valueType": "enum",
9271
- "enumValues": [
9272
- "date",
9273
- "time",
9274
- "datetime"
9275
- ]
9284
+ "path": "timestamp",
9285
+ "valueType": "boolean"
9276
9286
  }],
9277
9287
  "event-emitter": [
9278
9288
  {
@@ -9379,20 +9389,10 @@ Object.freeze({
9379
9389
  "valueType": "number"
9380
9390
  }
9381
9391
  ],
9382
- "humidity-sensor": [
9383
- {
9384
- "path": "percent",
9385
- "valueType": "number"
9386
- },
9387
- {
9388
- "path": "unit",
9389
- "valueType": "string"
9390
- },
9391
- {
9392
- "path": "precision",
9393
- "valueType": "number"
9394
- }
9395
- ],
9392
+ "humidity-sensor": [{
9393
+ "path": "percent",
9394
+ "valueType": "number"
9395
+ }],
9396
9396
  "image": [{
9397
9397
  "path": "url",
9398
9398
  "valueType": "string"
@@ -9731,20 +9731,10 @@ Object.freeze({
9731
9731
  "valueType": "boolean"
9732
9732
  }
9733
9733
  ],
9734
- "numeric-sensor": [
9735
- {
9736
- "path": "value",
9737
- "valueType": "number"
9738
- },
9739
- {
9740
- "path": "unit",
9741
- "valueType": "string"
9742
- },
9743
- {
9744
- "path": "precision",
9745
- "valueType": "number"
9746
- }
9747
- ],
9734
+ "numeric-sensor": [{
9735
+ "path": "value",
9736
+ "valueType": "number"
9737
+ }],
9748
9738
  "pet-feeder": [
9749
9739
  {
9750
9740
  "path": "foodLevel",
@@ -9836,14 +9826,6 @@ Object.freeze({
9836
9826
  {
9837
9827
  "path": "powerFactor",
9838
9828
  "valueType": "number"
9839
- },
9840
- {
9841
- "path": "unit",
9842
- "valueType": "string"
9843
- },
9844
- {
9845
- "path": "precision",
9846
- "valueType": "number"
9847
9829
  }
9848
9830
  ],
9849
9831
  "presence": [
@@ -9872,20 +9854,10 @@ Object.freeze({
9872
9854
  "valueType": "number"
9873
9855
  }
9874
9856
  ],
9875
- "pressure-sensor": [
9876
- {
9877
- "path": "hpa",
9878
- "valueType": "number"
9879
- },
9880
- {
9881
- "path": "unit",
9882
- "valueType": "string"
9883
- },
9884
- {
9885
- "path": "precision",
9886
- "valueType": "number"
9887
- }
9888
- ],
9857
+ "pressure-sensor": [{
9858
+ "path": "hpa",
9859
+ "valueType": "number"
9860
+ }],
9889
9861
  "privacy-mask": [{
9890
9862
  "path": "enabled",
9891
9863
  "valueType": "boolean"
@@ -10196,20 +10168,10 @@ Object.freeze({
10196
10168
  "path": "tampered",
10197
10169
  "valueType": "boolean"
10198
10170
  }],
10199
- "temperature-sensor": [
10200
- {
10201
- "path": "celsius",
10202
- "valueType": "number"
10203
- },
10204
- {
10205
- "path": "unit",
10206
- "valueType": "string"
10207
- },
10208
- {
10209
- "path": "precision",
10210
- "valueType": "number"
10211
- }
10212
- ],
10171
+ "temperature-sensor": [{
10172
+ "path": "celsius",
10173
+ "valueType": "number"
10174
+ }],
10213
10175
  "update": [
10214
10176
  {
10215
10177
  "path": "currentVersion",
@@ -10320,10 +10282,6 @@ Object.freeze({
10320
10282
  "path": "temperature",
10321
10283
  "valueType": "number"
10322
10284
  },
10323
- {
10324
- "path": "temperatureUnit",
10325
- "valueType": "string"
10326
- },
10327
10285
  {
10328
10286
  "path": "humidity",
10329
10287
  "valueType": "number"
@@ -10332,18 +10290,10 @@ Object.freeze({
10332
10290
  "path": "pressure",
10333
10291
  "valueType": "number"
10334
10292
  },
10335
- {
10336
- "path": "pressureUnit",
10337
- "valueType": "string"
10338
- },
10339
10293
  {
10340
10294
  "path": "windSpeed",
10341
10295
  "valueType": "number"
10342
10296
  },
10343
- {
10344
- "path": "windSpeedUnit",
10345
- "valueType": "string"
10346
- },
10347
10297
  {
10348
10298
  "path": "windBearing",
10349
10299
  "valueType": "number"
@@ -18007,7 +17957,8 @@ var CompositionProblemSchema = object({
18007
17957
  "item-field-reserved",
18008
17958
  "target-missing",
18009
17959
  "target-unreadable",
18010
- "not-replaceable"
17960
+ "not-replaceable",
17961
+ "native-capability-replace"
18011
17962
  ]),
18012
17963
  path: string(),
18013
17964
  message: string()
@@ -18065,9 +18016,11 @@ var CompositionFieldPlanSchema = object({
18065
18016
  reads: array(CompositionFieldReadSchema)
18066
18017
  });
18067
18018
  /**
18068
- * What a feature does to its target (D663): `new` builds a capability on a new
18069
- * device; on an existing device it `add`s a capability the device lacks, or
18070
- * `replace`s named fields of one it has natively.
18019
+ * What a feature does to its target (D663, D944): `new` builds a capability on a
18020
+ * new device; on an existing device it `add`s a capability the device lacks.
18021
+ * Replacing a capability the device already serves is refused
18022
+ * (`native-capability-replace`), not planned. `replace` remains on the claim
18023
+ * wire for a claim the hub already holds.
18071
18024
  */
18072
18025
  var CompositionFeatureModeSchema = _enum([
18073
18026
  "new",
@@ -19953,12 +19906,12 @@ method(object({ deviceId: number().int().nonnegative() }), DeviceAdminLinkSchema
19953
19906
  * providers detect renames by matching `uniqueId` and patch `id`
19954
19907
  * in-place so dispatch keeps working.
19955
19908
  *
19956
- * **Rendering metadata is NOT stored here.** Display fields (`unit`,
19957
- * `precision`) live in the cap STATUS SLICE so they flow live with every
19958
- * state push and are the single source of truth. The `device_class` tag is
19959
- * an HA-specific input that is consumed at the discovery boundary
19960
- * (`ha-domain-mapping`) to derive the CamStack `DeviceRole`; it is never
19961
- * stored after that point.
19909
+ * **Display unit and precision are NOT stored here.** They are a read-time
19910
+ * preference (D944). A polymorphic reading stores its `quantity` here once,
19911
+ * at adopt, and a date/time value stores `dateTimeShape` the same way —
19912
+ * neither is repeated on each sample. The `device_class` tag is an
19913
+ * HA-specific input consumed at the discovery boundary (`ha-domain-mapping`)
19914
+ * to derive the CamStack `DeviceRole`; it is never stored after that point.
19962
19915
  *
19963
19916
  * The `raw` escape hatch carries provider-specific attributes that don't
19964
19917
  * fit the structured slots (HA `attributes` whitelist, Reolink `deviceCache`
@@ -19972,6 +19925,14 @@ var SourceInfoSchema = object({
19972
19925
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
19973
19926
  * Used to detect rename when `id` changes. */
19974
19927
  uniqueId: string().optional(),
19928
+ /** Quantity of a polymorphic reading, written once at adopt (D944). */
19929
+ quantity: ReadingQuantitySchema.optional(),
19930
+ /** Date / time / datetime shape of a string reading, written once at adopt. */
19931
+ dateTimeShape: _enum([
19932
+ "date",
19933
+ "time",
19934
+ "datetime"
19935
+ ]).optional(),
19975
19936
  /** Provider-specific extras that don't fit the structured slots.
19976
19937
  * Whitelist what goes here per provider — do NOT dump entire HA
19977
19938
  * attribute blobs (would explode the meta JSON column). */
@@ -40909,7 +40870,8 @@ method(object({
40909
40870
  "enum"
40910
40871
  ]),
40911
40872
  enumValues: array(string()).optional(),
40912
- item: boolean().optional()
40873
+ item: boolean().optional(),
40874
+ quantity: ReadingQuantitySchema.optional()
40913
40875
  })).readonly(),
40914
40876
  itemArray: object({
40915
40877
  path: string(),
@@ -44709,8 +44671,8 @@ var MaskPolygonShapeSchema = object({
44709
44671
  /** Boolean cell grid — row-major, length === gridWidth*gridHeight. */
44710
44672
  var MaskGridShapeSchema = object({
44711
44673
  kind: literal("grid"),
44712
- gridWidth: number(),
44713
- gridHeight: number(),
44674
+ gridWidth: number().meta(readingMeta("none")),
44675
+ gridHeight: number().meta(readingMeta("none")),
44714
44676
  cells: array(boolean())
44715
44677
  });
44716
44678
  discriminatedUnion("kind", [
@@ -56120,46 +56082,27 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
56120
56082
  }), LogStreamEntrySchema, { kind: "subscription" });
56121
56083
  object({
56122
56084
  /** Carbon dioxide concentration in ppm. */
56123
- co2Ppm: number().min(0).optional(),
56085
+ co2Ppm: number().min(0).optional().meta(readingMeta("concentration-volume")),
56124
56086
  /** Total volatile organic compounds in ppb. */
56125
- vocPpb: number().min(0).optional(),
56087
+ vocPpb: number().min(0).optional().meta(readingMeta("concentration-ppb")),
56126
56088
  /** Particulate matter ≤ 2.5 μm in µg/m³. */
56127
- pm25: number().min(0).optional(),
56089
+ pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
56128
56090
  /** Particulate matter ≤ 10 μm in µg/m³. */
56129
- pm10: number().min(0).optional(),
56091
+ pm10: number().min(0).optional().meta(readingMeta("concentration-mass")),
56130
56092
  /** Composite AQI value (typically 0..500). */
56131
- aqi: number().optional(),
56093
+ aqi: number().optional().meta(readingMeta("index")),
56132
56094
  /** Ms epoch when the slice was last updated. */
56133
- lastFetchedAt: number(),
56134
- /** Live display unit of the single metric this slice carries (e.g. HA
56135
- * `attributes.unit_of_measurement` → 'ppm' / 'ppb' / 'µg/m³'). Each
56136
- * upstream `sensor.*` entity surfaces ONE device_class, so one unit
56137
- * per slice is unambiguous. */
56138
- unit: string().optional(),
56139
- /** Suggested decimal places for numeric display.
56140
- * Populated live from the upstream source when provided (e.g. HA
56141
- * `attributes.suggested_display_precision`). Falls back to
56142
- * auto-formatting when absent. */
56143
- precision: number().int().min(0).max(10).optional()
56095
+ lastFetchedAt: number()
56144
56096
  });
56145
56097
  DeviceType.Sensor;
56146
56098
  object({
56147
- /** Current illuminance in lux (lx). */
56148
- lux: number().min(0).meta({
56149
- unit: "lx",
56099
+ /** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
56100
+ lux: number().min(0).nullable().meta(readingMeta("illuminance", {
56101
+ precision: 0,
56150
56102
  label: "Illuminance"
56151
- }),
56103
+ })),
56152
56104
  /** Ms epoch when the slice was last updated. */
56153
- lastFetchedAt: number(),
56154
- /** Live display unit from the upstream source (e.g. HA
56155
- * `attributes.unit_of_measurement`). The UI prefers this over the
56156
- * role's canonical unit. Absent → fall back to the canonical unit. */
56157
- unit: string().optional(),
56158
- /** Suggested decimal places for numeric display.
56159
- * Populated live from the upstream source when provided (e.g. HA
56160
- * `attributes.suggested_display_precision`). Falls back to
56161
- * auto-formatting when absent. */
56162
- precision: number().int().min(0).max(10).optional()
56105
+ lastFetchedAt: number()
56163
56106
  });
56164
56107
  DeviceType.Sensor;
56165
56108
  /**
@@ -56304,10 +56247,7 @@ var BatteryStatusSchema = object({
56304
56247
  * Consumers must SKIP a null rather than coerce it — `battery-band` already
56305
56248
  * declines to band a non-finite reading, which is the correct shape.
56306
56249
  */
56307
- percentage: number().min(0).max(100).nullable().meta({
56308
- unit: "%",
56309
- label: "Charge"
56310
- }),
56250
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
56311
56251
  /**
56312
56252
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
56313
56253
  * Reolink-specific for the Solar Panel 2 accessory (will become
@@ -56334,7 +56274,14 @@ var BatteryStatusSchema = object({
56334
56274
  */
56335
56275
  sleeping: boolean().meta({ label: "Sleeping" }),
56336
56276
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
56337
- lastUpdated: number(),
56277
+ lastUpdated: number().meta(readingMeta("none")),
56278
+ /**
56279
+ * Battery voltage in volts, for a cell the firmware reports as voltage
56280
+ * rather than a percentage (Ecowitt capacitor packs). Absent on cameras
56281
+ * that only report charge. A second reading on this cap, not a second
56282
+ * `numeric-sensor` on the same device.
56283
+ */
56284
+ volts: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
56338
56285
  /**
56339
56286
  * Ms epoch of the last time the device PROVED it was reachable — a
56340
56287
  * completed firmware round-trip, an observed wake, or an inbound push
@@ -56406,7 +56353,7 @@ DeviceType.Sensor;
56406
56353
  */
56407
56354
  var BrightnessStatusSchema = object({
56408
56355
  /** Current level as 0..100 inclusive. Firmware-reported. */
56409
- percentage: number().min(0).max(100),
56356
+ percentage: number().min(0).max(100).meta(readingMeta("percentage")),
56410
56357
  /** Ms epoch of the last operator-driven change. Useful for UI freshness. */
56411
56358
  lastChangedAt: number()
56412
56359
  });
@@ -56791,21 +56738,21 @@ var ClimateControlStatusSchema = object({
56791
56738
  /** Single setpoint in Celsius. Used by single-target modes
56792
56739
  * (heat / cool / dry). Null when the device is in a range mode
56793
56740
  * (`heat_cool`) or has no setpoint at all (`fan_only`/`off`). */
56794
- target: number().nullable(),
56741
+ target: number().nullable().meta(readingMeta("temperature")),
56795
56742
  /** Upper bound of the dual setpoint in Celsius. Populated only
56796
56743
  * in `heat_cool` mode. */
56797
- targetHigh: number().nullable(),
56744
+ targetHigh: number().nullable().meta(readingMeta("temperature")),
56798
56745
  /** Lower bound of the dual setpoint in Celsius. Populated only
56799
56746
  * in `heat_cool` mode. */
56800
- targetLow: number().nullable(),
56747
+ targetLow: number().nullable().meta(readingMeta("temperature")),
56801
56748
  /** Target relative humidity (0..100). Null when the device has no
56802
56749
  * humidity control. */
56803
- targetHumidity: number().min(0).max(100).nullable(),
56750
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
56804
56751
  /** Current measured temperature in Celsius. Read-only — pushed by
56805
56752
  * the device's internal sensor. */
56806
- currentTemp: number().nullable(),
56753
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
56807
56754
  /** Current measured relative humidity (0..100). Read-only. */
56808
- currentHumidity: number().min(0).max(100).nullable(),
56755
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
56809
56756
  /** Vertical louver swing on/off. Null when the device has no vertical
56810
56757
  * swing surface (gate with `DeviceFeature.ClimateSwingVertical`). */
56811
56758
  swingVertical: boolean().nullable(),
@@ -56813,11 +56760,11 @@ var ClimateControlStatusSchema = object({
56813
56760
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
56814
56761
  swingHorizontal: boolean().nullable(),
56815
56762
  /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
56816
- minTemp: number().nullable().optional(),
56763
+ minTemp: number().nullable().optional().meta(readingMeta("temperature")),
56817
56764
  /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
56818
- maxTemp: number().nullable().optional(),
56765
+ maxTemp: number().nullable().optional().meta(readingMeta("temperature")),
56819
56766
  /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
56820
- tempStep: number().positive().nullable().optional(),
56767
+ tempStep: number().positive().nullable().optional().meta(readingMeta("temperature")),
56821
56768
  /** Ms epoch when the slice was last updated (push or command). */
56822
56769
  lastFetchedAt: number()
56823
56770
  });
@@ -56896,17 +56843,17 @@ DeviceType.Thermostat, DeviceType.Climate, method(object({
56896
56843
  * modes to expose in the picker without a slice fetch.
56897
56844
  */
56898
56845
  var RgbTripletSchema = object({
56899
- r: number().int().min(0).max(255),
56900
- g: number().int().min(0).max(255),
56901
- b: number().int().min(0).max(255)
56846
+ r: number().int().min(0).max(255).meta(readingMeta("none")),
56847
+ g: number().int().min(0).max(255).meta(readingMeta("none")),
56848
+ b: number().int().min(0).max(255).meta(readingMeta("none"))
56902
56849
  });
56903
56850
  var HsvTripletSchema = object({
56904
56851
  /** Hue in degrees, 0..360. */
56905
- h: number().min(0).max(360),
56852
+ h: number().min(0).max(360).meta(readingMeta("none")),
56906
56853
  /** Saturation as 0..100 inclusive. */
56907
- s: number().min(0).max(100),
56854
+ s: number().min(0).max(100).meta(readingMeta("none")),
56908
56855
  /** Value/brightness as 0..100 inclusive. */
56909
- v: number().min(0).max(100)
56856
+ v: number().min(0).max(100).meta(readingMeta("none"))
56910
56857
  });
56911
56858
  var ColorInputSchema = discriminatedUnion("mode", [
56912
56859
  object({
@@ -56935,7 +56882,7 @@ object({
56935
56882
  /** Populated when `mode === 'hsv'`. */
56936
56883
  hsv: HsvTripletSchema.optional(),
56937
56884
  /** Populated when `mode === 'mired'`. */
56938
- mireds: number().int().optional(),
56885
+ mireds: number().int().optional().meta(readingMeta("colour-temperature")),
56939
56886
  /** Ms epoch of the last operator-driven change. */
56940
56887
  lastChangedAt: number()
56941
56888
  });
@@ -57059,18 +57006,12 @@ _enum([
57059
57006
  "empty",
57060
57007
  "full"
57061
57008
  ]);
57062
- /** Units a remaining-life counter is reported in. Closed: the panel renders
57063
- * each. */
57064
- var ConsumableRemainingUnitSchema = _enum([
57065
- "days",
57066
- "hours",
57067
- "cycles"
57068
- ]);
57069
- /** Remaining life as a COUNT, not a percentage (the PetKit desiccant reports
57070
- * days). `value` null = unknown (D393). */
57009
+ /** Whether `remaining.value` is a duration in seconds or a dimensionless count. */
57010
+ var ConsumableRemainingKindSchema = _enum(["duration", "count"]);
57011
+ /** Remaining life. `value` null = unknown (D393). Duration is seconds. */
57071
57012
  var ConsumableRemainingSchema = object({
57072
- value: number().min(0).nullable(),
57073
- unit: ConsumableRemainingUnitSchema
57013
+ value: number().min(0).nullable().meta(readingMeta("device")),
57014
+ kind: ConsumableRemainingKindSchema
57074
57015
  });
57075
57016
  var ConsumablesStatusSchema = object({
57076
57017
  items: array(object({
@@ -57079,7 +57020,7 @@ var ConsumablesStatusSchema = object({
57079
57020
  /** Display name. */
57080
57021
  label: string().min(1),
57081
57022
  /** Remaining life % (`wear`) or fill % (`supply`, `waste`) when known (0..100). */
57082
- level: number().min(0).max(100).nullable(),
57023
+ level: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
57083
57024
  /** The provider's discrete verdict when known (binary mode). */
57084
57025
  status: ConsumableStatusSchema.nullable(),
57085
57026
  /** What the item is — decides whether low or full is bad. Absent = `wear`. */
@@ -57096,7 +57037,7 @@ var ConsumablesStatusSchema = object({
57096
57037
  })),
57097
57038
  lastChangedAt: number()
57098
57039
  });
57099
- Object.values(DeviceType), [...ConsumableRemainingUnitSchema.options], [...ConsumableStatusSchema.options], [...ConsumableKindSchema.options], [...ConsumableFormSchema.options];
57040
+ Object.values(DeviceType), [...ConsumableRemainingKindSchema.options], [...ConsumableStatusSchema.options], [...ConsumableKindSchema.options], [...ConsumableFormSchema.options];
57100
57041
  Object.values(DeviceType), method(object({
57101
57042
  deviceId: number().int().nonnegative(),
57102
57043
  key: string().min(1)
@@ -57133,39 +57074,17 @@ object({
57133
57074
  /** Current value. Numeric kind → number; select/text/datetime → string.
57134
57075
  * Datetime values are ISO 8601 strings (full timestamp, date-only,
57135
57076
  * or time-only — HA accepts all three forms). */
57136
- value: union([number(), string()]),
57077
+ value: union([number().meta(readingMeta("device")), string()]),
57137
57078
  /** Acceptable values when `kind === 'select'`. Empty for other kinds. */
57138
57079
  options: array(string()),
57139
57080
  /** Ms epoch when the slice was last updated. */
57140
57081
  lastChangedAt: number(),
57141
- /** Display unit-of-measurement (e.g. '°C', '%', 'lx').
57142
- * Populated live from HA `attributes.unit_of_measurement` on each push.
57143
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57144
- unit: string().optional(),
57145
- /** Minimum allowed value. Populated live from HA `attributes.min`.
57146
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57147
- min: number().optional(),
57148
- /** Maximum allowed value. Populated live from HA `attributes.max`.
57149
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57150
- max: number().optional(),
57151
- /** Step increment. Populated live from HA `attributes.step`.
57152
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
57153
- step: number().optional(),
57154
- /** Suggested decimal places for numeric display. Populated live from HA
57155
- * `attributes.suggested_display_precision`, or derived from `step` when the
57156
- * HA attribute is absent. Meaningful for `kind === 'numeric'`; absent for
57157
- * other kinds. Falls back to auto-formatting when absent. */
57158
- precision: number().int().min(0).max(10).optional(),
57159
- /** Date-picker granularity for `kind === 'datetime'`. 'date' → date-only,
57160
- * 'time' → time-only, 'datetime' → full timestamp. Absent for other kinds
57161
- * (UI defaults to 'datetime'). Derived live from the device's HA domain
57162
- * (date.* / time.* / datetime.*) or, for input_datetime, from the entity's
57163
- * `has_date`/`has_time` attributes on each push. */
57164
- format: _enum([
57165
- "date",
57166
- "time",
57167
- "datetime"
57168
- ]).optional()
57082
+ /** Minimum allowed value, in the device quantity's base unit. */
57083
+ min: number().optional().meta(readingMeta("device")),
57084
+ /** Maximum allowed value, in the device quantity's base unit. */
57085
+ max: number().optional().meta(readingMeta("device")),
57086
+ /** Step increment, in the device quantity's base unit. */
57087
+ step: number().optional().meta(readingMeta("device"))
57169
57088
  });
57170
57089
  var ControlSetValueInputSchema = discriminatedUnion("kind", [
57171
57090
  object({
@@ -57203,9 +57122,9 @@ var CoverStatusSchema = object({
57203
57122
  ]),
57204
57123
  /** 0 = fully closed, 100 = fully open. Null when the device has
57205
57124
  * no intermediate position surface. */
57206
- position: number().min(0).max(100).nullable(),
57125
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
57207
57126
  /** 0 = closed slats, 100 = open slats. Null when no tilt support. */
57208
- tiltPosition: number().min(0).max(100).nullable(),
57127
+ tiltPosition: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
57209
57128
  /** Ms epoch when the slice was last updated. */
57210
57129
  lastChangedAt: number()
57211
57130
  });
@@ -57263,9 +57182,9 @@ var NormalizedRangeSchema$1 = object({
57263
57182
  object({
57264
57183
  mode: DayNightModeSchema,
57265
57184
  /** IR-cut trigger sensitivity, NORMALIZED 0–100 (higher = switches to night sooner). */
57266
- sensitivity: number().optional(),
57185
+ sensitivity: number().optional().meta(readingMeta("none")),
57267
57186
  /** Delay before the IR-cut filter flips, in seconds. */
57268
- switchDelaySec: number().optional(),
57187
+ switchDelaySec: number().optional().meta(readingMeta("duration")),
57269
57188
  lastFetchedAt: number()
57270
57189
  });
57271
57190
  /**
@@ -57420,11 +57339,11 @@ object({
57420
57339
  /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
57421
57340
  availablePrograms: array(string()),
57422
57341
  /** Seconds remaining on the active cycle, or null when not running / not known. */
57423
- remainingSeconds: number().int().nonnegative().nullable(),
57342
+ remainingSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
57424
57343
  /** Seconds the delayed start is set to (time until the cycle starts), or null. */
57425
- delayedStartSeconds: number().int().nonnegative().nullable(),
57344
+ delayedStartSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
57426
57345
  /** Cycle completion 0..100, or null when not applicable. */
57427
- progressPercent: number().min(0).max(100).nullable(),
57346
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
57428
57347
  /** True when the door is reported open; null when the door state is not known. */
57429
57348
  doorOpen: boolean().nullable(),
57430
57349
  /** True when the door is latched (locked) during a cycle; null when not reported. */
@@ -57448,7 +57367,7 @@ object({
57448
57367
  /** True while the machine-care (descaling / cleaning-program) reminder is raised; false when clear; null when not reported. */
57449
57368
  machineCareDue: boolean().nullable(),
57450
57369
  /** Program runs left before the machine-care reminder is due; null when the appliance does not say. */
57451
- machineCareRemainingRuns: number().int().nonnegative().nullable(),
57370
+ machineCareRemainingRuns: number().int().nonnegative().nullable().meta(readingMeta("count")),
57452
57371
  /** Option states: null when the appliance does not expose the option or has not said. */
57453
57372
  halfLoad: boolean().nullable(),
57454
57373
  hygienePlus: boolean().nullable(),
@@ -57463,7 +57382,7 @@ object({
57463
57382
  /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
57464
57383
  activeEvents: array(string()),
57465
57384
  /** Numeric error code when the appliance reports one; null otherwise. */
57466
- errorCode: number().nullable(),
57385
+ errorCode: number().nullable().meta(readingMeta("none")),
57467
57386
  /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
57468
57387
  errorLabel: string().nullable(),
57469
57388
  /** Ms epoch of the last value received from the appliance; 0 = never. */
@@ -57609,24 +57528,14 @@ object({
57609
57528
  /** Ms epoch of the last press. null = never observed since this provider started. */
57610
57529
  lastPressedAt: number().nullable(),
57611
57530
  /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
57612
- pressCountSinceStart: number()
57531
+ pressCountSinceStart: number().meta(readingMeta("count"))
57613
57532
  });
57614
57533
  object({
57615
57534
  deviceId: number(),
57616
57535
  timestamp: number()
57617
57536
  });
57618
57537
  DeviceType.Button, DeviceType.Camera;
57619
- /**
57620
- * Enum-state sensor — a string value picked from a finite option set.
57621
- * Drives HA `sensor` entries with `state_class: enum` (HVAC action
57622
- * states, weather conditions, contact-source channels, mode strings).
57623
- * The option set is stable across observations; it is persisted in the
57624
- * device config blob (via the control slice at adoption) and is NOT
57625
- * stored in `sourceInfo`.
57626
- */
57627
- /** Locale-render shape for an ISO `value` carried by a `DateTimeSensor`-role
57628
- * enum sensor: `date` (date-only), `time` (time-only), `datetime` (both). */
57629
- var EnumSensorDateTimeFormatSchema = _enum([
57538
+ _enum([
57630
57539
  "date",
57631
57540
  "time",
57632
57541
  "datetime"
@@ -57634,12 +57543,11 @@ var EnumSensorDateTimeFormatSchema = _enum([
57634
57543
  object({
57635
57544
  value: string(),
57636
57545
  /**
57637
- * Set for `DateTimeSensor`-role sensors so the UI renders the ISO `value`
57638
- * as a locale date/time/datetime; absent for plain enum sensors. HA
57639
- * `device_class=timestamp` → `'datetime'`, `device_class=date` → `'date'`,
57640
- * a time-only sensor → `'time'`.
57546
+ * Set when `value` is a timestamp rather than an enum state, so history
57547
+ * does not learn ISO strings as states. The display shape (date / time /
57548
+ * datetime) lives on `SourceInfo.dateTimeShape`, written once at adopt.
57641
57549
  */
57642
- format: EnumSensorDateTimeFormatSchema.optional(),
57550
+ timestamp: boolean().optional(),
57643
57551
  /** Ms epoch when the slice was last updated. */
57644
57552
  lastFetchedAt: number()
57645
57553
  });
@@ -57658,13 +57566,13 @@ var EventFireSchema = object({
57658
57566
  deviceId: number(),
57659
57567
  eventType: string(),
57660
57568
  data: record(string(), unknown()).nullable(),
57661
- timestamp: number(),
57662
- seq: number()
57569
+ timestamp: number().meta(readingMeta("none")),
57570
+ seq: number().meta(readingMeta("count"))
57663
57571
  });
57664
57572
  object({
57665
57573
  eventTypes: array(string()),
57666
57574
  lastEvent: EventFireSchema.nullable(),
57667
- eventCountSinceStart: number()
57575
+ eventCountSinceStart: number().meta(readingMeta("count"))
57668
57576
  });
57669
57577
  DeviceType.EventEmitter;
57670
57578
  var IdentitySchema = object({
@@ -58053,10 +57961,10 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
58053
57961
  object({
58054
57962
  /** Active speed as 0..100 inclusive. Null when the device has no
58055
57963
  * speed surface (single-speed fan). */
58056
- percentage: number().min(0).max(100).nullable(),
57964
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58057
57965
  /** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
58058
57966
  * a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
58059
- percentageStep: number().positive().optional(),
57967
+ percentageStep: number().positive().optional().meta(readingMeta("percentage")),
58060
57968
  /** Active preset mode (`auto` / `quiet` / `turbo` / vendor-specific)
58061
57969
  * — empty string when no preset is active or supported. */
58062
57970
  preset: string(),
@@ -58138,7 +58046,7 @@ var FeatureProbeStatusSchema = object({
58138
58046
  /** Camera/firmware model string. `null` when the firmware doesn't expose it. */
58139
58047
  model: string().nullable(),
58140
58048
  /** Channel count for NVR/Hub devices; `1` for standalone cameras; `null` pre-probe. */
58141
- channelCount: number().nullable(),
58049
+ channelCount: number().nullable().meta(readingMeta("count")),
58142
58050
  /**
58143
58051
  * Ms epoch of the last SUCCESSFUL probe. `0` before the first probe
58144
58052
  * completes — drivers' `getAccessoryChildren()` should treat zero as
@@ -58172,7 +58080,7 @@ object({
58172
58080
  DeviceType.Sensor;
58173
58081
  object({
58174
58082
  /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
58175
- position: number().min(0).max(100).nullable(),
58083
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58176
58084
  /** Ms epoch when the slice was last updated (push or poll). */
58177
58085
  lastFetchedAt: number()
58178
58086
  });
@@ -58181,9 +58089,9 @@ object({
58181
58089
  /** Whether the humidifier is currently on. */
58182
58090
  on: boolean(),
58183
58091
  /** Current measured relative humidity (0..100). Null when not reported. */
58184
- currentHumidity: number().min(0).max(100).nullable(),
58092
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
58185
58093
  /** Target relative humidity (0..100). Null when no setpoint surface. */
58186
- targetHumidity: number().min(0).max(100).nullable(),
58094
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
58187
58095
  /** Active mode (`auto` / `normal` / `baby` / vendor). Null when the
58188
58096
  * device has no mode surface. */
58189
58097
  mode: string().nullable(),
@@ -58193,9 +58101,9 @@ object({
58193
58101
  * `idle` / `off`). Null when the device doesn't report it. */
58194
58102
  action: string().nullable(),
58195
58103
  /** HA `min_humidity` attribute. Null → UI uses 0. */
58196
- minHumidity: number().nullable(),
58104
+ minHumidity: number().nullable().meta(readingMeta("humidity")),
58197
58105
  /** HA `max_humidity` attribute. Null → UI uses 100. */
58198
- maxHumidity: number().nullable(),
58106
+ maxHumidity: number().nullable().meta(readingMeta("humidity")),
58199
58107
  /** Ms epoch when the slice was last updated. */
58200
58108
  lastChangedAt: number()
58201
58109
  });
@@ -58227,22 +58135,13 @@ DeviceType.Humidifier, method(object({
58227
58135
  * `sourceInfo`.
58228
58136
  */
58229
58137
  var HumiditySensorStatusSchema = object({
58230
- /** Current relative humidity, 0..100. */
58231
- percent: number().min(0).max(100).meta({
58232
- unit: "%",
58138
+ /** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
58139
+ percent: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
58140
+ precision: 0,
58233
58141
  label: "Humidity"
58234
- }),
58142
+ })),
58235
58143
  /** Ms epoch when the slice was last updated. */
58236
- lastFetchedAt: number(),
58237
- /** Live display unit from the upstream source (e.g. HA
58238
- * `attributes.unit_of_measurement`). The UI prefers this over the
58239
- * role's canonical unit. Absent → fall back to the canonical unit. */
58240
- unit: string().optional(),
58241
- /** Suggested decimal places for numeric display.
58242
- * Populated live from the upstream source when provided (e.g. HA
58243
- * `attributes.suggested_display_precision`). Falls back to
58244
- * auto-formatting when absent. */
58245
- precision: number().int().min(0).max(10).optional()
58144
+ lastFetchedAt: number()
58246
58145
  });
58247
58146
  DeviceType.Sensor, DeviceType.Thermostat;
58248
58147
  object({
@@ -58250,7 +58149,7 @@ object({
58250
58149
  * entity exposes no `entity_picture` (yet). */
58251
58150
  url: string().nullable(),
58252
58151
  /** Ms epoch of the upstream last-updated timestamp. Null at cold-start. */
58253
- lastUpdated: number().nullable()
58152
+ lastUpdated: number().nullable().meta(readingMeta("none"))
58254
58153
  });
58255
58154
  DeviceType.Image;
58256
58155
  /**
@@ -58306,19 +58205,19 @@ var NormalizedRangeSchema = object({
58306
58205
  });
58307
58206
  object({
58308
58207
  /** Normalized 0–100. */
58309
- brightness: number().optional(),
58208
+ brightness: number().optional().meta(readingMeta("none")),
58310
58209
  /** Normalized 0–100. */
58311
- contrast: number().optional(),
58210
+ contrast: number().optional().meta(readingMeta("none")),
58312
58211
  /** Normalized 0–100. */
58313
- saturation: number().optional(),
58212
+ saturation: number().optional().meta(readingMeta("none")),
58314
58213
  /** Normalized 0–100. */
58315
- sharpness: number().optional(),
58214
+ sharpness: number().optional().meta(readingMeta("none")),
58316
58215
  mirror: boolean().optional(),
58317
58216
  flip: boolean().optional(),
58318
58217
  rotate: ImageRotateSchema.optional(),
58319
58218
  whiteBalance: WhiteBalanceModeSchema.optional(),
58320
58219
  /** Manual white-balance warmth, NORMALIZED 0–100. Meaningful only when `whiteBalance === 'manual'`. */
58321
- warmth: number().optional(),
58220
+ warmth: number().optional().meta(readingMeta("none")),
58322
58221
  exposureMode: ExposureModeSchema.optional(),
58323
58222
  backlightMode: BacklightModeSchema.optional(),
58324
58223
  lastFetchedAt: number()
@@ -58563,10 +58462,10 @@ var IntercomAbilitySchema = object({
58563
58462
  /** Codecs accepted by firmware, in preference order. Driver-authored strings. */
58564
58463
  codecs: array(string()),
58565
58464
  /** Sample rate (Hz) the firmware expects. Reolink typical: 16000. */
58566
- sampleRate: number(),
58465
+ sampleRate: number().meta(readingMeta("none")),
58567
58466
  duplex: _enum(["half", "full"]),
58568
58467
  /** Max in-flight audio backlog before drop (ms). Server uses this to bound latency. */
58569
- maxBacklogMs: number()
58468
+ maxBacklogMs: number().meta(readingMeta("duration-ms"))
58570
58469
  });
58571
58470
  var IntercomStatusSchema = object({
58572
58471
  /** True while a talk session is open. */
@@ -58677,13 +58576,13 @@ object({
58677
58576
  activity: LawnMowerActivitySchema,
58678
58577
  /** 0..100 battery percentage. Null when the device has no battery
58679
58578
  * reading. */
58680
- batteryLevel: number().min(0).max(100).nullable(),
58579
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58681
58580
  /** 0..100 mowing-completion percentage of the current task, or null when no
58682
58581
  * task is active / progress is unavailable. */
58683
- progressPercent: number().min(0).max(100).nullable(),
58582
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58684
58583
  /** Current device/event code (dynamic — mostly status, sometimes an error),
58685
58584
  * or null when unknown. */
58686
- currentCode: number().nullable(),
58585
+ currentCode: number().nullable().meta(readingMeta("none")),
58687
58586
  /** Human label for {@link currentCode}, or null when undecodable. */
58688
58587
  currentCodeLabel: string().nullable(),
58689
58588
  /** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
@@ -59145,7 +59044,7 @@ object({
59145
59044
  state: MediaPlayerStateSchema,
59146
59045
  /** Volume as 0..100 inclusive. Null when the device has no volume
59147
59046
  * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
59148
- volumeLevel: number().min(0).max(100).nullable(),
59047
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59149
59048
  /** Mute toggle distinct from volume=0. Null when no mute surface.
59150
59049
  * Pair with `DeviceFeature.MediaPlayerMute`. */
59151
59050
  isMuted: boolean().nullable(),
@@ -59158,10 +59057,10 @@ object({
59158
59057
  currentMedia: MediaInfoSchema.nullable(),
59159
59058
  /** Current playback position in ms. Null when not seekable or
59160
59059
  * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
59161
- positionMs: number().int().nonnegative().nullable(),
59060
+ positionMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
59162
59061
  /** Total duration of the current media in ms. Null when unknown
59163
59062
  * (live stream) or nothing is playing. */
59164
- durationMs: number().int().nonnegative().nullable(),
59063
+ durationMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
59165
59064
  /** Shuffle toggle. Null when no shuffle surface.
59166
59065
  * Pair with `DeviceFeature.MediaPlayerShuffle`. */
59167
59066
  shuffle: boolean().nullable(),
@@ -59461,7 +59360,7 @@ var MotionStatusSchema = object({
59461
59360
  * it, every provider seeded it at boot, and every session left it
59462
59361
  * `detected: true` after its detach.
59463
59362
  */
59464
- autoClearAfterMs: number().nullable()
59363
+ autoClearAfterMs: number().nullable().meta(readingMeta("duration-ms"))
59465
59364
  });
59466
59365
  /**
59467
59366
  * Payload of `motion.onMotionChanged` event + the corresponding bus
@@ -59511,7 +59410,7 @@ var MotionZoneRegionSchema = object({
59511
59410
  });
59512
59411
  object({
59513
59412
  enabled: boolean(),
59514
- sensitivity: number(),
59413
+ sensitivity: number().meta(readingMeta("none")),
59515
59414
  /** Grid region(s). Today exactly one `grid` shape. */
59516
59415
  regions: array(MotionZoneRegionSchema),
59517
59416
  lastFetchedAt: number()
@@ -59815,7 +59714,7 @@ var NavigationStatusSchema = object({
59815
59714
  following: boolean(),
59816
59715
  flash: boolean(),
59817
59716
  lightMode: NavigationLightModeSchema,
59818
- lightLevel: number().min(40).max(100),
59717
+ lightLevel: number().min(40).max(100).meta(readingMeta("none")),
59819
59718
  /** Ms epoch when the slice was last updated. */
59820
59719
  lastChangedAt: number()
59821
59720
  });
@@ -59861,13 +59760,13 @@ var NetworkLinkStatusSchema = object({
59861
59760
  * one whose reading has not landed must not be drawn at 0 %. Consumers
59862
59761
  * SKIP a null rather than coerce it.
59863
59762
  */
59864
- signalPercent: number().min(0).max(100).nullable(),
59763
+ signalPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59865
59764
  /** Raw received signal strength in dBm, when the firmware reports one. */
59866
- rssiDbm: number().optional(),
59765
+ rssiDbm: number().optional().meta(readingMeta("signal-level")),
59867
59766
  /** Network name of a wireless link, when the firmware reports it. */
59868
59767
  ssid: string().optional(),
59869
59768
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
59870
- lastUpdated: number()
59769
+ lastUpdated: number().meta(readingMeta("none"))
59871
59770
  });
59872
59771
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
59873
59772
  deviceId: number(),
@@ -60186,7 +60085,7 @@ object({
60186
60085
  lastError: string().nullable(),
60187
60086
  /** Number of deliveries currently buffered server-side (rate-limited
60188
60087
  * notifiers may queue). 0 when the provider sends synchronously. */
60189
- queueDepth: number().int().nonnegative(),
60088
+ queueDepth: number().int().nonnegative().meta(readingMeta("count")),
60190
60089
  /** Per-feature capability matrix — authoritative source for the
60191
60090
  * compose-form field gating. */
60192
60091
  supports: NotifierSupportsSchema
@@ -60236,15 +60135,8 @@ DeviceType.Notifier, method(NotifierSendInputSchema, NotifierSendResultSchema, {
60236
60135
  acceptedAt: number()
60237
60136
  });
60238
60137
  object({
60239
- value: number(),
60240
- /** Display unit-of-measurement (e.g. 'dBm', 's', 'rpm', 'steps').
60241
- * Populated live from the upstream source on each state push.
60242
- * Absent for unitless sensors. */
60243
- unit: string().optional(),
60244
- /** Suggested decimal places for numeric display.
60245
- * Populated live from the upstream source when provided.
60246
- * Falls back to auto-formatting when absent. */
60247
- precision: number().int().min(0).max(10).optional(),
60138
+ /** Reading in the device quantity's base unit. `null` when refused (D393). */
60139
+ value: number().nullable().meta(readingMeta("device")),
60248
60140
  /** Ms epoch when the slice was last updated. */
60249
60141
  lastFetchedAt: number()
60250
60142
  });
@@ -60534,23 +60426,26 @@ object({
60534
60426
  /** Food currently in the bowl (grams). Null when the device has not
60535
60427
  * reported a reading yet. On dual-hopper models this is the combined
60536
60428
  * bowl reading; per-hopper levels live in `food1`/`food2`. */
60537
- foodLevel: number().nullable(),
60429
+ foodLevel: number().nullable().meta(readingMeta("none")),
60538
60430
  /** Hopper-1 food level (grams) on dual-hopper feeders; null on
60539
60431
  * single-hopper models. */
60540
- food1: number().nullable(),
60432
+ food1: number().nullable().meta(readingMeta("none")),
60541
60433
  /** Hopper-2 food level (grams) on dual-hopper feeders; null on
60542
60434
  * single-hopper models. */
60543
- food2: number().nullable(),
60435
+ food2: number().nullable().meta(readingMeta("none")),
60544
60436
  /** Derived low-food flag — mirrors the HA `food_level` binary_sensor
60545
60437
  * (`device_class: problem`, on = low). True when the bowl is empty /
60546
60438
  * below the feeder's low threshold. */
60547
60439
  lowFood: boolean(),
60548
60440
  /** Battery charge 0..100 (%). Null on mains-powered models or when the
60549
60441
  * device has no battery reading. */
60550
- batteryPower: number().min(0).max(100).nullable(),
60551
- /** Days of desiccant life remaining. Null when the model has no
60552
- * desiccant sensor. */
60553
- desiccantLeftDays: number().nullable(),
60442
+ batteryPower: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60443
+ /**
60444
+ * Desiccant life remaining, stored in seconds (duration base, D944).
60445
+ * Providers convert from the days the feeder reports. Null when the
60446
+ * model has no desiccant sensor.
60447
+ */
60448
+ desiccantLeftDays: number().nullable().meta(readingMeta("duration")),
60554
60449
  /** True while a feed is in progress. */
60555
60450
  feeding: boolean(),
60556
60451
  /** Decoded connectivity / power status (HA petkit device-status enum).
@@ -60561,7 +60456,7 @@ object({
60561
60456
  * with `errorCode` for consumers that want the raw integer. */
60562
60457
  error: string().nullable(),
60563
60458
  /** Raw device error code (0 / null = no error). */
60564
- errorCode: number().nullable(),
60459
+ errorCode: number().nullable().meta(readingMeta("none")),
60565
60460
  /** True for D4S/D4SH dual-hopper hardware — gates the per-hopper UI. */
60566
60461
  isDualHopper: boolean(),
60567
60462
  /** Child-lock (manual-lock) setting — buttons on the unit are disabled. */
@@ -60571,7 +60466,7 @@ object({
60571
60466
  /** Play a chime when dispensing. */
60572
60467
  feedSound: boolean(),
60573
60468
  /** Speaker / prompt volume level (device-scaled integer). */
60574
- volume: number(),
60469
+ volume: number().meta(readingMeta("none")),
60575
60470
  /** Ms epoch when the slice was last refreshed from the cloud. */
60576
60471
  lastFetchedAt: number()
60577
60472
  });
@@ -61008,36 +60903,19 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
61008
60903
  });
61009
60904
  object({
61010
60905
  /** Instantaneous power draw in watts. */
61011
- watts: number().optional().meta({
61012
- unit: "W",
61013
- label: "Power"
61014
- }),
60906
+ watts: number().optional().meta(readingMeta("power", { label: "Power" })),
61015
60907
  /** Cumulative energy in kilowatt-hours since the meter was reset. */
61016
- kwhTotal: number().optional().meta({
61017
- unit: "kWh",
61018
- label: "Energy"
61019
- }),
60908
+ kwhTotal: number().optional().meta(readingMeta("energy", { label: "Energy" })),
61020
60909
  /** Voltage in volts. */
61021
- volts: number().optional(),
60910
+ volts: number().optional().meta(readingMeta("voltage")),
61022
60911
  /** Current in amperes. */
61023
- amps: number().optional(),
61024
- /** Apparent power in volt-amperes (W × power-factor reciprocal). */
61025
- va: number().optional(),
60912
+ amps: number().optional().meta(readingMeta("current")),
60913
+ /** Apparent power in volt-amperes. */
60914
+ va: number().optional().meta(readingMeta("apparent-power")),
61026
60915
  /** Power factor (0..1) if reported. */
61027
- powerFactor: number().min(0).max(1).optional(),
60916
+ powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
61028
60917
  /** Ms epoch when the slice was last updated. */
61029
- lastFetchedAt: number(),
61030
- /** Live display unit of the single metric this slice carries (e.g. HA
61031
- * `attributes.unit_of_measurement` → 'V' / 'A' / 'W' / 'kW' / 'kWh').
61032
- * Each upstream `sensor.*` entity surfaces ONE device_class, so one
61033
- * unit per slice is unambiguous. The UI prefers this over the role's
61034
- * canonical unit so a 'kW' / 'Wh' feed renders verbatim. */
61035
- unit: string().optional(),
61036
- /** Suggested decimal places for numeric display.
61037
- * Populated live from the upstream source when provided (e.g. HA
61038
- * `attributes.suggested_display_precision`). Falls back to
61039
- * auto-formatting when absent. */
61040
- precision: number().int().min(0).max(10).optional()
60918
+ lastFetchedAt: number()
61041
60919
  });
61042
60920
  DeviceType.Sensor;
61043
60921
  /**
@@ -61058,11 +60936,11 @@ DeviceType.Sensor;
61058
60936
  */
61059
60937
  var GpsLocationSchema = object({
61060
60938
  /** Latitude in decimal degrees, -90..90. */
61061
- latitude: number().min(-90).max(90),
60939
+ latitude: number().min(-90).max(90).meta(readingMeta("angle")),
61062
60940
  /** Longitude in decimal degrees, -180..180. */
61063
- longitude: number().min(-180).max(180),
60941
+ longitude: number().min(-180).max(180).meta(readingMeta("angle")),
61064
60942
  /** Reported accuracy in meters (lower = better). */
61065
- accuracyMeters: number().nonnegative()
60943
+ accuracyMeters: number().nonnegative().meta(readingMeta("length"))
61066
60944
  });
61067
60945
  var PresenceStatusSchema = object({
61068
60946
  /** `home` / `not_home` / any user-defined zone name. */
@@ -61074,25 +60952,16 @@ var PresenceStatusSchema = object({
61074
60952
  gps: GpsLocationSchema.nullable(),
61075
60953
  /** Optional battery level of the tracking device (0..100). Null
61076
60954
  * when not reported. */
61077
- batteryPercent: number().min(0).max(100).nullable(),
60955
+ batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61078
60956
  /** Ms epoch when the slice was last updated. */
61079
60957
  lastChangedAt: number()
61080
60958
  });
61081
60959
  DeviceType.Presence;
61082
60960
  object({
61083
- /** Current pressure in hPa. */
61084
- hpa: number(),
60961
+ /** Current pressure in hPa. `null` when the sample was refused (D393). */
60962
+ hpa: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
61085
60963
  /** Ms epoch when the slice was last updated. */
61086
- lastFetchedAt: number(),
61087
- /** Live display unit from the upstream source (e.g. HA
61088
- * `attributes.unit_of_measurement`). The UI prefers this over the
61089
- * role's canonical unit. Absent → fall back to the canonical unit. */
61090
- unit: string().optional(),
61091
- /** Suggested decimal places for numeric display.
61092
- * Populated live from the upstream source when provided (e.g. HA
61093
- * `attributes.suggested_display_precision`). Falls back to
61094
- * auto-formatting when absent. */
61095
- precision: number().int().min(0).max(10).optional()
60964
+ lastFetchedAt: number()
61096
60965
  });
61097
60966
  DeviceType.Sensor;
61098
60967
  /**
@@ -61425,8 +61294,8 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
61425
61294
  }), _void(), { kind: "mutation" });
61426
61295
  var PtzAutotrackSettingsSchema = object({
61427
61296
  targetType: string().describe("Vendor target string (people/vehicle/pet); empty = camera default"),
61428
- stopDelaySeconds: number().int().min(0).max(300),
61429
- disappearDelaySeconds: number().int().min(0).max(300)
61297
+ stopDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration")),
61298
+ disappearDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration"))
61430
61299
  });
61431
61300
  /**
61432
61301
  * One option the camera advertises as a valid `targetType`. Drivers
@@ -61483,7 +61352,7 @@ object({
61483
61352
  /** null = unknown — never coerced to false (D393). */
61484
61353
  running: boolean().nullable(),
61485
61354
  /** Epoch ms the current boolean began; null while `running` is null. */
61486
- since: number().nullable(),
61355
+ since: number().nullable().meta(readingMeta("none")),
61487
61356
  source: RunningStateSourceSchema.meta({ label: "Source" }),
61488
61357
  phase: string().nullable(),
61489
61358
  /** null until a reading has been published (D393). */
@@ -62681,9 +62550,9 @@ var RecordTriggerSchema = _enum([
62681
62550
  */
62682
62551
  var RecordWindowSchema = object({
62683
62552
  trigger: RecordTriggerSchema,
62684
- day: number().int().min(0).max(6),
62685
- startMinute: number().int().min(0).max(1439),
62686
- endMinute: number().int().min(1).max(1440)
62553
+ day: number().int().min(0).max(6).meta(readingMeta("none")),
62554
+ startMinute: number().int().min(0).max(1439).meta(readingMeta("none")),
62555
+ endMinute: number().int().min(1).max(1440).meta(readingMeta("none"))
62687
62556
  });
62688
62557
  /** Status of one physical volume, as the camera itself describes it. */
62689
62558
  var OnboardStorageVolumeSchema = object({
@@ -62752,10 +62621,10 @@ object({
62752
62621
  /** Master "record to the card at all" switch. */
62753
62622
  enabled: boolean().nullable(),
62754
62623
  overwriteWhenFull: boolean().nullable(),
62755
- preRecordSec: number().nullable(),
62756
- postRecordSec: number().nullable(),
62624
+ preRecordSec: number().nullable().meta(readingMeta("duration")),
62625
+ postRecordSec: number().nullable().meta(readingMeta("duration")),
62757
62626
  /** Length of one recorded file, in minutes. */
62758
- segmentMinutes: number().nullable(),
62627
+ segmentMinutes: number().nullable().meta(readingMeta("none")),
62759
62628
  /** The primary track's weekly windows, flattened. */
62760
62629
  windows: array(RecordWindowSchema),
62761
62630
  /**
@@ -62771,7 +62640,7 @@ object({
62771
62640
  * provider reporting a non-zero count also reports the schedule as not
62772
62641
  * writable.
62773
62642
  */
62774
- unreadableWindows: number(),
62643
+ unreadableWindows: number().meta(readingMeta("count")),
62775
62644
  /**
62776
62645
  * The camera is scheduled to record and has NO usable storage.
62777
62646
  *
@@ -63408,7 +63277,7 @@ var CamStreamDescriptorSchema = object({
63408
63277
  url: string().optional(),
63409
63278
  codec: string().optional(),
63410
63279
  resolution: CamStreamResolutionSchema.optional(),
63411
- fps: number().positive().optional(),
63280
+ fps: number().positive().optional().meta(readingMeta("rate")),
63412
63281
  label: string().optional(),
63413
63282
  /** Device-level features (e.g. `battery-operated`) — drives broker policy. */
63414
63283
  deviceFeatures: array(string()).optional(),
@@ -63438,18 +63307,18 @@ var StreamProfileSchema = _enum([
63438
63307
  ]);
63439
63308
  /** The current encoding config of one stream profile. */
63440
63309
  var StreamProfileConfigSchema = object({
63441
- width: number(),
63442
- height: number(),
63310
+ width: number().meta(readingMeta("none")),
63311
+ height: number().meta(readingMeta("none")),
63443
63312
  codec: _enum(["h264", "h265"]),
63444
- framerate: number(),
63445
- bitrate: number(),
63313
+ framerate: number().meta(readingMeta("rate")),
63314
+ bitrate: number().meta(readingMeta("bitrate")),
63446
63315
  bitrateMode: _enum(["vbr", "cbr"]).optional(),
63447
63316
  encoderProfile: _enum([
63448
63317
  "high",
63449
63318
  "main",
63450
63319
  "baseline"
63451
63320
  ]).optional(),
63452
- gop: number().optional(),
63321
+ gop: number().optional().meta(readingMeta("none")),
63453
63322
  /**
63454
63323
  * Whether THIS profile currently carries an audio track. READ-ONLY here.
63455
63324
  *
@@ -64103,35 +63972,21 @@ DeviceType.Sensor;
64103
63972
  * entries with `device_class: temperature` and any future native
64104
63973
  * thermometer.
64105
63974
  *
64106
- * Unit normalisation: providers convert to Celsius before storing.
64107
- * The slice value is always Celsius so cross-cap aggregators
64108
- * (climate-control's `currentTemp`, energy analytics) can compose
64109
- * without per-source unit fixups. The canonical display unit (`°C`) is
64110
- * a descriptor constant in the UI (ROLE_DESCRIPTOR), not stored in
64111
- * `sourceInfo`.
63975
+ * The number is Celsius (D944). Providers convert on ingest. A failed
63976
+ * conversion is `null`, never a guess. Display unit is a read-time preference.
64112
63977
  *
64113
63978
  * Status `lastFetchedAt` lets staleness-aware consumers detect a
64114
63979
  * frozen feed (provider hung) distinct from a "temperature hasn't
64115
63980
  * changed" steady state.
64116
63981
  */
64117
63982
  var TemperatureSensorStatusSchema = object({
64118
- /** Current temperature in Celsius. */
64119
- celsius: number().meta({
64120
- unit: "°C",
63983
+ /** Current temperature in Celsius. `null` when the sample was refused (D393). */
63984
+ celsius: number().nullable().meta(readingMeta("temperature", {
63985
+ precision: 1,
64121
63986
  label: "Temperature"
64122
- }),
63987
+ })),
64123
63988
  /** Ms epoch when the slice was last updated (push or poll). */
64124
- lastFetchedAt: number(),
64125
- /** Live display unit from the upstream source (e.g. HA
64126
- * `attributes.unit_of_measurement`). The UI prefers this over the
64127
- * role's canonical unit, so a Fahrenheit feed renders '°F' not '°C'.
64128
- * Absent → the UI falls back to the role's canonical unit. */
64129
- unit: string().optional(),
64130
- /** Suggested decimal places for numeric display.
64131
- * Populated live from the upstream source when provided (e.g. HA
64132
- * `attributes.suggested_display_precision`). Falls back to
64133
- * auto-formatting when absent. */
64134
- precision: number().int().min(0).max(10).optional()
63989
+ lastFetchedAt: number()
64135
63990
  });
64136
63991
  DeviceType.Sensor, DeviceType.Thermostat;
64137
63992
  /**
@@ -64383,16 +64238,16 @@ object({
64383
64238
  ]),
64384
64239
  /** 0..100 battery percentage. Null when the device has no battery
64385
64240
  * reading. */
64386
- batteryLevel: number().min(0).max(100).nullable(),
64241
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64387
64242
  /** Current fan-speed token (provider-verbatim). Null when unknown or
64388
64243
  * the vacuum has no speed control. */
64389
64244
  fanSpeed: string().nullable(),
64390
64245
  /** Speed tokens the hardware accepts — drives the UI selector. */
64391
64246
  availableFanSpeeds: array(string()),
64392
64247
  /** 0..100 cleaning-completion percentage of the current task, or null. */
64393
- progressPercent: number().min(0).max(100).nullable(),
64248
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64394
64249
  /** Current error code (0 / null = no error). */
64395
- errorCode: number().nullable(),
64250
+ errorCode: number().nullable().meta(readingMeta("none")),
64396
64251
  /** Human label for {@link errorCode}, or null when none / undecodable. */
64397
64252
  errorLabel: string().nullable(),
64398
64253
  /** Ms epoch when the slice was last updated. */
@@ -64431,7 +64286,7 @@ object({
64431
64286
  ]),
64432
64287
  /** 0 = fully closed, 100 = fully open. Null when the device has no
64433
64288
  * intermediate position surface. */
64434
- position: number().min(0).max(100).nullable(),
64289
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64435
64290
  /** Ms epoch when the slice was last updated. */
64436
64291
  lastChangedAt: number()
64437
64292
  });
@@ -64459,9 +64314,9 @@ object({
64459
64314
  DeviceType.Sensor;
64460
64315
  object({
64461
64316
  /** Current measured temperature. Null when not reported. */
64462
- currentTemp: number().nullable(),
64317
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
64463
64318
  /** Target temperature setpoint. Null when no setpoint surface. */
64464
- targetTemp: number().nullable(),
64319
+ targetTemp: number().nullable().meta(readingMeta("temperature")),
64465
64320
  /** Active operation mode = HA `state` (`eco` / `electric` / `gas` /
64466
64321
  * `heat_pump` / `high_demand` / `performance` / `off`). Null when the
64467
64322
  * device reports an unknown state. */
@@ -64472,9 +64327,9 @@ object({
64472
64327
  * has no away surface. */
64473
64328
  away: boolean().nullable(),
64474
64329
  /** HA `min_temp` attribute. Null when not reported. */
64475
- minTemp: number().nullable(),
64330
+ minTemp: number().nullable().meta(readingMeta("temperature")),
64476
64331
  /** HA `max_temp` attribute. Null when not reported. */
64477
- maxTemp: number().nullable(),
64332
+ maxTemp: number().nullable().meta(readingMeta("temperature")),
64478
64333
  /** Ms epoch when the slice was last updated. */
64479
64334
  lastChangedAt: number()
64480
64335
  });
@@ -64498,25 +64353,18 @@ DeviceType.WaterHeater, method(object({
64498
64353
  auth: "protected"
64499
64354
  });
64500
64355
  object({
64501
- /** Verbatim HA condition state (`sunny`, `cloudy`, `rainy`, …). Null
64502
- * when no condition has been reported yet. */
64356
+ /** Verbatim condition state (`sunny`, `cloudy`, `rainy`, …). Null when none yet. */
64503
64357
  condition: string().nullable(),
64504
- /** Current temperature in the reported unit. Null when not provided. */
64505
- temperature: number().nullable(),
64506
- /** Temperature unit string (e.g. `°C` / `°F`). Null when not provided. */
64507
- temperatureUnit: string().nullable(),
64358
+ /** Current temperature in Celsius. Null when not provided or refused. */
64359
+ temperature: number().nullable().meta(readingMeta("temperature", { precision: 1 })),
64508
64360
  /** Relative humidity (0..100). Null when not provided. */
64509
- humidity: number().min(0).max(100).nullable(),
64510
- /** Barometric pressure in the reported unit. Null when not provided. */
64511
- pressure: number().nullable(),
64512
- /** Pressure unit string (e.g. `hPa` / `inHg`). Null when not provided. */
64513
- pressureUnit: string().nullable(),
64514
- /** Wind speed in the reported unit. Null when not provided. */
64515
- windSpeed: number().nullable(),
64516
- /** Wind-speed unit string (e.g. `km/h` / `mph`). Null when not provided. */
64517
- windSpeedUnit: string().nullable(),
64361
+ humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
64362
+ /** Barometric pressure in hPa. Null when not provided or refused. */
64363
+ pressure: number().nullable().meta(readingMeta("pressure")),
64364
+ /** Wind speed in metres per second. Null when not provided or refused. */
64365
+ windSpeed: number().nullable().meta(readingMeta("speed")),
64518
64366
  /** Wind bearing in degrees (0..360, meteorological). Null when not provided. */
64519
- windBearing: number().nullable(),
64367
+ windBearing: number().nullable().meta(readingMeta("angle")),
64520
64368
  /** Ms epoch when the slice was last updated. */
64521
64369
  lastFetchedAt: number()
64522
64370
  });
@@ -78391,7 +78239,6 @@ var SENSOR_CAP_VOCABULARY = {
78391
78239
  field: "value",
78392
78240
  quantity: t("the reading", "il valore"),
78393
78241
  label: t("Reading", "Valore"),
78394
- unitField: "unit",
78395
78242
  icon: "gauge"
78396
78243
  }]
78397
78244
  },
@@ -78527,7 +78374,7 @@ var SENSOR_CAP_VOCABULARY = {
78527
78374
  field: "temperature",
78528
78375
  quantity: t("the outdoor temperature", "la temperatura esterna"),
78529
78376
  label: t("Temperature", "Temperatura"),
78530
- unitField: "temperatureUnit",
78377
+ unit: "°C",
78531
78378
  icon: "thermometer"
78532
78379
  },
78533
78380
  {
@@ -78543,7 +78390,7 @@ var SENSOR_CAP_VOCABULARY = {
78543
78390
  field: "windSpeed",
78544
78391
  quantity: t("the wind speed", "la velocità del vento"),
78545
78392
  label: t("Wind", "Vento"),
78546
- unitField: "windSpeedUnit",
78393
+ unit: "m/s",
78547
78394
  icon: "wind"
78548
78395
  },
78549
78396
  {
@@ -78551,7 +78398,7 @@ var SENSOR_CAP_VOCABULARY = {
78551
78398
  field: "pressure",
78552
78399
  quantity: t("the air pressure", "la pressione atmosferica"),
78553
78400
  label: t("Pressure", "Pressione"),
78554
- unitField: "pressureUnit",
78401
+ unit: "hPa",
78555
78402
  icon: "gauge"
78556
78403
  }
78557
78404
  ]
@@ -84739,14 +84586,15 @@ var temperatureAdapter = {
84739
84586
  }),
84740
84587
  properties: (_cap, slice) => {
84741
84588
  const p = TemperatureSensorStatusSchema.pick({ celsius: true }).safeParse(slice);
84742
- return p.success ? [{
84589
+ if (!p.success || p.data.celsius === null) return [];
84590
+ return [{
84743
84591
  namespace: "Alexa.TemperatureSensor",
84744
84592
  name: "temperature",
84745
84593
  value: {
84746
84594
  value: Math.round(p.data.celsius * 10) / 10,
84747
84595
  scale: "CELSIUS"
84748
84596
  }
84749
- }] : [];
84597
+ }];
84750
84598
  },
84751
84599
  directives: [],
84752
84600
  shaping: () => ({
@@ -85489,11 +85337,12 @@ var humidityAdapter = {
85489
85337
  }),
85490
85338
  properties: (_cap, slice) => {
85491
85339
  const p = HumiditySensorStatusSchema.pick({ percent: true }).safeParse(slice);
85492
- return p.success ? [{
85340
+ if (!p.success || p.data.percent === null) return [];
85341
+ return [{
85493
85342
  namespace: "Alexa.HumiditySensor",
85494
85343
  name: "relativeHumidity",
85495
85344
  value: { value: Math.max(0, Math.min(100, p.data.percent)) }
85496
- }] : [];
85345
+ }];
85497
85346
  },
85498
85347
  directives: [],
85499
85348
  shaping: () => ({