Files
home-assistant-configuration/templates/security_report.yaml
2019-07-13 21:38:53 -04:00

22 lines
628 B
YAML
Executable File

>
{% macro getIntro() %}
{% if is_state("group.external_doors", "on") %}
There are doors are open.
{% else %}
All doors are closed.
{% endif %}
{% endmacro %}
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
{%- macro cleanup(data) -%}
{%- for item in data.split("\n") if item | trim != "" -%}
{{ item | trim }} {% endfor -%}
{%- endmacro -%}
{# a macro to call all macros :) #}
{%- macro mother_of_all_macros() -%}
{{ getIntro() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}