Update binary_sensor.template.markdown (#10007)

The example was corrected, but is now wrong, so I have made it wrong again, which is now correct
This commit is contained in:
James 2019-07-31 09:11:59 +01:00 committed by Franck Nijhof
parent 18501783b3
commit 6953727b94

View File

@ -85,7 +85,7 @@ Template Binary Sensor may get an `unknown` state during startup. This results
in error messages in your log file until that platform has completed loading. in error messages in your log file until that platform has completed loading.
If you use `is_state()` function in your template, you can avoid this situation. If you use `is_state()` function in your template, you can avoid this situation.
For example, you would replace For example, you would replace
{% raw %}`{{ is_state('switch.source', 'on') }}`{% endraw %} {% raw %}`{{ states.switch.source.state == 'on' }}`{% endraw %}
with this equivalent that returns `true`/`false` and never gives an unknown with this equivalent that returns `true`/`false` and never gives an unknown
result: result:
{% raw %}`{{ is_state('switch.source', 'on') }}`{% endraw %} {% raw %}`{{ is_state('switch.source', 'on') }}`{% endraw %}