diff --git a/micropython/umqtt.simple/manifest.py b/micropython/umqtt.simple/manifest.py index b418995c..45f9edfb 100644 --- a/micropython/umqtt.simple/manifest.py +++ b/micropython/umqtt.simple/manifest.py @@ -1,4 +1,4 @@ -metadata(description="Lightweight MQTT client for MicroPython.", version="1.4.0") +metadata(description="Lightweight MQTT client for MicroPython.", version="1.5.0") # Originally written by Paul Sokolovsky. diff --git a/micropython/umqtt.simple/umqtt/simple.py b/micropython/umqtt.simple/umqtt/simple.py index 6da38e44..2a5b9165 100644 --- a/micropython/umqtt.simple/umqtt/simple.py +++ b/micropython/umqtt.simple/umqtt/simple.py @@ -60,8 +60,9 @@ class MQTTClient: self.lw_qos = qos self.lw_retain = retain - def connect(self, clean_session=True): + def connect(self, clean_session=True, timeout=None): self.sock = socket.socket() + self.sock.settimeout(timeout) addr = socket.getaddrinfo(self.server, self.port)[0][-1] self.sock.connect(addr) if self.ssl: