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
@@ -4,7 +4,11 @@ from typing import Callable
|
||||
|
||||
from homeassistant.components.sensor import DOMAIN
|
||||
from homeassistant.const import (
|
||||
CONCENTRATION_PARTS_PER_MILLION,
|
||||
POWER_WATT,
|
||||
SPEED_KILOMETERS_PER_HOUR,
|
||||
SPEED_METERS_PER_SECOND,
|
||||
SPEED_MILES_PER_HOUR,
|
||||
TEMP_CELSIUS,
|
||||
TEMP_FAHRENHEIT,
|
||||
TIME_DAYS,
|
||||
@@ -51,7 +55,7 @@ UOM_FRIENDLY_NAME = {
|
||||
"29": "kV",
|
||||
"30": "kW",
|
||||
"31": "kPa",
|
||||
"32": "KPH",
|
||||
"32": SPEED_KILOMETERS_PER_HOUR,
|
||||
"33": "kWH",
|
||||
"34": "liedu",
|
||||
"35": "l",
|
||||
@@ -59,7 +63,7 @@ UOM_FRIENDLY_NAME = {
|
||||
"37": "mercalli",
|
||||
"38": "m",
|
||||
"39": "m³/hr",
|
||||
"40": f"m/{TIME_SECONDS}",
|
||||
"40": SPEED_METERS_PER_SECOND,
|
||||
"41": "mA",
|
||||
"42": TIME_MILLISECONDS,
|
||||
"43": "mV",
|
||||
@@ -67,13 +71,13 @@ UOM_FRIENDLY_NAME = {
|
||||
"45": TIME_MINUTES,
|
||||
"46": "mm/hr",
|
||||
"47": TIME_MONTHS,
|
||||
"48": "MPH",
|
||||
"49": f"m/{TIME_SECONDS}",
|
||||
"48": SPEED_MILES_PER_HOUR,
|
||||
"49": SPEED_METERS_PER_SECOND,
|
||||
"50": "ohm",
|
||||
"51": "%",
|
||||
"52": "lb",
|
||||
"53": "power factor",
|
||||
"54": "ppm",
|
||||
"54": CONCENTRATION_PARTS_PER_MILLION,
|
||||
"55": "pulse count",
|
||||
"57": TIME_SECONDS,
|
||||
"58": TIME_SECONDS,
|
||||
|
||||
Reference in new issue
Block a user