mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Use SensorDeviceClass in honeywell (#69298)
This commit is contained in:
parent
0446a2b4e5
commit
c6e2bdcea0
@ -8,17 +8,12 @@ from typing import Any
|
|||||||
from somecomfort import Device
|
from somecomfort import Device
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
|
SensorDeviceClass,
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
||||||
DEVICE_CLASS_HUMIDITY,
|
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
PERCENTAGE,
|
|
||||||
TEMP_CELSIUS,
|
|
||||||
TEMP_FAHRENHEIT,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers.typing import StateType
|
from homeassistant.helpers.typing import StateType
|
||||||
|
|
||||||
from .const import DOMAIN, HUMIDITY_STATUS_KEY, TEMPERATURE_STATUS_KEY
|
from .const import DOMAIN, HUMIDITY_STATUS_KEY, TEMPERATURE_STATUS_KEY
|
||||||
@ -48,7 +43,7 @@ SENSOR_TYPES: tuple[HoneywellSensorEntityDescription, ...] = (
|
|||||||
HoneywellSensorEntityDescription(
|
HoneywellSensorEntityDescription(
|
||||||
key=TEMPERATURE_STATUS_KEY,
|
key=TEMPERATURE_STATUS_KEY,
|
||||||
name="Temperature",
|
name="Temperature",
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
value_fn=lambda device: device.outdoor_temperature,
|
value_fn=lambda device: device.outdoor_temperature,
|
||||||
unit_fn=_get_temperature_sensor_unit,
|
unit_fn=_get_temperature_sensor_unit,
|
||||||
@ -56,7 +51,7 @@ SENSOR_TYPES: tuple[HoneywellSensorEntityDescription, ...] = (
|
|||||||
HoneywellSensorEntityDescription(
|
HoneywellSensorEntityDescription(
|
||||||
key=HUMIDITY_STATUS_KEY,
|
key=HUMIDITY_STATUS_KEY,
|
||||||
name="Humidity",
|
name="Humidity",
|
||||||
device_class=DEVICE_CLASS_HUMIDITY,
|
device_class=SensorDeviceClass.HUMIDITY,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
value_fn=lambda device: device.outdoor_humidity,
|
value_fn=lambda device: device.outdoor_humidity,
|
||||||
unit_fn=lambda device: PERCENTAGE,
|
unit_fn=lambda device: PERCENTAGE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user