Add support for adding contacts using the CLI, including remotely#933
Open
ianmcorvidae wants to merge 3 commits into
Open
Add support for adding contacts using the CLI, including remotely#933ianmcorvidae wants to merge 3 commits into
ianmcorvidae wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a CLI workflow for sharing and importing “contact” (node/user) information via a shareable URL/QR, enabling users to add contacts to the NodeDB locally or via remote admin actions.
Changes:
- Add
Node.getContactURL()andNode.addContactURL()for generating/parsing shareable contact URLs backed byadmin_pb2.SharedContact. - Extend the CLI with
--contact-qr(generate + print QR/URL) and--add-contact(import from URL), supporting remote destinations via--dest. - Add unit tests covering CLI argument plumbing and a protobuf URL encode/decode roundtrip.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
meshtastic/node.py |
Implements contact URL generation/parsing and sends AdminMessage.add_contact. |
meshtastic/__main__.py |
Adds CLI flags and wiring to call the new Node APIs (local or remote). |
meshtastic/tests/test_node.py |
Adds a protobuf-level contact URL encode/decode roundtrip test. |
meshtastic/tests/test_main.py |
Adds CLI tests for --add-contact and --contact-qr argument handling. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #933 +/- ##
==========================================
- Coverage 63.24% 62.67% -0.57%
==========================================
Files 25 25
Lines 4527 4595 +68
==========================================
+ Hits 2863 2880 +17
- Misses 1664 1715 +51
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Comment on lines
+397
to
+398
| if u.get("macaddr"): | ||
| contact.user.macaddr = base64.b64decode(u["macaddr"]) |
Comment on lines
+501
to
+503
| decodedURL = base64.urlsafe_b64decode(b64) | ||
| contact = admin_pb2.SharedContact() | ||
| contact.ParseFromString(decodedURL) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.