Add extra is pingable logging. #775

This commit is contained in:
Koen Kanters 2019-04-07 17:47:06 +02:00
parent 61942f8411
commit 4aa5877797

View File

@ -30,15 +30,21 @@ class DeviceAvailability {
} }
isPingable(device) { isPingable(device) {
logger.debug(`Checking if ${device.ieeeAddr} is pingable`);
if (this.blacklist.includes(device.ieeeAddr)) { if (this.blacklist.includes(device.ieeeAddr)) {
logger.debug(`${device.ieeeAddr} is not pingable because of blacklist`);
return false; return false;
} }
if (pingableDevices.find((d) => d.zigbeeModel.includes(device.modelId))) { if (pingableDevices.find((d) => d.zigbeeModel.includes(device.modelId))) {
logger.debug(`${device.ieeeAddr} is pingable because in pingable devices`);
return true; return true;
} }
return utils.isRouter(device) && !utils.isBatteryPowered(device); const result = utils.isRouter(device) && !utils.isBatteryPowered(device);
logger.debug(`${device.ieeeAddr} is pingable (${result}) not router or battery powered`);
return result;
} }
getAllPingableDevices() { getAllPingableDevices() {