From be0e58c3f01b0e2b8f0405f6c8e6a4cc962b5ca7 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Tue, 25 Aug 2020 19:14:02 +0200 Subject: [PATCH] move comments --- custom_components/circadian_lighting/__init__.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/custom_components/circadian_lighting/__init__.py b/custom_components/circadian_lighting/__init__.py index 38f48dae..715125c6 100644 --- a/custom_components/circadian_lighting/__init__.py +++ b/custom_components/circadian_lighting/__init__.py @@ -258,9 +258,8 @@ class CircadianLighting(object): solar_noon_seconds = today_sun_times["solar_noon"].timestamp() solar_midnight_seconds = today_sun_times["solar_midnight"].timestamp() - if ( - now < today_sun_times[SUN_EVENT_SUNRISE] - ): # It's before sunrise (after midnight) + if now < today_sun_times[SUN_EVENT_SUNRISE]: + # It's before sunrise (after midnight) # Because it's before sunrise (and after midnight) sunset must have happend yesterday yesterday_sun_times = self.get_sunrise_sunset(now - timedelta(days=1)) _LOGGER.debug("yesterday_sun_times: " + str(yesterday_sun_times)) @@ -274,9 +273,8 @@ class CircadianLighting(object): solar_midnight_seconds = yesterday_sun_times[ "solar_midnight" ].timestamp() - elif ( - now > today_sun_times[SUN_EVENT_SUNSET] - ): # It's after sunset (before midnight) + elif now > today_sun_times[SUN_EVENT_SUNSET]: + # It's after sunset (before midnight) # Because it's after sunset (and before midnight) sunrise should happen tomorrow tomorrow_sun_times = self.get_sunrise_sunset(now + timedelta(days=1)) _LOGGER.debug("tomorrow_sun_times: " + str(tomorrow_sun_times))