Add support for IoT Switches (tdq) in Tuya (#58952)

This commit is contained in:
Franck Nijhof
2021-11-02 19:27:46 +01:00
committed by Paulus Schoutsen
parent 44334ea4da
commit f8290ed026
2 changed files with 41 additions and 0 deletions

View File

@@ -143,6 +143,22 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
entity_category=ENTITY_CATEGORY_CONFIG, entity_category=ENTITY_CATEGORY_CONFIG,
), ),
), ),
# IoT Switch?
# Note: Undocumented
"tdq": (
SelectEntityDescription(
key=DPCode.RELAY_STATUS,
name="Power on Behavior",
device_class=DEVICE_CLASS_TUYA_RELAY_STATUS,
entity_category=ENTITY_CATEGORY_CONFIG,
),
SelectEntityDescription(
key=DPCode.LIGHT_MODE,
name="Indicator Light Mode",
device_class=DEVICE_CLASS_TUYA_LIGHT_MODE,
entity_category=ENTITY_CATEGORY_CONFIG,
),
),
# Dimmer Switch # Dimmer Switch
# https://developer.tuya.com/en/docs/iot/categorytgkg?id=Kaiuz0ktx7m0o # https://developer.tuya.com/en/docs/iot/categorytgkg?id=Kaiuz0ktx7m0o
"tgkg": ( "tgkg": (

View File

@@ -369,6 +369,31 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
entity_category=ENTITY_CATEGORY_CONFIG, entity_category=ENTITY_CATEGORY_CONFIG,
), ),
), ),
# IoT Switch?
# Note: Undocumented
"tdq": (
SwitchEntityDescription(
key=DPCode.SWITCH_1,
name="Switch 1",
device_class=DEVICE_CLASS_OUTLET,
),
SwitchEntityDescription(
key=DPCode.SWITCH_2,
name="Switch 2",
device_class=DEVICE_CLASS_OUTLET,
),
SwitchEntityDescription(
key=DPCode.SWITCH_3,
name="Switch 3",
device_class=DEVICE_CLASS_OUTLET,
),
SwitchEntityDescription(
key=DPCode.CHILD_LOCK,
name="Child Lock",
icon="mdi:account-lock",
entity_category=ENTITY_CATEGORY_CONFIG,
),
),
# Solar Light # Solar Light
# https://developer.tuya.com/en/docs/iot/tynd?id=Kaof8j02e1t98 # https://developer.tuya.com/en/docs/iot/tynd?id=Kaof8j02e1t98
"tyndj": ( "tyndj": (