Added MQTT logging to TouchLink Reset process (#3053)

* MQTT logging for TouchLink reset process

* Changed status to be in meta

* Update bridgeConfig.js

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
This commit is contained in:
Magnus Pernemark 2020-03-03 18:22:28 +01:00 committed by GitHub
parent dc8b6c5294
commit 2454136b9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -371,12 +371,15 @@ class BridgeConfig extends BaseExtension {
async touchlinkFactoryReset() {
logger.info('Starting touchlink factory reset...');
this.mqtt.log('touchlink', 'reset_started', {status: 'started'});
const result = await this.zigbee.touchlinkFactoryReset();
if (result) {
logger.info('Successfully factory reset device through Touchlink');
this.mqtt.log('touchlink', 'reset_success', {status: 'success'});
} else {
logger.warn('Failed to factory reset device through Touchlink');
this.mqtt.log('touchlink', 'reset_failed', {status: 'failed'});
}
}
}