message: [fix] Write configuration on scan complete and before close if saveConfiguration is enabled
diff: @@ -509,6 +509,10 @@ function scanComplete () {
  nodes[i].neighborns = this.client.getNodeNeighbors(nodes[i].node_id)
  }
  + if (this.cfg.saveConfig && typeof this.client.writeConfig === 'function') {
  + this.client.writeConfig()
  + }
  +
  debug('Network scan complete. Found:', nodes.length, 'nodes')
  }
  @@ -689,6 +693,9 @@ ZwaveClient.prototype.close = function () {
  }
  if (this.connected && this.client) {
  + if (this.cfg.saveConfig && typeof this.client.writeConfig === 'function') {
  + this.client.writeConfig()
  + }
  this.connected = false
  this.closed = true
  this.client.removeAllListeners()
  