zigbee-clusters 2.4.2 → 2.5.1

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 CHANGED
@@ -173,6 +173,12 @@ interface ZCLNodeCluster extends EventEmitter {
173
173
  discoverAttributesExtended(): Promise<any[]>;
174
174
  }
175
175
 
176
+ interface BasicCluster extends ZCLNodeCluster {
177
+ factoryReset(): Promise<void>;
178
+ }
179
+
180
+ interface PowerConfigurationCluster extends ZCLNodeCluster {}
181
+
176
182
  interface OnOffCluster extends ZCLNodeCluster {
177
183
  setOn(): Promise<void>;
178
184
  setOff(): Promise<void>;
@@ -309,7 +315,9 @@ declare module "zigbee-clusters" {
309
315
  [key: string]: { ID: number; NAME: string; ATTRIBUTES: any; COMMANDS: any };
310
316
  };
311
317
  export var ZCLNodeCluster;
318
+ export var BasicCluster;
312
319
  export var OnOffCluster;
313
320
  export var LevelControlCluster;
314
321
  export var ColorControlCluster;
322
+ export var PowerConfigurationCluster;
315
323
  }
package/lib/zclFrames.js CHANGED
@@ -60,7 +60,9 @@ const ZCLAttributeDataRecord = (withStatus, attributes) => new ZCLDataType(NaN,
60
60
  const dataTypeId = ZCLDataTypes.uint8.fromBuffer(buf, i);
61
61
  i += ZCLDataTypes.uint8.length;
62
62
 
63
- const DataType = attributes[res.id]
63
+ // don't use the attribute's type if the type in the data is 0 (noData).
64
+ // This breaks when the attribute ID is 0
65
+ const DataType = attributes[res.id] && dataTypeId !== 0
64
66
  ? attributes[res.id].type
65
67
  : Object.values(ZCLDataTypes).find(type => type && type.id === dataTypeId);
66
68
  if (!DataType) throw new TypeError(`Invalid Type for Attribute: ${res.id}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-clusters",
3
- "version": "2.4.2",
3
+ "version": "2.5.1",
4
4
  "description": "Zigbee Cluster Library for Node.js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",