From 60bb95d2244ef6d58561178cdb7e166b44200d81 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Mon, 26 Sep 2022 18:21:25 -0400 Subject: [PATCH] Fixed situation that would cause a large gap before rearming security --- packages/scheduling.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/scheduling.yaml b/packages/scheduling.yaml index b7bf6b3..a4833e2 100644 --- a/packages/scheduling.yaml +++ b/packages/scheduling.yaml @@ -288,7 +288,11 @@ script: {% if state_attr('input_datetime.tina_workday_start','timestamp') < state_attr('input_datetime.school_day_start','timestamp') %} {{ (state_attr('input_datetime.school_day_start','timestamp') + 1800) | timestamp_custom('%H:%M', false) }} {% else %} - {{ (state_attr('input_datetime.tina_workday_start','timestamp') + 900) | timestamp_custom('%H:%M', false) }} + {% if (state_attr('input_datetime.tina_workday_start','timestamp') - state_attr('input_datetime.school_day_start','timestamp')) > 5400 %} + {{ (state_attr('input_datetime.school_day_start','timestamp') + 1800) | timestamp_custom('%H:%M', false) }} + {% else %} + {{ (state_attr('input_datetime.tina_workday_start','timestamp') + 900) | timestamp_custom('%H:%M', false) }} + {% endif %} {% endif %} {% else %} 12:00