Add and use more unit constants (#32122)

* Add and use speed constants

* Add and use meter based volume and area constants

* Add and use more mass unit constants

* Add and use concentration unit constants

* Add and use watts per square meter constant

* Use more time constants

* Use more data constants
This commit is contained in:
Ville Skyttä authored and GitHub committed 2020-02-24 17:52:14 -08:00
1 parent c98f50115d
commit 496bd3dddf
44 files changed
+422 -177

No files matched your search

@@ -12,9 +12,9 @@ from homeassistant.const import (
CONF_API_KEY,
CONF_MONITORED_CONDITIONS,
CONF_NAME,
SPEED_METERS_PER_SECOND,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
TIME_SECONDS,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@@ -34,7 +34,7 @@ MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=120)
SENSOR_TYPES = {
"weather": ["Condition", None],
"temperature": ["Temperature", None],
"wind_speed": ["Wind speed", f"m/{TIME_SECONDS}"],
"wind_speed": ["Wind speed", SPEED_METERS_PER_SECOND],
"wind_bearing": ["Wind bearing", "°"],
"humidity": ["Humidity", "%"],
"pressure": ["Pressure", "mbar"],