Complete Ceiling Light (xdd) device support for Tuya (#58095)

pull/58119/head
Franck Nijhof 2021-10-20 18:24:34 +02:00 committed by GitHub
parent ea7252e377
commit 5fc2897c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions

View File

@ -150,6 +150,7 @@ class DPCode(str, Enum):
CUR_POWER = "cur_power" # Actual power
CUR_VOLTAGE = "cur_voltage" # Actual voltage
DEHUMIDITY_SET_VALUE = "dehumidify_set_value"
DO_NOT_DISTURB = "do_not_disturb"
DOORCONTACT_STATE = "doorcontact_state" # Status of door window sensor
DOORCONTACT_STATE_2 = "doorcontact_state_3"
DOORCONTACT_STATE_3 = "doorcontact_state_3"
@ -208,6 +209,7 @@ class DPCode(str, Enum):
SWITCH_LED = "switch_led" # Switch
SWITCH_LED_1 = "switch_led_1"
SWITCH_LED_2 = "switch_led_2"
SWITCH_NIGHT_LIGHT = "switch_night_light"
SWITCH_SPRAY = "switch_spray" # Spraying switch
SWITCH_USB1 = "switch_usb1" # USB 1
SWITCH_USB2 = "switch_usb2" # USB 2

View File

@ -130,7 +130,7 @@ LIGHTS: dict[str, tuple[TuyaLightEntityDescription, ...]] = {
color_data=DPCode.COLOUR_DATA,
),
),
# Ceiling Light
# Ceiling Light
# https://developer.tuya.com/en/docs/iot/ceiling-light?id=Kaiuz03xxfc4r
"xdd": (
TuyaLightEntityDescription(
@ -140,6 +140,10 @@ LIGHTS: dict[str, tuple[TuyaLightEntityDescription, ...]] = {
color_temp=DPCode.TEMP_VALUE,
color_data=DPCode.COLOUR_DATA,
),
TuyaLightEntityDescription(
key=DPCode.SWITCH_NIGHT_LIGHT,
name="Night Light",
),
),
# Remote Control
# https://developer.tuya.com/en/docs/iot/ykq?id=Kaof8ljn81aov

View File

@ -256,6 +256,16 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
entity_category=ENTITY_CATEGORY_CONFIG,
),
),
# Ceiling Light
# https://developer.tuya.com/en/docs/iot/ceiling-light?id=Kaiuz03xxfc4r
"xdd": (
SwitchEntityDescription(
key=DPCode.DO_NOT_DISTURB,
name="Do not disturb",
icon="mdi:minus-circle-outline",
entity_category=ENTITY_CATEGORY_CONFIG,
),
),
# Diffuser
# https://developer.tuya.com/en/docs/iot/categoryxxj?id=Kaiuz1f9mo6bl
"xxj": (