11"""Tuya 1,2,3 gang no neutral light switch."""
22
33from zigpy .profiles import zha
4- from zigpy .zcl .clusters .general import Basic , Groups , OnOff , Ota , Scenes , Time
4+ from zigpy .zcl .clusters .general import Basic , Groups , Identify , OnOff , Ota , Scenes , Time
55
66from zhaquirks .const import (
77 DEVICE_TYPE ,
88 ENDPOINTS ,
99 INPUT_CLUSTERS ,
1010 MODEL ,
11- MODELS_INFO ,
1211 OUTPUT_CLUSTERS ,
1312 PROFILE_ID ,
1413 SKIP_CONFIGURATION ,
1514)
16- from zhaquirks .tuya import TuyaSwitch , TuyaZBOnOffAttributeCluster
15+ from zhaquirks .tuya import (
16+ TuyaSwitch ,
17+ TuyaZBE000Cluster ,
18+ TuyaZBExternalSwitchTypeCluster ,
19+ TuyaZBOnOffAttributeCluster ,
20+ )
1721
1822
1923class TuyaSingleNoNeutralSwitch (TuyaSwitch ):
@@ -23,7 +27,7 @@ class TuyaSingleNoNeutralSwitch(TuyaSwitch):
2327 # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098,
2428 # maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264,
2529 # maximum_outgoing_transfer_size=82, descriptor_capability_field=0)
26- MODELS_INFO : [( "_TZ3000_9hpxg80k" , " TS0011")] ,
30+ MODEL : " TS0011" ,
2731 ENDPOINTS : {
2832 # <SimpleDescriptor endpoint=1 profile=260 device_type=100
2933 # device_version=1
@@ -71,7 +75,7 @@ class TuyaDoubleNoNeutralSwitch(TuyaSwitch):
7175 # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098,
7276 # maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264,
7377 # maximum_outgoing_transfer_size=82, descriptor_capability_field=0)"
74- MODELS_INFO : [( "_TZ3000_fvh3pjaz" , " TS0012")] ,
78+ MODEL : " TS0012" ,
7579 ENDPOINTS : {
7680 # <SimpleDescriptor endpoint=1 profile=260 device_type=100
7781 # device_version=1
@@ -227,3 +231,244 @@ class TuyaTripleNoNeutralSwitch(TuyaSwitch):
227231 },
228232 },
229233 }
234+
235+
236+ class Tuya_Single_No_N (TuyaSwitch ):
237+ """Tuya 1 gang no neutral light switch."""
238+
239+ signature = {
240+ # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098,
241+ # maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264,
242+ # maximum_outgoing_transfer_size=82, descriptor_capability_field=0)
243+ MODEL : "TS0011" ,
244+ ENDPOINTS : {
245+ # <SimpleDescriptor endpoint=1 profile=260 device_type=100
246+ # device_version=1
247+ # input_clusters=[0, 3, 4, 5, 6, 57344, 57345]
248+ # output_clusters=[a, 19]>
249+ 1 : {
250+ PROFILE_ID : zha .PROFILE_ID ,
251+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
252+ INPUT_CLUSTERS : [
253+ Basic .cluster_id ,
254+ Identify .cluster_id ,
255+ Groups .cluster_id ,
256+ Scenes .cluster_id ,
257+ OnOff .cluster_id ,
258+ TuyaZBE000Cluster .cluster_id ,
259+ TuyaZBExternalSwitchTypeCluster .cluster_id ,
260+ ],
261+ OUTPUT_CLUSTERS : [Ota .cluster_id , Time .cluster_id ],
262+ },
263+ },
264+ }
265+ replacement = {
266+ ENDPOINTS : {
267+ 1 : {
268+ PROFILE_ID : zha .PROFILE_ID ,
269+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
270+ INPUT_CLUSTERS : [
271+ Basic .cluster_id ,
272+ Identify .cluster_id ,
273+ Groups .cluster_id ,
274+ Scenes .cluster_id ,
275+ TuyaZBOnOffAttributeCluster ,
276+ TuyaZBE000Cluster ,
277+ TuyaZBExternalSwitchTypeCluster ,
278+ ],
279+ OUTPUT_CLUSTERS : [Ota .cluster_id , Time .cluster_id ],
280+ },
281+ },
282+ }
283+
284+
285+ class Tuya_Double_No_N (TuyaSwitch ):
286+ """Tuya 2 gang no neutral light switch."""
287+
288+ signature = {
289+ # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098,
290+ # maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264,
291+ # maximum_outgoing_transfer_size=82, descriptor_capability_field=0)
292+ # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098,
293+ # maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264,
294+ # maximum_outgoing_transfer_size=82, descriptor_capability_field=0)"
295+ MODEL : "TS0012" ,
296+ ENDPOINTS : {
297+ # <SimpleDescriptor endpoint=1 profile=260 device_type=100
298+ # device_version=1
299+ # input_clusters=[0, 3, 4, 5, 6, 57344, 57345]
300+ # output_clusters=[a, 19]>
301+ 1 : {
302+ PROFILE_ID : zha .PROFILE_ID ,
303+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
304+ INPUT_CLUSTERS : [
305+ Basic .cluster_id ,
306+ Identify .cluster_id ,
307+ Groups .cluster_id ,
308+ Scenes .cluster_id ,
309+ OnOff .cluster_id ,
310+ TuyaZBE000Cluster .cluster_id ,
311+ TuyaZBExternalSwitchTypeCluster .cluster_id ,
312+ ],
313+ OUTPUT_CLUSTERS : [Ota .cluster_id , Time .cluster_id ],
314+ },
315+ # <SimpleDescriptor endpoint=2 profile=260 device_type=100
316+ # device_version=1
317+ # input_clusters=[3, 4, 5, 6, 57344, 57345]
318+ # output_clusters=[]>
319+ 2 : {
320+ PROFILE_ID : zha .PROFILE_ID ,
321+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
322+ INPUT_CLUSTERS : [
323+ Identify .cluster_id ,
324+ Groups .cluster_id ,
325+ Scenes .cluster_id ,
326+ OnOff .cluster_id ,
327+ TuyaZBE000Cluster .cluster_id ,
328+ TuyaZBExternalSwitchTypeCluster .cluster_id ,
329+ ],
330+ OUTPUT_CLUSTERS : [],
331+ },
332+ },
333+ }
334+ replacement = {
335+ ENDPOINTS : {
336+ 1 : {
337+ PROFILE_ID : zha .PROFILE_ID ,
338+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
339+ INPUT_CLUSTERS : [
340+ Basic .cluster_id ,
341+ Identify .cluster_id ,
342+ Groups .cluster_id ,
343+ Scenes .cluster_id ,
344+ TuyaZBOnOffAttributeCluster ,
345+ TuyaZBE000Cluster ,
346+ TuyaZBExternalSwitchTypeCluster ,
347+ ],
348+ OUTPUT_CLUSTERS : [Time .cluster_id , Ota .cluster_id ],
349+ },
350+ 2 : {
351+ PROFILE_ID : zha .PROFILE_ID ,
352+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
353+ INPUT_CLUSTERS : [
354+ Identify .cluster_id ,
355+ Groups .cluster_id ,
356+ Scenes .cluster_id ,
357+ TuyaZBOnOffAttributeCluster ,
358+ TuyaZBExternalSwitchTypeCluster ,
359+ ],
360+ OUTPUT_CLUSTERS : [],
361+ },
362+ },
363+ }
364+
365+
366+ class Tuya_Triple_No_N (TuyaSwitch ):
367+ """Tuya 3 gang no neutral light switch."""
368+
369+ signature = {
370+ # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098,
371+ # maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264,
372+ # maximum_outgoing_transfer_size=82, descriptor_capability_field=0)
373+ # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098,
374+ # maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264,
375+ # maximum_outgoing_transfer_size=82, descriptor_capability_field=0)"
376+ MODEL : "TS0013" ,
377+ ENDPOINTS : {
378+ # <SimpleDescriptor endpoint=1 profile=260 device_type=100
379+ # device_version=1
380+ # input_clusters=[0, 4, 5, 6]
381+ # output_clusters=[a, 19]>
382+ 1 : {
383+ PROFILE_ID : zha .PROFILE_ID ,
384+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
385+ INPUT_CLUSTERS : [
386+ Basic .cluster_id ,
387+ Identify .cluster_id ,
388+ Groups .cluster_id ,
389+ Scenes .cluster_id ,
390+ OnOff .cluster_id ,
391+ TuyaZBE000Cluster .cluster_id ,
392+ TuyaZBExternalSwitchTypeCluster .cluster_id ,
393+ ],
394+ OUTPUT_CLUSTERS : [Ota .cluster_id , Time .cluster_id ],
395+ },
396+ # <SimpleDescriptor endpoint=2 profile=260 device_type=100
397+ # device_version=1
398+ # input_clusters=[4, 5, 6]
399+ # output_clusters=[]>
400+ 2 : {
401+ PROFILE_ID : zha .PROFILE_ID ,
402+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
403+ INPUT_CLUSTERS : [
404+ Identify .cluster_id ,
405+ Groups .cluster_id ,
406+ Scenes .cluster_id ,
407+ OnOff .cluster_id ,
408+ TuyaZBE000Cluster .cluster_id ,
409+ TuyaZBExternalSwitchTypeCluster .cluster_id ,
410+ ],
411+ OUTPUT_CLUSTERS : [],
412+ },
413+ # <SimpleDescriptor endpoint=3 profile=260 device_type=100
414+ # device_version=1
415+ # input_clusters=[4, 5, 6]
416+ # output_clusters=[]>
417+ 3 : {
418+ PROFILE_ID : zha .PROFILE_ID ,
419+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
420+ INPUT_CLUSTERS : [
421+ Identify .cluster_id ,
422+ Groups .cluster_id ,
423+ Scenes .cluster_id ,
424+ OnOff .cluster_id ,
425+ TuyaZBE000Cluster .cluster_id ,
426+ TuyaZBExternalSwitchTypeCluster .cluster_id ,
427+ ],
428+ OUTPUT_CLUSTERS : [],
429+ },
430+ },
431+ }
432+
433+ replacement = {
434+ ENDPOINTS : {
435+ 1 : {
436+ PROFILE_ID : zha .PROFILE_ID ,
437+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
438+ INPUT_CLUSTERS : [
439+ Basic .cluster_id ,
440+ Identify .cluster_id ,
441+ Groups .cluster_id ,
442+ Scenes .cluster_id ,
443+ TuyaZBOnOffAttributeCluster ,
444+ TuyaZBE000Cluster ,
445+ TuyaZBExternalSwitchTypeCluster ,
446+ ],
447+ OUTPUT_CLUSTERS : [Time .cluster_id , Ota .cluster_id ],
448+ },
449+ 2 : {
450+ PROFILE_ID : zha .PROFILE_ID ,
451+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
452+ INPUT_CLUSTERS : [
453+ Identify .cluster_id ,
454+ Groups .cluster_id ,
455+ Scenes .cluster_id ,
456+ TuyaZBOnOffAttributeCluster ,
457+ TuyaZBExternalSwitchTypeCluster ,
458+ ],
459+ OUTPUT_CLUSTERS : [],
460+ },
461+ 3 : {
462+ PROFILE_ID : zha .PROFILE_ID ,
463+ DEVICE_TYPE : zha .DeviceType .ON_OFF_LIGHT ,
464+ INPUT_CLUSTERS : [
465+ Identify .cluster_id ,
466+ Groups .cluster_id ,
467+ Scenes .cluster_id ,
468+ TuyaZBOnOffAttributeCluster ,
469+ TuyaZBExternalSwitchTypeCluster ,
470+ ],
471+ OUTPUT_CLUSTERS : [],
472+ },
473+ },
474+ }
0 commit comments