From 44cfd72a80e7991b7a62c77fb244455fbf44192d Mon Sep 17 00:00:00 2001 From: Derek Arnold Date: Sun, 15 Sep 2024 11:39:10 -0500 Subject: [PATCH] make sure new_index is always an int --- meshtastic/mesh_interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 48fff56..8c9679d 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -330,14 +330,14 @@ class MeshInterface: # pylint: disable=R0902 while retries_left > 0: retries_left -= 1 if not n.waitForConfig(): - new_index: int = len(n.partialChannels) + new_index: int = len(n.partialChannels) if n.partialChannels else 0 # each time we get a new channel, reset the counter if new_index != last_index: retries_left = requestChannelRetries - 1 if retries_left <= 0: our_exit(f"Error: Timed out waiting for channels, giving up") print("Timed out trying to retrieve channel info, retrying") - n.requestChannels(startingIndex=len(n.partialChannels)) + n.requestChannels(startingIndex=new_index) last_index = new_index else: break