mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-07-06 01:41:45 +02:00
trimChUtil
This commit is contained in:
@@ -66,9 +66,11 @@ def auto_response(message, snr, rssi, hop, message_from_id, channel_number, devi
|
||||
elif "lheard" in message.lower() or "sitrep" in message.lower():
|
||||
bot_response = "Last heard:\n" + str(get_node_list(1))
|
||||
chutil1 = interface1.nodes.get(decimal_to_hex(myNodeNum1), {}).get("deviceMetrics", {}).get("channelUtilization", 0)
|
||||
chutil1 = "{:.2f}".format(chutil1)
|
||||
if interface2_enabled:
|
||||
bot_response += "Port2:\n" + str(get_node_list(2))
|
||||
chutil2 = interface2.nodes.get(decimal_to_hex(myNodeNum2), {}).get("deviceMetrics", {}).get("channelUtilization", 0)
|
||||
chutil2 = "{:.2f}".format(chutil2)
|
||||
bot_response += "Ch Use: " + str(chutil1) + "%"
|
||||
if interface2_enabled:
|
||||
bot_response += " P2:" + str(chutil2) + "%"
|
||||
|
||||
@@ -108,6 +108,8 @@ if interface2_enabled:
|
||||
else:
|
||||
myNodeNum2 = 777
|
||||
|
||||
# functions
|
||||
|
||||
def log_timestamp():
|
||||
if zuluTime:
|
||||
return datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
+5
-1
@@ -42,8 +42,12 @@ def auto_response(message, snr, rssi, hop, message_from_id, channel_number, devi
|
||||
bot_response = help_message
|
||||
elif "lheard" in message.lower() or "sitrep" in message.lower():
|
||||
bot_response = "Last heard:\n" + str(get_node_list(1))
|
||||
chutil1 = interface1.nodes.get(decimal_to_hex(myNodeNum1), {}).get("deviceMetrics", {}).get("channelUtilization", 0)
|
||||
chutil1 = "{:.2f}".format(chutil1)
|
||||
if interface2_enabled:
|
||||
bot_response += "\nPort2:\n" + str(get_node_list(2))
|
||||
bot_response += "Port2:\n" + str(get_node_list(2))
|
||||
chutil2 = interface2.nodes.get(decimal_to_hex(myNodeNum2), {}).get("deviceMetrics", {}).get("channelUtilization", 0)
|
||||
chutil2 = "{:.2f}".format(chutil2)
|
||||
elif "testing" in message.lower() or "test" in message.lower():
|
||||
bot_response = "🏓Testing 1,2,3"
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user