mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix packages for schemas without a default (#33045)
This commit is contained in:
parent
ecbcdee934
commit
661101df08
@ -77,7 +77,11 @@ PERSON_SCHEMA = vol.Schema(
|
|||||||
)
|
)
|
||||||
|
|
||||||
CONFIG_SCHEMA = vol.Schema(
|
CONFIG_SCHEMA = vol.Schema(
|
||||||
{vol.Optional(DOMAIN): vol.All(cv.ensure_list, cv.remove_falsy, [PERSON_SCHEMA])},
|
{
|
||||||
|
vol.Optional(DOMAIN, default=[]): vol.All(
|
||||||
|
cv.ensure_list, cv.remove_falsy, [PERSON_SCHEMA]
|
||||||
|
)
|
||||||
|
},
|
||||||
extra=vol.ALLOW_EXTRA,
|
extra=vol.ALLOW_EXTRA,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -571,7 +571,9 @@ def _identify_config_schema(module: ModuleType) -> Tuple[Optional[str], Optional
|
|||||||
|
|
||||||
schema = module.CONFIG_SCHEMA.schema[key] # type: ignore
|
schema = module.CONFIG_SCHEMA.schema[key] # type: ignore
|
||||||
|
|
||||||
if hasattr(key, "default"):
|
if hasattr(key, "default") and not isinstance(
|
||||||
|
key.default, vol.schema_builder.Undefined
|
||||||
|
):
|
||||||
default_value = schema(key.default())
|
default_value = schema(key.default())
|
||||||
|
|
||||||
if isinstance(default_value, dict):
|
if isinstance(default_value, dict):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user