Skip to content

Commit

Permalink
buienradar dates tz-aware (home-assistant#8767)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjj4791 authored and dethpickle committed Aug 18, 2017
1 parent 6d30b5b commit e213350
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions homeassistant/components/sensor/buienradar.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
async_track_point_in_utc_time)
from homeassistant.util import dt as dt_util

REQUIREMENTS = ['buienradar==0.7']
REQUIREMENTS = ['buienradar==0.8']

_LOGGER = logging.getLogger(__name__)

MEASURED_LABEL = 'Measured'
TIMEFRAME_LABEL = 'Timeframe'
# Schedule next call after (minutes):
SCHEDULE_OK = 10
Expand All @@ -40,7 +41,7 @@
'symbol': ['Symbol', None, None],
'humidity': ['Humidity', '%', 'mdi:water-percent'],
'temperature': ['Temperature', TEMP_CELSIUS, 'mdi:thermometer'],
'groundtemperature': ['Ground Temperature', TEMP_CELSIUS,
'groundtemperature': ['Ground temperature', TEMP_CELSIUS,
'mdi:thermometer'],
'windspeed': ['Wind speed', 'm/s', 'mdi:weather-windy'],
'windforce': ['Wind force', 'Bft', 'mdi:weather-windy'],
Expand Down Expand Up @@ -205,10 +206,16 @@ def device_state_attributes(self):

return result

return {
result = {
ATTR_ATTRIBUTION: self._attribution,
SENSOR_TYPES['stationname'][0]: self._stationname,
}
if self._measured is not None:
# convert datetime (Europe/Amsterdam) into local datetime
local_dt = dt_util.as_local(self._measured)
result[MEASURED_LABEL] = local_dt.strftime("%c")

return result

@property
def unit_of_measurement(self):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/weather/buienradar.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
BrData)
import voluptuous as vol

REQUIREMENTS = ['buienradar==0.7']
REQUIREMENTS = ['buienradar==0.8']

_LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ broadlink==0.5

# homeassistant.components.sensor.buienradar
# homeassistant.components.weather.buienradar
buienradar==0.7
buienradar==0.8

# homeassistant.components.notify.ciscospark
ciscosparkapi==0.4.2
Expand Down

0 comments on commit e213350

Please sign in to comment.