Skip to content

Commit b734d1b

Browse files
authored
Add Tuya TS0601 switch variants (#4221)
1 parent 7e5e913 commit b734d1b

File tree

1 file changed

+99
-8
lines changed

1 file changed

+99
-8
lines changed

zhaquirks/tuya/ts0601_switch.py

Lines changed: 99 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class TuyaSingleSwitchTO(TuyaSwitch):
122122
}
123123

124124

125-
class TuyaSingleSwitch_GP(TuyaSwitch):
125+
class TuyaSingleSwitchGP(TuyaSwitch):
126126
"""Tuya single channel switch with GreenPowerProxy cluster device."""
127127

128128
signature = {
@@ -133,6 +133,7 @@ class TuyaSingleSwitch_GP(TuyaSwitch):
133133
("_TZE204_d0ypnbvn", "TS0601"), # reported in #3220 & #3291
134134
("_TZE204_ptaqh9tk", "TS0601"), # reported in #2780
135135
("_TZE204_v5xjyphj", "TS0601"), # reported in #4078
136+
("_TZE204_gbagoilo", "TS0601"), # reported in #4101
136137
],
137138
ENDPOINTS: {
138139
# <SimpleDescriptor endpoint=1 profile=260 device_type=51 device_version=1
@@ -242,7 +243,7 @@ class TuyaDoubleSwitchTO(TuyaSwitch):
242243
}
243244

244245

245-
class TuyaDoubleSwitch_GP(TuyaSwitch):
246+
class TuyaDoubleSwitchGP(TuyaSwitch):
246247
"""Tuya double channel switch with GreenPowerProxy cluster device."""
247248

248249
quirk_id = TUYA_PLUG_MANUFACTURER
@@ -251,6 +252,7 @@ class TuyaDoubleSwitch_GP(TuyaSwitch):
251252
MODELS_INFO: [
252253
("_TZE200_7deq70b8", "TS0601"),
253254
("_TZE200_nh9m9emk", "TS0601"), # reported in #1634
255+
("_TZE204_nh9m9emk", "TS0601"), # reported in #4100
254256
],
255257
ENDPOINTS: {
256258
# <SimpleDescriptor endpoint=1 profile=260 device_type=51 device_version=1
@@ -369,7 +371,7 @@ class TuyaTripleSwitchTO(TuyaSwitch):
369371
}
370372

371373

372-
class TuyaTripleSwitch_GP(TuyaSwitch):
374+
class TuyaTripleSwitchGP(TuyaSwitch):
373375
"""Tuya triple channel switch with GreenPowerProxy cluster device."""
374376

375377
quirk_id = TUYA_PLUG_MANUFACTURER
@@ -570,7 +572,7 @@ class TuyaQuadrupleSwitchTO(TuyaSwitch):
570572
}
571573

572574

573-
class TuyaQuadrupleSwitch_GP(TuyaSwitch):
575+
class TuyaQuadrupleSwitchGP(TuyaSwitch):
574576
"""Tuya quadruple channel switch with GreenPowerProxy cluster device."""
575577

576578
signature = {
@@ -652,6 +654,95 @@ class TuyaQuadrupleSwitch_GP(TuyaSwitch):
652654
}
653655

654656

657+
class TuyaQuintupleSwitchGP(TuyaSwitch):
658+
"""Tuya quintuple channel switch with GreenPowerProxy cluster device."""
659+
660+
signature = {
661+
MODELS_INFO: [
662+
("_TZE200_jwsjbxjs", "TS0601"), # reported #4219
663+
],
664+
ENDPOINTS: {
665+
# <SimpleDescriptor endpoint=1 profile=260 device_type=51 device_version=1
666+
# input_clusters=[0, 4, 5, 61184]
667+
# output_clusters=[10, 25]>
668+
1: {
669+
PROFILE_ID: zha.PROFILE_ID,
670+
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
671+
INPUT_CLUSTERS: [
672+
Basic.cluster_id,
673+
Groups.cluster_id,
674+
Scenes.cluster_id,
675+
TuyaOnOffManufCluster.cluster_id,
676+
],
677+
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
678+
},
679+
# <SimpleDescriptor endpoint=242 profile=41440 device_type=97
680+
# input_clusters=[]
681+
# output_clusters=[33]
682+
242: {
683+
PROFILE_ID: zgp.PROFILE_ID,
684+
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
685+
INPUT_CLUSTERS: [],
686+
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
687+
},
688+
},
689+
}
690+
691+
replacement = {
692+
ENDPOINTS: {
693+
1: {
694+
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
695+
INPUT_CLUSTERS: [
696+
Basic.cluster_id,
697+
Groups.cluster_id,
698+
Scenes.cluster_id,
699+
MoesSwitchManufCluster,
700+
TuyaOnOffNM,
701+
],
702+
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
703+
},
704+
2: {
705+
PROFILE_ID: zha.PROFILE_ID,
706+
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
707+
INPUT_CLUSTERS: [
708+
TuyaOnOffNM,
709+
],
710+
OUTPUT_CLUSTERS: [],
711+
},
712+
3: {
713+
PROFILE_ID: zha.PROFILE_ID,
714+
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
715+
INPUT_CLUSTERS: [
716+
TuyaOnOffNM,
717+
],
718+
OUTPUT_CLUSTERS: [],
719+
},
720+
4: {
721+
PROFILE_ID: zha.PROFILE_ID,
722+
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
723+
INPUT_CLUSTERS: [
724+
TuyaOnOffNM,
725+
],
726+
OUTPUT_CLUSTERS: [],
727+
},
728+
5: {
729+
PROFILE_ID: zha.PROFILE_ID,
730+
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
731+
INPUT_CLUSTERS: [
732+
TuyaOnOffNM,
733+
],
734+
OUTPUT_CLUSTERS: [],
735+
},
736+
242: {
737+
PROFILE_ID: zgp.PROFILE_ID,
738+
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
739+
INPUT_CLUSTERS: [],
740+
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
741+
},
742+
}
743+
}
744+
745+
655746
class TuyaQuintupleSwitchTO(TuyaSwitch):
656747
"""Tuya quintuple channel switch time on out cluster device."""
657748

@@ -813,7 +904,7 @@ class TuyaSextupleSwitchTO(TuyaSwitch):
813904
}
814905

815906

816-
class TuyaSextupleSwitchTO_GP(TuyaSwitch):
907+
class TuyaSextupleSwitchTOGP(TuyaSwitch):
817908
"""Tuya sextuple channel switch time on out cluster device with GreenPowerProxy cluster device."""
818909

819910
quirk_id = TUYA_PLUG_MANUFACTURER
@@ -913,7 +1004,7 @@ class TuyaSextupleSwitchTO_GP(TuyaSwitch):
9131004
}
9141005

9151006

916-
class TuyaSwitchX8_GP(TuyaSwitch):
1007+
class TuyaSwitchX8GP(TuyaSwitch):
9171008
"""Tuya x8 channels switch with GreenPowerProxy cluster device."""
9181009

9191010
signature = {
@@ -1027,7 +1118,7 @@ class TuyaSwitchX8_GP(TuyaSwitch):
10271118
}
10281119

10291120

1030-
class TuyaSwitchX12_GP(TuyaSwitch):
1121+
class TuyaSwitchX12GP(TuyaSwitch):
10311122
"""Tuya x12 channels switch with GreenPowerProxy cluster device."""
10321123

10331124
signature = {
@@ -1172,7 +1263,7 @@ class TuyaSwitchX12_GP(TuyaSwitch):
11721263
}
11731264

11741265

1175-
class TuyaSwitchX16_GP(TuyaSwitch):
1266+
class TuyaSwitchX16GP(TuyaSwitch):
11761267
"""Tuya x16 channels switch with GreenPowerProxy cluster device."""
11771268

11781269
signature = {

0 commit comments

Comments
 (0)