Skip to content

Commit

Permalink
feat: Add tuyaAction command (#968)
Browse files Browse the repository at this point in the history
* New command and attribute for Tuya-based devices

* rename
  • Loading branch information
kirovilya authored Mar 10, 2024
1 parent e7cb3b1 commit b0781d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/controller/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ const CommandsLookup: {[s: string]: MessagePayloadType} = {
'action3': 'commandAction3',
'action4': 'commandAction4',
'action6': 'commandAction6',

// Tuya
'tuyaAction': 'commandTuyaAction',
};

type MessagePayloadType =
Expand All @@ -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;
Expand Down
9 changes: 8 additions & 1 deletion src/zcl/definition/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,12 @@ const Cluster: {
{name: 'offwaittime', type: DataType.uint16},
],
},
tuyaAction: {
ID: 0xFD,
parameters: [
{name: 'value', type: DataType.uint8},
],
},
},
commandsResponse: {
},
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit b0781d2

Please sign in to comment.