1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

[config_validation] extend should combine extra validations (#9939)

This commit is contained in:
Clyde Stubbs
2025-07-28 17:23:35 +10:00
committed by GitHub
parent 4933ef780b
commit eecdaa5163
2 changed files with 55 additions and 3 deletions

View File

@@ -225,9 +225,10 @@ class _Schema(vol.Schema):
return ret
schema = schemas[0]
extra_schemas = self._extra_schemas.copy()
if isinstance(schema, _Schema):
extra_schemas.extend(schema._extra_schemas)
if isinstance(schema, vol.Schema):
schema = schema.schema
ret = super().extend(schema, extra=extra)
return _Schema(
ret.schema, extra=ret.extra, extra_schemas=self._extra_schemas.copy()
)
return _Schema(ret.schema, extra=ret.extra, extra_schemas=extra_schemas)