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

@@ -15,6 +15,7 @@ from homeassistant.const import (
SPEED_METERS_PER_SECOND,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
UNIT_PERCENTAGE,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@@ -36,9 +37,9 @@ SENSOR_TYPES = {
"temperature": ["Temperature", None],
"wind_speed": ["Wind speed", SPEED_METERS_PER_SECOND],
"wind_bearing": ["Wind bearing", "°"],
"humidity": ["Humidity", "%"],
"humidity": ["Humidity", UNIT_PERCENTAGE],
"pressure": ["Pressure", "mbar"],
"clouds": ["Cloud coverage", "%"],
"clouds": ["Cloud coverage", UNIT_PERCENTAGE],
"rain": ["Rain", "mm"],
"snow": ["Snow", "mm"],
"weather_code": ["Weather code", None],