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.
- package/lib/zclFrames.js +3 -1
- 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
|
-
|
|
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}`);
|