Add read_only entity_id to Trend options flow (#145657)

This commit is contained in:
karwosts 2025-05-26 23:42:08 -07:00 committed by GitHub
parent 6fc064fa6a
commit d49a613c62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,9 @@ async def get_base_options_schema(handler: SchemaCommonFlowHandler) -> vol.Schem
"""Get base options schema."""
return vol.Schema(
{
vol.Optional(CONF_ENTITY_ID): selector.EntitySelector(
selector.EntitySelectorConfig(multiple=False, read_only=True),
),
vol.Optional(CONF_ATTRIBUTE): selector.AttributeSelector(
selector.AttributeSelectorConfig(
entity_id=handler.options[CONF_ENTITY_ID]

View File

@ -18,6 +18,7 @@
},
"settings": {
"data": {
"entity_id": "[%key:component::trend::config::step::user::data::entity_id%]",
"attribute": "Attribute of entity that this sensor tracks",
"invert": "Invert the result"
}
@ -28,6 +29,7 @@
"step": {
"init": {
"data": {
"entity_id": "[%key:component::trend::config::step::user::data::entity_id%]",
"attribute": "[%key:component::trend::config::step::settings::data::attribute%]",
"invert": "[%key:component::trend::config::step::settings::data::invert%]",
"max_samples": "Maximum number of stored samples",