From bc85d47878ac6cfdf94145859de8e541f1d2c2e4 Mon Sep 17 00:00:00 2001 From: Ryan Bahm Date: Thu, 21 Mar 2019 12:59:07 -0700 Subject: [PATCH] Change .now() to .utcnow() (#22233) ephem works in UTC time, not local time. As a result, our comparison needs to be in UTC for accurate results. --- homeassistant/components/season/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/season/sensor.py b/homeassistant/components/season/sensor.py index c9b222f2b26..84a2b426e9e 100644 --- a/homeassistant/components/season/sensor.py +++ b/homeassistant/components/season/sensor.py @@ -130,5 +130,5 @@ class Season(Entity): def update(self): """Update season.""" - self.datetime = datetime.now() + self.datetime = datetime.utcnow() self.season = get_season(self.datetime, self.hemisphere, self.type)