mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-17 02:48:31 -07:00
Merge pull request #355 from dzungpv/dev
Support Foundation Command for use in zigbee-shepherd converter
This commit is contained in:
commit
f0f2dc847b
@ -541,7 +541,7 @@ class Controller {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.zigbee.publish(deviceID, message.cid, message.cmd, message.zclData, ep, callback);
|
this.zigbee.publish(deviceID, message.cid, message.cmd, message.zclData, ep, message.type, callback);
|
||||||
|
|
||||||
published.push({message: message, converter: converter});
|
published.push({message: message, converter: converter});
|
||||||
});
|
});
|
||||||
|
@ -183,7 +183,7 @@ class Zigbee {
|
|||||||
return this.shepherd.find(device.ieeeAddr, 1);
|
return this.shepherd.find(device.ieeeAddr, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
publish(deviceID, cid, cmd, zclData, ep, callback) {
|
publish(deviceID, cid, cmd, zclData, ep, type, callback) {
|
||||||
const device = this._findDevice(deviceID, ep);
|
const device = this._findDevice(deviceID, ep);
|
||||||
if (!device) {
|
if (!device) {
|
||||||
logger.error(`Zigbee cannot publish message to device because '${deviceID}' not known by zigbee-shepherd`);
|
logger.error(`Zigbee cannot publish message to device because '${deviceID}' not known by zigbee-shepherd`);
|
||||||
@ -191,7 +191,8 @@ class Zigbee {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logger.info(`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep}`);
|
logger.info(`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep}`);
|
||||||
device.functional(cid, cmd, zclData, (error) => {
|
|
||||||
|
device[type](cid, cmd, zclData, (error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
logger.error(
|
logger.error(
|
||||||
`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep} ` +
|
`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep} ` +
|
||||||
|
Loading…
Reference in New Issue
Block a user