diff --git a/lib/zigbee.js b/lib/zigbee.js index 718d5c6062..e93279685f 100644 --- a/lib/zigbee.js +++ b/lib/zigbee.js @@ -99,18 +99,25 @@ class Zigbee { } _acceptDevIncoming(devInfo, callback) { + logger.debug( + `Accept device incoming with ieeeAddr '${devInfo.ieeeAddr}' permit join is '${this.getPermitJoin()}'` + ); + if (this.getPermitJoin()) { if (settings.get().ban.includes(devInfo.ieeeAddr)) { logger.info(`Banned device tried to connect (${devInfo.ieeeAddr})`); callback(null, false); } else { + logger.debug(`Allowing device '${devInfo.ieeeAddr}' to join`); callback(null, true); } } else { if (this.getAllClients().find((d) => d.ieeeAddr === devInfo.ieeeAddr)) { // Allow already connected devices to rejoin. + logger.debug(`Allowing device '${devInfo.ieeeAddr}' to join (already connected device)`); callback(null, true); } else { + logger.debug(`Not allowing '${devInfo.ieeeAddr}' to join`); callback(null, false); } }