Skip to content

Commit

Permalink
Revert "Use datetime.utcnow() for season sensor to get offset-naive u…
Browse files Browse the repository at this point in the history
…tc time"

This reverts commit 5f36463.
  • Loading branch information
tsvi committed Sep 12, 2019
1 parent 3baf374 commit 6631fe9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions homeassistant/components/season/sensor.py
Expand Up @@ -8,6 +8,7 @@
from homeassistant.const import CONF_TYPE
from homeassistant.helpers.entity import Entity
from homeassistant import util
import homeassistant.util.dt as dt_util

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -104,7 +105,7 @@ def __init__(self, hass, hemisphere, season_tracking_type):
"""Initialize the season."""
self.hass = hass
self.hemisphere = hemisphere
self.datetime = datetime.utcnow()
self.datetime = dt_util.utcnow().replace(tzinfo=None)
self.type = season_tracking_type
self.season = get_season(self.datetime, self.hemisphere, self.type)

Expand All @@ -125,5 +126,5 @@ def icon(self):

def update(self):
"""Update season."""
self.datetime = datetime.utcnow()
self.datetime = dt_util.utcnow().replace(tzinfo=None)
self.season = get_season(self.datetime, self.hemisphere, self.type)

0 comments on commit 6631fe9

Please sign in to comment.