More time-based Jinja2 custom templates

This commit is contained in:
2023-04-19 20:38:13 -04:00
parent ad2735d414
commit 53c0d4e86a
7 changed files with 45 additions and 28 deletions

View File

@ -2,6 +2,7 @@
{# Welcome Home #}
{%- macro getReport() -%}
{% from 'speech.jinja' import dadjoke %}
{% from 'time.jinja' import input_datetime_12hr %}
<p>
"Welcome home, "
{% if is_state('person.tony_stork','home') and is_state('person.christina_stork','home') %}
@ -136,12 +137,12 @@
<p>
{% set tina = states.person.christina_stork.state %}
{% if tina in ['Bob Evans','BobEvans'] and is_state('input_boolean.work_today','on') %}
"Tina is at work right now. She will be done at approximately {{ (state_attr('input_datetime.tina_workday_end','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
"Tina is at work right now. She will be done at approximately {{ input_datetime_12hr('input_datetime.tina_workday_end') }}. "
{% elif is_state('input_boolean.work_today','on') %}
"Tina has work today. "
{% endif %}
{% if is_state('input_boolean.kallen_at_school','on') %}
"Kallen is at school right now. His pickup time will be at {{ (state_attr('input_datetime.kallen_school_day_end','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
"Kallen is at school right now. His pickup time will be at {{ input_datetime_12hr('input_datetime.kallen_school_day_end') }}. "
{% elif is_state('input_boolean.kallen_school_today','on') %}
"Kallen has school today. "
{% endif %}