message: feat: allow custom ZwaveOptions
diff: @@ -1281,21 +1281,23 @@ ZwaveClient.prototype.connect = async function () {
  // this could happen when the driver fails the connect and a reconnect timeout triggers
  if (this.closed) return
  - let networkKey
  + // extend options with hidden `options`
  + const zwaveOptions = Object.assign({
  + cacheDir: storeDir,
  + networkKey: this.cfg.networkKey
  + }, this.cfg.options)
  - if (this.cfg.networkKey && this.cfg.networkKey.length === 32) {
  - networkKey = Buffer.from(this.cfg.networkKey, 'hex')
  + // transform network key to buffer
  + if (zwaveOptions.networkKey && zwaveOptions.networkKey.length === 32) {
  + zwaveOptions.networkKey = Buffer.from(zwaveOptions.networkKey, 'hex')
  } else {
  - networkKey = undefined
  + delete zwaveOptions.networkKey
  }
  try {
  // init driver here because if connect fails the driver is destroyed
  // this could throw so include in the try/catch
  - this.driver = new Driver(this.cfg.port, {
  - cacheDir: storeDir,
  - networkKey: networkKey
  - })
  + this.driver = new Driver(this.cfg.port, zwaveOptions)
  this.driver.on('error', driverError.bind(this))
  this.driver.once('driver ready', driverReady.bind(this))
  