mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use SensorDeviceClass enum in htu21d (#61770)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
36da11e924
commit
8cda315cd1
@ -11,16 +11,11 @@ import voluptuous as vol
|
|||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
|
SensorDeviceClass,
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import CONF_NAME, PERCENTAGE, TEMP_CELSIUS
|
||||||
CONF_NAME,
|
|
||||||
DEVICE_CLASS_HUMIDITY,
|
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
PERCENTAGE,
|
|
||||||
TEMP_CELSIUS,
|
|
||||||
)
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
@ -40,12 +35,12 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=SENSOR_TEMPERATURE,
|
key=SENSOR_TEMPERATURE,
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=SENSOR_HUMIDITY,
|
key=SENSOR_HUMIDITY,
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
device_class=DEVICE_CLASS_HUMIDITY,
|
device_class=SensorDeviceClass.HUMIDITY,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user