List out the lights that are left on please.

This commit is contained in:
CCOSTAN 2017-02-10 20:45:11 +00:00
parent 5ce17e9728
commit cc673420c3

View File

@ -29,7 +29,13 @@
{% endif %}
. There are
{% for state in states.light if state.state == 'on' -%}
{%- if loop.last -%}
{{ loop.index }}
{%- endif -%}
{%- endfor %} lights on right now."
{%- if loop.last -%}
{{ loop.index }}
{%- endif -%}
{%- endfor %} lights on right now."
{% set comma = joiner(', ') %} The
{% for group in states.group|groupby('state') -%}
{%- for entity in group.list if entity.state == 'on' and entity.name.split(' ')[1]|lower == 'lights' and entity.name.split(' ')[0]|lower != 'all' and entity.name.split(' ')[0]|lower != 'interior' -%}
{{ comma() }}{{ entity.name }}
{%- endfor -%}
{%- endfor %}.