Skip to content
Snippets Groups Projects
Unverified Commit 5e88760f authored by Philip Allgaier's avatar Philip Allgaier Committed by GitHub
Browse files

Add translations for binary_sensor device classes (#58471)


Co-authored-by: default avatarJ. Nick Koston <nick@koston.org>
parent 370c7a7c
No related branches found
No related tags found
No related merge requests found
......@@ -207,5 +207,18 @@
"off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]"
}
},
"device_class": {
"cold": "cold",
"gas": "gas",
"heat": "heat",
"moisture": "moisture",
"motion": "motion",
"occupancy": "occupancy",
"power": "power",
"problem": "problem",
"smoke": "smoke",
"sound": "sound",
"vibration": "vibration"
}
}
\ No newline at end of file
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment