2019-02-21 17:49:55 +00:00
|
|
|
>
|
|
|
|
{% macro getIntro() %}
|
2019-07-12 20:34:15 +00:00
|
|
|
|
|
|
|
{{ [ "Pardom me, Skylar,, ",
|
|
|
|
"Good morning Skylar, This is your digital life mate, Jarvis ",
|
|
|
|
"This is your cruise director with your morning announcements.",
|
|
|
|
] | random }}
|
2019-02-21 17:49:55 +00:00
|
|
|
{% endmacro %}
|
|
|
|
{% macro getDressed() %}
|
|
|
|
{% if is_state("sensor.birthday_skylar", "0") %}
|
|
|
|
First, Happy Birthday Skylar! Second, even birthday boys have to get dressed. So get to it.
|
|
|
|
{% else %}
|
2019-07-12 20:34:15 +00:00
|
|
|
If you haven't gotten dressed,
|
|
|
|
{{ [ "It is time to get dressed. ",
|
|
|
|
"It is time to put some real clothes on. ",
|
|
|
|
"it is now time to change your underwear.",
|
|
|
|
] | random }}
|
2019-02-21 17:49:55 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
{% macro getSchoolDay() %}
|
|
|
|
{% if is_state("calendar.skylar_school", "on") %}
|
|
|
|
Because you have school today!
|
|
|
|
{% if states.calendar.skylar_school.attributes.description == "early-release" %}
|
|
|
|
And guess what? It is early release!
|
|
|
|
{% endif %}
|
2019-07-11 11:18:09 +00:00
|
|
|
# {% if is_state("sensor.weekday", "fri") %}
|
|
|
|
# Plus, it is fun Friday!
|
|
|
|
# {% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
{% macro getEvents() %}
|
|
|
|
{% if is_state("calendar.skylar_events", "on") %}
|
|
|
|
You have {{ states.calendar.skylar_events.attributes.message }} today!
|
|
|
|
# {% if is_state("sensor.weekday", "fri") %}
|
|
|
|
# Plus, it is fun Friday!
|
|
|
|
# {% endif %}
|
2019-02-21 17:49:55 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
{% macro getClothesSuggestion() %}
|
|
|
|
{% if is_state("sensor.clothing_forecast", "Freezing") %}
|
|
|
|
It is going to be freezing today so I suggest wearing long pants, and a heavy coat.
|
|
|
|
{% elif is_state("sensor.clothing_forecast","Cold") %}
|
|
|
|
It is going to be cold today so I suggest wearing long pants and a light jacket.
|
|
|
|
{% elif is_state("sensor.clothing_forecast", "Chilly") %}
|
|
|
|
It is going to be chilly today so I suggest wearing at least long pants.
|
|
|
|
{% elif is_state("sensor.clothing_forecast", "Nice") %}
|
|
|
|
It is going to be nice today so I suggest wearing shorts.
|
|
|
|
{% elif is_state("sensor.clothing_forecast", "Toasty") %}
|
|
|
|
It is going to be a bit warm today so I suggest wearing shorts.
|
|
|
|
{% elif is_state("sensor.clothing_forecast", "Hot") %}
|
|
|
|
It is going to be hot today so I suggest wearing shorts.
|
|
|
|
{% else %}
|
|
|
|
{% 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() -%}
|
|
|
|
{{ getIntro() }}
|
|
|
|
{{ getDressed() }}
|
|
|
|
{{ getSchoolDay() }}
|
2019-07-11 11:18:09 +00:00
|
|
|
{{ getEvents() }}
|
2019-02-21 17:49:55 +00:00
|
|
|
{{ getClothesSuggestion() }}
|
|
|
|
|
|
|
|
|
|
|
|
{%- endmacro -%}
|
|
|
|
|
|
|
|
{# Call the macro #}
|
|
|
|
{{- cleanup(mother_of_all_macros()) -}}
|