From 72510088c98bc85201672ecacb1fa408d09c3b64 Mon Sep 17 00:00:00 2001 From: Manuel Verch Date: Fri, 31 Mar 2023 09:46:27 +0200 Subject: [PATCH] reverted file belonging to another PR --- meshtastic/mesh_interface.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 06036cc..3301c62 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -3,7 +3,6 @@ import sys import random import time -import json import logging import collections from typing import AnyStr @@ -83,8 +82,8 @@ class MeshInterface: myinfo = '' if self.myInfo: myinfo = f"\nMy info: {stripnl(MessageToJson(self.myInfo))}" - mesh = "\n\nNodes in mesh: " - nodes = {} + mesh = "\nNodes in mesh:" + nodes = "" if self.nodes: for n in self.nodes.values(): # when the TBeam is first booted, it sometimes shows the raw data @@ -99,11 +98,8 @@ class MeshInterface: addr = convert_mac_addr(val) n2['user']['macaddr'] = addr - # use id as dictionary key for correct json format in list of nodes - nodeid = n2['user']['id'] - n2['user'].pop('id') - nodes[nodeid] = n2 - infos = owner + myinfo + mesh + json.dumps(nodes) + nodes = nodes + f" {stripnl(n2)}" + infos = owner + myinfo + mesh + nodes print(infos) return infos