Add Smoke Detector (ywbj) device support to Tuya (#58170)

This commit is contained in:
Regev Brody 2021-10-22 15:18:01 +03:00 committed by GitHub
parent ea2e94a4e5
commit 3c52bc214d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 0 deletions

View file

@ -10,6 +10,7 @@ from homeassistant.components.binary_sensor import (
DEVICE_CLASS_MOISTURE,
DEVICE_CLASS_MOTION,
DEVICE_CLASS_SAFETY,
DEVICE_CLASS_SMOKE,
DEVICE_CLASS_TAMPER,
DEVICE_CLASS_VIBRATION,
BinarySensorEntity,
@ -98,6 +99,7 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
device_class=DEVICE_CLASS_TAMPER,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
TAMPER_BINARY_SENSOR,
),
# PIR Detector
# https://developer.tuya.com/en/docs/iot/categorypir?id=Kaiuz3ss11b80
@ -128,6 +130,21 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
),
TAMPER_BINARY_SENSOR,
),
# Smoke Detector
# https://developer.tuya.com/en/docs/iot/categoryywbj?id=Kaiuz3f6sf952
"ywbj": (
TuyaBinarySensorEntityDescription(
key=DPCode.SMOKE_SENSOR_STATUS,
device_class=DEVICE_CLASS_SMOKE,
on_value="alarm",
),
TuyaBinarySensorEntityDescription(
key=DPCode.SMOKE_SENSOR_STATE,
device_class=DEVICE_CLASS_SMOKE,
on_value="1",
),
TAMPER_BINARY_SENSOR,
),
# Vibration Sensor
# https://developer.tuya.com/en/docs/iot/categoryzd?id=Kaiuz3a5vrzno
"zd": (