1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 11:22:24 +01:00

[schema-gen] fix referenced schemas when schema in component platform (#9755)

This commit is contained in:
Guillermo Ruffino
2025-07-22 15:52:56 -03:00
committed by GitHub
parent a614a68f1a
commit 3bb5a9e2f7

View File

@@ -411,11 +411,16 @@ def add_referenced_recursive(referenced_schemas, config_var, path, eat_schema=Fa
s1 = get_str_path_schema(k)
p = k.split(".")
if len(p) == 3 and path[0] == f"{p[0]}.{p[1]}":
# special case for schema inside platforms
add_referenced_recursive(
referenced_schemas, s1, [path[0], "schemas", p[2]]
)
if len(p) == 3:
if path[0] == f"{p[0]}.{p[1]}":
# special case for schema inside platforms
add_referenced_recursive(
referenced_schemas, s1, [path[0], "schemas", p[2]]
)
else:
add_referenced_recursive(
referenced_schemas, s1, [f"{p[0]}.{p[1]}", "schemas", p[2]]
)
else:
add_referenced_recursive(
referenced_schemas, s1, [p[0], "schemas", p[1]]