Skip to content

Commit 76f8c28

Browse files
authored
Merge pull request #228 from FoamyGuy/timeout_fix
timout 1 instead of 0
2 parents 62abc1a + 1d5a1e3 commit 76f8c28

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_minimqtt/adafruit_minimqtt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ def reconnect(self, resub_topics: bool = True) -> int:
921921

922922
return ret
923923

924-
def loop(self, timeout: float = 0) -> Optional[list[int]]:
924+
def loop(self, timeout: float = 1.0) -> Optional[list[int]]:
925925
"""Non-blocking message loop. Use this method to check for incoming messages.
926926
Returns list of packet types of any messages received or None.
927927
@@ -930,8 +930,8 @@ def loop(self, timeout: float = 0) -> Optional[list[int]]:
930930
"""
931931
if timeout < self._socket_timeout:
932932
raise MMQTTException(
933-
f"loop timeout ({timeout}) must be bigger "
934-
+ f"than socket timeout ({self._socket_timeout}))"
933+
f"loop timeout ({timeout}) must be >= "
934+
+ f"socket timeout ({self._socket_timeout}))"
935935
)
936936

937937
self._connected()

0 commit comments

Comments
 (0)