mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-05-07 22:04:27 +02:00
enhance
This commit is contained in:
+1
-1
@@ -68,7 +68,7 @@ def auto_response(message, snr, rssi, hop, pkiStatus, message_from_id, channel_n
|
||||
"leaderboard": lambda: get_mesh_leaderboard(message, message_from_id, deviceID),
|
||||
"lemonstand": lambda: handleLemonade(message, message_from_id, deviceID),
|
||||
"lheard": lambda: handle_lheard(message, message_from_id, deviceID, isDM),
|
||||
"map": lambda: mapHandler(message_from_id, deviceID, channel_number, message),
|
||||
"map": lambda: mapHandler(message_from_id, deviceID, channel_number, message, snr, rssi, hop),
|
||||
"mastermind": lambda: handleMmind(message, message_from_id, deviceID),
|
||||
"messages": lambda: handle_messages(message, deviceID, channel_number, msg_history, publicChannel, isDM),
|
||||
"moon": lambda: handle_moon(message_from_id, deviceID, channel_number),
|
||||
|
||||
@@ -1097,7 +1097,7 @@ def log_locationData_toMap(userID, location, message):
|
||||
logger.error(f"Failed to log location for {userID}: {e}")
|
||||
return False
|
||||
|
||||
def mapHandler(userID, deviceID, channel_number, message):
|
||||
def mapHandler(userID, deviceID, channel_number, message, snr, rssi, hop):
|
||||
from modules.system import get_node_location
|
||||
command = message[len("map"):].strip()
|
||||
location = get_node_location(userID, deviceID)
|
||||
@@ -1123,6 +1123,14 @@ def mapHandler(userID, deviceID, channel_number, message):
|
||||
if description and description[0] in ('=', '+', '-', '@'):
|
||||
description = "'" + description
|
||||
|
||||
# if there is SNR and RSSI info, append to description
|
||||
if snr is not None and rssi is not None:
|
||||
description += f" (SNR:{snr}dB RSSI:{rssi}dBm"
|
||||
|
||||
# if there is hop info, append to description
|
||||
if hop is not None:
|
||||
description += f" Meta:{hop})"
|
||||
|
||||
# location should be a tuple: (lat, lon)
|
||||
if not location or len(location) != 2:
|
||||
return "🚫Location data is missing or invalid."
|
||||
|
||||
Reference in New Issue
Block a user