Migrate power units to an enum (#81026)
parent
3eb574edca
commit
8645e47b07
|
@ -478,10 +478,22 @@ ATTR_PERSONS: Final = "persons"
|
|||
# Apparent power units
|
||||
POWER_VOLT_AMPERE: Final = "VA"
|
||||
|
||||
|
||||
# Power units
|
||||
class UnitOfPower(StrEnum):
|
||||
"""Power units."""
|
||||
|
||||
WATT = "W"
|
||||
KILO_WATT = "kW"
|
||||
BTU_PER_HOUR = "BTU/h"
|
||||
|
||||
|
||||
POWER_WATT: Final = "W"
|
||||
"""Deprecated: please use UnitOfPower.WATT."""
|
||||
POWER_KILO_WATT: Final = "kW"
|
||||
"""Deprecated: please use UnitOfPower.KILO_WATT."""
|
||||
POWER_BTU_PER_HOUR: Final = "BTU/h"
|
||||
"""Deprecated: please use UnitOfPower.BTU_PER_HOUR."""
|
||||
|
||||
# Reactive power units
|
||||
POWER_VOLT_AMPERE_REACTIVE: Final = "var"
|
||||
|
|
Loading…
Reference in New Issue