mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add daikin sensor state class (#60145)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
7c6a72b086
commit
0a0928b9f5
@ -6,7 +6,11 @@ from dataclasses import dataclass
|
|||||||
|
|
||||||
from pydaikin.daikin_base import Appliance
|
from pydaikin.daikin_base import Appliance
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
|
from homeassistant.components.sensor import (
|
||||||
|
STATE_CLASS_MEASUREMENT,
|
||||||
|
SensorEntity,
|
||||||
|
SensorEntityDescription,
|
||||||
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
DEVICE_CLASS_ENERGY,
|
DEVICE_CLASS_ENERGY,
|
||||||
DEVICE_CLASS_HUMIDITY,
|
DEVICE_CLASS_HUMIDITY,
|
||||||
@ -49,6 +53,7 @@ SENSOR_TYPES: tuple[DaikinSensorEntityDescription, ...] = (
|
|||||||
key=ATTR_INSIDE_TEMPERATURE,
|
key=ATTR_INSIDE_TEMPERATURE,
|
||||||
name="Inside Temperature",
|
name="Inside Temperature",
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
value_func=lambda device: device.inside_temperature,
|
value_func=lambda device: device.inside_temperature,
|
||||||
),
|
),
|
||||||
@ -56,6 +61,7 @@ SENSOR_TYPES: tuple[DaikinSensorEntityDescription, ...] = (
|
|||||||
key=ATTR_OUTSIDE_TEMPERATURE,
|
key=ATTR_OUTSIDE_TEMPERATURE,
|
||||||
name="Outside Temperature",
|
name="Outside Temperature",
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
value_func=lambda device: device.outside_temperature,
|
value_func=lambda device: device.outside_temperature,
|
||||||
),
|
),
|
||||||
@ -63,6 +69,7 @@ SENSOR_TYPES: tuple[DaikinSensorEntityDescription, ...] = (
|
|||||||
key=ATTR_HUMIDITY,
|
key=ATTR_HUMIDITY,
|
||||||
name="Humidity",
|
name="Humidity",
|
||||||
device_class=DEVICE_CLASS_HUMIDITY,
|
device_class=DEVICE_CLASS_HUMIDITY,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
value_func=lambda device: device.humidity,
|
value_func=lambda device: device.humidity,
|
||||||
),
|
),
|
||||||
@ -70,6 +77,7 @@ SENSOR_TYPES: tuple[DaikinSensorEntityDescription, ...] = (
|
|||||||
key=ATTR_TARGET_HUMIDITY,
|
key=ATTR_TARGET_HUMIDITY,
|
||||||
name="Target Humidity",
|
name="Target Humidity",
|
||||||
device_class=DEVICE_CLASS_HUMIDITY,
|
device_class=DEVICE_CLASS_HUMIDITY,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
value_func=lambda device: device.humidity,
|
value_func=lambda device: device.humidity,
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user