Fix incorrect device class in nibe heatpump (#84047)

This commit is contained in:
epenet 2022-12-15 14:23:06 +01:00 committed by GitHub
parent 0184aadb09
commit c4a01cf8d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,13 +12,12 @@ from homeassistant.components.sensor import (
) )
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ( from homeassistant.const import (
ELECTRIC_POTENTIAL_MILLIVOLT,
ELECTRIC_POTENTIAL_VOLT,
TIME_HOURS,
UnitOfElectricCurrent, UnitOfElectricCurrent,
UnitOfElectricPotential,
UnitOfEnergy, UnitOfEnergy,
UnitOfPower, UnitOfPower,
UnitOfTemperature, UnitOfTemperature,
UnitOfTime,
) )
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory from homeassistant.helpers.entity import EntityCategory
@ -58,16 +57,16 @@ UNIT_DESCRIPTIONS = {
"V": SensorEntityDescription( "V": SensorEntityDescription(
key="V", key="V",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
device_class=SensorDeviceClass.CURRENT, device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT, native_unit_of_measurement=UnitOfElectricPotential.VOLT,
), ),
"mV": SensorEntityDescription( "mV": SensorEntityDescription(
key="mV", key="mV",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
device_class=SensorDeviceClass.CURRENT, device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_POTENTIAL_MILLIVOLT, native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT,
), ),
"W": SensorEntityDescription( "W": SensorEntityDescription(
key="W", key="W",
@ -109,7 +108,7 @@ UNIT_DESCRIPTIONS = {
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
device_class=SensorDeviceClass.DURATION, device_class=SensorDeviceClass.DURATION,
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement=TIME_HOURS, native_unit_of_measurement=UnitOfTime.HOURS,
), ),
} }