Drop UNIT_ prefix for constants (#34164)

* Drop UNIT_ prefix for VOLT

* Drop UNIT_ prefix for DEGREE

* Drop UNIT_ prefix for CONDUCTIVITY

* Drop UNIT_ prefix for UV_INDEX

* Run isort
This commit is contained in:
springstan 2020-04-21 19:45:53 +02:00 committed by GitHub
parent fbde040f59
commit ef9d9b17bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 170 additions and 196 deletions

View file

@ -5,6 +5,7 @@ from typing import Callable
from homeassistant.components.sensor import DOMAIN
from homeassistant.const import (
CONCENTRATION_PARTS_PER_MILLION,
DEGREE,
FREQUENCY_HERTZ,
LENGTH_CENTIMETERS,
LENGTH_KILOMETERS,
@ -23,10 +24,9 @@ from homeassistant.const import (
TIME_MONTHS,
TIME_SECONDS,
TIME_YEARS,
UNIT_DEGREE,
UNIT_PERCENTAGE,
UNIT_UV_INDEX,
UNIT_VOLT,
UV_INDEX,
VOLT,
)
from homeassistant.helpers.typing import ConfigType
@ -46,7 +46,7 @@ UOM_FRIENDLY_NAME = {
"10": TIME_DAYS,
"12": "dB",
"13": "dB A",
"14": UNIT_DEGREE,
"14": DEGREE,
"16": "macroseismic",
"17": TEMP_FAHRENHEIT,
"18": "ft",
@ -97,12 +97,12 @@ UOM_FRIENDLY_NAME = {
"64": "shindo",
"65": "SML",
"69": "gal",
"71": UNIT_UV_INDEX,
"72": UNIT_VOLT,
"71": UV_INDEX,
"72": VOLT,
"73": POWER_WATT,
"74": f"{POWER_WATT}/m²",
"75": "weekday",
"76": f"Wind Direction ({UNIT_DEGREE})",
"76": f"Wind Direction ({DEGREE})",
"77": TIME_YEARS,
"82": "mm",
"83": LENGTH_KILOMETERS,
@ -112,8 +112,8 @@ UOM_FRIENDLY_NAME = {
"88": "Water activity",
"89": "RPM",
"90": FREQUENCY_HERTZ,
"91": f"{UNIT_DEGREE} (Relative to North)",
"92": f"{UNIT_DEGREE} (Relative to South)",
"91": f"{DEGREE} (Relative to North)",
"92": f"{DEGREE} (Relative to South)",
}
UOM_TO_STATES = {