mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add Gas Detector (rqbj) device support to Tuya (#58293)
This commit is contained in:
parent
0a272669ed
commit
3cdfb84b79
@ -7,6 +7,7 @@ from tuya_iot import TuyaDevice, TuyaDeviceManager
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_DOOR,
|
||||
DEVICE_CLASS_GAS,
|
||||
DEVICE_CLASS_MOISTURE,
|
||||
DEVICE_CLASS_MOTION,
|
||||
DEVICE_CLASS_SAFETY,
|
||||
@ -126,6 +127,21 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
|
||||
),
|
||||
TAMPER_BINARY_SENSOR,
|
||||
),
|
||||
# Gas Detector
|
||||
# https://developer.tuya.com/en/docs/iot/categoryrqbj?id=Kaiuz3d162ubw
|
||||
"rqbj": (
|
||||
TuyaBinarySensorEntityDescription(
|
||||
key=DPCode.GAS_SENSOR_STATUS,
|
||||
device_class=DEVICE_CLASS_GAS,
|
||||
on_value="alarm",
|
||||
),
|
||||
TuyaBinarySensorEntityDescription(
|
||||
key=DPCode.GAS_SENSOR_STATE,
|
||||
device_class=DEVICE_CLASS_GAS,
|
||||
on_value="1",
|
||||
),
|
||||
TAMPER_BINARY_SENSOR,
|
||||
),
|
||||
# Water Detector
|
||||
# https://developer.tuya.com/en/docs/iot/categorysj?id=Kaiuz3iub2sli
|
||||
"sj": (
|
||||
|
@ -177,6 +177,9 @@ class DPCode(str, Enum):
|
||||
FAN_SPEED_PERCENT = "fan_speed_percent" # Stepless speed
|
||||
FAR_DETECTION = "far_detection"
|
||||
FILTER_RESET = "filter_reset" # Filter (cartridge) reset
|
||||
GAS_SENSOR_STATE = "gas_sensor_state"
|
||||
GAS_SENSOR_STATUS = "gas_sensor_status"
|
||||
GAS_SENSOR_VALUE = "gas_sensor_value"
|
||||
HUMIDITY_CURRENT = "humidity_current" # Current humidity
|
||||
HUMIDITY_SET = "humidity_set" # Humidity setting
|
||||
HUMIDITY_VALUE = "humidity_value" # Humidity
|
||||
|
@ -211,6 +211,16 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
|
||||
# PIR Detector
|
||||
# https://developer.tuya.com/en/docs/iot/categorypir?id=Kaiuz3ss11b80
|
||||
"pir": BATTERY_SENSORS,
|
||||
# Gas Detector
|
||||
# https://developer.tuya.com/en/docs/iot/categoryrqbj?id=Kaiuz3d162ubw
|
||||
"rqbj": (
|
||||
SensorEntityDescription(
|
||||
key=DPCode.GAS_SENSOR_VALUE,
|
||||
icon="mdi:gas-cylinder",
|
||||
device_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
*BATTERY_SENSORS,
|
||||
),
|
||||
# Water Detector
|
||||
# https://developer.tuya.com/en/docs/iot/categorysj?id=Kaiuz3iub2sli
|
||||
"sj": BATTERY_SENSORS,
|
||||
|
Loading…
x
Reference in New Issue
Block a user