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

Add sunrise and sunset to Darksky weather sensor #19492

Merged
merged 2 commits into from Dec 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions homeassistant/components/sensor/darksky.py
Expand Up @@ -23,11 +23,12 @@

_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'

Expand Down Expand Up @@ -130,6 +131,10 @@
['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 = {
Expand Down Expand Up @@ -296,7 +301,7 @@ def icon(self):
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
ATTR_ATTRIBUTION: ATTRIBUTION,
}

def update(self):
Expand Down