Commit Graph
11 Commits
Author SHA1 Message Date
Jesse Hills 63e1adfd5f [schema] Keep the field's own range when spreading a named schema
Address esphbot review: emitting min/max means named scalar schemas now carry
bounds (e.g. core.uint8_t is 0..255), and shrink()'s spread copied those over a
tighter bound the field defined itself. cv.All(cv.uint8_t, cv.Range(min=1,
max=6)) dumped 0..255 instead of 1..6, and All(uint32_t, Range(min=1)) lost its
min. The spread now reconciles the two to the intersection (larger min, smaller
max); non-numeric bounds keep the field's own value.
2026-09-15 07:13:29 +12:00
Jesse Hills 59044484e2 [schema] Unit-type number-with-unit validators; leave dimensions untyped
Address esphbot review: validators that accept a number optionally carrying a
unit (percentage, possibly_negative_percentage, temperature, temperature_delta,
color_temperature, percentage_int, validate_bytes) are dumped as their base
numeric type plus the canonical unit (e.g. {type: float, unit: "%"}), like
float_with_unit, so the editor accepts both the bare-number and the unit-string
form instead of rejecting one. cv.dimensions accepts a "WIDTHxHEIGHT" string or
a [w, h] list, so it is left untyped rather than misrepresented as a string.
2026-09-14 13:52:22 +12:00
Jesse Hills b40c497d3e Merge branch 'dev' into jesserockz-2026-446 2026-09-14 13:41:47 +12:00
J. Nick Koston d9567b2974 Normalize marker-wrapped callable keys in the schema dump (#18218) 2026-08-10 10:05:37 -05:00
Jesse Hills d4fb77af75 [schema] Emit unit for float fields; leave union validators untyped
Address review feedback:
- float_with_unit fields now dump as type "float" with the canonical unit
  (e.g. {"type": "float", "unit": "Hz"}) rather than the quantity name as the
  type. This keeps the type vocabulary closed and lets editors label the field
  with its unit directly instead of mapping each quantity name. The unit is the
  first alternative of the accepted-units regex; current/voltage list A/V first
  (no validation change).
- Drop scalar typing of validate_bytes and date_time: both accept multiple YAML
  forms (unit-suffixed strings or numbers, and a formatted string or a mapping)
  that a single scalar type would wrongly reject in the editor.
2026-07-16 07:51:26 +12:00
Jesse Hills 98f6e74385 [schema] Type config_validation validators and range bounds in language schema dump
The language schema dump left many config_validation validators untyped
(icon, mac_address, percentage, update_interval, lambdas, encryption keys,
...), so the visual editor and dashboard could not tell what YAML those
fields accept. Type them via convert() and schema_extractor decorators,
emit float_with_unit quantities (frequency, voltage, current, ...) as the
field type, and attach min/max bounds detected from range validators next
to the type.
2026-07-15 14:44:28 +12:00
Jesse HillsandJ. Nick Koston 1ee49720c7 [psram] Make schema extractable with per-variant options (#16949)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-06-15 19:55:21 +12:00
Clyde StubbsandClaude Opus 4.8 10ce6024bf [lvgl] Fix schema extraction (#16895)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 08:21:38 -04:00
J. Nick Koston cbc3770b11 Include model-driven display schemas in the language schema dump (#16872) 2026-06-07 17:30:43 -05:00
J. Nick Koston bac62cb7de [core] Add cv.sensitive marker for schema-level sensitive fields (#16673) 2026-05-26 15:29:06 -05:00
Jesse Hills 76ce45c59e [script] Preserve source order of enum options in language schema (#16371) 2026-05-13 06:28:39 +12:00