Add documentation of state_translated jinja function (#31323)

Co-authored-by: Piotr Machowski <PiotrMachowski@users.noreply.github.com>
This commit is contained in:
Piotr Machowski 2024-02-14 10:12:31 +01:00 committed by GitHub
parent 3d14330dd5
commit e2687d9f97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -325,6 +325,32 @@ List of lights that are on with a brightness of 255:
{% endraw %} {% endraw %}
### State translated
Not supported in [limited templates](#limited-templates).
The `state_translated` function returns a translated state of an entity using a language that is currently configured in the [general settings](https://my.home-assistant.io/redirect/general/).
#### State translated examples
{% raw %}
```text
{{ states("sun.sun") }} # below_horizon
{{ state_translated("sun.sun") }} # Below horizon
{{ "sun.sun" | state_translated }} # Below horizon
```
```text
{{ states("binary_sensor.movement_backyard") }} # on
{{ state_translated("binary_sensor.movement_backyard") }} # Detected
{{ "binary_sensor.movement_backyard" | state_translated }} # Detected
```
{% endraw %}
### Working with groups ### Working with groups
Not supported in [limited templates](#limited-templates). Not supported in [limited templates](#limited-templates).