From 054379fdfd96f68959cc589af157db7076598bbf Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Sun, 30 Nov 2025 02:31:30 +0100 Subject: [PATCH 1/4] Add the onoff attribute cluster to ts004f These attributes are not available on the output side, only on the input side. This fixes warnings about direction being wrong on the onoff cluster, since the onoff cluster was removed on the input side. --- zhaquirks/tuya/ts004f.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zhaquirks/tuya/ts004f.py b/zhaquirks/tuya/ts004f.py index 1e679f1114..49fb054b81 100644 --- a/zhaquirks/tuya/ts004f.py +++ b/zhaquirks/tuya/ts004f.py @@ -62,6 +62,7 @@ TuyaNoBindPowerConfigurationCluster, TuyaSmartRemoteOnOffCluster, TuyaZBExternalSwitchTypeCluster, + TuyaZBOnOffAttributeCluster, ) @@ -116,6 +117,7 @@ class TuyaSmartRemote004FROK(EnchantedDevice): TuyaNoBindPowerConfigurationCluster, Identify.cluster_id, Groups.cluster_id, # Is needed for adding group then binding is not working. + TuyaZBOnOffAttributeCluster, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ @@ -233,6 +235,7 @@ class TuyaSmartRemote004FDMS(EnchantedDevice): TuyaNoBindPowerConfigurationCluster, Identify.cluster_id, Groups.cluster_id, # Is needed for adding group then binding is not working. + TuyaZBOnOffAttributeCluster, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ @@ -367,6 +370,7 @@ class TuyaSmartRemote004FSK(EnchantedDevice): TuyaNoBindPowerConfigurationCluster, Identify.cluster_id, Groups.cluster_id, # Is needed for adding group then binding is not working. + TuyaZBOnOffAttributeCluster, LightLink.cluster_id, TuyaZBExternalSwitchTypeCluster, ], @@ -483,6 +487,7 @@ class TuyaSmartRemote004F(EnchantedDevice): TuyaNoBindPowerConfigurationCluster, Identify.cluster_id, Groups.cluster_id, # Is needed for adding group then binding is not working. + TuyaZBOnOffAttributeCluster, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ From 69c09fbe8e0376a978e6d47e3d117b38b6d3cf1d Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Sun, 30 Nov 2025 03:51:15 +0100 Subject: [PATCH 2/4] Add tuya plug quirk --- zhaquirks/tuya/ts004f.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/zhaquirks/tuya/ts004f.py b/zhaquirks/tuya/ts004f.py index 49fb054b81..426ce45124 100644 --- a/zhaquirks/tuya/ts004f.py +++ b/zhaquirks/tuya/ts004f.py @@ -57,6 +57,7 @@ TURN_OFF, TURN_ON, ) +from zhaquirks.quirk_ids import TUYA_PLUG_ONOFF from zhaquirks.tuya import ( EnchantedDevice, TuyaNoBindPowerConfigurationCluster, @@ -69,6 +70,8 @@ class TuyaSmartRemote004FROK(EnchantedDevice): """Tuya Smart (rotating) Knob device.""" + quirk_id = TUYA_PLUG_ONOFF + signature = { # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False, *is_valid=True, *logical_type=, *user_descriptor_available=False)", # SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=260, device_version=1, input_clusters=[0, 1, 3, 4, 6, 4096], output_clusters=[25, 10, 3, 4, 5, 6, 8, 4096]) @@ -191,6 +194,8 @@ class TuyaSmartRemote004FROK(EnchantedDevice): class TuyaSmartRemote004FDMS(EnchantedDevice): """Tuya 4 btton dimmer switch / remote device.""" + quirk_id = TUYA_PLUG_ONOFF + signature = { # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False, *is_valid=True, *logical_type=, *user_descriptor_available=False)", # SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=260, device_version=1, input_clusters=[0, 1, 3, 4, 6, 4096], output_clusters=[25, 10, 3, 4, 5, 6, 8, 4096]) @@ -327,6 +332,8 @@ class TuyaSmartRemote004FDMS(EnchantedDevice): class TuyaSmartRemote004FSK(EnchantedDevice): """Tuya Smart (Single) Knob device.""" + quirk_id = TUYA_PLUG_ONOFF + signature = { # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False, *is_valid=True, *logical_type=, *user_descriptor_available=False)", # SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=260, device_version=1, input_clusters=[0, 1, 3, 4, 6, 4096, 57345], output_clusters=[25, 10, 3, 4, 6, 8, 4096]) @@ -447,6 +454,8 @@ class TuyaSmartRemote004FSK_v2(TuyaSmartRemote004FSK): class TuyaSmartRemote004F(EnchantedDevice): """Tuya 4-button New version remote device.""" + quirk_id = TUYA_PLUG_ONOFF + signature = { # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False, *is_valid=True, *logical_type=, *user_descriptor_available=False)", # SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=260, device_version=1, input_clusters=[0, 1, 3, 4, 6, 4096], output_clusters=[25, 10, 3, 4, 5, 6, 8, 4096]) From fbc462789796cb7ea4e4c943b3ebb82019243ed8 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Sat, 31 Jan 2026 01:37:40 +0100 Subject: [PATCH 3/4] Restore name of tuya smart remote cluster The cluster is a normal On/Off cluster with some extensions. --- zhaquirks/tuya/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/zhaquirks/tuya/__init__.py b/zhaquirks/tuya/__init__.py index b519115557..a6a2ed88d1 100644 --- a/zhaquirks/tuya/__init__.py +++ b/zhaquirks/tuya/__init__.py @@ -1058,8 +1058,6 @@ class TuyaSmartRemoteOnOffCluster(OnOff, EventableCluster): 0x01: DOUBLE_PRESS, 0x02: LONG_PRESS, } - name = "TS004X_cluster" - ep_attribute = "TS004X_cluster" class AttributeDefs(OnOff.AttributeDefs): """Attribute definitions.""" From b84f04433f7f91fe6820e649b21d9ff8846ef3cf Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Sat, 31 Jan 2026 22:21:40 +0100 Subject: [PATCH 4/4] Merge the Tuya on off clusters into one This is just two sides of the same cluster and such are normally handled as a single cluster definition. --- tests/test_tuya_spells.py | 4 +- zhaquirks/quirk_ids.py | 4 +- zhaquirks/tuya/__init__.py | 17 +---- zhaquirks/tuya/ts0001_switch.py | 4 +- zhaquirks/tuya/ts000f_switch.py | 8 +-- zhaquirks/tuya/ts000x.py | 84 +++++++++++------------ zhaquirks/tuya/ts001x.py | 62 ++++++++--------- zhaquirks/tuya/ts0041.py | 10 +-- zhaquirks/tuya/ts0042.py | 18 ++--- zhaquirks/tuya/ts0043.py | 32 ++++----- zhaquirks/tuya/ts0044.py | 34 ++++----- zhaquirks/tuya/ts0046.py | 14 ++-- zhaquirks/tuya/ts004f.py | 35 +++++----- zhaquirks/tuya/ts011f_plug.py | 118 ++++++++++++++++---------------- zhaquirks/tuya/ts011f_switch.py | 8 +-- zhaquirks/tuya/ts0121_plug.py | 16 ++--- 16 files changed, 229 insertions(+), 239 deletions(-) diff --git a/tests/test_tuya_spells.py b/tests/test_tuya_spells.py index 08ab1676a9..ec74dfeec9 100644 --- a/tests/test_tuya_spells.py +++ b/tests/test_tuya_spells.py @@ -20,7 +20,7 @@ TUYA_QUERY_DATA, EnchantedDevice, TuyaNewManufCluster, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ) import zhaquirks.tuya.tuya_valve @@ -55,7 +55,7 @@ class TuyaTestSpellDevice(EnchantedDevice): DEVICE_TYPE: zha.DeviceType.SMART_PLUG, INPUT_CLUSTERS: [ Basic.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaNewManufCluster, ], OUTPUT_CLUSTERS: [], diff --git a/zhaquirks/quirk_ids.py b/zhaquirks/quirk_ids.py index 714e90a6df..dffd19af39 100644 --- a/zhaquirks/quirk_ids.py +++ b/zhaquirks/quirk_ids.py @@ -4,7 +4,9 @@ KONKE_BUTTON = "konke.button_remote" # remote with custom handling in cluster handler # Tuya -TUYA_PLUG_ONOFF = "tuya.plug_on_off_attributes" # plugs with configurable attributes on the OnOff cluster +TUYA_ON_OFF_CLUSTER = ( + "tuya.on_off_cluster" # devices with extra attributes on the OnOff cluster +) TUYA_PLUG_MANUFACTURER = "tuya.plug_manufacturer_attributes" # plugs with configurable attributes on a custom cluster # Xiaomi diff --git a/zhaquirks/tuya/__init__.py b/zhaquirks/tuya/__init__.py index a6a2ed88d1..20b28abd96 100644 --- a/zhaquirks/tuya/__init__.py +++ b/zhaquirks/tuya/__init__.py @@ -1033,20 +1033,8 @@ class PowerOnState(t.enum8): LastState = 0x02 -class TuyaZBOnOffAttributeCluster(CustomCluster, OnOff): - """Tuya Zigbee On Off cluster with extra attributes.""" - - class AttributeDefs(OnOff.AttributeDefs): - """Attribute definitions.""" - - child_lock: Final = ZCLAttributeDef(id=0x8000, type=t.Bool) - backlight_mode: Final = ZCLAttributeDef(id=0x8001, type=SwitchBackLight) - power_on_state: Final = ZCLAttributeDef(id=0x8002, type=PowerOnState) - switch_mode: Final = ZCLAttributeDef(id=0x8004, type=SwitchMode) - - -class TuyaSmartRemoteOnOffCluster(OnOff, EventableCluster): - """TuyaSmartRemoteOnOffCluster: fire events corresponding to press type.""" +class TuyaOnOffCluster(OnOff, EventableCluster): + """TuyaOnOffCluster: fire events corresponding to press type.""" rotate_type = { 0x00: RIGHT, @@ -1062,6 +1050,7 @@ class TuyaSmartRemoteOnOffCluster(OnOff, EventableCluster): class AttributeDefs(OnOff.AttributeDefs): """Attribute definitions.""" + child_lock: Final = ZCLAttributeDef(id=0x8000, type=t.Bool) backlight_mode: Final = ZCLAttributeDef(id=0x8001, type=SwitchBackLight) power_on_state: Final = ZCLAttributeDef(id=0x8002, type=PowerOnState) switch_mode: Final = ZCLAttributeDef(id=0x8004, type=SwitchMode) diff --git a/zhaquirks/tuya/ts0001_switch.py b/zhaquirks/tuya/ts0001_switch.py index 046d994f2b..adec55c4f1 100644 --- a/zhaquirks/tuya/ts0001_switch.py +++ b/zhaquirks/tuya/ts0001_switch.py @@ -5,7 +5,7 @@ from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement from zigpy.zcl.clusters.smartenergy import Metering -from zhaquirks.tuya import TuyaZBExternalSwitchTypeCluster, TuyaZBOnOffAttributeCluster +from zhaquirks.tuya import TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster class CustomElectricalMeasurement(ElectricalMeasurement, CustomCluster): @@ -46,7 +46,7 @@ class CustomMetering(Metering, CustomCluster): .applies_to("_TZ3000_jsfzkftc", "TS0001") .replaces(CustomMetering) .replaces(CustomElectricalMeasurement) - .replaces(TuyaZBOnOffAttributeCluster) + .replaces(TuyaOnOffCluster) .replaces(TuyaZBExternalSwitchTypeCluster) .add_to_registry() ) diff --git a/zhaquirks/tuya/ts000f_switch.py b/zhaquirks/tuya/ts000f_switch.py index 62136852d0..80f42dd5a6 100644 --- a/zhaquirks/tuya/ts000f_switch.py +++ b/zhaquirks/tuya/ts000f_switch.py @@ -23,12 +23,12 @@ ) from zhaquirks.tuya import ( EnchantedDevice, + TuyaOnOffCluster, TuyaZB1888Cluster, TuyaZBE000Cluster, TuyaZBElectricalMeasurement, TuyaZBExternalSwitchTypeCluster, TuyaZBMeteringCluster, - TuyaZBOnOffAttributeCluster, ) @@ -80,7 +80,7 @@ class Tuya_1G_Wall_Switch_Metering(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, Time.cluster_id, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, @@ -150,7 +150,7 @@ class Tuya_2G_Wall_Switch_Metering(EnchantedDevice): Basic.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -165,7 +165,7 @@ class Tuya_2G_Wall_Switch_Metering(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], diff --git a/zhaquirks/tuya/ts000x.py b/zhaquirks/tuya/ts000x.py index aadd24de80..caab1ffb76 100644 --- a/zhaquirks/tuya/ts000x.py +++ b/zhaquirks/tuya/ts000x.py @@ -20,21 +20,21 @@ OUTPUT_CLUSTERS, PROFILE_ID, ) -from zhaquirks.quirk_ids import TUYA_PLUG_ONOFF +from zhaquirks.quirk_ids import TUYA_ON_OFF_CLUSTER from zhaquirks.tuya import ( EnchantedDevice, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBElectricalMeasurement, TuyaZBExternalSwitchTypeCluster, TuyaZBMeteringCluster, - TuyaZBOnOffAttributeCluster, ) class Switch_1G_GPP(EnchantedDevice): """Tuya 1 gang switch module with restore power state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0001", @@ -79,7 +79,7 @@ class Switch_1G_GPP(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -92,7 +92,7 @@ class Switch_1G_GPP(EnchantedDevice): class Switch_1G_Metering(EnchantedDevice): """Tuya 1 gang switch with metering support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0001", @@ -138,7 +138,7 @@ class Switch_1G_Metering(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaZBE000Cluster, @@ -153,7 +153,7 @@ class Switch_1G_Metering(EnchantedDevice): class Switch_2G_GPP(EnchantedDevice): """Tuya 2 gang switch module with restore power state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0002", @@ -213,7 +213,7 @@ class Switch_2G_GPP(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -225,7 +225,7 @@ class Switch_2G_GPP(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -243,7 +243,7 @@ class Switch_2G_GPP(EnchantedDevice): class Switch_2G_Metering(EnchantedDevice): """Tuya 2 gang switch with metering support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0002", @@ -302,7 +302,7 @@ class Switch_2G_Metering(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaZBE000Cluster, @@ -316,7 +316,7 @@ class Switch_2G_Metering(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -333,7 +333,7 @@ class Switch_2G_Metering(EnchantedDevice): class Switch_2G_Var03(EnchantedDevice): """Tuya 2 gang (variation 03).""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0002", @@ -395,7 +395,7 @@ class Switch_2G_Var03(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -408,7 +408,7 @@ class Switch_2G_Var03(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -427,7 +427,7 @@ class Switch_2G_Var03(EnchantedDevice): class Switch_3G_GPP(EnchantedDevice): """Tuya 3 gang switch module with restore power state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0003", @@ -502,7 +502,7 @@ class Switch_3G_GPP(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -514,7 +514,7 @@ class Switch_3G_GPP(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -525,7 +525,7 @@ class Switch_3G_GPP(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -543,7 +543,7 @@ class Switch_3G_GPP(EnchantedDevice): class Switch_3G_Metering(EnchantedDevice): """Tuya 3 gang switch with metering support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0003", @@ -615,7 +615,7 @@ class Switch_3G_Metering(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaZBE000Cluster, @@ -629,7 +629,7 @@ class Switch_3G_Metering(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -639,7 +639,7 @@ class Switch_3G_Metering(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -656,7 +656,7 @@ class Switch_3G_Metering(EnchantedDevice): class Switch_3G_GPP_Var2(EnchantedDevice): """Tuya 3 gang switch module.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0003", @@ -723,7 +723,7 @@ class Switch_3G_GPP_Var2(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -739,7 +739,7 @@ class Switch_3G_GPP_Var2(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -752,7 +752,7 @@ class Switch_3G_GPP_Var2(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -771,7 +771,7 @@ class Switch_3G_GPP_Var2(EnchantedDevice): class Switch_4G_GPP(EnchantedDevice): """Tuya 4 gang switch module with restore power state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0004", @@ -861,7 +861,7 @@ class Switch_4G_GPP(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -873,7 +873,7 @@ class Switch_4G_GPP(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -884,7 +884,7 @@ class Switch_4G_GPP(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -895,7 +895,7 @@ class Switch_4G_GPP(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -913,7 +913,7 @@ class Switch_4G_GPP(EnchantedDevice): class Switch_4G_Metering(EnchantedDevice): """Tuya 4 gang switch with metering support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0004", @@ -998,7 +998,7 @@ class Switch_4G_Metering(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaZBE000Cluster, @@ -1012,7 +1012,7 @@ class Switch_4G_Metering(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -1022,7 +1022,7 @@ class Switch_4G_Metering(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -1032,7 +1032,7 @@ class Switch_4G_Metering(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -1049,7 +1049,7 @@ class Switch_4G_Metering(EnchantedDevice): class Switch_4G_GPP_Var2(EnchantedDevice): """Tuya 4 gang switch module.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0004", @@ -1129,7 +1129,7 @@ class Switch_4G_GPP_Var2(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -1145,7 +1145,7 @@ class Switch_4G_GPP_Var2(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -1158,7 +1158,7 @@ class Switch_4G_GPP_Var2(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -1171,7 +1171,7 @@ class Switch_4G_GPP_Var2(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], diff --git a/zhaquirks/tuya/ts001x.py b/zhaquirks/tuya/ts001x.py index 0a35b24d5e..a810a18d80 100644 --- a/zhaquirks/tuya/ts001x.py +++ b/zhaquirks/tuya/ts001x.py @@ -13,10 +13,10 @@ ) from zhaquirks.tuya import ( EnchantedDevice, + TuyaOnOffCluster, TuyaSwitch, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, - TuyaZBOnOffAttributeCluster, ) @@ -57,7 +57,7 @@ class TuyaSingleNoNeutralSwitch(EnchantedDevice, TuyaSwitch): Basic.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, @@ -118,7 +118,7 @@ class TuyaDoubleNoNeutralSwitch(EnchantedDevice, TuyaSwitch): Basic.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, @@ -128,7 +128,7 @@ class TuyaDoubleNoNeutralSwitch(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -203,7 +203,7 @@ class TuyaTripleNoNeutralSwitch(EnchantedDevice, TuyaSwitch): Basic.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, @@ -213,7 +213,7 @@ class TuyaTripleNoNeutralSwitch(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -223,7 +223,7 @@ class TuyaTripleNoNeutralSwitch(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -269,7 +269,7 @@ class TuyaSingleNoNeutralSwitch_2(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, @@ -332,7 +332,7 @@ class TuyaDoubleNoNeutralSwitch_2(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, @@ -342,7 +342,7 @@ class TuyaDoubleNoNeutralSwitch_2(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -419,7 +419,7 @@ class TuyaTripleNoNeutralSwitch_2(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, @@ -429,7 +429,7 @@ class TuyaTripleNoNeutralSwitch_2(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -439,7 +439,7 @@ class TuyaTripleNoNeutralSwitch_2(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -487,7 +487,7 @@ class Tuya_Single_No_N(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -556,7 +556,7 @@ class Tuya_Double_No_N(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -569,7 +569,7 @@ class Tuya_Double_No_N(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -636,7 +636,7 @@ class Tuya_Double_No_N_Plus(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -648,7 +648,7 @@ class Tuya_Double_No_N_Plus(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -707,7 +707,7 @@ class Tuya_Double_Var05(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -719,7 +719,7 @@ class Tuya_Double_Var05(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -772,7 +772,7 @@ class Tuya_Double_Var06(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [ Time.cluster_id, @@ -786,7 +786,7 @@ class Tuya_Double_Var06(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -871,7 +871,7 @@ class Tuya_Triple_No_N(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -884,7 +884,7 @@ class Tuya_Triple_No_N(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -896,7 +896,7 @@ class Tuya_Triple_No_N(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -978,7 +978,7 @@ class Tuya_Triple_No_N_Plus(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -990,7 +990,7 @@ class Tuya_Triple_No_N_Plus(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -1001,7 +1001,7 @@ class Tuya_Triple_No_N_Plus(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -1078,7 +1078,7 @@ class TuyaTripleGang_var05(EnchantedDevice, TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -1090,7 +1090,7 @@ class TuyaTripleGang_var05(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -1100,7 +1100,7 @@ class TuyaTripleGang_var05(EnchantedDevice, TuyaSwitch): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, diff --git a/zhaquirks/tuya/ts0041.py b/zhaquirks/tuya/ts0041.py index 063bbd129b..a23f2eb19f 100644 --- a/zhaquirks/tuya/ts0041.py +++ b/zhaquirks/tuya/ts0041.py @@ -20,7 +20,7 @@ ) from zhaquirks.tuya import ( TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, ) @@ -52,7 +52,7 @@ class TuyaSmartRemote0041TO(CustomDevice): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Ota.cluster_id, Time.cluster_id], }, @@ -94,7 +94,7 @@ class TuyaSmartRemote0041TI(CustomDevice): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, Time.cluster_id, ], OUTPUT_CLUSTERS: [Ota.cluster_id], @@ -173,7 +173,7 @@ class TuyaSmartRemote0041TOPlusA(CustomDevice): OUTPUT_CLUSTERS: [ Time.cluster_id, Ota.cluster_id, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], }, }, @@ -224,7 +224,7 @@ class TuyaSmartRemote0041_var04(CustomDevice): OnOff.cluster_id, ], OUTPUT_CLUSTERS: [ - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, Time.cluster_id, Ota.cluster_id, ], diff --git a/zhaquirks/tuya/ts0042.py b/zhaquirks/tuya/ts0042.py index b783e0e748..e9f512fb4d 100644 --- a/zhaquirks/tuya/ts0042.py +++ b/zhaquirks/tuya/ts0042.py @@ -21,7 +21,7 @@ ) from zhaquirks.tuya import ( TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, ) @@ -64,7 +64,7 @@ class TuyaSmartRemote0042TI(CustomDevice): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, Time.cluster_id, ], OUTPUT_CLUSTERS: [Ota.cluster_id], @@ -74,7 +74,7 @@ class TuyaSmartRemote0042TI(CustomDevice): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -128,7 +128,7 @@ class TuyaSmartRemote0042TO(CustomDevice): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, @@ -137,7 +137,7 @@ class TuyaSmartRemote0042TO(CustomDevice): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -217,14 +217,14 @@ class TuyaSmartRemote0042TOPlusA(CustomDevice): OUTPUT_CLUSTERS: [ Time.cluster_id, Ota.cluster_id, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], }, 2: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [TuyaSmartRemoteOnOffCluster], + OUTPUT_CLUSTERS: [TuyaOnOffCluster], }, }, } @@ -277,7 +277,7 @@ class TuyaSmartRemote0042NO(CustomDevice): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, @@ -286,7 +286,7 @@ class TuyaSmartRemote0042NO(CustomDevice): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, diff --git a/zhaquirks/tuya/ts0043.py b/zhaquirks/tuya/ts0043.py index eec0caaf8c..a7ce13db36 100644 --- a/zhaquirks/tuya/ts0043.py +++ b/zhaquirks/tuya/ts0043.py @@ -22,7 +22,7 @@ ) from zhaquirks.tuya import ( TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, ) @@ -75,7 +75,7 @@ class TuyaSmartRemote0043TI(CustomDevice): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, Time.cluster_id, ], OUTPUT_CLUSTERS: [Ota.cluster_id], @@ -85,7 +85,7 @@ class TuyaSmartRemote0043TI(CustomDevice): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -94,7 +94,7 @@ class TuyaSmartRemote0043TI(CustomDevice): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -161,7 +161,7 @@ class TuyaSmartRemote0043TO(CustomDevice): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, @@ -170,7 +170,7 @@ class TuyaSmartRemote0043TO(CustomDevice): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -179,7 +179,7 @@ class TuyaSmartRemote0043TO(CustomDevice): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -257,7 +257,7 @@ class TuyaSmartRemote0043TOPlusA(CustomDevice): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, ], OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], @@ -267,7 +267,7 @@ class TuyaSmartRemote0043TOPlusA(CustomDevice): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -276,7 +276,7 @@ class TuyaSmartRemote0043TOPlusA(CustomDevice): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -349,20 +349,20 @@ class TuyaSmartRemote0043TOPlusB(CustomDevice): OUTPUT_CLUSTERS: [ Time.cluster_id, Ota.cluster_id, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], }, 2: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [TuyaSmartRemoteOnOffCluster, TuyaZBE000Cluster], + OUTPUT_CLUSTERS: [TuyaOnOffCluster, TuyaZBE000Cluster], }, 3: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [TuyaSmartRemoteOnOffCluster, TuyaZBE000Cluster], + OUTPUT_CLUSTERS: [TuyaOnOffCluster, TuyaZBE000Cluster], }, }, } @@ -429,7 +429,7 @@ class TuyaSmartRemote0043NO(CustomDevice): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, @@ -438,7 +438,7 @@ class TuyaSmartRemote0043NO(CustomDevice): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -447,7 +447,7 @@ class TuyaSmartRemote0043NO(CustomDevice): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, diff --git a/zhaquirks/tuya/ts0044.py b/zhaquirks/tuya/ts0044.py index cb14136e85..ade3dea46f 100644 --- a/zhaquirks/tuya/ts0044.py +++ b/zhaquirks/tuya/ts0044.py @@ -23,7 +23,7 @@ ) from zhaquirks.tuya import ( TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, ) @@ -105,7 +105,7 @@ class TuyaSmartRemote0044TI(CustomDevice, Tuya4ButtonTriggers): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, Time.cluster_id, ], OUTPUT_CLUSTERS: [Ota.cluster_id], @@ -115,7 +115,7 @@ class TuyaSmartRemote0044TI(CustomDevice, Tuya4ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -124,7 +124,7 @@ class TuyaSmartRemote0044TI(CustomDevice, Tuya4ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -133,7 +133,7 @@ class TuyaSmartRemote0044TI(CustomDevice, Tuya4ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -198,7 +198,7 @@ class TuyaSmartRemote0044TO(CustomDevice, Tuya4ButtonTriggers): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, @@ -207,7 +207,7 @@ class TuyaSmartRemote0044TO(CustomDevice, Tuya4ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -216,7 +216,7 @@ class TuyaSmartRemote0044TO(CustomDevice, Tuya4ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -225,7 +225,7 @@ class TuyaSmartRemote0044TO(CustomDevice, Tuya4ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -291,7 +291,7 @@ class TuyaSmartRemote0044TOPlusA(CustomDevice, Tuya4ButtonTriggers): INPUT_CLUSTERS: [ Basic.cluster_id, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, ], OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], @@ -301,7 +301,7 @@ class TuyaSmartRemote0044TOPlusA(CustomDevice, Tuya4ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -310,7 +310,7 @@ class TuyaSmartRemote0044TOPlusA(CustomDevice, Tuya4ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -319,7 +319,7 @@ class TuyaSmartRemote0044TOPlusA(CustomDevice, Tuya4ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [ TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -391,26 +391,26 @@ class TuyaSmartRemote0044TOPlusB(CustomDevice, Tuya4ButtonTriggers): OUTPUT_CLUSTERS: [ Time.cluster_id, Ota.cluster_id, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], }, 2: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [TuyaSmartRemoteOnOffCluster, TuyaZBE000Cluster], + OUTPUT_CLUSTERS: [TuyaOnOffCluster, TuyaZBE000Cluster], }, 3: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [TuyaSmartRemoteOnOffCluster, TuyaZBE000Cluster], + OUTPUT_CLUSTERS: [TuyaOnOffCluster, TuyaZBE000Cluster], }, 4: { PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [], - OUTPUT_CLUSTERS: [TuyaSmartRemoteOnOffCluster, TuyaZBE000Cluster], + OUTPUT_CLUSTERS: [TuyaOnOffCluster, TuyaZBE000Cluster], }, }, } diff --git a/zhaquirks/tuya/ts0046.py b/zhaquirks/tuya/ts0046.py index 7c74e2d4f1..570a875fce 100644 --- a/zhaquirks/tuya/ts0046.py +++ b/zhaquirks/tuya/ts0046.py @@ -25,7 +25,7 @@ from zhaquirks.tuya import ( EnchantedDevice, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, ) @@ -116,7 +116,7 @@ class TuyaSmartRemote0046(EnchantedDevice, Tuya6ButtonTriggers): TuyaZBE000Cluster, ], OUTPUT_CLUSTERS: [ - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, Time.cluster_id, Ota.cluster_id, ], @@ -126,7 +126,7 @@ class TuyaSmartRemote0046(EnchantedDevice, Tuya6ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], }, 3: { @@ -134,7 +134,7 @@ class TuyaSmartRemote0046(EnchantedDevice, Tuya6ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], }, 4: { @@ -142,7 +142,7 @@ class TuyaSmartRemote0046(EnchantedDevice, Tuya6ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], }, 5: { @@ -150,7 +150,7 @@ class TuyaSmartRemote0046(EnchantedDevice, Tuya6ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], }, 6: { @@ -158,7 +158,7 @@ class TuyaSmartRemote0046(EnchantedDevice, Tuya6ButtonTriggers): DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL, INPUT_CLUSTERS: [], OUTPUT_CLUSTERS: [ - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], }, }, diff --git a/zhaquirks/tuya/ts004f.py b/zhaquirks/tuya/ts004f.py index 426ce45124..461edeaf0d 100644 --- a/zhaquirks/tuya/ts004f.py +++ b/zhaquirks/tuya/ts004f.py @@ -57,20 +57,19 @@ TURN_OFF, TURN_ON, ) -from zhaquirks.quirk_ids import TUYA_PLUG_ONOFF +from zhaquirks.quirk_ids import TUYA_ON_OFF_CLUSTER from zhaquirks.tuya import ( EnchantedDevice, TuyaNoBindPowerConfigurationCluster, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, - TuyaZBOnOffAttributeCluster, ) class TuyaSmartRemote004FROK(EnchantedDevice): """Tuya Smart (rotating) Knob device.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False, *is_valid=True, *logical_type=, *user_descriptor_available=False)", @@ -120,7 +119,7 @@ class TuyaSmartRemote004FROK(EnchantedDevice): TuyaNoBindPowerConfigurationCluster, Identify.cluster_id, Groups.cluster_id, # Is needed for adding group then binding is not working. - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ @@ -129,7 +128,7 @@ class TuyaSmartRemote004FROK(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, LevelControl.cluster_id, Color.cluster_id, LightLink.cluster_id, @@ -194,7 +193,7 @@ class TuyaSmartRemote004FROK(EnchantedDevice): class TuyaSmartRemote004FDMS(EnchantedDevice): """Tuya 4 btton dimmer switch / remote device.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False, *is_valid=True, *logical_type=, *user_descriptor_available=False)", @@ -240,7 +239,7 @@ class TuyaSmartRemote004FDMS(EnchantedDevice): TuyaNoBindPowerConfigurationCluster, Identify.cluster_id, Groups.cluster_id, # Is needed for adding group then binding is not working. - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ @@ -249,7 +248,7 @@ class TuyaSmartRemote004FDMS(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, LevelControl.cluster_id, Color.cluster_id, LightLink.cluster_id, @@ -259,7 +258,7 @@ class TuyaSmartRemote004FDMS(EnchantedDevice): PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.NON_COLOR_CONTROLLER, INPUT_CLUSTERS: [ - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -267,7 +266,7 @@ class TuyaSmartRemote004FDMS(EnchantedDevice): PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.NON_COLOR_CONTROLLER, INPUT_CLUSTERS: [ - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -275,7 +274,7 @@ class TuyaSmartRemote004FDMS(EnchantedDevice): PROFILE_ID: zha.PROFILE_ID, DEVICE_TYPE: zha.DeviceType.NON_COLOR_CONTROLLER, INPUT_CLUSTERS: [ - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -332,7 +331,7 @@ class TuyaSmartRemote004FDMS(EnchantedDevice): class TuyaSmartRemote004FSK(EnchantedDevice): """Tuya Smart (Single) Knob device.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False, *is_valid=True, *logical_type=, *user_descriptor_available=False)", @@ -377,7 +376,7 @@ class TuyaSmartRemote004FSK(EnchantedDevice): TuyaNoBindPowerConfigurationCluster, Identify.cluster_id, Groups.cluster_id, # Is needed for adding group then binding is not working. - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, LightLink.cluster_id, TuyaZBExternalSwitchTypeCluster, ], @@ -386,7 +385,7 @@ class TuyaSmartRemote004FSK(EnchantedDevice): Time.cluster_id, Identify.cluster_id, Groups.cluster_id, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, LevelControl.cluster_id, Color.cluster_id, LightLink.cluster_id, @@ -454,7 +453,7 @@ class TuyaSmartRemote004FSK_v2(TuyaSmartRemote004FSK): class TuyaSmartRemote004F(EnchantedDevice): """Tuya 4-button New version remote device.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False, *is_valid=True, *logical_type=, *user_descriptor_available=False)", @@ -496,7 +495,7 @@ class TuyaSmartRemote004F(EnchantedDevice): TuyaNoBindPowerConfigurationCluster, Identify.cluster_id, Groups.cluster_id, # Is needed for adding group then binding is not working. - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, LightLink.cluster_id, ], OUTPUT_CLUSTERS: [ @@ -505,7 +504,7 @@ class TuyaSmartRemote004F(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaSmartRemoteOnOffCluster, + TuyaOnOffCluster, LevelControl.cluster_id, LightLink.cluster_id, ], diff --git a/zhaquirks/tuya/ts011f_plug.py b/zhaquirks/tuya/ts011f_plug.py index 3fffc3a420..1d8801a1d2 100644 --- a/zhaquirks/tuya/ts011f_plug.py +++ b/zhaquirks/tuya/ts011f_plug.py @@ -26,24 +26,24 @@ OUTPUT_CLUSTERS, PROFILE_ID, ) -from zhaquirks.quirk_ids import TUYA_PLUG_ONOFF +from zhaquirks.quirk_ids import TUYA_ON_OFF_CLUSTER from zhaquirks.tuya import ( EnchantedDevice, TuyaNewManufCluster, + TuyaOnOffCluster, TuyaZB1888Cluster, TuyaZBE000Cluster, TuyaZBElectricalMeasurement, TuyaZBExternalSwitchTypeCluster, TuyaZBMeteringCluster, TuyaZBMeteringClusterWithUnit, - TuyaZBOnOffAttributeCluster, ) class Plug(EnchantedDevice): """Tuya plug with restore power state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -90,7 +90,7 @@ class Plug(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaZBE000Cluster, @@ -105,7 +105,7 @@ class Plug(EnchantedDevice): class Plug_1AC(CustomDevice): """Tuya plug without metering with restore power state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -148,7 +148,7 @@ class Plug_1AC(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, @@ -165,7 +165,7 @@ class Plug_1AC(CustomDevice): class Plug_2AC_2USB(EnchantedDevice): """Tuya 2 outlet + 2 USB with restore power state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODELS_INFO: [("_TZ3000_3zofvcaa", "TS011F")], @@ -255,7 +255,7 @@ class Plug_2AC_2USB(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -304,7 +304,7 @@ class Plug_2AC_2USB(EnchantedDevice): class Plug_3AC_4USB(CustomDevice): """Tuya 3 outlet + 4 USB with restore power state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -377,7 +377,7 @@ class Plug_3AC_4USB(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, @@ -388,7 +388,7 @@ class Plug_3AC_4USB(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -399,7 +399,7 @@ class Plug_3AC_4USB(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [], }, @@ -416,7 +416,7 @@ class Plug_3AC_4USB(CustomDevice): class Plug_4AC_2USB(CustomDevice): """Tuya 4 outlet + 2 USB surge protector with restore power state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -529,7 +529,7 @@ class Plug_4AC_2USB(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -542,7 +542,7 @@ class Plug_4AC_2USB(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -555,7 +555,7 @@ class Plug_4AC_2USB(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -568,7 +568,7 @@ class Plug_4AC_2USB(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -581,7 +581,7 @@ class Plug_4AC_2USB(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -600,7 +600,7 @@ class Plug_4AC_2USB(CustomDevice): class Plug_TZ3210_2AC(CustomDevice): """TS0011F 2 outlet plug.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -663,7 +663,7 @@ class Plug_TZ3210_2AC(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaNewManufCluster, @@ -677,7 +677,7 @@ class Plug_TZ3210_2AC(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaNewManufCluster, ], OUTPUT_CLUSTERS: [], @@ -695,7 +695,7 @@ class Plug_TZ3210_2AC(CustomDevice): class Plug_TZ3210_1AC(CustomDevice): """TS0011F 1 outlet plug.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -742,7 +742,7 @@ class Plug_TZ3210_1AC(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaNewManufCluster, @@ -762,7 +762,7 @@ class Plug_TZ3210_1AC(CustomDevice): class Plug_4AC_2USB_cfnprab5(EnchantedDevice): """Tuya 4 outlet + 2 USB surge protector with restore power state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -867,7 +867,7 @@ class Plug_4AC_2USB_cfnprab5(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -879,7 +879,7 @@ class Plug_4AC_2USB_cfnprab5(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -890,7 +890,7 @@ class Plug_4AC_2USB_cfnprab5(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -901,7 +901,7 @@ class Plug_4AC_2USB_cfnprab5(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -912,7 +912,7 @@ class Plug_4AC_2USB_cfnprab5(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -930,7 +930,7 @@ class Plug_4AC_2USB_cfnprab5(EnchantedDevice): class Plug_4AC_2USB_Metering(EnchantedDevice): """Tuya Tuya 4 outlet + 2 USB with power metering.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1007,7 +1007,7 @@ class Plug_4AC_2USB_Metering(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaZBE000Cluster, @@ -1021,7 +1021,7 @@ class Plug_4AC_2USB_Metering(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -1032,7 +1032,7 @@ class Plug_4AC_2USB_Metering(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -1050,7 +1050,7 @@ class Plug_4AC_2USB_Metering(EnchantedDevice): class Plug_v2(EnchantedDevice): """Another TS011F Tuya plug. First one using this definition is _TZ3000_okaz9tjs.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1086,7 +1086,7 @@ class Plug_v2(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringClusterWithUnit, TuyaZBElectricalMeasurement, TuyaZBExternalSwitchTypeCluster, @@ -1100,7 +1100,7 @@ class Plug_v2(EnchantedDevice): class Plug_v3(EnchantedDevice): """Tuya TS011F plug. One plug is _Tz3000_0Zfrhq4I.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1146,7 +1146,7 @@ class Plug_v3(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, Time.cluster_id, TuyaZBMeteringClusterWithUnit, TuyaZBElectricalMeasurement, @@ -1173,7 +1173,7 @@ class Plug_v3(EnchantedDevice): class Plug_v3_NoGP(EnchantedDevice): """Tuya TS011F plug without GP. One plug is _TZ3000_cehuw1lw.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1211,7 +1211,7 @@ class Plug_v3_NoGP(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, Time.cluster_id, TuyaZBMeteringClusterWithUnit, TuyaZBElectricalMeasurement, @@ -1230,7 +1230,7 @@ class Plug_v3_NoGP(EnchantedDevice): class Plug_v4(EnchantedDevice): """Another TS011F Tuya plug. This one using this definition is _TZ3000_okaz9tjs.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1277,7 +1277,7 @@ class Plug_v4(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringClusterWithUnit, TuyaZBElectricalMeasurement, TuyaZBE000Cluster, @@ -1333,7 +1333,7 @@ class Plug_v6(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringClusterWithUnit, TuyaZBElectricalMeasurement, TuyaZBExternalSwitchTypeCluster, @@ -1349,7 +1349,7 @@ class Plug_v6(EnchantedDevice): class Plug_v5(EnchantedDevice): """Another TS011F Tuya plug. This one using this definition is _TZ3000_okaz9tjs.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1388,7 +1388,7 @@ class Plug_v5(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, Time.cluster_id, TuyaZBMeteringClusterWithUnit, TuyaZBElectricalMeasurement, @@ -1405,7 +1405,7 @@ class Plug_v5(EnchantedDevice): class Plug_2AC_var03(CustomDevice): """Tuya 2 socket wall outlet with child lock and power-restore state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1456,7 +1456,7 @@ class Plug_2AC_var03(CustomDevice): # but does not implement the backlight_mode extended # attribute. For this device, changing this attribute # has no effect on the switch lights. - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Ota.cluster_id], }, @@ -1477,7 +1477,7 @@ class Plug_2AC_var03(CustomDevice): class Plug_CB_Metering(EnchantedDevice): """Circuit breaker with monitoring, e.g. Tongou TO-Q-SY1-JZT. First one using this definition was _TZ3000_qeuvnohg.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1525,7 +1525,7 @@ class Plug_CB_Metering(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaZBE000Cluster, @@ -1546,7 +1546,7 @@ class Plug_CB_Metering(EnchantedDevice): class Plug_2AC_var05(EnchantedDevice): """Immax TS0011F 2 outlet plug.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1608,7 +1608,7 @@ class Plug_2AC_var05(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaZBE000Cluster, @@ -1622,7 +1622,7 @@ class Plug_2AC_var05(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -1640,7 +1640,7 @@ class Plug_2AC_var05(EnchantedDevice): class Plug_TZ3000_2AC(CustomDevice): """TS0011F 2 outlet plug.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1690,7 +1690,7 @@ class Plug_TZ3000_2AC(CustomDevice): Basic.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, ], @@ -1702,7 +1702,7 @@ class Plug_TZ3000_2AC(CustomDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, ], @@ -1715,7 +1715,7 @@ class Plug_TZ3000_2AC(CustomDevice): class Plug_TZ3000_2AC_var02(EnchantedDevice): """Tuya 2 socket wall outlet.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1763,7 +1763,7 @@ class Plug_TZ3000_2AC_var02(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -1775,7 +1775,7 @@ class Plug_TZ3000_2AC_var02(EnchantedDevice): INPUT_CLUSTERS: [ Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBExternalSwitchTypeCluster, ], OUTPUT_CLUSTERS: [], @@ -1793,7 +1793,7 @@ class Plug_TZ3000_2AC_var02(EnchantedDevice): class Plug_v7(EnchantedDevice): """Another TS011F Tuya wall socket. This one using this definition is _TZ3000_o1jzcxou.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS011F", @@ -1830,7 +1830,7 @@ class Plug_v7(EnchantedDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], diff --git a/zhaquirks/tuya/ts011f_switch.py b/zhaquirks/tuya/ts011f_switch.py index 950f08fc2c..388e4f6fa8 100644 --- a/zhaquirks/tuya/ts011f_switch.py +++ b/zhaquirks/tuya/ts011f_switch.py @@ -21,10 +21,10 @@ PROFILE_ID, ) from zhaquirks.tuya import ( + TuyaOnOffCluster, TuyaSwitch, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, - TuyaZBOnOffAttributeCluster, ) @@ -88,7 +88,7 @@ class Tuya_2G_Switch(TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -101,7 +101,7 @@ class Tuya_2G_Switch(TuyaSwitch): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBExternalSwitchTypeCluster, ], @@ -148,7 +148,7 @@ class Tuya_1G_Switch(TuyaSwitch): Basic.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, ], OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id], }, diff --git a/zhaquirks/tuya/ts0121_plug.py b/zhaquirks/tuya/ts0121_plug.py index 0a742fbc7f..b639a72239 100644 --- a/zhaquirks/tuya/ts0121_plug.py +++ b/zhaquirks/tuya/ts0121_plug.py @@ -23,21 +23,21 @@ OUTPUT_CLUSTERS, PROFILE_ID, ) -from zhaquirks.quirk_ids import TUYA_PLUG_ONOFF +from zhaquirks.quirk_ids import TUYA_ON_OFF_CLUSTER from zhaquirks.tuya import ( TuyaNewManufCluster, + TuyaOnOffCluster, TuyaZBE000Cluster, TuyaZBElectricalMeasurement, TuyaZBExternalSwitchTypeCluster, TuyaZBMeteringCluster, - TuyaZBOnOffAttributeCluster, ) class Plug(CustomDevice): """Tuya TS0121 plug with restore tuya power state support.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0121", @@ -70,7 +70,7 @@ class Plug(CustomDevice): Basic.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, ], @@ -83,7 +83,7 @@ class Plug(CustomDevice): class TS0121B(CustomDevice): """Tuya TS0121 plug with restore tuya power state support and ZGP endpoint.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0121", @@ -122,7 +122,7 @@ class TS0121B(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaZBE000Cluster, @@ -143,7 +143,7 @@ class TS0121B(CustomDevice): class TS0121_Var03(CustomDevice): """Tuya TS0121 plug DeviceType.MAIN_POWER_OUTLET.""" - quirk_id = TUYA_PLUG_ONOFF + quirk_id = TUYA_ON_OFF_CLUSTER signature = { MODEL: "TS0121", @@ -187,7 +187,7 @@ class TS0121_Var03(CustomDevice): Identify.cluster_id, Groups.cluster_id, Scenes.cluster_id, - TuyaZBOnOffAttributeCluster, + TuyaOnOffCluster, TuyaZBMeteringCluster, TuyaZBElectricalMeasurement, TuyaNewManufCluster,