From b0781d2bdecdbc9fa8c68e129675722cc12d001d Mon Sep 17 00:00:00 2001 From: Ilya Kirov Date: Sun, 10 Mar 2024 21:30:15 +0300 Subject: [PATCH] feat: Add `tuyaAction` command (#968) * New command and attribute for Tuya-based devices * rename --- src/controller/events.ts | 6 +++++- src/zcl/definition/cluster.ts | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/controller/events.ts b/src/controller/events.ts index 2bdeb7640a..ee5b6ea04e 100644 --- a/src/controller/events.ts +++ b/src/controller/events.ts @@ -144,6 +144,9 @@ const CommandsLookup: {[s: string]: MessagePayloadType} = { 'action3': 'commandAction3', 'action4': 'commandAction4', 'action6': 'commandAction6', + + // Tuya + 'tuyaAction': 'commandTuyaAction', }; type MessagePayloadType = @@ -170,7 +173,8 @@ type MessagePayloadType = 'commandSiglisZigfredButtonEvent' | 'commandDanfossSetpointCommand' | 'commandZosungSendIRCode00' | 'commandZosungSendIRCode01' | 'commandZosungSendIRCode02'|'commandZosungSendIRCode04' | 'zosungSendIRCode03Resp' | 'zosungSendIRCode05Resp' | 'commandMcuGatewayConnectionStatus' | 'commandSchneiderWiserThermostatBoost' | - 'transferDataResp' | 'commandAction1' | 'commandAction2' | 'commandAction3' | 'commandAction4' | 'commandAction6'; + 'transferDataResp' | 'commandAction1' | 'commandAction2' | 'commandAction3' | 'commandAction4' | 'commandAction6' | + 'commandTuyaAction'; interface MessagePayload { type: MessagePayloadType; diff --git a/src/zcl/definition/cluster.ts b/src/zcl/definition/cluster.ts index adb28352de..07d06e9dde 100644 --- a/src/zcl/definition/cluster.ts +++ b/src/zcl/definition/cluster.ts @@ -504,6 +504,12 @@ const Cluster: { {name: 'offwaittime', type: DataType.uint16}, ], }, + tuyaAction: { + ID: 0xFD, + parameters: [ + {name: 'value', type: DataType.uint8}, + ], + }, }, commandsResponse: { }, @@ -4708,8 +4714,9 @@ const Cluster: { manuSpecificTuya_3: { ID: 0xe001, attributes: { - switchType: {ID: 0xd030, type: DataType.enum8}, powerOnBehavior: {ID: 0xd010, type: DataType.enum8}, + switchMode: {ID: 0xd020, type: DataType.enum8}, + switchType: {ID: 0xd030, type: DataType.enum8}, }, commands: { setOptions1: {