Add sunrise and sunset to Darksky weather sensor (#19492)

* Add sunrise and sunset to Darksky weather sensor

* Fix lint issue
pull/19521/head
Fabian Affolter 2018-12-22 14:52:36 +01:00 committed by Charles Garwood
parent f0e187e306
commit 6880be5aeb
1 changed files with 9 additions and 4 deletions

View File

@ -23,11 +23,12 @@ REQUIREMENTS = ['python-forecastio==1.4.0']
_LOGGER = logging.getLogger(__name__)
CONF_ATTRIBUTION = "Powered by Dark Sky"
CONF_UNITS = 'units'
CONF_UPDATE_INTERVAL = 'update_interval'
ATTRIBUTION = "Powered by Dark Sky"
CONF_FORECAST = 'forecast'
CONF_LANGUAGE = 'language'
CONF_UNITS = 'units'
CONF_UPDATE_INTERVAL = 'update_interval'
DEFAULT_LANGUAGE = 'en'
@ -130,6 +131,10 @@ SENSOR_TYPES = {
['currently', 'hourly', 'daily']],
'moon_phase': ['Moon Phase', None, None, None, None, None,
'mdi:weather-night', ['daily']],
'sunrise_time': ['Sunrise', None, None, None, None, None,
'mdi:white-balance-sunny', ['daily']],
'sunset_time': ['Sunset', None, None, None, None, None,
'mdi:weather-night', ['daily']],
}
CONDITION_PICTURES = {
@ -296,7 +301,7 @@ class DarkSkySensor(Entity):
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
ATTR_ATTRIBUTION: ATTRIBUTION,
}
def update(self):