mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00: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:
parent
0713ac4977
commit
a073a6b01e
@ -233,7 +233,7 @@ def validate_services(config: Config, integration: Integration) -> None: # noqa
|
|||||||
)
|
)
|
||||||
if service_schema is None:
|
if service_schema is None:
|
||||||
continue
|
continue
|
||||||
if "name" not in service_schema:
|
if "name" not in service_schema and integration.core:
|
||||||
try:
|
try:
|
||||||
strings["services"][service_name]["name"]
|
strings["services"][service_name]["name"]
|
||||||
except KeyError:
|
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}",
|
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:
|
try:
|
||||||
strings["services"][service_name]["description"]
|
strings["services"][service_name]["description"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -257,7 +257,7 @@ def validate_services(config: Config, integration: Integration) -> None: # noqa
|
|||||||
if "fields" in field_schema:
|
if "fields" in field_schema:
|
||||||
# This is a section
|
# This is a section
|
||||||
continue
|
continue
|
||||||
if "name" not in field_schema:
|
if "name" not in field_schema and integration.core:
|
||||||
try:
|
try:
|
||||||
strings["services"][service_name]["fields"][field_name]["name"]
|
strings["services"][service_name]["fields"][field_name]["name"]
|
||||||
except KeyError:
|
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}",
|
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:
|
try:
|
||||||
strings["services"][service_name]["fields"][field_name][
|
strings["services"][service_name]["fields"][field_name][
|
||||||
"description"
|
"description"
|
||||||
@ -296,13 +296,14 @@ def validate_services(config: Config, integration: Integration) -> None: # noqa
|
|||||||
if "fields" not in section_schema:
|
if "fields" not in section_schema:
|
||||||
# This is not a section
|
# This is not a section
|
||||||
continue
|
continue
|
||||||
try:
|
if "name" not in section_schema and integration.core:
|
||||||
strings["services"][service_name]["sections"][section_name]["name"]
|
try:
|
||||||
except KeyError:
|
strings["services"][service_name]["sections"][section_name]["name"]
|
||||||
integration.add_error(
|
except KeyError:
|
||||||
"services",
|
integration.add_error(
|
||||||
f"Service {service_name} has a section {section_name} with no name {error_msg_suffix}",
|
"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:
|
def validate(integrations: dict[str, Integration], config: Config) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user