From 3ec6d2c53cfa763004b621fc83cbb2c0b4524546 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 22 Nov 2024 13:16:16 -0600 Subject: [PATCH 1/3] timout 1 instead of 0 --- adafruit_minimqtt/adafruit_minimqtt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_minimqtt/adafruit_minimqtt.py b/adafruit_minimqtt/adafruit_minimqtt.py index feedf19..6b1e5de 100644 --- a/adafruit_minimqtt/adafruit_minimqtt.py +++ b/adafruit_minimqtt/adafruit_minimqtt.py @@ -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. From c09644d78c64ffb0cf23e4e77b36c0c95fe36271 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 25 Nov 2024 08:56:34 -0600 Subject: [PATCH 2/3] update timeout message --- adafruit_minimqtt/adafruit_minimqtt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_minimqtt/adafruit_minimqtt.py b/adafruit_minimqtt/adafruit_minimqtt.py index 6b1e5de..cdd0aca 100644 --- a/adafruit_minimqtt/adafruit_minimqtt.py +++ b/adafruit_minimqtt/adafruit_minimqtt.py @@ -930,7 +930,7 @@ def loop(self, timeout: float = 1.0) -> Optional[list[int]]: """ if timeout < self._socket_timeout: raise MMQTTException( - f"loop timeout ({timeout}) must be bigger " + f"loop timeout ({timeout}) must be >= " + f"than socket timeout ({self._socket_timeout}))" ) From 1d5a1e30a3e69358ffb1d9ca29ff5e66a67cede7 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 25 Nov 2024 10:08:04 -0500 Subject: [PATCH 3/3] fix grammar in error msg --- adafruit_minimqtt/adafruit_minimqtt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_minimqtt/adafruit_minimqtt.py b/adafruit_minimqtt/adafruit_minimqtt.py index cdd0aca..09f7662 100644 --- a/adafruit_minimqtt/adafruit_minimqtt.py +++ b/adafruit_minimqtt/adafruit_minimqtt.py @@ -931,7 +931,7 @@ def loop(self, timeout: float = 1.0) -> Optional[list[int]]: if timeout < self._socket_timeout: raise MMQTTException( f"loop timeout ({timeout}) must be >= " - + f"than socket timeout ({self._socket_timeout}))" + + f"socket timeout ({self._socket_timeout}))" ) self._connected()