Skip to content

add --set-is-unmessageable to CLI commands #794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pdxlocations
Copy link
Member

allows:
meshtastic --set-is-unmessagable true
meshtastic --set-is-unmessageable true
meshtastic --set-is-unmessagable false
meshtastic --set-is-unmessageable false

Copy link

codecov bot commented Jun 21, 2025

Codecov Report

Attention: Patch coverage is 60.71429% with 11 lines in your changes missing coverage. Please review.

Project coverage is 59.43%. Comparing base (ab997aa) to head (51b543f).

Files with missing lines Patch % Lines
meshtastic/node.py 10.00% 9 Missing ⚠️
meshtastic/__main__.py 88.88% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #794   +/-   ##
=======================================
  Coverage   59.42%   59.43%           
=======================================
  Files          24       24           
  Lines        4128     4156   +28     
=======================================
+ Hits         2453     2470   +17     
- Misses       1675     1686   +11     
Flag Coverage Δ
unittests 59.43% <60.71%> (+<0.01%) ⬆️

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.

Copy link
Contributor

@ianmcorvidae ianmcorvidae left a comment

Choose a reason for hiding this comment

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

I'm thinking this should be rearranged a little to match other code, but otherwise looks reasonable to me.

@@ -327,6 +327,23 @@ def setOwner(self, long_name: Optional[str]=None, short_name: Optional[str]=None
onResponse = self.onAckNak
return self._sendAdmin(p, onResponse=onResponse)

def setIsUnmessageable(self, is_unmessagable: Optional[bool]=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should probably add this to setOwner, since we're already messing with all these fields there. And, it should be combined with set-owner and set-owner-short where those are present, which is probably done that way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes! That makes a lot of sense. Thanks for the review, I'll revise.

@@ -350,6 +350,26 @@ def onConnected(interface):
print(f"Setting device owner short to {args.set_owner_short}")
interface.getNode(args.dest, False, **getNode_kwargs).setOwner(long_name=args.set_owner, short_name=args.set_owner_short)

if args.set_is_unmessageable:
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly to the comment in node.py, this block should be merged into the if args.set_owner or args.set_owner_short above it, so everything's done in one admin command to the node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants