Minor tweeks to work better with Amazon Polly

This commit is contained in:
Jeffrey Stone 2019-07-12 16:34:15 -04:00
parent c86e73561e
commit 1ba86da318
4 changed files with 70 additions and 12 deletions

View File

@ -2,10 +2,11 @@
{% macro getGreeting() %} {% macro getGreeting() %}
{{ [ "Good morning Anchorage House. Rise and Shine. ", {{ [ "Good morning Anchorage House. Rise and Shine. ",
"Good morning everyone. ", "Good morning everyone. ",
"Good morning. The early bird gets the worm. And look over there. A worm. Wait, is that a snake. umm, someone might want to take care, ok, moving on.", "Good morning. The early bird gets the worm. And look over there. A worm. Wait, is that a snake? umm,,,I don't like snakes. Someone might want to take care,, ok,,, moving on.",
"Good morning. The early bird gets the worm.", "Good morning. The early bird gets the worm.",
"Good morning from the bridge.", "Good morning from the bridge.",
"I hope I am not waking you, but I think this would be a good time for the morning report." "Pardom the interuption.",
"I hope I am not interupting, but I think this would be a good time for the morning report."
] | random }} ] | random }}
{% if is_state("input_boolean.guest_mode", "on") %} {% if is_state("input_boolean.guest_mode", "on") %}
{{ [ "And a special welcome to our guests. ", {{ [ "And a special welcome to our guests. ",

View File

@ -1,12 +1,12 @@
> >
{% macro getSnark() %} {% macro getSnark() %}
{{ [ "Good evening, ", {{ [ "Good evening, ",
"Before we shut this party down, ", "Pardon the interuption, ",
"Good Evening Anchorage House, " "Good Evening Anchorage House, "
] | random }} ] | random }}
{{ [ "I thought you might like to know. ", {{ [ "I thought you might like to know. ",
"I might have some bad news for you.", "Here is the nightly report.",
"Just one more thing." "Before I call it a day I wanted to let you know,"
] | random }} ] | random }}
{% endmacro %} {% endmacro %}
{% macro getForecast() %} {% macro getForecast() %}
@ -14,7 +14,10 @@
{% endmacro %} {% endmacro %}
{% macro getTrashDay() %} {% macro getTrashDay() %}
{% if is_state("sensor.weekday", "mon") %} {% if is_state("sensor.weekday", "mon") %}
Don't forget Tomorrow is trash day! {{ [ "Don't forget tomorrow is Trash Day. ",
"I advise you move the trash cans to the curb for the weekly pickup. ",
" The trash and recycle should go out"
] | random }}
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
{% macro getBirthdays() %} {% macro getBirthdays() %}

View File

@ -0,0 +1,50 @@
>
{% macro getForecast() %}
The low tonight will be {{states.sensor.dark_sky_overnight_low_temperature_0.state | round}} degrees and there is a {{states.sensor.dark_sky_precip_probability_0.state|round}} percent chance of rain.
{% endmacro %}
{% macro getTrashDay() %}
{% if is_state("sensor.weekday", "mon") %}
Tomorrow is trash day!
{% endif %}
{% endmacro %}
{% macro getBirthdays() %}
{% if states.sensor.birthday_skylar.state | int < 2 %}
Tomorrow is Skylar's Birthday.
{% endif %}
{% if states.sensor.birthday_jeff.state | int < 2 %}
Tomorrow is Jeff's Birthday.
{% endif %}
{% if states.sensor.birthday_kat.state | int < 2 %}
Tomorrow is Katherine's Birthday.
{% endif %}
{% if states.sensor.anniversary_our_wedding.state | int < 2 %}
Tomorrow is Jeff and Katherine's Wedding Anniversary.
{% endif %}
{% endmacro %}
{% macro getHolidays() %}
{% if states.sensor.holiday_halloween.state | int < 2 %}
Tomorrow is Halloween. Hope you have picked out a costume.
{% endif %}
{% if states.sensor.holiday_christmas.state | int < 2 %}
Tomorrow is Christmas. It's practically here!
{% 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") }}.
{{ getForecast() }}
{{ getTrashDay() }}
{{ getBirthdays() }}
{{ getHolidays() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}

View File

@ -1,16 +1,20 @@
> >
{% macro getIntro() %} {% macro getIntro() %}
Skylar.
{{ [ "This is your friendly neighborhood smart home ", {{ [ "Pardom me, Skylar,, ",
"This is your digital life mate ", "Good morning Skylar, This is your digital life mate, Jarvis ",
"This is your cruise director ", "This is your cruise director with your morning announcements.",
] | random }} with your morning announcements. ] | random }}
{% endmacro %} {% endmacro %}
{% macro getDressed() %} {% macro getDressed() %}
{% if is_state("sensor.birthday_skylar", "0") %} {% if is_state("sensor.birthday_skylar", "0") %}
First, Happy Birthday Skylar! Second, even birthday boys have to get dressed. So get to it. First, Happy Birthday Skylar! Second, even birthday boys have to get dressed. So get to it.
{% else %} {% else %}
It is time to get dressed. 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 }}
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
{% macro getSchoolDay() %} {% macro getSchoolDay() %}