Skip to content

Commit

Permalink
Merge pull request #228 from FoamyGuy/timeout_fix
Browse files Browse the repository at this point in the history
timout 1 instead of 0
  • Loading branch information
FoamyGuy authored Nov 25, 2024
2 parents 62abc1a + 1d5a1e3 commit 76f8c28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adafruit_minimqtt/adafruit_minimqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ def reconnect(self, resub_topics: bool = True) -> int:

return ret

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

self._connected()
Expand Down

0 comments on commit 76f8c28

Please sign in to comment.