From fbbfdeae39627ee1e8859f67ed8226cbb35580cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Can=20Geli=C5=9F?= Date: Wed, 27 Apr 2022 02:50:46 +0300 Subject: [PATCH] Add integration for Tuya wake up light ii (#68845) --- homeassistant/components/tuya/button.py | 9 ++++++ homeassistant/components/tuya/light.py | 11 +++++++ homeassistant/components/tuya/switch.py | 38 +++++++++++++++++++++++++ 3 files changed, 58 insertions(+) diff --git a/homeassistant/components/tuya/button.py b/homeassistant/components/tuya/button.py index f8cfe36cf91..3b4a2883266 100644 --- a/homeassistant/components/tuya/button.py +++ b/homeassistant/components/tuya/button.py @@ -53,6 +53,15 @@ BUTTONS: dict[str, tuple[ButtonEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), + # Wake Up Light II + # Not documented + "hxd": ( + ButtonEntityDescription( + key=DPCode.SWITCH_USB6, + name="Snooze", + icon="mdi:sleep", + ), + ), } diff --git a/homeassistant/components/tuya/light.py b/homeassistant/components/tuya/light.py index 9601aa0a910..6b8329701aa 100644 --- a/homeassistant/components/tuya/light.py +++ b/homeassistant/components/tuya/light.py @@ -265,6 +265,17 @@ LIGHTS: dict[str, tuple[TuyaLightEntityDescription, ...]] = { brightness=DPCode.BRIGHT_VALUE_2, ), ), + # Wake Up Light II + # Not documented + "hxd": ( + TuyaLightEntityDescription( + key=DPCode.SWITCH_LED, + name="Light", + brightness=(DPCode.BRIGHT_VALUE_V2, DPCode.BRIGHT_VALUE), + brightness_max=DPCode.BRIGHTNESS_MAX_1, + brightness_min=DPCode.BRIGHTNESS_MIN_1, + ), + ), # Solar Light # https://developer.tuya.com/en/docs/iot/tynd?id=Kaof8j02e1t98 "tyndj": ( diff --git a/homeassistant/components/tuya/switch.py b/homeassistant/components/tuya/switch.py index d978b377cc5..d587e8ea54b 100644 --- a/homeassistant/components/tuya/switch.py +++ b/homeassistant/components/tuya/switch.py @@ -98,6 +98,44 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { name="Switch", ), ), + # Wake Up Light II + # Not documented + "hxd": ( + SwitchEntityDescription( + key=DPCode.SWITCH_1, + name="Radio", + icon="mdi:radio", + ), + SwitchEntityDescription( + key=DPCode.SWITCH_2, + name="Alarm 1", + icon="mdi:alarm", + entity_category=EntityCategory.CONFIG, + ), + SwitchEntityDescription( + key=DPCode.SWITCH_3, + name="Alarm 2", + icon="mdi:alarm", + entity_category=EntityCategory.CONFIG, + ), + SwitchEntityDescription( + key=DPCode.SWITCH_4, + name="Alarm 3", + icon="mdi:alarm", + entity_category=EntityCategory.CONFIG, + ), + SwitchEntityDescription( + key=DPCode.SWITCH_5, + name="Alarm 4", + icon="mdi:alarm", + entity_category=EntityCategory.CONFIG, + ), + SwitchEntityDescription( + key=DPCode.SWITCH_6, + name="Sleep Aid", + icon="mdi:power-sleep", + ), + ), # Switch # https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s "kg": (