From 5d7da3c6f65d3af8f91fee5cef29c082e8e3d23a Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Wed, 17 May 2023 13:53:55 -0400 Subject: [PATCH] Fix garbage pickup scheduling --- packages/scheduling.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/scheduling.yaml b/packages/scheduling.yaml index 9d59961..1f2ccb6 100644 --- a/packages/scheduling.yaml +++ b/packages/scheduling.yaml @@ -433,8 +433,10 @@ script: - condition: template value_template: > {% from 'easy_time.jinja' import count_the_days, month_week_day %} - {% set month = as_timestamp(now()) | timestamp_custom('%-m') %} - {{ count_the_days(month_week_day(month,3,2)) | int < 7 }} + {% set month = as_timestamp(now()) | timestamp_custom('%-m') | int %} + {% set largepickup = month_week_day(month,3,2) %} + {% set countdown = count_the_days(largepickup) | int %} + {{ 0 <= countdown < 7 }} then: - service: calendar.create_event target: