diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index 863e12b9a37..5093745a0bf 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -90,6 +90,7 @@ class TuyaDeviceClass(StrEnum): BASIC_ANTI_FLICKR = "tuya__basic_anti_flickr" BASIC_NIGHTVISION = "tuya__basic_nightvision" DECIBEL_SENSITIVITY = "tuya__decibel_sensitivity" + FAN_ANGLE = "tuya__fan_angle" FINGERBOT_MODE = "tuya__fingerbot_mode" IPC_WORK_MODE = "tuya__ipc_work_mode" LED_TYPE = "tuya__led_type" @@ -186,6 +187,8 @@ class DPCode(StrEnum): CONTROL = "control" CONTROL_2 = "control_2" CONTROL_3 = "control_3" + COUNTDOWN = "countdown" # Countdown + COUNTDOWN_SET = "countdown_set" # Countdown setting CRY_DETECTION_SWITCH = "cry_detection_switch" CUP_NUMBER = "cup_number" # NUmber of cups CUR_CURRENT = "cur_current" # Actual current @@ -201,11 +204,15 @@ class DPCode(StrEnum): DUSTER_CLOTH = "duster_cloth" EDGE_BRUSH = "edge_brush" ELECTRICITY_LEFT = "electricity_left" + FAN_BEEP = "fan_beep" # Sound + FAN_COOL = "fan_cool" # Cool wind FAN_DIRECTION = "fan_direction" # Fan direction + FAN_HORIZONTAL = "fan_horizontal" # Horizontal swing flap angle FAN_SPEED = "fan_speed" FAN_SPEED_ENUM = "fan_speed_enum" # Speed mode FAN_SPEED_PERCENT = "fan_speed_percent" # Stepless speed FAN_MODE = "fan_mode" + FAN_VERTICAL = "fan_vertical" # Vertical swing flap angle FAR_DETECTION = "far_detection" FAULT = "fault" FEED_REPORT = "feed_report" @@ -218,6 +225,7 @@ class DPCode(StrEnum): GAS_SENSOR_STATE = "gas_sensor_state" GAS_SENSOR_STATUS = "gas_sensor_status" GAS_SENSOR_VALUE = "gas_sensor_value" + HUMIDIFIER = "humidifier" # Humidification HUMIDITY_CURRENT = "humidity_current" # Current humidity HUMIDITY_SET = "humidity_set" # Humidity setting HUMIDITY_VALUE = "humidity_value" # Humidity @@ -264,6 +272,7 @@ class DPCode(StrEnum): PRESSURE_STATE = "pressure_state" PRESSURE_VALUE = "pressure_value" PUMP_RESET = "pump_reset" # Water pump reset + OXYGEN = "oxygen" # Oxygen bar RECORD_MODE = "record_mode" RECORD_SWITCH = "record_switch" # Recording switch RELAY_STATUS = "relay_status" @@ -320,6 +329,7 @@ class DPCode(StrEnum): SWITCH_USB6 = "switch_usb6" # USB 6 SWITCH_VERTICAL = "switch_vertical" # Vertical swing flap switch SWITCH_VOICE = "switch_voice" # Voice switch + TEMP = "temp" # Temperature setting TEMP_BOILING_C = "temp_boiling_c" TEMP_BOILING_F = "temp_boiling_f" TEMP_CONTROLLER = "temp_controller" diff --git a/homeassistant/components/tuya/light.py b/homeassistant/components/tuya/light.py index 0e7aee4655e..36a7bdf1ef1 100644 --- a/homeassistant/components/tuya/light.py +++ b/homeassistant/components/tuya/light.py @@ -275,6 +275,16 @@ LIGHTS: dict[str, tuple[TuyaLightEntityDescription, ...]] = { color_temp=DPCode.TEMP_CONTROLLER, ), ), + # Fan + # https://developer.tuya.com/en/docs/iot/categoryfs?id=Kaiuz1xweel1c + "fs": ( + TuyaLightEntityDescription( + key=DPCode.LIGHT, + color_mode=DPCode.WORK_MODE, + brightness=DPCode.BRIGHT_VALUE, + color_temp=DPCode.TEMP_VALUE, + ), + ), } # Socket (duplicate of `kg`) diff --git a/homeassistant/components/tuya/number.py b/homeassistant/components/tuya/number.py index 9d357f78b35..d234b6778be 100644 --- a/homeassistant/components/tuya/number.py +++ b/homeassistant/components/tuya/number.py @@ -241,6 +241,15 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = { entity_category=EntityCategory.CONFIG, ), ), + # Fan + # https://developer.tuya.com/en/docs/iot/categoryfs?id=Kaiuz1xweel1c + "fs": ( + NumberEntityDescription( + key=DPCode.TEMP, + name="Temperature", + icon="mdi:thermometer-lines", + ), + ), } diff --git a/homeassistant/components/tuya/select.py b/homeassistant/components/tuya/select.py index c229e1998c2..ce89000acd2 100644 --- a/homeassistant/components/tuya/select.py +++ b/homeassistant/components/tuya/select.py @@ -227,9 +227,38 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = { icon="mdi:layers-outline", ), ), + # Fan + # https://developer.tuya.com/en/docs/iot/f?id=K9gf45vs7vkge + "fs": ( + SelectEntityDescription( + key=DPCode.FAN_VERTICAL, + name="Vertical Swing Flap Angle", + device_class=TuyaDeviceClass.FAN_ANGLE, + entity_category=EntityCategory.CONFIG, + icon="mdi:format-vertical-align-center", + ), + SelectEntityDescription( + key=DPCode.FAN_HORIZONTAL, + name="Horizontal Swing Flap Angle", + device_class=TuyaDeviceClass.FAN_ANGLE, + entity_category=EntityCategory.CONFIG, + icon="mdi:format-horizontal-align-center", + ), + SelectEntityDescription( + key=DPCode.COUNTDOWN, + name="Countdown", + entity_category=EntityCategory.CONFIG, + icon="mdi:timer-cog-outline", + ), + SelectEntityDescription( + key=DPCode.COUNTDOWN_SET, + name="Countdown Setting", + entity_category=EntityCategory.CONFIG, + icon="mdi:timer-cog-outline", + ), + ), } - # Socket (duplicate of `kg`) # https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s SELECTS["cz"] = SELECTS["kg"] diff --git a/homeassistant/components/tuya/strings.select.json b/homeassistant/components/tuya/strings.select.json index 63acda534d7..48bf653979e 100644 --- a/homeassistant/components/tuya/strings.select.json +++ b/homeassistant/components/tuya/strings.select.json @@ -80,6 +80,11 @@ "point": "Point", "part": "Part", "pick_zone": "Pick Zone" + }, + "tuya__fan_angle": { + "30": "30°", + "60": "60°", + "90": "90°" } } } diff --git a/homeassistant/components/tuya/switch.py b/homeassistant/components/tuya/switch.py index 1b1ad11d7fb..4e36aec5ee5 100644 --- a/homeassistant/components/tuya/switch.py +++ b/homeassistant/components/tuya/switch.py @@ -480,6 +480,40 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { name="Switch", ), ), + # Fan + # https://developer.tuya.com/en/docs/iot/categoryfs?id=Kaiuz1xweel1c + "fs": ( + SwitchEntityDescription( + key=DPCode.ANION, + name="Anion", + icon="mdi:atom", + entity_category=EntityCategory.CONFIG, + ), + SwitchEntityDescription( + key=DPCode.HUMIDIFIER, + name="Humidification", + icon="mdi:air-humidifier", + entity_category=EntityCategory.CONFIG, + ), + SwitchEntityDescription( + key=DPCode.OXYGEN, + name="Oxygen Bar", + icon="mdi:molecule", + entity_category=EntityCategory.CONFIG, + ), + SwitchEntityDescription( + key=DPCode.FAN_BEEP, + name="Sound", + icon="mdi:minus-circle", + entity_category=EntityCategory.CONFIG, + ), + SwitchEntityDescription( + key=DPCode.CHILD_LOCK, + name="Child Lock", + icon="mdi:account-lock", + entity_category=EntityCategory.CONFIG, + ), + ), } # Socket (duplicate of `pc`)