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

@@ -7,9 +7,9 @@ from homeassistant.const import (
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_TEMPERATURE,
POWER_WATT,
SPEED_METERS_PER_SECOND,
TEMP_CELSIUS,
TIME_HOURS,
TIME_SECONDS,
)
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@@ -41,8 +41,8 @@ SENSOR_TYPES = {
SENSOR_TYPE_RAINRATE: ["Rain rate", f"mm/{TIME_HOURS}", "mdi:water", None],
SENSOR_TYPE_RAINTOTAL: ["Rain total", "mm", "mdi:water", None],
SENSOR_TYPE_WINDDIRECTION: ["Wind direction", "", "", None],
SENSOR_TYPE_WINDAVERAGE: ["Wind average", f"m/{TIME_SECONDS}", "", None],
SENSOR_TYPE_WINDGUST: ["Wind gust", f"m/{TIME_SECONDS}", "", None],
SENSOR_TYPE_WINDAVERAGE: ["Wind average", SPEED_METERS_PER_SECOND, "", None],
SENSOR_TYPE_WINDGUST: ["Wind gust", SPEED_METERS_PER_SECOND, "", None],
SENSOR_TYPE_UV: ["UV", "UV", "", None],
SENSOR_TYPE_WATT: ["Power", POWER_WATT, "", None],
SENSOR_TYPE_LUMINANCE: ["Luminance", "lx", None, DEVICE_CLASS_ILLUMINANCE],