mirror of
https://github.com/thejeffreystone/home-assistant-configuration.git
synced 2025-08-20 04:33:09 +00:00
22 lines
628 B
YAML
Executable File
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()) -}} |