From 4aa5877797f116f9cc07594c20c6db36ba72aebe Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 7 Apr 2019 17:47:06 +0200 Subject: [PATCH] Add extra is pingable logging. #775 --- lib/extension/deviceAvailability.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/extension/deviceAvailability.js b/lib/extension/deviceAvailability.js index 34d9e43d..5816de5c 100644 --- a/lib/extension/deviceAvailability.js +++ b/lib/extension/deviceAvailability.js @@ -30,15 +30,21 @@ class DeviceAvailability { } isPingable(device) { + logger.debug(`Checking if ${device.ieeeAddr} is pingable`); + if (this.blacklist.includes(device.ieeeAddr)) { + logger.debug(`${device.ieeeAddr} is not pingable because of blacklist`); return false; } if (pingableDevices.find((d) => d.zigbeeModel.includes(device.modelId))) { + logger.debug(`${device.ieeeAddr} is pingable because in pingable devices`); 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() {