mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-16 18:39:09 -07:00
Add extra acceptDevIncoming logging. #538
This commit is contained in:
parent
91bc56a09f
commit
2f52b851a9
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user