From 0e233176df2633ed9ecb55570758eb3ec620bf29 Mon Sep 17 00:00:00 2001 From: zefr0x <65136727+zefr0x@users.noreply.github.com> Date: Sun, 12 May 2024 20:27:35 +0300 Subject: [PATCH] fix `auto-temperature.py` script *again* (#24) It looks like after refactoring the code in #23, I just returned the original problem. --- scripts/auto-temperature.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/auto-temperature.py b/scripts/auto-temperature.py index 92a3f83..0bc5578 100755 --- a/scripts/auto-temperature.py +++ b/scripts/auto-temperature.py @@ -26,9 +26,9 @@ def mk_time(hours, minutes, seconds=0): temp = (DAWN_TIME - current_time) * (TEMP_NIGHT - TEMP_DAY) / WINDOW + TEMP_DAY elif DUSK_TIME - WINDOW < current_time < DUSK_TIME: temp = (DUSK_TIME - current_time) * (TEMP_DAY - TEMP_NIGHT) / WINDOW + TEMP_NIGHT - elif current_time > DUSK_TIME or current_time < DAWN_TIME: + elif current_time >= DUSK_TIME or current_time < DAWN_TIME: temp = TEMP_NIGHT - elif current_time > DAWN_TIME or current_time < DUSK_TIME: + elif current_time >= DAWN_TIME or current_time < DUSK_TIME: temp = TEMP_DAY if temp: