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:
1 parent
c98f50115d
commit
496bd3dddf
44 files changed
+422
-177
No files matched your search
@@ -21,8 +21,8 @@ from homeassistant.const import (
|
||||
DEVICE_CLASS_PRESSURE,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
PRESSURE_HPA,
|
||||
SPEED_METERS_PER_SECOND,
|
||||
TEMP_CELSIUS,
|
||||
TIME_SECONDS,
|
||||
)
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
@@ -42,8 +42,8 @@ SENSOR_TYPES = {
|
||||
"symbol": ["Symbol", None, None],
|
||||
"precipitation": ["Precipitation", "mm", None],
|
||||
"temperature": ["Temperature", TEMP_CELSIUS, DEVICE_CLASS_TEMPERATURE],
|
||||
"windSpeed": ["Wind speed", f"m/{TIME_SECONDS}", None],
|
||||
"windGust": ["Wind gust", f"m/{TIME_SECONDS}", None],
|
||||
"windSpeed": ["Wind speed", SPEED_METERS_PER_SECOND, None],
|
||||
"windGust": ["Wind gust", SPEED_METERS_PER_SECOND, None],
|
||||
"pressure": ["Pressure", PRESSURE_HPA, DEVICE_CLASS_PRESSURE],
|
||||
"windDirection": ["Wind direction", "°", None],
|
||||
"humidity": ["Humidity", "%", DEVICE_CLASS_HUMIDITY],
|
||||
|
||||
Reference in new issue
Block a user