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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 191 additions and 202 deletions

View file

@ -24,7 +24,6 @@ from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_MILLION,
ELECTRIC_CURRENT_AMPERE,
ENERGY_KILO_WATT_HOUR,
LIGHT_LUX,
PERCENTAGE,
PRESSURE_HPA,
@ -32,6 +31,7 @@ from homeassistant.const import (
TEMP_CELSIUS,
Platform,
UnitOfElectricPotential,
UnitOfEnergy,
UnitOfPower,
UnitOfSoundPressure,
)
@ -167,7 +167,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
name="Energy kWh",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
),
CharacteristicsTypes.VENDOR_EVE_ENERGY_WATT: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.VENDOR_EVE_ENERGY_WATT,
@ -181,7 +181,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
name="Energy kWh",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
),
CharacteristicsTypes.VENDOR_EVE_ENERGY_VOLTAGE: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.VENDOR_EVE_ENERGY_VOLTAGE,