mirror of
https://github.com/meshtastic/python.git
synced 2026-01-15 19:28:05 -05:00
stop fetching channels once we reach disabled
This commit is contained in:
@@ -455,13 +455,17 @@ class MeshInterface:
|
||||
"""
|
||||
p = admin_pb2.AdminMessage()
|
||||
p.get_channel_request = channelNum + 1
|
||||
logging.debug(f"Requesting channel {channelNum}")
|
||||
|
||||
def onResponse(p):
|
||||
"""A closure to handle the response packet"""
|
||||
c = p["decoded"]["admin"]["raw"].get_channel_response
|
||||
self.partialChannels.append(c)
|
||||
if channelNum >= self.myInfo.max_channels - 1:
|
||||
# Done with all channels
|
||||
logging.debug(f"Received channel {c}")
|
||||
# for stress testing, download all channels
|
||||
# if channelNum >= self.myInfo.max_channels - 1:
|
||||
if c.role == channel_pb2.Channel.Role.DISABLED or channelNum >= self.myInfo.max_channels - 1:
|
||||
# Once we see a response that has NO settings, assume we are at the end of channels and stop fetching
|
||||
self.channels = self.partialChannels
|
||||
# FIXME, the following should only be called after we have settings and channels
|
||||
self._connected() # Tell everone else we are ready to go
|
||||
|
||||
4
setup.py
4
setup.py
@@ -12,11 +12,7 @@ with open("README.md", "r") as fh:
|
||||
# This call to setup() does all the work
|
||||
setup(
|
||||
name="meshtastic",
|
||||
<<<<<<< HEAD
|
||||
version="1.2.00",
|
||||
=======
|
||||
version="1.1.50",
|
||||
>>>>>>> dev
|
||||
description="Python API & client shell for talking to Meshtastic devices",
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/markdown",
|
||||
|
||||
Reference in New Issue
Block a user