mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Add VOC Sensor (voc) device support to Tuya (#58332)
This commit is contained in:
parent
0f965c6b31
commit
539fdaad69
@ -161,6 +161,16 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
|
|||||||
),
|
),
|
||||||
TAMPER_BINARY_SENSOR,
|
TAMPER_BINARY_SENSOR,
|
||||||
),
|
),
|
||||||
|
# Volatile Organic Compound Sensor
|
||||||
|
# Note: Undocumented in cloud API docs, based on test device
|
||||||
|
"voc": (
|
||||||
|
TuyaBinarySensorEntityDescription(
|
||||||
|
key=DPCode.VOC_STATE,
|
||||||
|
device_class=DEVICE_CLASS_SAFETY,
|
||||||
|
on_value="alarm",
|
||||||
|
),
|
||||||
|
TAMPER_BINARY_SENSOR,
|
||||||
|
),
|
||||||
# Pressure Sensor
|
# Pressure Sensor
|
||||||
# https://developer.tuya.com/en/docs/iot/categoryylcg?id=Kaiuz3kc2e4gm
|
# https://developer.tuya.com/en/docs/iot/categoryylcg?id=Kaiuz3kc2e4gm
|
||||||
"ylcg": (
|
"ylcg": (
|
||||||
|
@ -291,6 +291,7 @@ class DPCode(str, Enum):
|
|||||||
UV = "uv" # UV sterilization
|
UV = "uv" # UV sterilization
|
||||||
VA_HUMIDITY = "va_humidity"
|
VA_HUMIDITY = "va_humidity"
|
||||||
VA_TEMPERATURE = "va_temperature"
|
VA_TEMPERATURE = "va_temperature"
|
||||||
|
VOC_STATE = "voc_state"
|
||||||
VOC_VALUE = "voc_value"
|
VOC_VALUE = "voc_value"
|
||||||
WARM = "warm" # Heat preservation
|
WARM = "warm" # Heat preservation
|
||||||
WARM_TIME = "warm_time" # Heat preservation time
|
WARM_TIME = "warm_time" # Heat preservation time
|
||||||
|
@ -264,6 +264,46 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
|
|||||||
# Solar Light
|
# Solar Light
|
||||||
# https://developer.tuya.com/en/docs/iot/tynd?id=Kaof8j02e1t98
|
# https://developer.tuya.com/en/docs/iot/tynd?id=Kaof8j02e1t98
|
||||||
"tyndj": BATTERY_SENSORS,
|
"tyndj": BATTERY_SENSORS,
|
||||||
|
# Volatile Organic Compound Sensor
|
||||||
|
# Note: Undocumented in cloud API docs, based on test device
|
||||||
|
"voc": (
|
||||||
|
SensorEntityDescription(
|
||||||
|
key=DPCode.CO2_VALUE,
|
||||||
|
name="Carbon Dioxide",
|
||||||
|
device_class=DEVICE_CLASS_CO2,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
|
),
|
||||||
|
SensorEntityDescription(
|
||||||
|
key=DPCode.PM25_VALUE,
|
||||||
|
name="Particulate Matter 2.5 µm",
|
||||||
|
device_class=DEVICE_CLASS_PM25,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
|
),
|
||||||
|
SensorEntityDescription(
|
||||||
|
key=DPCode.CH2O_VALUE,
|
||||||
|
name="Formaldehyde",
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
|
),
|
||||||
|
SensorEntityDescription(
|
||||||
|
key=DPCode.HUMIDITY_VALUE,
|
||||||
|
name="Humidity",
|
||||||
|
device_class=DEVICE_CLASS_HUMIDITY,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
|
),
|
||||||
|
SensorEntityDescription(
|
||||||
|
key=DPCode.TEMP_CURRENT,
|
||||||
|
name="Temperature",
|
||||||
|
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
|
),
|
||||||
|
SensorEntityDescription(
|
||||||
|
key=DPCode.VOC_VALUE,
|
||||||
|
name="Volatile Organic Compound",
|
||||||
|
device_class=DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
|
),
|
||||||
|
*BATTERY_SENSORS,
|
||||||
|
),
|
||||||
# Pressure Sensor
|
# Pressure Sensor
|
||||||
# https://developer.tuya.com/en/docs/iot/categoryylcg?id=Kaiuz3kc2e4gm
|
# https://developer.tuya.com/en/docs/iot/categoryylcg?id=Kaiuz3kc2e4gm
|
||||||
"ylcg": (
|
"ylcg": (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user