diff --git a/lib/zigbee.js b/lib/zigbee.js index 7c2ffb455..3ba4c1a65 100644 --- a/lib/zigbee.js +++ b/lib/zigbee.js @@ -191,15 +191,8 @@ class Zigbee { } logger.info(`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep}`); - - 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) => { + + device[type](cid, cmd, [zclData], (error) => { if (error) { logger.error( `Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep} ` +