mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
buienradar dates tz-aware (#8767)
This commit is contained in:
parent
e6331aafb2
commit
775185896a
@ -23,10 +23,11 @@ from homeassistant.helpers.event import (
|
|||||||
async_track_point_in_utc_time)
|
async_track_point_in_utc_time)
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
REQUIREMENTS = ['buienradar==0.7']
|
REQUIREMENTS = ['buienradar==0.8']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
MEASURED_LABEL = 'Measured'
|
||||||
TIMEFRAME_LABEL = 'Timeframe'
|
TIMEFRAME_LABEL = 'Timeframe'
|
||||||
# Schedule next call after (minutes):
|
# Schedule next call after (minutes):
|
||||||
SCHEDULE_OK = 10
|
SCHEDULE_OK = 10
|
||||||
@ -40,7 +41,7 @@ SENSOR_TYPES = {
|
|||||||
'symbol': ['Symbol', None, None],
|
'symbol': ['Symbol', None, None],
|
||||||
'humidity': ['Humidity', '%', 'mdi:water-percent'],
|
'humidity': ['Humidity', '%', 'mdi:water-percent'],
|
||||||
'temperature': ['Temperature', TEMP_CELSIUS, 'mdi:thermometer'],
|
'temperature': ['Temperature', TEMP_CELSIUS, 'mdi:thermometer'],
|
||||||
'groundtemperature': ['Ground Temperature', TEMP_CELSIUS,
|
'groundtemperature': ['Ground temperature', TEMP_CELSIUS,
|
||||||
'mdi:thermometer'],
|
'mdi:thermometer'],
|
||||||
'windspeed': ['Wind speed', 'm/s', 'mdi:weather-windy'],
|
'windspeed': ['Wind speed', 'm/s', 'mdi:weather-windy'],
|
||||||
'windforce': ['Wind force', 'Bft', 'mdi:weather-windy'],
|
'windforce': ['Wind force', 'Bft', 'mdi:weather-windy'],
|
||||||
@ -205,10 +206,16 @@ class BrSensor(Entity):
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
return {
|
result = {
|
||||||
ATTR_ATTRIBUTION: self._attribution,
|
ATTR_ATTRIBUTION: self._attribution,
|
||||||
SENSOR_TYPES['stationname'][0]: self._stationname,
|
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
|
@property
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
|
@ -16,7 +16,7 @@ from homeassistant.components.sensor.buienradar import (
|
|||||||
BrData)
|
BrData)
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
REQUIREMENTS = ['buienradar==0.7']
|
REQUIREMENTS = ['buienradar==0.8']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ broadlink==0.5
|
|||||||
|
|
||||||
# homeassistant.components.sensor.buienradar
|
# homeassistant.components.sensor.buienradar
|
||||||
# homeassistant.components.weather.buienradar
|
# homeassistant.components.weather.buienradar
|
||||||
buienradar==0.7
|
buienradar==0.8
|
||||||
|
|
||||||
# homeassistant.components.notify.ciscospark
|
# homeassistant.components.notify.ciscospark
|
||||||
ciscosparkapi==0.4.2
|
ciscosparkapi==0.4.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user