Site updated at 2016-07-14 13:35:51 UTC
This commit is contained in:
parent
030ba6f0e9
commit
94524d7954
23 changed files with 52 additions and 38 deletions
|
@ -157,6 +157,16 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<p>By comparing the details published on the <a href="/topics/templating/">template</a> page the same can be archived with a different approach:</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">value_template</span>: <span class="string"><span class="delimiter">"</span><span class="content">{%if states.sensor.ENTITY_ID.state == 'on' %}running{%elif states.switch.ENTITY_ID.state == 'off' %}not running{% endif %}</span><span class="delimiter">"</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>The <a href="/components/binary_sensor.template/">Binary template sensor</a> is the one in similar cases if you prefer to see an icon instead of text.</p>
|
||||
|
||||
<h3><a class="title-link" name="multiline-example-with-an-if-test-and-warnings-disabled" href="#multiline-example-with-an-if-test-and-warnings-disabled"></a> Multiline example with an if test (and warnings disabled)</h3>
|
||||
|
||||
<p>This example shows a multiple line template with and if test. It looks at a sensing switch and shows on/off in the frontend. It disables warnings to avoid log messages where the switch it depends on isn’t loaded yet.</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue