Fix hassfest icons check for notify and image_processing (#113446)
This commit is contained in:
parent
3ed7a7166d
commit
b1c636c886
1 changed files with 4 additions and 4 deletions
|
@ -47,7 +47,7 @@ def ensure_not_same_as_default(value: dict) -> dict:
|
|||
return value
|
||||
|
||||
|
||||
def icon_schema(integration_type: str, no_entity_platforms: bool) -> vol.Schema:
|
||||
def icon_schema(integration_type: str, no_entity_platform: bool) -> vol.Schema:
|
||||
"""Create a icon schema."""
|
||||
|
||||
state_validator = cv.schema_with_slug_keys(
|
||||
|
@ -78,7 +78,7 @@ def icon_schema(integration_type: str, no_entity_platforms: bool) -> vol.Schema:
|
|||
)
|
||||
|
||||
if integration_type in ("entity", "helper", "system"):
|
||||
if integration_type != "entity" or no_entity_platforms:
|
||||
if integration_type != "entity" or no_entity_platform:
|
||||
field = vol.Optional("entity_component")
|
||||
else:
|
||||
field = vol.Required("entity_component")
|
||||
|
@ -126,9 +126,9 @@ def validate_icon_file(config: Config, integration: Integration) -> None: # noq
|
|||
integration.add_error("icons", f"Invalid JSON in {name}: {err}")
|
||||
return
|
||||
|
||||
no_entity_platforms = name in ("notify", "image_processing")
|
||||
no_entity_platform = integration.domain in ("notify", "image_processing")
|
||||
|
||||
schema = icon_schema(integration.integration_type, no_entity_platforms)
|
||||
schema = icon_schema(integration.integration_type, no_entity_platform)
|
||||
|
||||
try:
|
||||
schema(icons)
|
||||
|
|
Loading…
Add table
Reference in a new issue