Add support for translating state attributes (#77028)
* Allow defining state attributes in strings.json * Add all climate attributes * Remove support for custom device classes * Address review comments
This commit is contained in:
parent
b172abaeeb
commit
8f761f44bd
3 changed files with 190 additions and 0 deletions
|
@ -224,6 +224,18 @@ def gen_strings_schema(config: Config, integration: Integration) -> vol.Schema:
|
|||
cv.schema_with_slug_keys(str, slug_validator=lowercase_validator),
|
||||
slug_validator=vol.Any("_", cv.slug),
|
||||
),
|
||||
vol.Optional("state_attributes"): cv.schema_with_slug_keys(
|
||||
cv.schema_with_slug_keys(
|
||||
{
|
||||
vol.Optional("name"): str,
|
||||
vol.Optional("state"): cv.schema_with_slug_keys(
|
||||
str, slug_validator=lowercase_validator
|
||||
),
|
||||
},
|
||||
slug_validator=lowercase_validator,
|
||||
),
|
||||
slug_validator=vol.Any("_", cv.slug),
|
||||
),
|
||||
vol.Optional("system_health"): {
|
||||
vol.Optional("info"): {str: cv.string_with_no_html}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue