From c4a01cf8d2d402be9e829566608f6d1685cbb5b2 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 15 Dec 2022 14:23:06 +0100 Subject: [PATCH] Fix incorrect device class in nibe heatpump (#84047) --- homeassistant/components/nibe_heatpump/sensor.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/nibe_heatpump/sensor.py b/homeassistant/components/nibe_heatpump/sensor.py index 5f50358912d..310e3ac26ad 100644 --- a/homeassistant/components/nibe_heatpump/sensor.py +++ b/homeassistant/components/nibe_heatpump/sensor.py @@ -12,13 +12,12 @@ from homeassistant.components.sensor import ( ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( - ELECTRIC_POTENTIAL_MILLIVOLT, - ELECTRIC_POTENTIAL_VOLT, - TIME_HOURS, UnitOfElectricCurrent, + UnitOfElectricPotential, UnitOfEnergy, UnitOfPower, UnitOfTemperature, + UnitOfTime, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import EntityCategory @@ -58,16 +57,16 @@ UNIT_DESCRIPTIONS = { "V": SensorEntityDescription( key="V", entity_category=EntityCategory.DIAGNOSTIC, - device_class=SensorDeviceClass.CURRENT, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, - native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT, + native_unit_of_measurement=UnitOfElectricPotential.VOLT, ), "mV": SensorEntityDescription( key="mV", entity_category=EntityCategory.DIAGNOSTIC, - device_class=SensorDeviceClass.CURRENT, + device_class=SensorDeviceClass.VOLTAGE, state_class=SensorStateClass.MEASUREMENT, - native_unit_of_measurement=ELECTRIC_POTENTIAL_MILLIVOLT, + native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, ), "W": SensorEntityDescription( key="W", @@ -109,7 +108,7 @@ UNIT_DESCRIPTIONS = { entity_category=EntityCategory.DIAGNOSTIC, device_class=SensorDeviceClass.DURATION, state_class=SensorStateClass.TOTAL_INCREASING, - native_unit_of_measurement=TIME_HOURS, + native_unit_of_measurement=UnitOfTime.HOURS, ), }