From f4c2c54e84b223a1d102fa56838d65e3d71823cb Mon Sep 17 00:00:00 2001 From: alexanv1 <44785744+alexanv1@users.noreply.github.com> Date: Sun, 24 Oct 2021 11:34:05 -0700 Subject: [PATCH] Extend Tuya Humidifier (#58260) --- homeassistant/components/tuya/const.py | 1 + homeassistant/components/tuya/humidifier.py | 1 + homeassistant/components/tuya/light.py | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index 5da0bad19ac..96913c16aeb 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -172,6 +172,7 @@ class DPCode(str, Enum): CO2_STATE = "co2_state" CO2_VALUE = "co2_value" # CO2 concentration COLOR_DATA_V2 = "color_data_v2" + COLOUR_DATA_HSV = "colour_data_hsv" # Colored light mode COLOUR_DATA = "colour_data" # Colored light mode COLOUR_DATA_V2 = "colour_data_v2" # Colored light mode CONCENTRATION_SET = "concentration_set" # Concentration setting diff --git a/homeassistant/components/tuya/humidifier.py b/homeassistant/components/tuya/humidifier.py index 4152399daec..b9fc10790e3 100644 --- a/homeassistant/components/tuya/humidifier.py +++ b/homeassistant/components/tuya/humidifier.py @@ -45,6 +45,7 @@ HUMIDIFIERS: dict[str, TuyaHumidifierEntityDescription] = { # https://developer.tuya.com/en/docs/iot/categoryjsq?id=Kaiuz1smr440b "jsq": TuyaHumidifierEntityDescription( key=DPCode.SWITCH, + dpcode=(DPCode.SWITCH, DPCode.SWITCH_SPRAY), humidity=DPCode.HUMIDITY_SET, device_class=DEVICE_CLASS_HUMIDIFIER, ), diff --git a/homeassistant/components/tuya/light.py b/homeassistant/components/tuya/light.py index 437c1a1262f..10aa8806a81 100644 --- a/homeassistant/components/tuya/light.py +++ b/homeassistant/components/tuya/light.py @@ -109,6 +109,16 @@ LIGHTS: dict[str, tuple[TuyaLightEntityDescription, ...]] = { color_data=DPCode.COLOUR_DATA, ), ), + # Humidifier Light + # https://developer.tuya.com/en/docs/iot/categoryjsq?id=Kaiuz1smr440b + "jsq": ( + TuyaLightEntityDescription( + key=DPCode.SWITCH_LED, + color_mode=DPCode.WORK_MODE, + brightness=DPCode.BRIGHT_VALUE, + color_data=DPCode.COLOUR_DATA_HSV, + ), + ), # Switch # https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s "kg": (