mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Migrate power units to an enum (#81026)
This commit is contained in:
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…
x
Reference in New Issue
Block a user