Add sunrise and sunset to Darksky weather sensor (#19492)
* Add sunrise and sunset to Darksky weather sensor * Fix lint issuepull/19521/head
parent
f0e187e306
commit
6880be5aeb
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue