zigbee-clusters 2.2.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +4 -0
- package/lib/Cluster.js +15 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -272,6 +272,10 @@ interface ColorControlCluster extends ZCLNodeCluster {
|
|
|
272
272
|
}): Promise<void>;
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
+
interface MeteringCluster extends ZCLNodeCluster {}
|
|
276
|
+
|
|
277
|
+
interface ElectricalMeasurementCluster extends ZCLNodeCluster {}
|
|
278
|
+
|
|
275
279
|
type ZCLNodeEndpoint = {
|
|
276
280
|
clusters: {
|
|
277
281
|
onOff?: OnOffCluster;
|
package/lib/Cluster.js
CHANGED
|
@@ -1087,6 +1087,21 @@ class Cluster extends EventEmitter {
|
|
|
1087
1087
|
return this.sendFrame(payload);
|
|
1088
1088
|
}
|
|
1089
1089
|
|
|
1090
|
+
// This is a workaround for nodes that send a default response, even if they are sending
|
|
1091
|
+
// another response message (this is not allowed by zigbee cluster spec §2.5.12.2).
|
|
1092
|
+
// The option sets the 'Disable Default Response' flag in the ZCL header,
|
|
1093
|
+
// causing the node to only send a default response if an error occurred.
|
|
1094
|
+
// A normal response from the node is still required to resolve this cluster command.
|
|
1095
|
+
if (opts.disableDefaultResponse) {
|
|
1096
|
+
if (!Array.isArray(payload.frameControl)) {
|
|
1097
|
+
// Need to add the 'clusterSpecific' flag here,
|
|
1098
|
+
// because it is not added by 'sendFrame' if the frameControl flags are present.
|
|
1099
|
+
payload.frameControl = ['clusterSpecific', 'disableDefaultResponse'];
|
|
1100
|
+
} else if (!payload.frameControl.includes('disableDefaultResponse')) {
|
|
1101
|
+
payload.frameControl.push('disableDefaultResponse');
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1090
1105
|
if (opts.waitForResponse === false) {
|
|
1091
1106
|
return this.sendFrame(payload);
|
|
1092
1107
|
}
|