Skip to content

Commit

Permalink
Allow request-telemetry to illicit LocalStats response
Browse files Browse the repository at this point in the history
  • Loading branch information
thebentern committed Nov 24, 2024
1 parent 4c7ac60 commit b180b6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ def onConnected(interface):
"air_quality": "air_quality_metrics",
"airquality": "air_quality_metrics",
"power": "power_metrics",
"localstats": "local_stats",
"local_stats": "local_stats",
}
telemType = telemMap.get(args.request_telemetry, "device_metrics")
print(
Expand Down
2 changes: 2 additions & 0 deletions meshtastic/mesh_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ def sendTelemetry(
r.air_quality_metrics.CopyFrom(telemetry_pb2.AirQualityMetrics())
elif telemetryType == "power_metrics":
r.power_metrics.CopyFrom(telemetry_pb2.PowerMetrics())
elif telemetryType == "local_stats":
r.local_stats.CopyFrom(telemetry_pb2.LocalStats())

Check warning on line 621 in meshtastic/mesh_interface.py

View check run for this annotation

Codecov / codecov/patch

meshtastic/mesh_interface.py#L620-L621

Added lines #L620 - L621 were not covered by tests
else: # fall through to device metrics
if self.nodesByNum is not None:
node = self.nodesByNum.get(self.localNode.nodeNum)
Expand Down

0 comments on commit b180b6f

Please sign in to comment.