Skip to content

Commit

Permalink
add utc tz to forecast
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewFlamm committed Sep 29, 2019
1 parent f259ff1 commit e0b9577
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions homeassistant/components/darksky/weather.py
@@ -1,5 +1,5 @@
"""Support for retrieving meteorological data from Dark Sky."""
from datetime import datetime, timedelta
from datetime import timedelta
import logging

from requests.exceptions import ConnectionError as ConnectError, HTTPError, Timeout
Expand Down Expand Up @@ -29,6 +29,7 @@
)
import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle
from homeassistant.util.dt import utc_from_timestamp
from homeassistant.util.pressure import convert as convert_pressure

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -178,7 +179,7 @@ def calc_precipitation(intensity, hours):
if self._mode == "daily":
data = [
{
ATTR_FORECAST_TIME: datetime.fromtimestamp(
ATTR_FORECAST_TIME: utc_from_timestamp(
entry.d.get("time")
).isoformat(),
ATTR_FORECAST_TEMP: entry.d.get("temperatureHigh"),
Expand All @@ -195,7 +196,7 @@ def calc_precipitation(intensity, hours):
else:
data = [
{
ATTR_FORECAST_TIME: datetime.fromtimestamp(
ATTR_FORECAST_TIME: utc_from_timestamp(
entry.d.get("time")
).isoformat(),
ATTR_FORECAST_TEMP: entry.d.get("temperature"),
Expand Down

0 comments on commit e0b9577

Please sign in to comment.