mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix shadowing of outer name in config_validation (#82088)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
parent
987b840665
commit
4f7b583f19
@ -914,9 +914,9 @@ def key_value_schemas(
|
|||||||
with contextlib.suppress(vol.Invalid):
|
with contextlib.suppress(vol.Invalid):
|
||||||
return cast(dict[Hashable, Any], default_schema(value))
|
return cast(dict[Hashable, Any], default_schema(value))
|
||||||
|
|
||||||
alternatives = ", ".join(str(key) for key in value_schemas)
|
alternatives = ", ".join(str(alternative) for alternative in value_schemas)
|
||||||
if default_description:
|
if default_description:
|
||||||
alternatives += ", " + default_description
|
alternatives = f"{alternatives}, {default_description}"
|
||||||
raise vol.Invalid(
|
raise vol.Invalid(
|
||||||
f"Unexpected value for {key}: '{key_value}'. Expected {alternatives}"
|
f"Unexpected value for {key}: '{key_value}'. Expected {alternatives}"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user