mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Allow the helper integrations to omit icon translation field (#109648)
This commit is contained in:
parent
10d3b10da4
commit
2c0b897658
@ -77,9 +77,13 @@ def icon_schema(integration_type: str) -> vol.Schema:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if integration_type in ("entity", "helper", "system"):
|
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(
|
schema = schema.extend(
|
||||||
{
|
{
|
||||||
vol.Required("entity_component"): vol.All(
|
field: vol.All(
|
||||||
cv.schema_with_slug_keys(
|
cv.schema_with_slug_keys(
|
||||||
icon_schema_slug(vol.Required),
|
icon_schema_slug(vol.Required),
|
||||||
slug_validator=vol.Any("_", cv.slug),
|
slug_validator=vol.Any("_", cv.slug),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user