code: def connect(self):
          
          self._connect()
          logger.debug('Connected to Deluge, detecting daemon version')
          self._detect_deluge_version()
          logger.debug('Daemon version {} detected, logging in'.format(self.deluge_version))
          if self.deluge_version == 2:
              result = self.call('daemon.login', self.username, self.password, client_version='deluge-client')
          else:
              result = self.call('daemon.login', self.username, self.password)
          logger.debug('Logged in with value %r' % result)
          self.connected = True
docs: Connects to the Deluge instance