From 98f982337261f07b50b1a16a99d1bc86062e9927 Mon Sep 17 00:00:00 2001 From: Andrea Santaniello Date: Thu, 9 May 2024 14:00:30 +0200 Subject: [PATCH] nodeid in status page --- meshttpd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meshttpd.py b/meshttpd.py index 9d4a5ae..55c2a12 100644 --- a/meshttpd.py +++ b/meshttpd.py @@ -19,6 +19,7 @@ class MeshAPI(object): """ self.hostname = hostname self.iface = None + self.whoami = None self.device_telemetry_cache = {} # Cache to store device telemetry data self.environment_telemetry_cache = {} # Cache to store environment telemetry data self.message_cache = {} # Cache to store messages @@ -84,6 +85,7 @@ class MeshAPI(object): """ self.last_connection_time = time.time() self.connection_attempts += 1 + self.whoami = self.iface.myInfo.my_node_num print(f"Connected to Meshtastic device at {self.hostname}") @cherrypy.expose @@ -264,6 +266,7 @@ class MeshAPI(object): """ return { "connected": bool(self.iface), + "nodeid": str(self.whoami), "last_connection_time": self.last_connection_time, "total_connection_attempts": self.connection_attempts }