diff --git a/custom_templates/time.jinja b/custom_templates/time.jinja index dda51c7..bd1cad3 100644 --- a/custom_templates/time.jinja +++ b/custom_templates/time.jinja @@ -38,8 +38,12 @@ {{ as_timestamp(strptime(state_attr(calendar,start_or_end), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%I:%M %p") }} {% endmacro %} -{% macro increment_datetime_from_now(hours) %} +{% macro increment_datetime_from_now(hours,minutes) %} +{% if minutes is defined %} +{{ (as_timestamp(now()) + (((hours * 60) * 60) + (minutes * 60))) | int | timestamp_custom('%Y-%m-%d %H:%M:%S') }} +{% else %} {{ (as_timestamp(now()) + ((hours* 60) * 60)) | int | timestamp_custom('%Y-%m-%d %H:%M:%S') }} +{% endif %} {% endmacro %} {% macro ct() %} diff --git a/packages/emmalynn.yaml b/packages/emmalynn.yaml index e4d5c93..0d16419 100644 --- a/packages/emmalynn.yaml +++ b/packages/emmalynn.yaml @@ -465,7 +465,7 @@ script: data: datetime: > {% from 'time.jinja' import increment_datetime_from_now %} - {{ increment_datetime_from_now(0.5) }} + {{ increment_datetime_from_now(0,30) }} - service: script.text_notify data: who: parents @@ -553,7 +553,7 @@ script: data: datetime: > {% from 'time.jinja' import increment_datetime_from_now %} - {{ increment_datetime_from_now(0.5) }} + {{ increment_datetime_from_now(0,30) }} - service: script.text_notify data: who: parents