Skip to content
Permalink
Browse files

Use local time for nearest strike

  • Loading branch information...
bachya committed Jul 7, 2019
1 parent ef6a2d7 commit 947d3073e7ffcc7584c5f76e3b92655f3e97f101
Showing with 3 additions and 3 deletions.
  1. +3 −3 homeassistant/components/wwlln/sensor.py
@@ -2,7 +2,7 @@
import logging

from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE
from homeassistant.util.dt import utc_from_timestamp
from homeassistant.util.dt import as_local, utc_from_timestamp

from . import (
SENSOR_TYPES, TYPE_NEAREST_STRIKE_DISTANCE, TYPE_NUM_NEARBY_STRIKES,
@@ -40,8 +40,8 @@ def state(self):
self._attrs.update({
ATTR_LATITUDE: self._wwlln.nearest_strike['lat'],
ATTR_LONGITUDE: self._wwlln.nearest_strike['long'],
ATTR_TIMESTAMP: utc_from_timestamp(
self._wwlln.nearest_strike['unixTime']),
ATTR_TIMESTAMP: as_local(utc_from_timestamp(
self._wwlln.nearest_strike['unixTime'])),
})
self._state = round(self._wwlln.nearest_strike['distance'], 2)
elif self._sensor_type == TYPE_NUM_NEARBY_STRIKES:

0 comments on commit 947d307

Please sign in to comment.
You can’t perform that action at this time.