Allow the helper integrations to omit icon translation field (#109648)

This commit is contained in:
Joost Lekkerkerker 2024-02-04 22:57:11 +01:00 committed by GitHub
parent 10d3b10da4
commit 2c0b897658
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,9 +77,13 @@ def icon_schema(integration_type: str) -> vol.Schema:
)
if integration_type in ("entity", "helper", "system"):
if integration_type != "entity":
field = vol.Optional("entity_component")
else:
field = vol.Required("entity_component")
schema = schema.extend(
{
vol.Required("entity_component"): vol.All(
field: vol.All(
cv.schema_with_slug_keys(
icon_schema_slug(vol.Required),
slug_validator=vol.Any("_", cv.slug),