Use UnitOfElectricPotential in integrations (#84044)

This commit is contained in:
epenet 2022-12-15 13:59:21 +01:00 committed by GitHub
parent d72c28a135
commit 0184aadb09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 141 additions and 143 deletions

View file

@ -23,10 +23,10 @@ from homeassistant.components.sensor import (
SensorStateClass,
)
from homeassistant.const import (
ELECTRIC_POTENTIAL_VOLT,
PERCENTAGE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
TEMP_CELSIUS,
UnitOfElectricPotential,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
@ -76,7 +76,7 @@ SENSOR_DESCRIPTIONS = {
): SensorEntityDescription(
key=f"{SensorProSensorDeviceClass.VOLTAGE}_{Units.ELECTRIC_POTENTIAL_VOLT}",
device_class=SensorDeviceClass.VOLTAGE,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
state_class=SensorStateClass.MEASUREMENT,
),
}