Fix garbage pickup scheduling

This commit is contained in:
2023-05-17 13:53:55 -04:00
parent a209715387
commit 5d7da3c6f6

View File

@ -433,8 +433,10 @@ script:
- condition: template - condition: template
value_template: > value_template: >
{% from 'easy_time.jinja' import count_the_days, month_week_day %} {% from 'easy_time.jinja' import count_the_days, month_week_day %}
{% set month = as_timestamp(now()) | timestamp_custom('%-m') %} {% set month = as_timestamp(now()) | timestamp_custom('%-m') | int %}
{{ count_the_days(month_week_day(month,3,2)) | int < 7 }} {% set largepickup = month_week_day(month,3,2) %}
{% set countdown = count_the_days(largepickup) | int %}
{{ 0 <= countdown < 7 }}
then: then:
- service: calendar.create_event - service: calendar.create_event
target: target: