Use UnitOfPower in integrations [s-z] (#83826)

This commit is contained in:
epenet
2022-12-12 12:20:16 +01:00
committed by GitHub
parent eb6310f7bb
commit 52d4a358a0
22 changed files with 69 additions and 70 deletions

View File

@@ -22,8 +22,6 @@ from homeassistant.const import (
ENERGY_WATT_HOUR,
LIGHT_LUX,
PERCENTAGE,
POWER_KILO_WATT,
POWER_WATT,
PRESSURE_BAR,
PRESSURE_HPA,
PRESSURE_INHG,
@@ -37,6 +35,7 @@ from homeassistant.const import (
VOLUME_CUBIC_FEET,
VOLUME_CUBIC_METERS,
Platform,
UnitOfPower,
)
DOMAIN = "tuya"
@@ -505,12 +504,12 @@ UNITS = (
conversion_fn=lambda x: x * 1000,
),
UnitOfMeasurement(
unit=POWER_WATT,
unit=UnitOfPower.WATT,
aliases={"watt"},
device_classes={SensorDeviceClass.POWER},
),
UnitOfMeasurement(
unit=POWER_KILO_WATT,
unit=UnitOfPower.KILO_WATT,
aliases={"kilowatt"},
device_classes={SensorDeviceClass.POWER},
),