From 8733270a2511632ea9c0577d4e2e6113a7165b25 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sat, 6 May 2023 21:28:41 -0400 Subject: [PATCH] Add my next Twitch stream to TTS briefings, as though anyone cares --- custom_templates/time.jinja | 5 +++++ templates/speech/daily_briefing.yaml | 4 +++- templates/speech/morning_briefing.yaml | 2 ++ templates/speech/nightly_briefing.yaml | 4 +++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/custom_templates/time.jinja b/custom_templates/time.jinja index 5a94044..b7395b5 100644 --- a/custom_templates/time.jinja +++ b/custom_templates/time.jinja @@ -50,4 +50,9 @@ {% macro ct() %} {{ ((now().hour * 60 + now().minute) * 60 ) }} +{% endmacro %} + +{% macro next_twitch_stream() %} +{% from 'easy_time.jinja' import custom_time %} +{{ custom_time('calendar.tony_s_twitch_schedule','week,day,hour,minute') }} {% endmacro %} \ No newline at end of file diff --git a/templates/speech/daily_briefing.yaml b/templates/speech/daily_briefing.yaml index a64ec09..ae4b072 100644 --- a/templates/speech/daily_briefing.yaml +++ b/templates/speech/daily_briefing.yaml @@ -2,7 +2,7 @@ {# Daily Briefing #} {%- macro getReport() -%} {% from 'speech.jinja' import greeting, dadjoke, inspirational_quote %} - {% from 'time.jinja' import input_datetime_12hr %} + {% from 'time.jinja' import input_datetime_12hr, next_twitch_stream %} {% from 'status.jinja' import emma_sleep %} {% from 'formatting.jinja' import cleanup %} {% from 'easy_time.jinja' import count_the_days, speak_the_days %} @@ -291,6 +291,8 @@ "Tony will be scraping out the nickels and dimes tonight for the sake of entertainment. ", "Tony is not really all that funny, but tonight he will present himself to a crowd of questionable individuals who seem to think that he is. " ] | random }} The studio is scheduled to go online at {{ input_datetime_12hr('input_datetime.tony_streaming_start_time') }}. " + {% else %} + "Tony does not have a stream scheduled today. His next scheduled stream is in {{ next_twitch_stream() }}. " {% endif %} {% if is_state('input_boolean.kallen_school_today', 'on') %} diff --git a/templates/speech/morning_briefing.yaml b/templates/speech/morning_briefing.yaml index 2d3eae6..a2e0076 100644 --- a/templates/speech/morning_briefing.yaml +++ b/templates/speech/morning_briefing.yaml @@ -153,6 +153,8 @@ "Tony will be scraping out the nickels and dimes tonight for the sake of entertainment. ", "Tony is not really all that funny, but tonight he will present himself to a crowd of questionable individuals who seem to think that he is. " ] | random }} The studio is scheduled to go online at {{ input_datetime_12hr('input_datetime.tony_streaming_start_time') }}. " + {% else %} + "Tony does not have a stream scheduled today. " {% endif %}

diff --git a/templates/speech/nightly_briefing.yaml b/templates/speech/nightly_briefing.yaml index 0655103..b74fe57 100644 --- a/templates/speech/nightly_briefing.yaml +++ b/templates/speech/nightly_briefing.yaml @@ -2,7 +2,7 @@ {# Nightly Briefing #} {%- macro getReport() -%} {% from 'speech.jinja' import greeting, dadjoke, inspirational_quote %} - {% from 'time.jinja' import input_datetime_12hr, read_time_from_calendar %} + {% from 'time.jinja' import input_datetime_12hr, read_time_from_calendar, next_twitch_stream %} {% from 'status.jinja' import emma_sleep %} {% from 'formatting.jinja' import cleanup %} {% from 'easy_time.jinja' import count_the_days %} @@ -62,6 +62,8 @@ "Tony will be scraping out the nickels and dimes tonight for the sake of entertainment. ", "Tony is not really all that funny, but tonight he will present himself to a crowd of questionable individuals who seem to think that he is. " ] | random }} The studio is scheduled to go online at {{ input_datetime_12hr('input_datetime.tony_streaming_start_time') }}. " + {% else %} + "Tonight the studio will be dormant. Tony does not stream again until {{ next_twitch_stream() }} from now. " {% endif %} {% if is_state('binary_sensor.kallen_school_tomorrow','on') %} {% if is_state('binary_sensor.kallen_band_tomorrow','on') %}