Documentation for v2.19

This commit is contained in:
Philip Abbey
2024-08-29 23:12:13 +01:00
parent 17162c14f2
commit df3be94bf9
4 changed files with 27 additions and 2 deletions

View File

@ -118,6 +118,20 @@ Note: Only when you use the `tap_action` field do you also need to include the `
}
```
## Group and Toggle Menu Items
Both `group` and `toggle` menu items accept an optional `content` field as of v2.19. This allows the use of templates to present status information.
```json
{
"name": "Each Lounge Light",
"title": "Lounge",
"type": "group",
"content": "{{'On: %d, Off: %d'|format(expand(state_attr('light.living_room_lights', 'entity_id'))|selectattr('state','eq','on')|map(attribute='entity_id')|list|count, expand(state_attr('light.living_room_lights', 'entity_id'))|selectattr('state','eq','off')|map(attribute='entity_id')|list|count)}}",
"items": [..]
}
```
## Advanced
Here we generate a bar graph of the battery level. We use the following steps to do this: