Log error when zigbee command fails. #254

This commit is contained in:
Koenkk
2018-08-13 19:21:55 +02:00
parent 07d8fd5605
commit 502c0cb852
+9 -1
View File
@@ -185,7 +185,15 @@ class Zigbee {
}
logger.info(`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep}`);
device.functional(cid, cmd, zclData, callback);
device.functional(cid, cmd, zclData, (error) => {
if (error) {
logger.error(
`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep} ` +
`failed with error ${error}`);
}
callback(error);
});
}
read(deviceID, cid, attr, ep, callback) {