mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Add Formaldehyde Detector (jqbj) device support to Tuya (#58118)
This commit is contained in:
parent
487fa0a905
commit
c204196a7a
@ -70,6 +70,16 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
|
|||||||
on_value="presence",
|
on_value="presence",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
# Formaldehyde Detector
|
||||||
|
# Note: Not documented
|
||||||
|
"jqbj": (
|
||||||
|
TuyaBinarySensorEntityDescription(
|
||||||
|
key=DPCode.CH2O_STATE,
|
||||||
|
device_class=DEVICE_CLASS_SAFETY,
|
||||||
|
on_value="alarm",
|
||||||
|
),
|
||||||
|
TAMPER_BINARY_SENSOR,
|
||||||
|
),
|
||||||
# Door Window Sensor
|
# Door Window Sensor
|
||||||
# https://developer.tuya.com/en/docs/iot/s?id=K9gf48hm02l8m
|
# https://developer.tuya.com/en/docs/iot/s?id=K9gf48hm02l8m
|
||||||
"mcs": (
|
"mcs": (
|
||||||
|
@ -138,6 +138,8 @@ class DPCode(str, Enum):
|
|||||||
BRIGHT_VALUE_2 = "bright_value_2"
|
BRIGHT_VALUE_2 = "bright_value_2"
|
||||||
BRIGHT_VALUE_V2 = "bright_value_v2"
|
BRIGHT_VALUE_V2 = "bright_value_v2"
|
||||||
C_F = "c_f" # Temperature unit switching
|
C_F = "c_f" # Temperature unit switching
|
||||||
|
CH2O_STATE = "ch2o_state"
|
||||||
|
CH2O_VALUE = "ch2o_value"
|
||||||
CHILD_LOCK = "child_lock" # Child lock
|
CHILD_LOCK = "child_lock" # Child lock
|
||||||
CO2_STATE = "co2_state"
|
CO2_STATE = "co2_state"
|
||||||
CO2_VALUE = "co2_value" # CO2 concentration
|
CO2_VALUE = "co2_value" # CO2 concentration
|
||||||
@ -182,6 +184,7 @@ class DPCode(str, Enum):
|
|||||||
PERCENT_STATE_2 = "percent_state_2"
|
PERCENT_STATE_2 = "percent_state_2"
|
||||||
PERCENT_STATE_3 = "percent_state_3"
|
PERCENT_STATE_3 = "percent_state_3"
|
||||||
PIR = "pir" # Motion sensor
|
PIR = "pir" # Motion sensor
|
||||||
|
PM25_VALUE = "pm25_value"
|
||||||
POWDER_SET = "powder_set" # Powder
|
POWDER_SET = "powder_set" # Powder
|
||||||
POWER_GO = "power_go"
|
POWER_GO = "power_go"
|
||||||
PRESENCE_STATE = "presence_state"
|
PRESENCE_STATE = "presence_state"
|
||||||
@ -234,6 +237,9 @@ class DPCode(str, Enum):
|
|||||||
TEMP_VALUE_V2 = "temp_value_v2"
|
TEMP_VALUE_V2 = "temp_value_v2"
|
||||||
TEMPER_ALARM = "temper_alarm" # Tamper alarm
|
TEMPER_ALARM = "temper_alarm" # Tamper alarm
|
||||||
UV = "uv" # UV sterilization
|
UV = "uv" # UV sterilization
|
||||||
|
VA_HUMIDITY = "va_humidity"
|
||||||
|
VA_TEMPERATURE = "va_temperature"
|
||||||
|
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
|
||||||
WATER_RESET = "water_reset" # Resetting of water usage days
|
WATER_RESET = "water_reset" # Resetting of water usage days
|
||||||
|
@ -18,8 +18,10 @@ from homeassistant.const import (
|
|||||||
DEVICE_CLASS_CURRENT,
|
DEVICE_CLASS_CURRENT,
|
||||||
DEVICE_CLASS_HUMIDITY,
|
DEVICE_CLASS_HUMIDITY,
|
||||||
DEVICE_CLASS_ILLUMINANCE,
|
DEVICE_CLASS_ILLUMINANCE,
|
||||||
|
DEVICE_CLASS_PM25,
|
||||||
DEVICE_CLASS_POWER,
|
DEVICE_CLASS_POWER,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
DEVICE_CLASS_TEMPERATURE,
|
||||||
|
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
|
||||||
DEVICE_CLASS_VOLTAGE,
|
DEVICE_CLASS_VOLTAGE,
|
||||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
@ -79,7 +81,7 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
|
|||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=DPCode.CO2_VALUE,
|
key=DPCode.CO2_VALUE,
|
||||||
name="Carbon Dioxide (CO2)",
|
name="Carbon Dioxide",
|
||||||
device_class=DEVICE_CLASS_CO2,
|
device_class=DEVICE_CLASS_CO2,
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
),
|
),
|
||||||
@ -110,6 +112,46 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
|
|||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
# Formaldehyde Detector
|
||||||
|
# Note: Not documented
|
||||||
|
"jqbj": (
|
||||||
|
SensorEntityDescription(
|
||||||
|
key=DPCode.CO2_VALUE,
|
||||||
|
name="Carbon Dioxide",
|
||||||
|
device_class=DEVICE_CLASS_CO2,
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
SensorEntityDescription(
|
||||||
|
key=DPCode.PM25_VALUE,
|
||||||
|
name="Particulate Matter 2.5 µm",
|
||||||
|
device_class=DEVICE_CLASS_PM25,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
|
),
|
||||||
|
SensorEntityDescription(
|
||||||
|
key=DPCode.VA_HUMIDITY,
|
||||||
|
name="Humidity",
|
||||||
|
device_class=DEVICE_CLASS_HUMIDITY,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
|
),
|
||||||
|
SensorEntityDescription(
|
||||||
|
key=DPCode.VA_TEMPERATURE,
|
||||||
|
name="Temperature",
|
||||||
|
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
|
),
|
||||||
|
SensorEntityDescription(
|
||||||
|
key=DPCode.CH2O_VALUE,
|
||||||
|
name="Formaldehyde",
|
||||||
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
|
),
|
||||||
|
*BATTERY_SENSORS,
|
||||||
|
),
|
||||||
# Luminance Sensor
|
# Luminance Sensor
|
||||||
# https://developer.tuya.com/en/docs/iot/categoryldcg?id=Kaiuz3n7u69l8
|
# https://developer.tuya.com/en/docs/iot/categoryldcg?id=Kaiuz3n7u69l8
|
||||||
"ldcg": (
|
"ldcg": (
|
||||||
@ -138,7 +180,7 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
|
|||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=DPCode.CO2_VALUE,
|
key=DPCode.CO2_VALUE,
|
||||||
name="Carbon Dioxide (CO2)",
|
name="Carbon Dioxide",
|
||||||
device_class=DEVICE_CLASS_CO2,
|
device_class=DEVICE_CLASS_CO2,
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user