From 95823576ea3ded481599b2075c17948bb4f609ad Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Mon, 28 Sep 2020 21:16:10 +0200 Subject: [PATCH] pylint fix --- custom_components/adaptive_lighting/switch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 143911ce..efd19bf3 100755 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -366,9 +366,9 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity): def _get_sun_events(self, date): def _replace_time(date, key): time = getattr(self, f"_{key}_time") - dt = datetime.datetime.combine(datetime.date.today(), time) - tz = self.hass.config.time_zone - utc_time = tz.localize(dt).astimezone(dt_util.UTC) + date_time = datetime.datetime.combine(datetime.date.today(), time) + time_zone = self.hass.config.time_zone + utc_time = time_zone.localize(date_time).astimezone(dt_util.UTC) return date.replace( hour=utc_time.hour, minute=utc_time.minute,