1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-27 14:31:13 +00:00

Add support for translating custom attribute state (#83386)

* Add support for translating custom attribute state

* Address review comment

* Rename attribute to state_attributes, allow naming attributes
This commit is contained in:
Erik Montnemery
2022-12-21 10:43:49 +01:00
committed by GitHub
parent fc94569a0d
commit 255f35b979
5 changed files with 83 additions and 6 deletions

View File

@@ -269,9 +269,15 @@ def gen_strings_schema(config: Config, integration: Integration) -> vol.Schema:
},
vol.Optional("entity"): {
str: {
str: vol.Schema(
{vol.Optional("state"): {str: cv.string_with_no_html}}
)
str: {
vol.Optional("state_attributes"): {
str: {
vol.Optional("name"): cv.string_with_no_html,
vol.Optional("state"): {str: cv.string_with_no_html},
}
},
vol.Optional("state"): {str: cv.string_with_no_html},
}
}
},
}