home-assistant-configuration/templates/iss_report.yaml

26 lines
920 B
YAML

>
{% macro getIntro() %}
Excuse me. I don't mean to interupt.
{{ [
"But the International Space Station is passing over. Wave.",
"But The International Space Station just flew by.",
"But if you were to look up right now, and it was dark outside, and you happened to be looking in the right place you would see the International Space Station go by. But it's already passed by now."
] | random}}
{% 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()) -}}