mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
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:
@@ -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}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user