Skip to content

Commit 25b344a

Browse files
authored
Merge pull request #5 from brentru/fix-connack-exception
Fix CONNACK IndexError
2 parents 801b3a3 + 075d0ac commit 25b344a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_minimqtt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def connect(self, clean_session=True):
279279
rc = self._sock.read(3)
280280
assert rc[0] == 0x02
281281
if rc[2] != 0x00:
282-
raise MMQTTException(CONNACK_ERRORS[rc[3]])
282+
raise MMQTTException(CONNACK_ERRORS[rc[2]])
283283
self._is_connected = True
284284
result = rc[0] & 1
285285
if self.on_connect is not None:

0 commit comments

Comments
 (0)