code: def connect(self):
      
      if self._connected or self.is_alive():
        raise ConnectionExistsError("Already connected")
      # After starting the thread we wait for it to post us
      # an event signifying that connection is established. This
      # ensures that the caller only resumes when we are fully connected.
      self.start()
      with self._lock:
        self._connect_cond.wait_for(lambda: self._connected)
docs: Connects to the lutron controller.