Extend ping function with friendlyName logging

This commit is contained in:
tb-killa
2018-08-13 19:21:55 +02:00
committed by Koenkk
parent 08f64b96be
commit 3900d56d6e
+7 -2
View File
@@ -154,11 +154,16 @@ class Zigbee {
}
ping(deviceID) {
let friendlyName = 'unknown';
const device = this.shepherd._findDevByAddr(deviceID);
const ieeeAddr = device.ieeeAddr;
if (settings.getDevice(ieeeAddr)) {
friendlyName = settings.getDevice(ieeeAddr).friendly_name;
}
if (device) {
// Note: checkOnline has the callback argument but does not call callback
logger.debug(`Check online ${deviceID}`);
logger.debug(`Check online ${friendlyName} ${deviceID}`);
this.shepherd.controller.checkOnline(device);
}
}