From f03ade277579f2a6d4e7b6007eef794a68084d2a Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 25 Jun 2018 20:18:39 +0200 Subject: [PATCH] Don't log 'Connecting with device' when device is already known. --- lib/controller.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/controller.js b/lib/controller.js index e0fb7de0..0a45692a 100644 --- a/lib/controller.js +++ b/lib/controller.js @@ -209,11 +209,12 @@ class Controller { this.softResetTimeout(true); logger.debug('Recieved zigbee message with data', JSON.stringify(message.data)); - - if (message.type == 'devInterview') { + if (message.type == 'devInterview' && !settings.getDevice(message.data)) { logger.info('Connecting with device...'); this.mqtt.log('pairing', 'connecting with device'); - } else if (message.type == 'devIncoming') { + } + + if (message.type == 'devIncoming') { logger.info('Device incoming...'); this.mqtt.log('pairing', 'device incoming'); }