From 1ba86da318c415c033106eb80a9480604309e5c9 Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Fri, 12 Jul 2019 16:34:15 -0400 Subject: [PATCH] Minor tweeks to work better with Amazon Polly --- templates/morning_report.yaml | 5 ++-- templates/nightly_report.yaml | 11 +++++--- templates/prebed_routing.yaml | 50 +++++++++++++++++++++++++++++++++++ templates/skylar_morning.yaml | 16 ++++++----- 4 files changed, 70 insertions(+), 12 deletions(-) create mode 100644 templates/prebed_routing.yaml diff --git a/templates/morning_report.yaml b/templates/morning_report.yaml index d3930eb..dda68f7 100644 --- a/templates/morning_report.yaml +++ b/templates/morning_report.yaml @@ -2,10 +2,11 @@ {% macro getGreeting() %} {{ [ "Good morning Anchorage House. Rise and Shine. ", "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 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 }} {% if is_state("input_boolean.guest_mode", "on") %} {{ [ "And a special welcome to our guests. ", diff --git a/templates/nightly_report.yaml b/templates/nightly_report.yaml index 201f535..ddeec9e 100644 --- a/templates/nightly_report.yaml +++ b/templates/nightly_report.yaml @@ -1,12 +1,12 @@ > {% macro getSnark() %} {{ [ "Good evening, ", - "Before we shut this party down, ", + "Pardon the interuption, ", "Good Evening Anchorage House, " ] | random }} {{ [ "I thought you might like to know. ", - "I might have some bad news for you.", - "Just one more thing." + "Here is the nightly report.", + "Before I call it a day I wanted to let you know," ] | random }} {% endmacro %} {% macro getForecast() %} @@ -14,7 +14,10 @@ {% endmacro %} {% macro getTrashDay() %} {% 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 %} {% endmacro %} {% macro getBirthdays() %} diff --git a/templates/prebed_routing.yaml b/templates/prebed_routing.yaml new file mode 100644 index 0000000..aa24037 --- /dev/null +++ b/templates/prebed_routing.yaml @@ -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()) -}} \ No newline at end of file diff --git a/templates/skylar_morning.yaml b/templates/skylar_morning.yaml index 8e19141..99b9edd 100644 --- a/templates/skylar_morning.yaml +++ b/templates/skylar_morning.yaml @@ -1,16 +1,20 @@ > {% macro getIntro() %} - Skylar. - {{ [ "This is your friendly neighborhood smart home ", - "This is your digital life mate ", - "This is your cruise director ", - ] | random }} with your morning announcements. + + {{ [ "Pardom me, Skylar,, ", + "Good morning Skylar, This is your digital life mate, Jarvis ", + "This is your cruise director with your morning announcements.", + ] | random }} {% 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 %} - 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 %} {% endmacro %} {% macro getSchoolDay() %}