mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-02 18:11:36 +00:00
Update foundation publish
This commit is contained in:
+9
-2
@@ -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} ` +
|
||||
|
||||
Reference in New Issue
Block a user