Skip to content

Commit

Permalink
Use datetime.utcnow() for season sensor to get offset-naive utc time
Browse files Browse the repository at this point in the history
  • Loading branch information
tsvi committed Sep 12, 2019
1 parent a791f0a commit 3baf374
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions homeassistant/components/season/sensor.py
Expand Up @@ -8,7 +8,6 @@
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 @@ -105,7 +104,7 @@ def __init__(self, hass, hemisphere, season_tracking_type):
"""Initialize the season."""
self.hass = hass
self.hemisphere = hemisphere
self.datetime = dt_util.utcnow().replace(tzinfo=None)
self.datetime = datetime.utcnow()
self.type = season_tracking_type
self.season = get_season(self.datetime, self.hemisphere, self.type)

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

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

0 comments on commit 3baf374

Please sign in to comment.