8000 Darksky enhancements by rdbahm · Pull Request #9851 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Darksky enhancements #9851

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

Merged
merged 4 commits into from
Oct 14, 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
10 changes: 7 additions & 3 deletions homeassistant/components/sensor/darksky.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_API_KEY, CONF_NAME, CONF_MONITORED_CONDITIONS, ATTR_ATTRIBUTION,
CONF_LATITUDE, CONF_LONGITUDE)
CONF_LATITUDE, CONF_LONGITUDE, UNIT_UV_INDEX)
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
import homeassistant.helpers.config_validation as cv
Expand Down Expand Up @@ -62,7 +62,7 @@
'apparent_temperature': ['Apparent Temperature',
'°C', '°F', '°C', '°C', '°C', 'mdi:thermometer',
['currently', 'hourly']],
'dew_point': ['Dew point', '°C', '°F', '°C', '°C', '°C',
'dew_point': ['Dew Point', '°C', '°F', '°C', '°C', '°C',
'mdi:thermometer', ['currently', 'hourly', 'daily']],
'wind_speed': ['Wind Speed', 'm/s', 'mph', 'km/h', 'mph', 'mph',
'mdi:weather-windy', ['currently', 'hourly', 'daily']],
Expand Down Expand Up @@ -96,6 +96,10 @@
'precip_intensity_max': ['Daily Max Precip Intensity',
'mm', 'in', 'mm', 'mm', 'mm', 'mdi:thermometer',
['currently', 'hourly', 'daily']],
'uv_index': ['UV Index',
UNIT_UV_INDEX, UNIT_UV_INDEX, UNIT_UV_INDEX,
UNIT_UV_INDEX, UNIT_UV_INDEX, 'mdi:weather-sunny',
['currently', 'hourly', 'daily']],
}

CONDITION_PICTURES = {
Expand Down Expand Up @@ -305,7 +309,7 @@ def get_state(self, data):
'temperature_min', 'temperature_max',
'apparent_temperature_min',
'apparent_temperature_max',
'pressure', 'ozone']):
'pressure', 'ozone', 'uvIndex']):
return round(state, 1)
return state

Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/sensor/isy994.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import homeassistant.components.isy994 as isy
from homeassistant.const import (
TEMP_CELSIUS, TEMP_FAHRENHEIT, STATE_OFF, STATE_ON)
TEMP_CELSIUS, TEMP_FAHRENHEIT, STATE_OFF, STATE_ON, UNIT_UV_INDEX)
from homeassistant.helpers.typing import ConfigType

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -77,7 +77,7 @@
'64': 'shindo',
'65': 'SML',
'69': 'gal',
'71': 'UV index',
'71': UNIT_UV_INDEX,
'72': 'V',
'73': 'W',
'74': 'W/m²',
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@
MASS_OUNCES = 'oz' # type: str
MASS_POUNDS = 'lb' # type: str

# UV Index units
UNIT_UV_INDEX = 'UV index' # type: str

# Contains the information that is discovered
ATTR_DISCOVERED = 'discovered'

Expand Down
0