mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-18 06:36:13 +00:00
Fix Lint error
This commit is contained in:
+17
-17
@@ -191,27 +191,27 @@ class Zigbee {
|
||||
}
|
||||
|
||||
logger.info(`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep}`);
|
||||
if(zclData['foudation']!==true){
|
||||
device.functional(cid, cmd, zclData, (error) => {
|
||||
if (error) {
|
||||
logger.error(
|
||||
`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep} ` +
|
||||
`failed with error ${error}`);
|
||||
}
|
||||
if (zclData['foudation']!==true) {
|
||||
device.functional(cid, cmd, zclData, (error) => {
|
||||
if (error) {
|
||||
logger.error(
|
||||
`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep} ` +
|
||||
`failed with error ${error}`);
|
||||
}
|
||||
|
||||
callback(error);
|
||||
callback(error);
|
||||
});
|
||||
}else{ // use foundation command
|
||||
device.foundation(cid, cmd, [{ attrId: zclData['attrId'], dataType:zclData['dataType'], attrData:zclData['attrData'] }, ], function (error, rsp) {
|
||||
if (error){
|
||||
logger.error(
|
||||
`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep} ` +
|
||||
`failed with error ${error}, respond ${rsp}`);
|
||||
} else { // use foundation command
|
||||
device.foundation(cid, cmd, [{attrId: zclData['attrId'], dataType: zclData['dataType'],
|
||||
attrData: zclData['attrData']}], function(error, rsp) {
|
||||
if (error) {
|
||||
logger.error(
|
||||
`Zigbee publish to '${deviceID}', ${cid} - ${cmd} - ${JSON.stringify(zclData)} - ${ep} ` +
|
||||
`failed with error ${error}, respond ${rsp}`);
|
||||
}
|
||||
callback(error);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
read(deviceID, cid, attr, ep, callback) {
|
||||
|
||||
Reference in New Issue
Block a user