mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 13:34:24 +00:00
Fix functional command. #386
This commit is contained in:
+10
-2
@@ -192,7 +192,7 @@ class Zigbee {
|
||||
|
||||
logger.info(`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep}`);
|
||||
|
||||
device[type](cid, cmd, [zclData], (error) => {
|
||||
const callback_ = (error) => {
|
||||
if (error) {
|
||||
logger.error(
|
||||
`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep} ` +
|
||||
@@ -200,7 +200,15 @@ class Zigbee {
|
||||
}
|
||||
|
||||
callback(error);
|
||||
});
|
||||
};
|
||||
|
||||
if (type === 'functional') {
|
||||
device.functional(cid, cmd, zclData, callback_);
|
||||
} else if (type === 'foundation') {
|
||||
device.foundation(cid, cmd, [zclData], callback_);
|
||||
} else {
|
||||
logger.error(`Unknown zigbee publish type ${type}`);
|
||||
}
|
||||
}
|
||||
|
||||
read(deviceID, cid, attr, ep, callback) {
|
||||
|
||||
Reference in New Issue
Block a user