From cb8160fddabf63c7f1cd39b2ac4eb5290a1ede0a Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Thu, 20 Oct 2022 20:19:52 -0400 Subject: [PATCH] Ability to add temporary extra info to briefings --- packages/announcements.yaml | 10 ++++++++++ templates/speech/daily_briefing.yaml | 7 ++++++- templates/speech/morning_briefing.yaml | 5 +++++ templates/speech/nightly_briefing.yaml | 6 ++++++ templates/speech/welcome_home.yaml | 6 ++++++ 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/packages/announcements.yaml b/packages/announcements.yaml index ee6d7d0..cf4aba3 100644 --- a/packages/announcements.yaml +++ b/packages/announcements.yaml @@ -52,6 +52,16 @@ input_select: - Common Areas icon: mdi:map-marker +input_text: + briefing_extras: + name: Briefing Extras + icon: mdi:plus + +input_boolean: + briefing_extras: + name: Briefing Extras + icon: mdi:plus + ################################ # Announcment Automation - fires at the time of the above input_datetimes ################################ diff --git a/templates/speech/daily_briefing.yaml b/templates/speech/daily_briefing.yaml index a69a2f7..c48b5cd 100644 --- a/templates/speech/daily_briefing.yaml +++ b/templates/speech/daily_briefing.yaml @@ -323,13 +323,18 @@ Today is the first day of Summer Break! {%- endif %} {% endif %} -

Around the house, there are currently {{ states.sensor.current_lights_on.state }} lights on.

+

+ {% if is_state('input_boolean.briefing_extras','on') %} + "And now we have the following extra information to pass along. {{ states('input_text.briefing_extras') }} " + {% endif %} +

+ {%- endmacro -%} diff --git a/templates/speech/morning_briefing.yaml b/templates/speech/morning_briefing.yaml index ee308de..8676531 100644 --- a/templates/speech/morning_briefing.yaml +++ b/templates/speech/morning_briefing.yaml @@ -120,6 +120,11 @@ It appears no traffic reports are needed today. Enjoy your day off! {% endif %} +

+ {% if is_state('input_boolean.briefing_extras','on') %} + "And now we have the following extra information to pass along. {{ states('input_text.briefing_extras') }} " + {% endif %} +

{%- endmacro -%} diff --git a/templates/speech/nightly_briefing.yaml b/templates/speech/nightly_briefing.yaml index 155c342..e8da93a 100644 --- a/templates/speech/nightly_briefing.yaml +++ b/templates/speech/nightly_briefing.yaml @@ -77,6 +77,12 @@ {% endif %}

+

+ {% if is_state('input_boolean.briefing_extras','on') %} + "And now we have the following extra information to pass along. {{ states('input_text.briefing_extras') }} " + {% endif %} +

+

"This briefing is a work in progress. Stay tuned in the coming days for more updates! "

diff --git a/templates/speech/welcome_home.yaml b/templates/speech/welcome_home.yaml index 088d8da..1aea55e 100644 --- a/templates/speech/welcome_home.yaml +++ b/templates/speech/welcome_home.yaml @@ -148,6 +148,12 @@ {% endif %}

+

+ {% if is_state('input_boolean.briefing_extras','on') %} + "And now we have the following extra information to pass along. {{ states('input_text.briefing_extras') }} " + {% endif %} +

+ {%- endmacro -%} {# a macro that removes all newline characters, empty spaces, and returns formatted text #}