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:
1 parent
fbde040f59
commit
ef9d9b17bd
42 files changed
+170
-196
No files matched your search
@@ -13,7 +13,7 @@ from homeassistant.const import (
|
||||
TIME_MINUTES,
|
||||
TIME_SECONDS,
|
||||
UNIT_PERCENTAGE,
|
||||
UNIT_VOLT,
|
||||
VOLT,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
@@ -31,7 +31,7 @@ SENSOR_TYPES = {
|
||||
"badbatts": ["Bad Batteries", "", "mdi:information-outline"],
|
||||
"battdate": ["Battery Replaced", "", "mdi:calendar-clock"],
|
||||
"battstat": ["Battery Status", "", "mdi:information-outline"],
|
||||
"battv": ["Battery Voltage", UNIT_VOLT, "mdi:flash"],
|
||||
"battv": ["Battery Voltage", VOLT, "mdi:flash"],
|
||||
"bcharge": ["Battery", UNIT_PERCENTAGE, "mdi:battery"],
|
||||
"cable": ["Cable Type", "", "mdi:ethernet-cable"],
|
||||
"cumonbatt": ["Total Time on Battery", "", "mdi:timer"],
|
||||
@@ -44,33 +44,33 @@ SENSOR_TYPES = {
|
||||
"endapc": ["Date and Time", "", "mdi:calendar-clock"],
|
||||
"extbatts": ["External Batteries", "", "mdi:information-outline"],
|
||||
"firmware": ["Firmware Version", "", "mdi:information-outline"],
|
||||
"hitrans": ["Transfer High", UNIT_VOLT, "mdi:flash"],
|
||||
"hitrans": ["Transfer High", VOLT, "mdi:flash"],
|
||||
"hostname": ["Hostname", "", "mdi:information-outline"],
|
||||
"humidity": ["Ambient Humidity", UNIT_PERCENTAGE, "mdi:water-percent"],
|
||||
"itemp": ["Internal Temperature", TEMP_CELSIUS, "mdi:thermometer"],
|
||||
"lastxfer": ["Last Transfer", "", "mdi:transfer"],
|
||||
"linefail": ["Input Voltage Status", "", "mdi:information-outline"],
|
||||
"linefreq": ["Line Frequency", FREQUENCY_HERTZ, "mdi:information-outline"],
|
||||
"linev": ["Input Voltage", UNIT_VOLT, "mdi:flash"],
|
||||
"linev": ["Input Voltage", VOLT, "mdi:flash"],
|
||||
"loadpct": ["Load", UNIT_PERCENTAGE, "mdi:gauge"],
|
||||
"loadapnt": ["Load Apparent Power", UNIT_PERCENTAGE, "mdi:gauge"],
|
||||
"lotrans": ["Transfer Low", UNIT_VOLT, "mdi:flash"],
|
||||
"lotrans": ["Transfer Low", VOLT, "mdi:flash"],
|
||||
"mandate": ["Manufacture Date", "", "mdi:calendar"],
|
||||
"masterupd": ["Master Update", "", "mdi:information-outline"],
|
||||
"maxlinev": ["Input Voltage High", UNIT_VOLT, "mdi:flash"],
|
||||
"maxlinev": ["Input Voltage High", VOLT, "mdi:flash"],
|
||||
"maxtime": ["Battery Timeout", "", "mdi:timer-off"],
|
||||
"mbattchg": ["Battery Shutdown", UNIT_PERCENTAGE, "mdi:battery-alert"],
|
||||
"minlinev": ["Input Voltage Low", UNIT_VOLT, "mdi:flash"],
|
||||
"minlinev": ["Input Voltage Low", VOLT, "mdi:flash"],
|
||||
"mintimel": ["Shutdown Time", "", "mdi:timer"],
|
||||
"model": ["Model", "", "mdi:information-outline"],
|
||||
"nombattv": ["Battery Nominal Voltage", UNIT_VOLT, "mdi:flash"],
|
||||
"nominv": ["Nominal Input Voltage", UNIT_VOLT, "mdi:flash"],
|
||||
"nomoutv": ["Nominal Output Voltage", UNIT_VOLT, "mdi:flash"],
|
||||
"nombattv": ["Battery Nominal Voltage", VOLT, "mdi:flash"],
|
||||
"nominv": ["Nominal Input Voltage", VOLT, "mdi:flash"],
|
||||
"nomoutv": ["Nominal Output Voltage", VOLT, "mdi:flash"],
|
||||
"nompower": ["Nominal Output Power", POWER_WATT, "mdi:flash"],
|
||||
"nomapnt": ["Nominal Apparent Power", "VA", "mdi:flash"],
|
||||
"numxfers": ["Transfer Count", "", "mdi:counter"],
|
||||
"outcurnt": ["Output Current", "A", "mdi:flash"],
|
||||
"outputv": ["Output Voltage", UNIT_VOLT, "mdi:flash"],
|
||||
"outputv": ["Output Voltage", VOLT, "mdi:flash"],
|
||||
"reg1": ["Register 1 Fault", "", "mdi:information-outline"],
|
||||
"reg2": ["Register 2 Fault", "", "mdi:information-outline"],
|
||||
"reg3": ["Register 3 Fault", "", "mdi:information-outline"],
|
||||
@@ -97,7 +97,7 @@ INFERRED_UNITS = {
|
||||
" Minutes": TIME_MINUTES,
|
||||
" Seconds": TIME_SECONDS,
|
||||
" Percent": UNIT_PERCENTAGE,
|
||||
" Volts": UNIT_VOLT,
|
||||
" Volts": VOLT,
|
||||
" Ampere": "A",
|
||||
" Volt-Ampere": "VA",
|
||||
" Watts": POWER_WATT,
|
||||
|
||||
Reference in new issue
Block a user