From 74c84437a692f3afd007814fd65ef8d07fcdb337 Mon Sep 17 00:00:00 2001 From: hangy Date: Sun, 3 Nov 2024 15:35:39 +0100 Subject: [PATCH 1/3] Add quirk for TZ3000 Adds support for UseeLink 302EU-Zigbee, based onhttps://github.com/zigpy/zha-device-handlers/issues/1632#issuecomment-1627072807 Co-authored-by: ingoratsdorf --- zhaquirks/tuya/ts011f_plug.py | 160 ++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) diff --git a/zhaquirks/tuya/ts011f_plug.py b/zhaquirks/tuya/ts011f_plug.py index 24812e25da..9d21fa9470 100644 --- a/zhaquirks/tuya/ts011f_plug.py +++ b/zhaquirks/tuya/ts011f_plug.py @@ -1613,3 +1613,163 @@ class Plug_TZ3000_2AC_var02(EnchantedDevice): }, }, } + +class Plug_4AC_2USB_TZ3000_cfnprab5(CustomDevice): + """Tuya 4 outlet + 4 USB without any metering or restore""" + + signature = { + MODEL: "TS011F", + ENDPOINTS: { + 1: { + # + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + OnOff.cluster_id, + TuyaZBE000Cluster.cluster_id, + ], + OUTPUT_CLUSTERS: [ + Time.cluster_id + ], + }, + 2: { + # + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + OnOff.cluster_id, + TuyaZBE000Cluster.cluster_id, + ], + OUTPUT_CLUSTERS: [], + }, + 3: { + # + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + OnOff.cluster_id, + TuyaZBE000Cluster.cluster_id, + ], + OUTPUT_CLUSTERS: [], + }, + 4: { + # + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + OnOff.cluster_id, + TuyaZBE000Cluster.cluster_id, + ], + OUTPUT_CLUSTERS: [], + }, + 5: { + # + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + OnOff.cluster_id, + TuyaZBE000Cluster.cluster_id, + ], + OUTPUT_CLUSTERS: [], + }, + }, + } + replacement = { + ENDPOINTS: { + 1: { + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + TuyaZBOnOffAttributeCluster, + TuyaZBExternalSwitchTypeCluster, + ], + OUTPUT_CLUSTERS: [], + }, + 2: { + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + TuyaZBOnOffAttributeCluster, + TuyaZBExternalSwitchTypeCluster, + ], + OUTPUT_CLUSTERS: [], + }, + 3: { + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + TuyaZBOnOffAttributeCluster, + TuyaZBExternalSwitchTypeCluster, + ], + OUTPUT_CLUSTERS: [], + }, + 4: { + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + TuyaZBOnOffAttributeCluster, + TuyaZBExternalSwitchTypeCluster, + ], + OUTPUT_CLUSTERS: [], + }, + 5: { + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.ON_OFF_PLUG_IN_UNIT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + TuyaZBOnOffAttributeCluster, + TuyaZBExternalSwitchTypeCluster, + ], + OUTPUT_CLUSTERS: [], + }, + }, + } From 1b49fa34442858f1f8f69bb595629bd26e0dd851 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:36:17 +0000 Subject: [PATCH 2/3] Apply pre-commit auto fixes --- zhaquirks/tuya/ts011f_plug.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zhaquirks/tuya/ts011f_plug.py b/zhaquirks/tuya/ts011f_plug.py index 9d21fa9470..39ca89eaa1 100644 --- a/zhaquirks/tuya/ts011f_plug.py +++ b/zhaquirks/tuya/ts011f_plug.py @@ -1614,6 +1614,7 @@ class Plug_TZ3000_2AC_var02(EnchantedDevice): }, } + class Plug_4AC_2USB_TZ3000_cfnprab5(CustomDevice): """Tuya 4 outlet + 4 USB without any metering or restore""" @@ -1634,9 +1635,7 @@ class Plug_4AC_2USB_TZ3000_cfnprab5(CustomDevice): OnOff.cluster_id, TuyaZBE000Cluster.cluster_id, ], - OUTPUT_CLUSTERS: [ - Time.cluster_id - ], + OUTPUT_CLUSTERS: [Time.cluster_id], }, 2: { # Date: Sun, 3 Nov 2024 15:38:54 +0100 Subject: [PATCH 3/3] fix(docs): Add missing trailing period. --- zhaquirks/tuya/ts011f_plug.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zhaquirks/tuya/ts011f_plug.py b/zhaquirks/tuya/ts011f_plug.py index 39ca89eaa1..2761fd8532 100644 --- a/zhaquirks/tuya/ts011f_plug.py +++ b/zhaquirks/tuya/ts011f_plug.py @@ -1616,7 +1616,7 @@ class Plug_TZ3000_2AC_var02(EnchantedDevice): class Plug_4AC_2USB_TZ3000_cfnprab5(CustomDevice): - """Tuya 4 outlet + 4 USB without any metering or restore""" + """Tuya 4 outlet + 4 USB without any metering or restore.""" signature = { MODEL: "TS011F",