Use watt in example (#19248)

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
erffrfez 2021-09-12 17:01:10 +08:00 committed by GitHub
parent 0d09c70f68
commit 7f1871cdfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -415,7 +415,7 @@ template:
### Multiline Example With an `if` Test
This example shows a multiple line template with an `if` test. It looks at a sensing switch and shows `on`/`off` in the frontend.
This example shows a multiple line template with an `if` test. It looks at a sensing switch and shows `on`/`off` in the frontend, and shows 'standby' if the power use is less than 1000 watts.
{% raw %}
@ -426,7 +426,7 @@ template:
state: >
{% if is_state('switch.kettle', 'off') %}
off
{% elif state_attr('switch.kettle', 'kwh')|float < 1000 %}
{% elif state_attr('switch.kettle', 'W')|float < 1000 %}
standby
{% elif is_state('switch.kettle', 'on') %}
on