This commit is contained in:
Koen Kanters
2019-02-16 19:40:34 +01:00
parent 577bb0d12c
commit b08bf33ccf
+12
View File
@@ -14,6 +14,7 @@ class BridgeConfig {
// Bind functions
this.permitJoin = this.permitJoin.bind(this);
this.reset = this.reset.bind(this);
this.logLevel = this.logLevel.bind(this);
this.devices = this.devices.bind(this);
this.rename = this.rename.bind(this);
@@ -23,6 +24,7 @@ class BridgeConfig {
// Set supported options
this.supportedOptions = {
'permit_join': this.permitJoin,
'reset': this.reset,
'log_level': this.logLevel,
'devices': this.devices,
'rename': this.rename,
@@ -35,6 +37,16 @@ class BridgeConfig {
this.zigbee.permitJoin(message.toString().toLowerCase() === 'true', () => this.publish());
}
reset(topic, message) {
this.zigbee.softReset((error) => {
if (error) {
logger.error('Soft reset failed');
} else {
logger.info('Soft resetted ZNP');
}
});
}
logLevel(topic, message) {
const level = message.toString().toLowerCase();
if (allowedLogLevels.includes(level)) {