mirror of
https://github.com/home-assistant/core.git
synced 2025-06-25 01:21:51 +02:00
Fix hassfest expecting strings file for custom components (#135789)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Co-authored-by: Robert Resch <robert@resch.dev>
This commit is contained in:
@ -233,7 +233,7 @@ def validate_services(config: Config, integration: Integration) -> None: # noqa
|
||||
)
|
||||
if service_schema is None:
|
||||
continue
|
||||
if "name" not in service_schema:
|
||||
if "name" not in service_schema and integration.core:
|
||||
try:
|
||||
strings["services"][service_name]["name"]
|
||||
except KeyError:
|
||||
@ -242,7 +242,7 @@ def validate_services(config: Config, integration: Integration) -> None: # noqa
|
||||
f"Service {service_name} has no name {error_msg_suffix}",
|
||||
)
|
||||
|
||||
if "description" not in service_schema:
|
||||
if "description" not in service_schema and integration.core:
|
||||
try:
|
||||
strings["services"][service_name]["description"]
|
||||
except KeyError:
|
||||
@ -257,7 +257,7 @@ def validate_services(config: Config, integration: Integration) -> None: # noqa
|
||||
if "fields" in field_schema:
|
||||
# This is a section
|
||||
continue
|
||||
if "name" not in field_schema:
|
||||
if "name" not in field_schema and integration.core:
|
||||
try:
|
||||
strings["services"][service_name]["fields"][field_name]["name"]
|
||||
except KeyError:
|
||||
@ -266,7 +266,7 @@ def validate_services(config: Config, integration: Integration) -> None: # noqa
|
||||
f"Service {service_name} has a field {field_name} with no name {error_msg_suffix}",
|
||||
)
|
||||
|
||||
if "description" not in field_schema:
|
||||
if "description" not in field_schema and integration.core:
|
||||
try:
|
||||
strings["services"][service_name]["fields"][field_name][
|
||||
"description"
|
||||
@ -296,13 +296,14 @@ def validate_services(config: Config, integration: Integration) -> None: # noqa
|
||||
if "fields" not in section_schema:
|
||||
# This is not a section
|
||||
continue
|
||||
try:
|
||||
strings["services"][service_name]["sections"][section_name]["name"]
|
||||
except KeyError:
|
||||
integration.add_error(
|
||||
"services",
|
||||
f"Service {service_name} has a section {section_name} with no name {error_msg_suffix}",
|
||||
)
|
||||
if "name" not in section_schema and integration.core:
|
||||
try:
|
||||
strings["services"][service_name]["sections"][section_name]["name"]
|
||||
except KeyError:
|
||||
integration.add_error(
|
||||
"services",
|
||||
f"Service {service_name} has a section {section_name} with no name {error_msg_suffix}",
|
||||
)
|
||||
|
||||
|
||||
def validate(integrations: dict[str, Integration], config: Config) -> None:
|
||||
|
Reference in New Issue
Block a user