mirror of
https://github.com/meshtastic/python.git
synced 2026-01-07 07:17:56 -05:00
Merge pull request #413 from GUVWAF/metrics
Display battery level, channel and Tx air util. with --nodes
This commit is contained in:
@@ -137,7 +137,20 @@ class MeshInterface:
|
||||
"Latitude": formatFloat(pos.get("latitude"), 4, "°"),
|
||||
"Longitude": formatFloat(pos.get("longitude"), 4, "°"),
|
||||
"Altitude": formatFloat(pos.get("altitude"), 0, " m"),
|
||||
"Battery": formatFloat(pos.get("batteryLevel"), 2, "%"),
|
||||
})
|
||||
|
||||
metrics = node.get('deviceMetrics')
|
||||
if metrics:
|
||||
batteryLevel = metrics.get('batteryLevel')
|
||||
if batteryLevel is not None:
|
||||
if batteryLevel == 0:
|
||||
batteryString = "Powered"
|
||||
else:
|
||||
batteryString = str(batteryLevel)+"%"
|
||||
row.update({"Battery": batteryString})
|
||||
row.update({
|
||||
"Channel util.": formatFloat(metrics.get('channelUtilization'), 2, "%"),
|
||||
"Tx air util.": formatFloat(metrics.get('airUtilTx'), 2, "%"),
|
||||
})
|
||||
|
||||
row.update({
|
||||
|
||||
Reference in New Issue
Block a user