39 lines
1.1 KiB
YAML
Executable File
39 lines
1.1 KiB
YAML
Executable File
>
|
|
{% macro getIntro() %}
|
|
{{ [
|
|
"Pardon me,",
|
|
"Excuse me,",
|
|
"I do not mean to interupt, but,"
|
|
] | random }}
|
|
Skylar. Bedtime is in thirty minutes.
|
|
{% endmacro %}
|
|
{% macro getPrebedRoutine() %}
|
|
If you are taking a bath now is the time to get in the tub, so you have time to brush teeth and read stories.
|
|
Otherwise it is time to put on your pajamas.
|
|
{% endmacro %}
|
|
{% macro getReminders() %}
|
|
Don't forget to feed your fish.
|
|
{% if is_state("sensor.weekday", "fri") %}
|
|
Oh, and tomorrow is the weekend, so why don't we sleep in.
|
|
{% 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() -%}
|
|
It is {{ now().strftime("%I:%M %p") }}.
|
|
{{ getIntro() }}
|
|
{{ getPrebedRoutine() }}
|
|
{{ getReminders() }}
|
|
|
|
{%- endmacro -%}
|
|
|
|
{# Call the macro #}
|
|
{{- cleanup(mother_of_all_macros()) -}}
|