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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user