51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
>
|
|
{# Basement Briefing #}
|
|
|
|
{% from 'formatting.jinja' import cleanup %}
|
|
{%- macro getReport() -%}
|
|
{% from 'speech.jinja' import greeting, today_is, sun_status %}
|
|
{% from 'weather.jinja' import weatherReport %}
|
|
{% from 'sports.jinja' import sports_updates %}
|
|
{% from 'server.jinja' import services_down %}
|
|
<p>
|
|
{{ greeting('date') }}
|
|
</p>
|
|
<p>
|
|
{{ today_is() }}
|
|
</p>
|
|
|
|
<p>
|
|
{{ sun_status() }}
|
|
</p>
|
|
|
|
<p>
|
|
{{ weatherReport('full','tts') }}
|
|
</p>
|
|
|
|
<p>
|
|
{{ services_down() }}
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('input_boolean.sports_updates','on') %}
|
|
{{ sports_updates('pregame') }}
|
|
{{ sports_updates('main') }}
|
|
{% endif %}
|
|
</p>
|
|
|
|
{%- 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() -%}
|
|
{{ getReport() }}
|
|
{%- endmacro -%}
|
|
|
|
{# Call the macro #}
|
|
{{- cleanup(mother_of_all_macros()) -}}
|