diff --git a/homeassistant/helpers/config_validation.py b/homeassistant/helpers/config_validation.py index 48f26c2b768..6963b2cfb05 100644 --- a/homeassistant/helpers/config_validation.py +++ b/homeassistant/helpers/config_validation.py @@ -914,9 +914,9 @@ def key_value_schemas( with contextlib.suppress(vol.Invalid): 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: - alternatives += ", " + default_description + alternatives = f"{alternatives}, {default_description}" raise vol.Invalid( f"Unexpected value for {key}: '{key_value}'. Expected {alternatives}" )