home-assistant-configuration/templates/jarvis_interuptions.yaml

25 lines
646 B
YAML
Raw Normal View History

2019-07-12 16:32:25 -04:00
>
2019-07-13 21:38:53 -04:00
{% macro getIntro() %}
2019-07-12 16:32:25 -04:00
{{ [
"Pardon me,",
"Excuse me,",
"I do not mean to interupt, but.",
"I thought you might like to know."
] | random }}
{% endmacro %}
2019-07-13 21:38:53 -04:00
2019-07-12 16:32:25 -04:00
{# 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() -%}
2019-07-13 21:38:53 -04:00
{{ getIntro() }}
2019-07-12 16:32:25 -04:00
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}