From f0e8b2c05762cbd9515cd6f9886a304aedb44550 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Tue, 2 Sep 2025 11:19:23 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mesh_bot.py | 4 ++-- modules/locationdata.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 784a7e3..dfd14d9 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -1158,11 +1158,11 @@ def onReceive(packet, interface): if msg: # wait a responseDelay to avoid message collision from lora-ack. time.sleep(responseDelay) - logger.info(f"System: BBS DM Found: {msg[1]} For: {get_name_from_number(message_from_id, 'long', rxNode)}") + logger.info(f"System: BBS DM Delivery: {msg[1]} For: {get_name_from_number(message_from_id, 'long', rxNode)}") message = "Mail: " + msg[1] + " From: " + get_name_from_number(msg[2], 'long', rxNode) bbs_delete_dm(msg[0], msg[1]) send_message(message, channel_number, message_from_id, rxNode) - + # handle TEXT_MESSAGE_APP try: if 'decoded' in packet and packet['decoded']['portnum'] == 'TEXT_MESSAGE_APP': diff --git a/modules/locationdata.py b/modules/locationdata.py index 0483168..0fd1535 100644 --- a/modules/locationdata.py +++ b/modules/locationdata.py @@ -782,17 +782,17 @@ def checkUSGSEarthQuake(lat=0, lon=0): quake_data = requests.get(USGSquake_url, timeout=urlTimeoutSeconds) if not quake_data.ok: logger.warning("Location:Error fetching earthquake data from USGS") - quake_count = 0 + return NO_ALERTS if not quake_data.text.strip(): - quake_count = 0 + return NO_ALERTS try: quake_xml = xml.dom.minidom.parseString(quake_data.text) except Exception as e: logger.warning(f"Location: USGS earthquake API returned invalid XML: {e}") - quake_count = 0 + return NO_ALERTS except (requests.exceptions.RequestException): logger.warning("Location:Error fetching earthquake data from USGS") - quake_count = 0 + return NO_ALERTS quake_xml = xml.dom.minidom.parseString(quake_data.text) quake_count = len(quake_xml.getElementsByTagName("event"))