mirror of
https://github.com/home-assistant/core.git
synced 2025-07-07 21:37:07 +00:00
Use new SensorDeviceClass in ihc (#61799)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
e203b85303
commit
93c05b627f
@ -1,6 +1,6 @@
|
||||
"""Support for IHC sensors."""
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.const import CONF_UNIT_OF_MEASUREMENT, DEVICE_CLASS_TEMPERATURE
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||
from homeassistant.const import CONF_UNIT_OF_MEASUREMENT
|
||||
from homeassistant.util.unit_system import TEMPERATURE_UNITS
|
||||
|
||||
from . import IHC_CONTROLLER, IHC_INFO
|
||||
@ -42,7 +42,7 @@ class IHCSensor(IHCDevice, SensorEntity):
|
||||
def device_class(self):
|
||||
"""Return the class of this device, from component DEVICE_CLASSES."""
|
||||
return (
|
||||
DEVICE_CLASS_TEMPERATURE
|
||||
SensorDeviceClass.TEMPERATURE
|
||||
if self._unit_of_measurement in TEMPERATURE_UNITS
|
||||
else None
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user