zigbee-clusters 2.5.0 → 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.
Files changed (2) hide show
  1. package/lib/zclFrames.js +3 -1
  2. package/package.json +1 -1
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.5.0",
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",