Skip to content

Commit 87bf385

Browse files
author
brentru
committed
add reconnect
1 parent 8200a0d commit 87bf385

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

adafruit_gc_iot_core.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ def disconnect(self):
128128
# De-initialize MiniMQTT Client
129129
self._client.deinit()
130130

131+
def reconnect(self):
132+
"""Reconnects to the Google MQTT Broker.
133+
"""
134+
try:
135+
self._client.reconnect()
136+
except:
137+
raise MQTT_API_ERROR("Error reconnecting to Google MQTT.")
138+
131139
def connect(self):
132140
"""Connects to the Google MQTT Broker.
133141
"""

0 commit comments

Comments
 (0)