From 998d979d714ddd48a90284568b1afe0ff82efd01 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Tue, 11 Nov 2025 13:13:06 -0800 Subject: [PATCH] batter channel assign --- mesh_bot.py | 9 +++++++-- pong_bot.py | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 0e28652..18c1a06 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -1909,10 +1909,15 @@ def onReceive(packet, interface): # check if the packet has a channel flag use it ## FIXME needs to be channel hash lookup if packet.get('channel'): channel_number = packet.get('channel') + channel_name = "unknown" try: - channel_name, _ = resolve_channel_name(channel_number, rxNode, interface) + res = resolve_channel_name(channel_number, rxNode, interface) + if res: + try: + channel_name, _ = res + except Exception: + channel_name = "unknown" except Exception as e: - channel_name = "unknown" logger.debug(f"System: channel resolution error: {e}") #debug channel info diff --git a/pong_bot.py b/pong_bot.py index 0b2d918..d77372d 100755 --- a/pong_bot.py +++ b/pong_bot.py @@ -279,10 +279,15 @@ def onReceive(packet, interface): # check if the packet has a channel flag use it ## FIXME needs to be channel hash lookup if packet.get('channel'): channel_number = packet.get('channel') + channel_name = "unknown" try: - channel_name, _ = resolve_channel_name(channel_number, rxNode, interface) + res = resolve_channel_name(channel_number, rxNode, interface) + if res: + try: + channel_name, _ = res + except Exception: + channel_name = "unknown" except Exception as e: - channel_name = "unknown" logger.debug(f"System: channel resolution error: {e}") #debug channel info