code: def connect(self, host="localhost", port=1883, keepalive=60):
          
          # Disconnect first (it also stops the timer)
          self.disconnect()
  
          # Prepare the connection
          self.__mqtt.connect(host, port, keepalive)
  
          # Start the MQTT loop
          self.__mqtt.loop_start()
docs: Connects to the MQTT server. The client will automatically try to
          reconnect to this server when the connection is lost.
  
          :param host: MQTT server host
          :param port: MQTT server port
          :param keepalive: Maximum period in seconds between communications with
                            the broker
          :raise ValueError: Invalid host or port