From 65606a4967dc256f13d256ec46cb754f05d3b86a Mon Sep 17 00:00:00 2001 From: zim514 Date: Fri, 3 May 2024 12:39:12 -0400 Subject: [PATCH] Add 1 second to 'now' to attempt fixing daylight not switching properly when the time delta is 0 --- script.service.hue/addon.xml | 2 +- script.service.hue/resources/lib/core.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script.service.hue/addon.xml b/script.service.hue/addon.xml index 0531aa22..3e267782 100644 --- a/script.service.hue/addon.xml +++ b/script.service.hue/addon.xml @@ -1,4 +1,4 @@ - + diff --git a/script.service.hue/resources/lib/core.py b/script.service.hue/resources/lib/core.py index ecd0b7ed..3c104b79 100644 --- a/script.service.hue/resources/lib/core.py +++ b/script.service.hue/resources/lib/core.py @@ -217,7 +217,7 @@ def _task_loop(self): while not self.settings_monitor.abortRequested() and not self.stop_timers.is_set(): #todo: Update timers if sunset offset changes. - now = datetime.now() + now = datetime.now() + timedelta(seconds=1) today = date.today() # Convert self.morning_time to a datetime object #todo: Do this in settings.py, or something morning_datetime = datetime.combine(today, self.settings_monitor.morning_time)