From 5788b135d6ae3791dd0f63af74c3d463b0aa7cf9 Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 25 Apr 2025 16:17:55 +0200 Subject: [PATCH] defaults to public channel --- src/meshcore_cli/meshcore_cli.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index 2869273..14a016f 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -178,6 +178,10 @@ def make_completion_dict(contacts): for c in it : contact_list[c[1]['adv_name']] = None + contact_list["public"] = None + contact_list["ch"] = None + contact_list["ch0"] = None + completion_list = { "to" : contact_list, "to_ch" : None, @@ -251,8 +255,9 @@ Line starting with \"$\" or \".\" will issue a meshcli command. contact = to elif len(mc.contacts.items()) == 0 : contact = {"adv_name" : "public", "type" : 0, "chan_nb" : 0} - else: - contact = next(iter(mc.contacts.items()))[1] + else: # defaults to public chanel + contact = {"adv_name" : "public", "type" : 0, "chan_nb" : 0} +# contact = next(iter(mc.contacts.items()))[1] try: while True: # purge msgs