Skip to content

Commit

Permalink
Add "(MQTT)" after node name when appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
lachesis committed Oct 22, 2024
1 parent 92a3986 commit 9968952
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions meshtastic/mesh_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,18 +247,19 @@ def getTimeAgo(ts) -> Optional[str]:
if not includeSelf and node["num"] == self.localNode.nodeNum:
continue

mqtt_suffix = ' (MQTT)' if node.get('viaMqtt') else ''
presumptive_id = f"!{node['num']:08x}"
row = {
"N": 0,
"User": f"Meshtastic {presumptive_id[-4:]}",
"User": f"Meshtastic {presumptive_id[-4:]}" + mqtt_suffix,
"ID": presumptive_id,
}

user = node.get("user")
if user:
row.update(
{
"User": user.get("longName", "N/A"),
"User": user.get("longName", "N/A") + mqtt_suffix,
"AKA": user.get("shortName", "N/A"),
"ID": user["id"],
"Hardware": user.get("hwModel", "UNSET"),
Expand Down

0 comments on commit 9968952

Please sign in to comment.