Log and publish friendly_name on deviceLeave. https://github.com/Koenkk/zigbee2mqtt/issues/7725

This commit is contained in:
Koen Kanters
2021-06-08 15:58:10 +02:00
parent 000884b080
commit fa8593c898
3 changed files with 10 additions and 3 deletions
+3 -1
View File
@@ -266,7 +266,9 @@ class Controller {
} else {
/* istanbul ignore else */
if (type === 'deviceLeave') {
logger.warn(`Device '${name || data.ieeeAddr}' left the network`);
const settingsDevice = settings.getDevice(data.ieeeAddr);
logger.warn(`Device '${settingsDevice ? settingsDevice.friendlyName : data.ieeeAddr}' ` +
`left the network`);
this.state.remove(data.ieeeAddr);
}
}