Skip to content

Commit 52f8e82

Browse files
committed
_getAdminChannelIndex can get the index of the admin channel regardless of case.
1 parent 6dcdf7f commit 52f8e82

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

meshtastic/node.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,10 @@ def getDisabledChannel(self):
266266

267267
def _getAdminChannelIndex(self):
268268
"""Return the channel number of the admin channel, or 0 if no reserved channel"""
269-
c = self.getChannelByName("admin")
270-
if c:
271-
return c.index
272-
else:
273-
return 0
269+
for c in self.channels or []:
270+
if c.settings and c.settings.name.lower() == "admin":
271+
return c.index
272+
return 0
274273

275274
def setOwner(self, long_name=None, short_name=None, is_licensed=False):
276275
"""Set device owner name"""

0 commit comments

Comments
 (0)