FR: Add Hop Limits to send functions by NekoCWD · Pull Request #828 · meshtastic/python

@NekoCWD

@CLAassistant

CLA assistant check
All committers have signed the CLA.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional hop-limit override to several high-level “send” helper methods in MeshInterface, allowing callers to control routing TTL per message while still delegating packet construction/sending to sendData() / _sendPacket().

Changes:

  • Add optional hopLimit parameter to sendText(), sendAlert(), sendPosition(), sendTelemetry(), sendWaypoint(), and deleteWaypoint().
  • Forward hopLimit through to sendData() so it ultimately sets meshPacket.hop_limit in _sendPacket().
  • Update docstring for sendText() and partially for sendAlert() to mention hopLimit.

Comment on lines 467 to 470

Arguments:
text {string} -- The text of the alert to send
hopLimit -- hop limit to use

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this docstring, hopLimit is listed under “Arguments”, but it’s a keyword argument (optional) in the function signature. Move it to the “Keyword Arguments” section (or clarify it’s optional) to avoid misleading API docs.

Copilot uses AI. Check for mistakes.

ianmcorvidae

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

@ianmcorvidae

@codecov

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.59%. Comparing base (cfb2378) to head (c7ee644).
⚠️ Report is 87 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #828      +/-   ##
==========================================
+ Coverage   59.99%   60.59%   +0.59%     
==========================================
  Files          24       24              
  Lines        4267     4337      +70     
==========================================
+ Hits         2560     2628      +68     
- Misses       1707     1709       +2     
Flag Coverage Δ
unittests 60.59% <100.00%> (+0.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.