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

View file

@ -31,8 +31,8 @@ from homeassistant.const import (
ENERGY_KILO_WATT_HOUR,
EVENT_HOMEASSISTANT_STOP,
PERCENTAGE,
POWER_WATT,
SIGNAL_STRENGTH_DECIBELS,
UnitOfPower,
)
from homeassistant.core import Event, HomeAssistant, callback
from homeassistant.exceptions import PlatformNotReady
@ -61,33 +61,33 @@ RT_SENSORS: tuple[SensorEntityDescription, ...] = (
key="averagePower",
name="average power",
device_class=SensorDeviceClass.POWER,
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
),
SensorEntityDescription(
key="power",
name="power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
),
SensorEntityDescription(
key="powerProduction",
name="power production",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
),
SensorEntityDescription(
key="minPower",
name="min power",
device_class=SensorDeviceClass.POWER,
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
),
SensorEntityDescription(
key="maxPower",
name="max power",
device_class=SensorDeviceClass.POWER,
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
),
SensorEntityDescription(
key="accumulatedConsumption",