From 4555f52e50ea543b4274473d2804e4d4219d142f Mon Sep 17 00:00:00 2001 From: cvroque <65680394+cvroque@users.noreply.github.com> Date: Tue, 23 Nov 2021 22:15:49 -0300 Subject: [PATCH] Add configuration entities to Tuya Vacuum (sd) (#59936) --- homeassistant/components/tuya/const.py | 3 +++ homeassistant/components/tuya/number.py | 10 ++++++++++ homeassistant/components/tuya/switch.py | 16 ++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index f0707b1b37a..0173bde9a6b 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -271,6 +271,7 @@ class DPCode(str, Enum): SWITCH_BACKLIGHT = "switch_backlight" # Backlight switch SWITCH_CHARGE = "switch_charge" SWITCH_CONTROLLER = "switch_controller" + SWITCH_DISTURB = "switch_disturb" SWITCH_HORIZONTAL = "switch_horizontal" # Horizontal swing flap switch SWITCH_LED = "switch_led" # Switch SWITCH_LED_1 = "switch_led_1" @@ -304,6 +305,8 @@ class DPCode(str, Enum): VA_TEMPERATURE = "va_temperature" VOC_STATE = "voc_state" VOC_VALUE = "voc_value" + VOICE_SWITCH = "voice_switch" + VOLUME_SET = "volume_set" WARM = "warm" # Heat preservation WARM_TIME = "warm_time" # Heat preservation time WATER_RESET = "water_reset" # Resetting of water usage days diff --git a/homeassistant/components/tuya/number.py b/homeassistant/components/tuya/number.py index 8db2e4debd5..634f4858186 100644 --- a/homeassistant/components/tuya/number.py +++ b/homeassistant/components/tuya/number.py @@ -103,6 +103,16 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = { entity_category=ENTITY_CATEGORY_CONFIG, ), ), + # Robot Vacuum + # https://developer.tuya.com/en/docs/iot/fsd?id=K9gf487ck1tlo + "sd": ( + NumberEntityDescription( + key=DPCode.VOLUME_SET, + name="Volume", + icon="mdi:volume-high", + entity_category=ENTITY_CATEGORY_CONFIG, + ), + ), # Siren Alarm # https://developer.tuya.com/en/docs/iot/categorysgbj?id=Kaiuz37tlpbnu "sgbj": ( diff --git a/homeassistant/components/tuya/switch.py b/homeassistant/components/tuya/switch.py index 8395c02cf39..5fb5a0f39b0 100644 --- a/homeassistant/components/tuya/switch.py +++ b/homeassistant/components/tuya/switch.py @@ -290,6 +290,22 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = { entity_category=ENTITY_CATEGORY_CONFIG, ), ), + # Robot Vacuum + # https://developer.tuya.com/en/docs/iot/fsd?id=K9gf487ck1tlo + "sd": ( + SwitchEntityDescription( + key=DPCode.SWITCH_DISTURB, + name="Do Not Disturb", + icon="mdi:minus-circle", + entity_category=ENTITY_CATEGORY_CONFIG, + ), + SwitchEntityDescription( + key=DPCode.VOICE_SWITCH, + name="Voice", + icon="mdi:account-voice", + entity_category=ENTITY_CATEGORY_CONFIG, + ), + ), # Siren Alarm # https://developer.tuya.com/en/docs/iot/categorysgbj?id=Kaiuz37tlpbnu "sgbj": (