mirror of
https://github.com/meshtastic/python.git
synced 2026-01-18 20:57:57 -05:00
cast data as string in order to avoid concatenation error
This commit is contained in:
@@ -143,11 +143,11 @@ def printNodes(nodes):
|
||||
tableData = []
|
||||
for node in nodes:
|
||||
#aux var to get not defined keys
|
||||
lat=node['position'].get("latitude", "N/A")
|
||||
lon=node['position'].get("longitude", "N/A")
|
||||
alt=node['position'].get("altitude", "N/A")
|
||||
batt=node['position'].get("batteryLevel", "N/A")
|
||||
snr=node.get("snr", "N/A")
|
||||
lat=str(node['position'].get("latitude", "N/A"))
|
||||
lon=str(node['position'].get("longitude", "N/A"))
|
||||
alt=str(node['position'].get("altitude", "N/A"))
|
||||
batt=str(node['position'].get("batteryLevel", "N/A"))
|
||||
snr=str(node.get("snr", "N/A"))
|
||||
tableData.append({"User":node['user']['longName'],
|
||||
"Position":"Lat:"+lat+",Lon:"+lon+",Alt:"+alt,
|
||||
"Battery":batt, "SNR":snr})
|
||||
|
||||
Reference in New Issue
Block a user