Update foundation publish

This commit is contained in:
Koen Kanters
2018-09-14 08:31:11 +02:00
committed by GitHub
parent 469a01ebb6
commit f916ec5f4c
+9 -2
View File
@@ -191,8 +191,15 @@ class Zigbee {
}
logger.info(`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep}`);
device[type](cid, cmd, [zclData], (error) => {
let func = null;
if (type === 'foundation') {
func = (cb) => device.foundation(cid, cmd, [zclData], cb);
} else if (type === 'functional') {
func = (cb) => device.functional(cid, cmd, zclData, cb);
}
func((error) => {
if (error) {
logger.error(
`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep} ` +