code: def disconnect(self):
          
          self.logger.debug('Close connection...')
  
          self.auto_reconnect = False
  
          if self.websocket is not None:
              self.websocket.close()
docs: Closes the connection.