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: