[scripts] Fix build_language_schema (#16816)

Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
This commit is contained in:
Clyde Stubbs
2026-06-06 07:44:31 +10:00
committed by GitHub
parent 913b9f5ca4
commit 93334d4e60

View File

@@ -924,9 +924,14 @@ def convert(schema, config_var, path):
config_var[S_TYPE] = "enum"
config_var["values"] = dict.fromkeys(list(data.keys()))
elif schema_type == "maybe":
config_var[S_TYPE] = S_SCHEMA
# maybe_simple_value: either a scalar shorthand (mapped to the key in
# data[1]) or the full wrapped schema. The wrapped schema is usually a
# plain Schema (converts to a "schema" config var), but may be something
# else, e.g. a typed_schema (converts to a "typed" config var with
# "types" and no top-level "schema" key). Merge whatever it produced
# rather than assuming a "schema" key is present.
config_var["maybe"] = data[1]
config_var["schema"] = convert_config(data[0], path + "/maybe")["schema"]
config_var.update(convert_config(data[0], path + "/maybe"))
# esphome/on_boot
elif schema_type == "automation":
extra_schema = None