disconnect() {
    if (!this._connected) {
      return;
    }

    debug('Disconnect');

    this._connected = false;
    this.device.parser.cipher.setSessionKey(null);

    // Clear timeouts
    clearInterval(this._pingPongInterval);
    clearTimeout(this._pingPongTimeout);

    if (this.client) {
      this.client.destroy();
    }

    /**
     * Emitted when a socket is disconnected
     * from device. Not an exclusive event:
     * `error` and `disconnected` may be emitted
     * at the same time if, for example, the device
     * goes off the network.
     * @event TuyaDevice#disconnected
     */
    this.emit('disconnected');
  }
Disconnects from the device, use to
close the socket and exit gracefully.