python icon indicating copy to clipboard operation
python copied to clipboard

Add support for add channels query string to --seturl

Open garthvh opened this issue 1 year ago • 2 comments

Append any channels in a channels URL to the end of the array if the add=true query string value is present.

Otherwise delete and replace all channels (exiting functionality)

garthvh avatar Apr 04 '24 22:04 garthvh

I opened MR #708 which creates new option --ch-add-url that adds any new channels from an add URL. It doesn't change any existing channels. It errors out with relevant messages if the URL is invalid or the node runs out of channels.

I don't know pytest so I didn't contibute any tests for it in test_node.py.

Examples of use:

Add channels with new names from the URL:

% meshtastic --ch-add-url 'https://meshtastic.org/e/?add=true#Ch0SEAdk8ukuvs5lth8X1TQ5qlkaBFRlc3QlBAAAAAoeEhCklt7p_KHfBjTQmokk2D4FGgVUZXN0MiUFAAAAEg8IATgBQANIAVAeaAHABgE'
Connected to radio
Adding new channel 'Test' to device
Adding new channel 'Test2' to device

Fail when a non-add URL was provided:

% meshtastic --ch-add-url 'https://meshtastic.org/e/#Ch0SEAdk8ukuvs5lth8X1TQ5qlkaBFRlc3QlBAAAAAoeEhCklt7p_KHfBjTQmokk2D4FGgVUZXN0MiUFAAAAEg8IATgBQANIAVAeaAHABgE'
Connected to radio
Warning: Invalid URL 'https://meshtastic.org/e/#Ch0SEAdk8ukuvs5lth8X1TQ5qlkaBFRlc3QlBAAAAAoeEhCklt7p_KHfBjTQmokk2D4FGgVUZXN0MiUFAAAAEg8IATgBQANIAVAeaAHABgE'

mikeymakesit avatar Dec 02 '24 07:12 mikeymakesit

I chose a new argument instead of overloading --seturl because it feels like a different behavior. But I can refactor it into --seturl if you prefer.

mikeymakesit avatar Dec 02 '24 16:12 mikeymakesit

available in v2.7.3. Is there anything remaining to do or can this point be closed?

juergenRe avatar Oct 27 '25 08:10 juergenRe

Close it, thanks.

mikeymakesit avatar Oct 27 '25 13:10 mikeymakesit

I don't have the permissions to do so... @garthvh : can you please close it?

juergenRe avatar Oct 30 '25 06:10 juergenRe