Add and use percentage constant (#32094)

* Add and use percentage constant

* Fix pylint error and broken test
This commit is contained in:
springstan authored and GitHub committed 2020-02-28 11:46:48 -08:00
1 parent c7f128f286
commit f1a0ca7cd3
155 files changed
+735 -459

No files matched your search

+7 -6
View File
@@ -23,6 +23,7 @@ from homeassistant.const import (
PRESSURE_HPA,
SPEED_METERS_PER_SECOND,
TEMP_CELSIUS,
UNIT_PERCENTAGE,
)
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
@@ -46,12 +47,12 @@ SENSOR_TYPES = {
"windGust": ["Wind gust", SPEED_METERS_PER_SECOND, None],
"pressure": ["Pressure", PRESSURE_HPA, DEVICE_CLASS_PRESSURE],
"windDirection": ["Wind direction", "°", None],
"humidity": ["Humidity", "%", DEVICE_CLASS_HUMIDITY],
"fog": ["Fog", "%", None],
"cloudiness": ["Cloudiness", "%", None],
"lowClouds": ["Low clouds", "%", None],
"mediumClouds": ["Medium clouds", "%", None],
"highClouds": ["High clouds", "%", None],
"humidity": ["Humidity", UNIT_PERCENTAGE, DEVICE_CLASS_HUMIDITY],
"fog": ["Fog", UNIT_PERCENTAGE, None],
"cloudiness": ["Cloudiness", UNIT_PERCENTAGE, None],
"lowClouds": ["Low clouds", UNIT_PERCENTAGE, None],
"mediumClouds": ["Medium clouds", UNIT_PERCENTAGE, None],
"highClouds": ["High clouds", UNIT_PERCENTAGE, None],
"dewpointTemperature": [
"Dewpoint temperature",
TEMP_CELSIUS,