More briefing tweaks #97

This commit is contained in:
2023-10-09 18:32:22 -04:00
parent 8a7964c6a4
commit 2dd52b58e6
4 changed files with 26 additions and 38 deletions

View File

@ -1,4 +1,4 @@
{% macro greeting() %} {% macro greeting(date) %}
{% if now().strftime('%H')|int < 12 %} {% if now().strftime('%H')|int < 12 %}
{{ [ {{ [
"Good morning. ", "Good morning. ",
@ -18,43 +18,33 @@
"The grandest of evenings to you. " "The grandest of evenings to you. "
] | random }} ] | random }}
{% endif %} {% endif %}
{% if is_state('binary_sensor.morning','on') %} {% if is_state('binary_sensor.morning','on') and date == 'date' %}
Today is {{ states('sensor.today_is') }}, {{ as_timestamp(now()) | timestamp_custom('%B %d %Y') }}. Today's date is {{ as_timestamp(now()) | timestamp_custom('%B %d %Y') }}.
{% endif %} {% endif %}
It is {{ now().strftime("%I:%M %p") }}. It is {{ now().strftime("%I:%M %p") }}.
{% endmacro %} {% endmacro %}
{% macro greeting_nodate() %} {% macro today_is() %}
{% if now().strftime('%H')|int < 12 %}
{{ [ {{ [
"Good morning. ", 'Today is ',
"Top of the morning to you laddy. ", 'If you have not been keeping track today is ',
'Do you know what day of the week it is? Today is',
'I hate to be the bearer of bad news, but today is ',
'In case you do not own a calendar, today is ',
'If you have forgotten the order in which the week progresses, today is ',
'Because we all forget sometimes, today is ',
'What day is today? Oh, right, it is '
]|random }} ]|random }}
{% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %} {{ states('sensor.today_is') }}.
{{ [
"Greetings earthling. ",
"Good afternoon. ",
"How do you do, fellow kids? ",
"Howdy partner. ",
"Greetings, human overlords. ",
] | random }}
{% else %}
{{ [
"Good evening. ",
"The grandest of evenings to you. "
] | random }}
{% endif %}
It is {{ now().strftime("%I:%M %p") }}.
{% endmacro %} {% endmacro %}
{% macro dadjoke() %} {% macro dadjoke() %}
{{ [ {{ [
"Here is a random dad joke ", "Here is a random dad joke ",
"In case you hadn't had enough idiotic humor today, here is a little more ", "In case you hadn't had enough idiotic humor today, here is a little more ",
"For further proof that the developer responsible for my existence is an idiot, I present the following joke ",
"I like jokes. I particularly like stupid jokes. Here is an example ",
"The best jokes are the dumb ones like this one ", "The best jokes are the dumb ones like this one ",
"And now for todays episode of humor for morons ", "And now for todays episode of humor for morons ",
"We are all dead inside, so here is another idiotic joke ",
] | random }}<break time="1s"/> {{ states('sensor.random_joke') }} ] | random }}<break time="1s"/> {{ states('sensor.random_joke') }}
{% endmacro %} {% endmacro %}

View File

@ -2,13 +2,17 @@
{# Daily Briefing #} {# Daily Briefing #}
{% from 'formatting.jinja' import cleanup %} {% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%} {%- macro getReport() -%}
{% from 'speech.jinja' import greeting, dadjoke, inspirational_quote %} {% from 'speech.jinja' import greeting, dadjoke, inspirational_quote, today_is %}
{% from 'status.jinja' import houseStatusReport, tonyStatusReport, tinaStatusReport, kallenStatusReport, emmaStatusReport %} {% from 'status.jinja' import houseStatusReport, tonyStatusReport, tinaStatusReport, kallenStatusReport, emmaStatusReport %}
{% from 'easy_time.jinja' import count_the_days %} {% from 'easy_time.jinja' import count_the_days %}
{% from 'weather.jinja' import weatherReport %} {% from 'weather.jinja' import weatherReport %}
{% from 'sports.jinja' import sports_updates %} {% from 'sports.jinja' import sports_updates %}
<p> <p>
{{ greeting() }} {{ greeting('date') }}
</p>
<p>
{{ today_is() }}
</p> </p>
<p> <p>

View File

@ -2,22 +2,16 @@
{# Morning Briefing #} {# Morning Briefing #}
{% from 'formatting.jinja' import cleanup %} {% from 'formatting.jinja' import cleanup %}
{%- macro getReport() -%} {%- macro getReport() -%}
{% from 'speech.jinja' import greeting_nodate, dadjoke, inspirational_quote %} {% from 'speech.jinja' import greeting, dadjoke, inspirational_quote, today_is %}
{% from 'status.jinja' import tonyStatusReport, tinaStatusReport, kallenStatusReport, emmaStatusReport %} {% from 'status.jinja' import tonyStatusReport, tinaStatusReport, kallenStatusReport, emmaStatusReport %}
{% from 'easy_time.jinja' import count_the_days %} {% from 'easy_time.jinja' import count_the_days %}
{% from 'weather.jinja' import weatherReport %} {% from 'weather.jinja' import weatherReport %}
{% from 'sports.jinja' import sports_updates %} {% from 'sports.jinja' import sports_updates %}
<p> <p>
{{ greeting_nodate() }} {{ greeting('nodate') }}
</p> </p>
<p> <p>
{{ [ {{ today_is() }}
'Today is ',
'If you have not been keeping track today is ',
'Do you know what day of the week it is? Today is',
'I hate to be the bearer of bad news, but today is '
]|random }}
{{states.sensor.today_is.state }}.
</p> </p>
<p> <p>

View File

@ -9,7 +9,7 @@
{% from 'weather.jinja' import weatherReport %} {% from 'weather.jinja' import weatherReport %}
{% from 'sports.jinja' import sports_updates %} {% from 'sports.jinja' import sports_updates %}
<p> <p>
{{ greeting() }} {{ greeting('date') }}
</p> </p>
<p> <p>
{{ [ {{ [