diff --git a/lib/zigbeecontroller.js b/lib/zigbeecontroller.js index 0de3be55..e6d0a3bd 100644 --- a/lib/zigbeecontroller.js +++ b/lib/zigbeecontroller.js @@ -390,7 +390,7 @@ class ZigbeeController extends EventEmitter { getDevice(key) { try { return this.herdsman.getDeviceByIeeeAddr(key); - } + } catch { return undefined; } @@ -399,7 +399,7 @@ class ZigbeeController extends EventEmitter { getDevicesByType(type) { try { return this.herdsman.getDevicesByType(type); - } + } catch { return undefined; } @@ -408,7 +408,7 @@ class ZigbeeController extends EventEmitter { getDeviceByNetworkAddress(networkAddress) { try { return this.herdsman.getDeviceByNetworkAddress(networkAddress); - } + } catch { return undefined; } @@ -480,7 +480,7 @@ class ZigbeeController extends EventEmitter { name: key.type === 'Coordinator' ? 'Coordinator' : key.ieeeAddr, }; } - } + } catch { return undefined; } @@ -488,7 +488,7 @@ class ZigbeeController extends EventEmitter { } async incMsgHandler(message) { - try { + try { this.debug('incoming msg', message); const device = await this.herdsman.getDeviceByIeeeAddr(message.srcaddr); if (!device) { @@ -503,7 +503,7 @@ class ZigbeeController extends EventEmitter { this.event('msg', device.ieeeAddr, message, { modelId: device.modelId }); - } + } catch { return; } @@ -883,7 +883,7 @@ class ZigbeeController extends EventEmitter { callback && callback(undefined, result); } } - catch (error) + catch (error) { this.log.error(`error sending ${type} ${cmd} to endpoint: ${(error && error.message ? error.message : 'no error message')} ${(error && error.stack ? error.stack : 'no call stack')}`) } diff --git a/main.js b/main.js index 721452f1..a1c9700c 100644 --- a/main.js +++ b/main.js @@ -629,10 +629,10 @@ class Zigbee extends utils.Adapter { let isGroup = false; const has_elevated_debug = this.stController.checkDebugDevice(deviceId) - if (has_elevated_debug) - { - let stateNames = []; - stateList.forEach( state => stateNames.push(state.id)); + if (has_elevated_debug) + { + const stateNames = []; + stateList.forEach( state => stateNames.push(state.id)); this.log.warn(`ELEVATED O03: Publishing to ${deviceId} of model ${model} ${stateNames.join(', ')}`); } else @@ -704,7 +704,7 @@ class Zigbee extends utils.Adapter { if (has_elevated_debug) { this.log.warn(`ELEVATED OE02.1 Failed to read state '${JSON.stringify(ckey)}'of '${entity.device.ieeeAddr}/${entity.device.endpoints[0].ID}' from query with '${error && error.message ? error.message : 'no error message'}`); } - else + else this.log.info(`failed to read state ${JSON.stringify(ckey)} of ${entity.device.ieeeAddr}/${entity.device.endpoints[0].ID} after device query`); } } @@ -712,7 +712,7 @@ class Zigbee extends utils.Adapter { } if (has_elevated_debug) this.log.warn(`ELEVATED O07: Device query for '${entity.device.ieeeAddr}/${entity.device.endpoints[0].ID}' complete`); - else + else this.log.info(`Device query for '${entity.device.ieeeAddr}/${entity.device.endpoints[0].ID}' complete`); const idToRemove = deviceId;