From 02b0b19dd492b21c2fae4074770d6e3b333dad79 Mon Sep 17 00:00:00 2001 From: osono-design <73175269+osono-design@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:07:59 +0200 Subject: [PATCH] Add tuya access control devices (binary status of lock) (#79793) --- homeassistant/components/tuya/binary_sensor.py | 9 +++++++++ homeassistant/components/tuya/const.py | 1 + 2 files changed, 10 insertions(+) diff --git a/homeassistant/components/tuya/binary_sensor.py b/homeassistant/components/tuya/binary_sensor.py index 44d37050229..7da59c8cc76 100644 --- a/homeassistant/components/tuya/binary_sensor.py +++ b/homeassistant/components/tuya/binary_sensor.py @@ -201,6 +201,15 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = { ), TAMPER_BINARY_SENSOR, ), + # Access Control + # https://developer.tuya.com/en/docs/iot/s?id=Kb0o2xhlkxbet + "mk": ( + TuyaBinarySensorEntityDescription( + key=DPCode.CLOSED_OPENED_KIT, + device_class=BinarySensorDeviceClass.LOCK, + on_value={"AQAB"}, + ), + ), # Luminance Sensor # https://developer.tuya.com/en/docs/iot/categoryldcg?id=Kaiuz3n7u69l8 "ldcg": ( diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index 792036e49ff..50e55cd8d77 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -182,6 +182,7 @@ class DPCode(StrEnum): CLEAN_TIME = "clean_time" CLICK_SUSTAIN_TIME = "click_sustain_time" CLOUD_RECIPE_NUMBER = "cloud_recipe_number" + CLOSED_OPENED_KIT = "closed_opened_kit" CO_STATE = "co_state" CO_STATUS = "co_status" CO_VALUE = "co_value"