forked from home-assistant/core
Add translations for binary_sensor device classes (#58471)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
@@ -196,7 +196,7 @@ def gen_platform_strings_schema(config: Config, integration: Integration):
|
||||
"""
|
||||
|
||||
def device_class_validator(value):
|
||||
"""Key validator for platorm states.
|
||||
"""Key validator for platform states.
|
||||
|
||||
Platform states are only allowed to provide states for device classes they prefix.
|
||||
"""
|
||||
@@ -246,6 +246,14 @@ def validate_translation_file(config: Config, integration: Integration, all_stri
|
||||
strings_schema = gen_auth_schema(config, integration)
|
||||
elif integration.domain == "onboarding":
|
||||
strings_schema = ONBOARDING_SCHEMA
|
||||
elif integration.domain == "binary_sensor":
|
||||
strings_schema = gen_strings_schema(config, integration).extend(
|
||||
{
|
||||
vol.Optional("device_class"): cv.schema_with_slug_keys(
|
||||
cv.string_with_no_html, slug_validator=vol.Any("_", cv.slug)
|
||||
)
|
||||
}
|
||||
)
|
||||
else:
|
||||
strings_schema = gen_strings_schema(config, integration)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user