Use UnitOfEnergy in integrations (a-n) (#84220)

This commit is contained in:
epenet
2022-12-19 11:06:00 +01:00
committed by GitHub
parent ebdf9a8658
commit 0dd20fb309
29 changed files with 191 additions and 202 deletions

View File

@@ -38,12 +38,12 @@ from homeassistant.components.sensor import (
)
from homeassistant.const import (
CONF_RESOURCES,
ENERGY_KILO_WATT_HOUR,
PERCENTAGE,
REVOLUTIONS_PER_MINUTE,
TEMP_CELSIUS,
TIME_DAYS,
VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR,
UnitOfEnergy,
UnitOfPower,
)
from homeassistant.core import HomeAssistant
@@ -249,7 +249,7 @@ SENSOR_TYPES = (
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
name="Energy total",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
sensor_id=SENSOR_POWER_TOTAL,
),
ComfoconnectSensorEntityDescription(
@@ -265,7 +265,7 @@ SENSOR_TYPES = (
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
name="Preheater energy total",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
sensor_id=SENSOR_PREHEATER_POWER_TOTAL,
),
)