From c7b2092b21116f266f46d0378e056229bec77312 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Fri, 5 Aug 2022 14:27:04 -0400 Subject: [PATCH] Added shower awareness to K's bedtime announcement --- templates/speech/kallen_nightly_briefing.yaml | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/templates/speech/kallen_nightly_briefing.yaml b/templates/speech/kallen_nightly_briefing.yaml index 28cc85c..5a2e67f 100644 --- a/templates/speech/kallen_nightly_briefing.yaml +++ b/templates/speech/kallen_nightly_briefing.yaml @@ -3,12 +3,18 @@ {%- macro getReport() -%}

Good Evening, Kallen, - {{ [ 'It is almost bedtime. That means it is time to start preparing for bed. if you are taking a shower tonight, you need to head that way.', - 'My sensors are detecting a strange smell. I am running diagnostics. But in the mean time, you should start a shower.', - 'I hate to say it but, the day is coming to an end. Time to finish up your tasks, pick up any toys you have out, and get ready for bed.', - 'Did you ever hear the one about the kid who never took a shower? Yeah, me either. So we should keep it that way. It is time to get ready for bed.', - 'The count down clock until bedtime has started. Time to get cleaned up, get your pajamas on, and head for your bedroom.' - ] | random }} + {%- if as_timestamp(strptime(state_attr('calendar.kallen_tasks','end_time'), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%Y-%m-%d") == now().strftime("%Y-%m-%d") and is_state_attr('calendar.kallen_tasks','message','Shower') %} + {{ [ 'My sensors are detecting a strange smell. I am running diagnostics. But in the mean time, you should start a shower.', + 'It is a shower night, so you need to head upstairs and get on that.', + 'Did you ever hear the one about the kid who never took a shower? Yeah, me either. So we should keep it that way. It is time to get ready for bed.' + ] | random }} + {% else %} + {{ [ 'It is almost bedtime. That means it is time to start preparing for bed.', + 'I hate to say it but, the day is coming to an end. Time to finish up your tasks, pick up any toys you have out, and get ready for bed.', + 'The count down clock until bedtime has started. Time to get cleaned up, get your pajamas on, and head for your bedroom.', + 'Its the final countdown until bedtime, silly. Time to get ready to head that way!' + ] | random }} + {% endif %} {% if is_state('sensor.school_tomorrow', 'on') %} {{ [ 'Because you have school tomorrow. ', 'Because you have to get up early tomorrow for school.', @@ -57,7 +63,8 @@ Tomorrow is the first day of summer. Are you ready? {%- endif %} {{ [ 'I will turn on your bedroom lights and appropriate white noise device at bedtime.', - 'I have executed the Pre bed routine for your room. Standby for bedtime protocol in two zero minutes.' + 'I have executed the Pre bed routine for your room. Standby for bedtime protocol in two zero minutes.', + 'I will prepare your bedroom shortly.' ] | random }}

{%- endmacro -%}