From ef1546b6b93a47b51aa6f1379b938cbc071ad3dd Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Sun, 6 Aug 2023 19:21:16 -0700 Subject: [PATCH] Fix min_sunrise_time and max_sunset_time (#717) Closes #714 --- custom_components/adaptive_lighting/const.py | 2 ++ custom_components/adaptive_lighting/switch.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/custom_components/adaptive_lighting/const.py b/custom_components/adaptive_lighting/const.py index f3dc628d..0608d3da 100644 --- a/custom_components/adaptive_lighting/const.py +++ b/custom_components/adaptive_lighting/const.py @@ -377,10 +377,12 @@ EXTRA_VALIDATION = { CONF_INTERVAL: (cv.time_period, timedelta_as_int), CONF_SUNRISE_OFFSET: (cv.time_period, timedelta_as_int), CONF_SUNRISE_TIME: (cv.time, str), + CONF_MIN_SUNRISE_TIME: (cv.time, str), CONF_MAX_SUNRISE_TIME: (cv.time, str), CONF_SUNSET_OFFSET: (cv.time_period, timedelta_as_int), CONF_SUNSET_TIME: (cv.time, str), CONF_MIN_SUNSET_TIME: (cv.time, str), + CONF_MAX_SUNSET_TIME: (cv.time, str), CONF_BRIGHTNESS_MODE_TIME_LIGHT: (cv.time_period, timedelta_as_int), CONF_BRIGHTNESS_MODE_TIME_DARK: (cv.time_period, timedelta_as_int), } diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 88d94009..07eb0a97 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -1689,8 +1689,10 @@ class SunLightSettings: if ( self.sunrise_time is None and self.sunset_time is None + and self.min_sunrise_time is None and self.max_sunrise_time is None and self.min_sunset_time is None + and self.max_sunset_time is None ): solar_noon = location.noon(date, local=False) solar_midnight = location.midnight(date, local=False)