Use UnitOfEnergy in integrations (o-z) (#84221)

This commit is contained in:
epenet 2022-12-19 10:58:37 +01:00 committed by GitHub
parent 3168b30535
commit ebdf9a8658
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 120 additions and 134 deletions

View file

@ -11,13 +11,13 @@ from homeassistant.components.sensor import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ENERGY_KILO_WATT_HOUR,
PERCENTAGE,
PRESSURE_PSI,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
UnitOfElectricCurrent,
UnitOfElectricPotential,
UnitOfEnergy,
UnitOfFrequency,
UnitOfPower,
)
@ -152,7 +152,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
),
SensorEntityDescription(
key="GensetTotalEnergy",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),