From df6a1cfb668c264d93b67ae04100bb87f14c6894 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sun, 17 Aug 2025 20:25:40 -0700 Subject: [PATCH] Update pong_bot.py better MQTT handler --- pong_bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pong_bot.py b/pong_bot.py index a703a7f..7faafc3 100755 --- a/pong_bot.py +++ b/pong_bot.py @@ -254,6 +254,7 @@ def onReceive(packet, interface): if 'decoded' in packet and packet['decoded']['portnum'] == 'TEXT_MESSAGE_APP': message_bytes = packet['decoded']['payload'] message_string = message_bytes.decode('utf-8') + via_mqtt = packet['decoded'].get('viaMqtt', False) # check if the packet is from us if message_from_id == myNodeNum1 or message_from_id == myNodeNum2: @@ -286,7 +287,7 @@ def onReceive(packet, interface): if hop_start == hop_limit: hop = "Direct" hop_count = 0 - elif hop_start == 0 and hop_limit > 0: + elif hop_start == 0 and hop_limit > 0 or via_mqtt: hop = "MQTT" hop_count = 0 else: