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
@@ -17,7 +17,7 @@ from homeassistant.const import (
|
||||
CONF_LONGITUDE,
|
||||
CONF_MONITORED_CONDITIONS,
|
||||
CONF_NAME,
|
||||
TIME_HOURS,
|
||||
SPEED_KILOMETERS_PER_HOUR,
|
||||
__version__,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
@@ -40,12 +40,17 @@ SENSOR_TYPES = {
|
||||
"pressure": ("Pressure", "hPa", "LDstat hPa", float),
|
||||
"pressure_sealevel": ("Pressure at Sea Level", "hPa", "LDred hPa", float),
|
||||
"humidity": ("Humidity", "%", "RF %", int),
|
||||
"wind_speed": ("Wind Speed", f"km/{TIME_HOURS}", f"WG km/{TIME_HOURS}", float),
|
||||
"wind_speed": (
|
||||
"Wind Speed",
|
||||
SPEED_KILOMETERS_PER_HOUR,
|
||||
f"WG {SPEED_KILOMETERS_PER_HOUR}",
|
||||
float,
|
||||
),
|
||||
"wind_bearing": ("Wind Bearing", "°", "WR °", int),
|
||||
"wind_max_speed": (
|
||||
"Top Wind Speed",
|
||||
f"km/{TIME_HOURS}",
|
||||
f"WSG km/{TIME_HOURS}",
|
||||
SPEED_KILOMETERS_PER_HOUR,
|
||||
f"WSG {SPEED_KILOMETERS_PER_HOUR}",
|
||||
float,
|
||||
),
|
||||
"wind_max_bearing": ("Top Wind Bearing", "°", "WSR °", int),
|
||||
|
||||
Reference in new issue
Block a user