Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buienradar dates tz-aware #8767

Merged
merged 1 commit into from
Aug 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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