2020-12-03 03:55:11 +00:00
>
{# Skylar Nightly Report #}
{%- macro getReport() -%}
2020-12-04 06:01:28 +00:00
<p>
2021-04-22 00:24:21 +00:00
Good Evening, Skyler,
2020-12-03 03:55:11 +00:00
{{ [ 'It is time to get in the bath. ' ,
2021-03-14 03:28:49 +00:00
'It is almost bedtime. That means it is time to start preparing for bed. if you are taking a bath tonight, you need to head that way.' ,
2021-04-22 00:24:21 +00:00
'I cannot communicate with the bathtub. Or I would have started the water for you already. So you will have to start the bath, yourself' ,
'My sensors are detecting a strange smell. I am running diagnostics. But in the mean time, you should start a bath.' ,
2021-03-14 03:28:49 +00:00
'I hate to say it but, the day is coming to an end. Time to finish up your tasks, pick up any toys you have out, and get ready for bed.' ,
2021-05-24 15:46:53 +00:00
'We have reached that time in every day when we must switch gears and start preparing for bed. If you would like to have story time you better get a move on.' ,
2021-04-22 00:24:21 +00:00
'Did you ever hear the one about the kid who never took a bath? <break time="2s"/>Yeah, me either. So we should keep it that way. It is time to get ready for bed.' ,
2021-03-14 03:28:49 +00:00
'The count down clock until bedtime has started. Time to get cleaned up, get your pajamas on, and pick the story you will read tonight.'
2020-12-03 03:55:11 +00:00
] | random }}
{% if is_state('sensor.school_tomorrow', 'on') %}
{{ [ 'Because you have school tomorrow. ' ,
'Because you have to get up early tomorrow for school.' ,
'Because you want to be ready for school tomorrow.'
] | random }}
{% else %}
{% set month=states("sensor.date").split('-')[1] | int %}
{%- if is_state('input_boolean.school_in_session', 'off') -%}
{{ [ 'Looks like tomorrow is another day of summer vacation. ' ,
'You are still on summer break tomorrow. ' ,
'Summer vacation does not last forever, but it is not over yet. '
] | random }}
{% else %}
Oh, and it appears you do not have school tomorrow
{% endif %}
2021-03-14 03:28:49 +00:00
{{ [ 'so you can sleep in late. ' ,
'so let us sleep a little later. ' ,
' so there is not a reason to get up early. ' ,
'so we can sleep in. '
2020-12-03 03:55:11 +00:00
] | random }}
{% endif %}
{% if states.sensor.school_start_days2go.state | int < 10 and states.sensor.school_start_days2go.state | int > 1 -%}
{{ [ 'I hate to say it, but ' ,
2021-07-31 01:24:43 +00:00
'Unfortunately,' ,
2020-12-03 03:55:11 +00:00
'All good things must come to an end.'
] | random }}
There are only {{ states.sensor.school_start_days2go.state }} days
{{ [ 'left of summer vacation. ' ,
' left of summer break.' ,
'Until School starts again.'
] | random }}
{% elif states.sensor.school_start_days2go.state | int == 1 -%}
Tomorrow is the first day of school. Are you ready?
{%- endif %}
2021-05-24 15:46:53 +00:00
{% if states.sensor.school_end_days2go.state | int < 15 and states.sensor.school_end_days2go.state | int > 0 -%}
2020-12-03 03:55:11 +00:00
{{ [ 'School is almost over for the year.' ,
'You have made it to the end of the school year.' ,
'You are almost done with school.'
] | random }}
There are only {{ states.sensor.school_end_days2go.state }} days
{{ [ 'left in the school year ' ,
' left of school.' ,
'Until the last day of school.'
] | random }}
{% elif states.sensor.school_end_days2go.state | int == 0 -%}
Tomorrow is the first day of summer. Are you ready?
{%- endif %}
2021-03-14 03:28:49 +00:00
{{ [ 'I have prepared your room as you like it. ' ,
'I have adjusted the lighting in your room.' ,
2021-05-24 15:46:53 +00:00
'I have turned on your bedroom lights, and adjusted the lighting under your bed.' ,
2021-03-14 03:28:49 +00:00
'I have executed the Pre bed routine for your room.'
2020-12-03 03:55:11 +00:00
] | random }}
</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()) -}}