Turn dad jokes into a macro

This commit is contained in:
2023-04-18 17:31:35 -04:00
parent 9ad2215b12
commit 4d597a7fe8
7 changed files with 25 additions and 20 deletions

View File

@ -42,3 +42,11 @@ It is {{ now().strftime("%I:%M %p") }}.
{% endif %}
It is {{ now().strftime("%I:%M %p") }}.
{% endmacro %}
{% macro dadjoke() %}
{{ [
"Here is a random dad joke ",
"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 ",
] | random }}<break time="1s"/> {{ states('sensor.random_joke') }}
{% endmacro %}

View File

@ -1,7 +1,7 @@
>
{# Daily Briefing #}
{%- macro getReport() -%}
{% from 'speech.jinja' import greeting %}
{% from 'speech.jinja' import greeting, dadjoke %}
<p>
{{ greeting() }}
</p>
@ -432,11 +432,7 @@
</p>
<p>
{{ [
"Here is a random dad joke ",
"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 ",
] | random }}<break time="1s"/> {{ states('sensor.random_joke') }}
{{ dadjoke() }}
</p>
<p>

View File

@ -2,6 +2,7 @@
{# Kallen Morning Briefing #}
{%- macro getReport() -%}
{% from 'time.jinja' import current_time_12hr, current_date_readout %}
{% from 'speech.jinja' import dadjoke %}
<p>
Good morning, Collin.
@ -158,6 +159,12 @@
</p>
<p>
{% if is_state('input_boolean.kallen_school_today','off') %}
{{ dadjoke() }}
{% endif %}
</p>
<p>
{% if is_state('input_boolean.kallen_briefing_extras','on') %}
"And now we have the following extra information to pass along. {{ states('input_text.kallen_briefing_extras') }} "

View File

@ -1,6 +1,7 @@
>
{# Kallen Nightly Briefing #}
{%- macro getReport() -%}
{% from 'speech.jinja' import dadjoke %}
<p>
Good Evening, Collin, it is currently {{ now().strftime("%I:%M %p") }}.
{{ [ 'My sensors are detecting a strange smell. I am running diagnostics. But in the mean time, you should start a shower.',
@ -112,7 +113,7 @@
</p>
<p>
Just for you, here is a random dad joke <break time="1s"/> {{ states('sensor.random_joke') }}
{{ dadjoke() }}
</p>
<p>

View File

@ -1,7 +1,7 @@
>
{# Morning Briefing #}
{%- macro getReport() -%}
{% from 'speech.jinja' import greeting_nodate %}
{% from 'speech.jinja' import greeting_nodate, dadjoke %}
<p>
{{ greeting_nodate() }}
</p>
@ -214,11 +214,7 @@
</p>
<p>
{{ [
"Here is a random dad joke ",
"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 ",
] | random }}<break time="1s"/> {{ states('sensor.random_joke') }}
{{ dadjoke() }}
</p>
<p>

View File

@ -1,7 +1,7 @@
>
{# Nightly Briefing #}
{%- macro getReport() -%}
{% from 'speech.jinja' import greeting %}
{% from 'speech.jinja' import greeting, dadjoke %}
<p>
{{ greeting() }}
</p>
@ -266,11 +266,7 @@
</p>
<p>
{{ [
"Here is a random dad joke ",
"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 ",
] | random }}<break time="1s"/> {{ states('sensor.random_joke') }}
{{ dadjoke() }}
</p>
<p>

View File

@ -1,6 +1,7 @@
>
{# Welcome Home #}
{%- macro getReport() -%}
{% from 'speech.jinja' import dadjoke %}
<p>
"Welcome home, "
{% if is_state('person.tony_stork','home') and is_state('person.christina_stork','home') %}
@ -147,7 +148,7 @@
</p>
<p>
Here is a random dad joke <break time="1s"/> {{ states('sensor.random_joke') }}
{{ dadjoke() }}
</p>
<p>