mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-17 02:48:31 -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) {
|
_acceptDevIncoming(devInfo, callback) {
|
||||||
|
logger.debug(
|
||||||
|
`Accept device incoming with ieeeAddr '${devInfo.ieeeAddr}' permit join is '${this.getPermitJoin()}'`
|
||||||
|
);
|
||||||
|
|
||||||
if (this.getPermitJoin()) {
|
if (this.getPermitJoin()) {
|
||||||
if (settings.get().ban.includes(devInfo.ieeeAddr)) {
|
if (settings.get().ban.includes(devInfo.ieeeAddr)) {
|
||||||
logger.info(`Banned device tried to connect (${devInfo.ieeeAddr})`);
|
logger.info(`Banned device tried to connect (${devInfo.ieeeAddr})`);
|
||||||
callback(null, false);
|
callback(null, false);
|
||||||
} else {
|
} else {
|
||||||
|
logger.debug(`Allowing device '${devInfo.ieeeAddr}' to join`);
|
||||||
callback(null, true);
|
callback(null, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.getAllClients().find((d) => d.ieeeAddr === devInfo.ieeeAddr)) {
|
if (this.getAllClients().find((d) => d.ieeeAddr === devInfo.ieeeAddr)) {
|
||||||
// Allow already connected devices to rejoin.
|
// Allow already connected devices to rejoin.
|
||||||
|
logger.debug(`Allowing device '${devInfo.ieeeAddr}' to join (already connected device)`);
|
||||||
callback(null, true);
|
callback(null, true);
|
||||||
} else {
|
} else {
|
||||||
|
logger.debug(`Not allowing '${devInfo.ieeeAddr}' to join`);
|
||||||
callback(null, false);
|
callback(null, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user