Use UnitOfEnergy in integrations (o-z) (#84221)
This commit is contained in:
parent
3168b30535
commit
ebdf9a8658
29 changed files with 120 additions and 134 deletions
|
@ -22,10 +22,9 @@ from homeassistant.const import (
|
|||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
CONF_NAME,
|
||||
CONF_UNIQUE_ID,
|
||||
ENERGY_KILO_WATT_HOUR,
|
||||
ENERGY_WATT_HOUR,
|
||||
STATE_UNAVAILABLE,
|
||||
STATE_UNKNOWN,
|
||||
UnitOfEnergy,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers import entity_platform, entity_registry as er
|
||||
|
@ -88,8 +87,8 @@ ATTR_LAST_PERIOD = "last_period"
|
|||
ATTR_TARIFF = "tariff"
|
||||
|
||||
DEVICE_CLASS_MAP = {
|
||||
ENERGY_WATT_HOUR: SensorDeviceClass.ENERGY,
|
||||
ENERGY_KILO_WATT_HOUR: SensorDeviceClass.ENERGY,
|
||||
UnitOfEnergy.WATT_HOUR: SensorDeviceClass.ENERGY,
|
||||
UnitOfEnergy.KILO_WATT_HOUR: SensorDeviceClass.ENERGY,
|
||||
}
|
||||
|
||||
ICON = "mdi:counter"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue