mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 05:24:29 +00:00
Extend ping function with friendlyName logging
This commit is contained in:
+7
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user