From a46ddedf9ee908c623c2b18bee3e0ddcc616da6b Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Tue, 18 Jun 2024 23:08:20 -0700 Subject: [PATCH] Update mesh-bot.py --- mesh-bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesh-bot.py b/mesh-bot.py index d0edb2d..29c0027 100644 --- a/mesh-bot.py +++ b/mesh-bot.py @@ -111,12 +111,14 @@ def onReceive(packet, interface): # check if the packet has a hop count flag use it if packet.get('hopsAway'): hop_away = packet['hopsAway'] + else: + hop_away = 0 # set hop to Direct if the message was sent directly otherwise set the hop count if hop_start == hop_limit: hop = "Direct" else: - if hop_away: + if hop_away > 0: hop_count = hop_away print (f"Using hopsAway: {hop_count}") else: