Add example of sorting states by entity_id (#26822)

This commit is contained in:
J. Nick Koston 2023-04-02 21:37:23 -10:00 committed by GitHub
parent 83d07f9b9e
commit a5b9d2d1da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,6 +150,16 @@ Print out a list of all the sensor states:
{% endfor %}
```
Print out a list of all the sensor states sorted by `entity_id`:
{% raw %}
```text
{% for state in states.sensor | sort(attribute='entity_id') %}
{{ state.entity_id }}={{ state.state }},
{% endfor %}
```
{% endraw %}
Entities that are on: