From 9968952f4aa1e863dee8beb8fc7cca9cab072573 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Sat, 19 Oct 2024 01:47:43 -0400 Subject: [PATCH 1/2] Add "(MQTT)" after node name when appropriate --- meshtastic/mesh_interface.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 053e8d36..2c1fce9d 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -247,10 +247,11 @@ 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, } @@ -258,7 +259,7 @@ def getTimeAgo(ts) -> Optional[str]: 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"), From a29eef98669ccd4a19e9df89b86dbec090589601 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Mon, 21 Oct 2024 22:03:31 -0400 Subject: [PATCH 2/2] Add missing camel to snake conversion --- meshtastic/node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/node.py b/meshtastic/node.py index 2986ded5..fa02c6a3 100644 --- a/meshtastic/node.py +++ b/meshtastic/node.py @@ -121,7 +121,7 @@ def onResponseRequestSettings(self, p): ) return if config_values is not None: - raw_config = getattr(getattr(adminMessage['raw'], oneof), field) + raw_config = getattr(getattr(adminMessage['raw'], oneof), camel_to_snake(field)) config_values.CopyFrom(raw_config) print(f"{str(camel_to_snake(field))}:\n{str(config_values)}")