message: fix: detect driver failed and restart
  * fix: detect driver failed and restart
  Fixes
  * fix: error check
  * fix: emit event before destroy
diff: @@ -318,8 +318,11 @@ class ZwaveClient extends EventEmitter {
  /**
  * Method used to close client connection, use this before destroy
  + *
  + * @param {boolean} keepListeners Prevents to remove all ZwaveCLient listeners (used when restarting)
  + * @memberof ZwaveClient
  */
  - async close () {
  + async close (keepListeners) {
  this.status = ZWAVE_STATUS.closed
  this.closed = true
  @@ -363,10 +366,13 @@ class ZwaveClient extends EventEmitter {
  if (this.driver) {
  this.driverReady = false
  - this.removeAllListeners()
  await this.driver.destroy()
  }
  + if (!keepListeners) {
  + this.removeAllListeners()
  + }
  +
  logger.info('Client closed')
  }
  @@ -1750,12 +1756,22 @@ class ZwaveClient extends EventEmitter {
  logger.info(`Scanning network with homeid: ${homeHex}`)
  }
  - _onDriverError (error) {
  + async _onDriverError (error) {
  this.error = 'Driver: ' + error.message
  this.status = ZWAVE_STATUS.driverFailed
  this._updateControllerStatus(this.error)
  -
  this.emit('event', eventEmitter.driver, 'driver error', error)
  +
  + if (error.code === ZWaveErrorCodes.Driver_Failed) {
  + // this cannot be recovered by zwave-js, requires a manual restart
  + try {
  + await this.close(true)
  + this.closed = false
  + await this.connect()
  + } catch (error) {
  + logger.error(`Error while restarting driver: ${error.message}`)
  + }
  + }
  }
  _onScanComplete () {
  