Add Water Detector (sj) device support to Tuya (#58049)

This commit is contained in:
Franck Nijhof 2021-10-19 20:09:06 +02:00 committed by GitHub
parent bb9053e93d
commit 6d898a631c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 3 deletions

View file

@ -7,6 +7,7 @@ from tuya_iot import TuyaDevice, TuyaDeviceManager
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_DOOR,
DEVICE_CLASS_MOISTURE,
DEVICE_CLASS_MOTION,
DEVICE_CLASS_SAFETY,
DEVICE_CLASS_TAMPER,
@ -80,6 +81,21 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
),
# Water Detector
# https://developer.tuya.com/en/docs/iot/categorysj?id=Kaiuz3iub2sli
"sj": (
TuyaBinarySensorEntityDescription(
key=DPCode.WATERSENSOR_STATE,
device_class=DEVICE_CLASS_MOISTURE,
on_value="alarm",
),
TuyaBinarySensorEntityDescription(
key=DPCode.TEMPER_ALARM,
name="Tamper",
device_class=DEVICE_CLASS_TAMPER,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
),
),
# Emergency Button
# https://developer.tuya.com/en/docs/iot/categorysos?id=Kaiuz3oi6agjy
"sos": (