Tweak my med report to clean it up a bit in text form
This commit is contained in:
@ -44,19 +44,21 @@
|
||||
{% macro tony_morning_meds(method) %}
|
||||
{% from 'time.jinja' import input_datetime_12hr, input_datetime_12hr_with_date, ct %}
|
||||
{% set ct = ct() | int %}
|
||||
{% if is_state('input_boolean.tony_morning_meds_taken','on') %}
|
||||
Tony took his morning meds at {{ input_datetime_12hr_with_date('input_datetime.tony_morning_meds_taken') }} today.
|
||||
{% elif is_state('input_boolean.tony_morning_meds_taken','off') and ct >= 21600 %}
|
||||
Tony has not taken his morning meds.
|
||||
{% if ct < state_attr('input_datetime.tony_morning_meds_notify','timestamp') | int %}
|
||||
{% if method == 'tts' %}
|
||||
{{ ['He has a reminder scheduled for',
|
||||
'Rest assured that I will pester him mercilessly about this, starting at',
|
||||
'This is absolutely essential, and I will remind him to do it at',
|
||||
'Since nobody including Tony himself likes him without his meds, I will remind him at',
|
||||
] | random }} {{ input_datetime_12hr('input_datetime.tony_morning_meds_notify') }} today.
|
||||
{% else %}
|
||||
He will be reminded at {{ input_datetime_12hr('input_datetime.tony_morning_meds_notify') }} today.
|
||||
{% if is_state('binary_sensor.overnight','off') %}
|
||||
{% if is_state('input_boolean.tony_morning_meds_taken','on') %}
|
||||
Tony took his morning meds at {{ input_datetime_12hr_with_date('input_datetime.tony_morning_meds_taken') }} today.
|
||||
{% elif is_state('input_boolean.tony_morning_meds_taken','off') and ct >= 21600 %}
|
||||
Tony has not taken his morning meds.
|
||||
{% if ct < state_attr('input_datetime.tony_morning_meds_notify','timestamp') | int %}
|
||||
{% if method == 'tts' %}
|
||||
{{ ['He has a reminder scheduled for',
|
||||
'Rest assured that I will pester him mercilessly about this, starting at',
|
||||
'This is absolutely essential, and I will remind him to do it at',
|
||||
'Since nobody including Tony himself likes him without his meds, I will remind him at',
|
||||
] | random }} {{ input_datetime_12hr('input_datetime.tony_morning_meds_notify') }} today.
|
||||
{% else %}
|
||||
He will be reminded at {{ input_datetime_12hr('input_datetime.tony_morning_meds_notify') }} today.
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user