We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ac46214 + 15b8789 commit 3d79f01Copy full SHA for 3d79f01
Adafruit_IO/mqtt_client.py
@@ -102,9 +102,11 @@ def connect(self, **kwargs):
102
# Skip calling connect if already connected.
103
if self._connected:
104
return
105
+ # If given, use user-provided keepalive, otherwise default to KEEP_ALIVE_SEC
106
+ keepalive = kwargs.pop('keepalive', KEEP_ALIVE_SEC)
107
# Connect to the Adafruit IO MQTT service.
108
self._client.connect(self._service_host, port=self._service_port,
- keepalive=KEEP_ALIVE_SEC, **kwargs)
109
+ keepalive=keepalive, **kwargs)
110
111
def is_connected(self):
112
"""Returns True if connected to Adafruit.IO and False if not connected.
0 commit comments