Skip to content

Commit

Permalink
Merge pull request #135 from athombv/master
Browse files Browse the repository at this point in the history
Merge master into production (#minor)
  • Loading branch information
RobinBol authored Nov 10, 2023
2 parents 88ffc5c + fb796fc commit 35068ff
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/Cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,21 @@ class Cluster extends EventEmitter {
return this.sendFrame(payload);
}

// This is a workaround for nodes that send a default response, even if they are sending
// another response message (this is not allowed by zigbee cluster spec §2.5.12.2).
// The option sets the 'Disable Default Response' flag in the ZCL header,
// causing the node to only send a default response if an error occurred.
// A normal response from the node is still required to resolve this cluster command.
if (opts.disableDefaultResponse) {
if (!Array.isArray(payload.frameControl)) {
// Need to add the 'clusterSpecific' flag here,
// because it is not added by 'sendFrame' if the frameControl flags are present.
payload.frameControl = ['clusterSpecific', 'disableDefaultResponse'];
} else if (!payload.frameControl.includes('disableDefaultResponse')) {
payload.frameControl.push('disableDefaultResponse');
}
}

if (opts.waitForResponse === false) {
return this.sendFrame(payload);
}
Expand Down

0 comments on commit 35068ff

Please sign in to comment.