meshcore-cli 1.3.1__py3-none-any.whl → 1.3.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,7 @@ import re
32
32
  from meshcore import MeshCore, EventType, logger
33
33
 
34
34
  # Version
35
- VERSION = "v1.3.1"
35
+ VERSION = "v1.3.3"
36
36
 
37
37
  # default ble address is stored in a config file
38
38
  MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/"
@@ -285,7 +285,7 @@ async def handle_log_rx(event):
285
285
  if chan_name != "" :
286
286
  width = os.get_terminal_size().columns
287
287
  cars = width - 13 - 2 * path_len - len(chan_name) - 1
288
- dispmsg = message[0:cars]
288
+ dispmsg = message.replace("\n","")[0:cars]
289
289
  txt = f"{ANSI_LIGHT_GRAY}{chan_name} {ANSI_DGREEN}{dispmsg+(cars-len(dispmsg))*' '} {ANSI_YELLOW}[{path}]{ANSI_LIGHT_GRAY}{event.payload['snr']:6,.2f}{event.payload['rssi']:4}{ANSI_END}"
290
290
  if handle_message.above:
291
291
  print_above(txt)
@@ -591,6 +591,9 @@ def make_completion_dict(contacts, pending={}, to=None, channels=None):
591
591
  "?at":None,
592
592
  "?node_discover":None,
593
593
  "?nd":None,
594
+ "?pending_contacts":None,
595
+ "?add_pending":None,
596
+ "?flush_pending":None,
594
597
  }
595
598
 
596
599
  contact_completion_list = {
@@ -1158,7 +1161,7 @@ async def process_contact_chat_line(mc, contact, line):
1158
1161
  print("")
1159
1162
  return True
1160
1163
 
1161
- if line.startswith("sleep") or line.startswith("s"):
1164
+ if line.startswith("sleep ") or line.startswith("s "):
1162
1165
  try:
1163
1166
  sleeptime = int(line.split(" ",2)[1])
1164
1167
  cmd_pos = 2
@@ -1219,6 +1222,8 @@ async def process_contact_chat_line(mc, contact, line):
1219
1222
 
1220
1223
  if line.startswith("set timeout "):
1221
1224
  cmds=line.split(" ")
1225
+ #args = ["contact_timeout", contact['adv_name'], cmds[2]]
1226
+ #await process_cmds(mc, args)
1222
1227
  contact["timeout"] = float(cmds[2])
1223
1228
  return True
1224
1229
 
@@ -2598,7 +2603,7 @@ async def next_cmd(mc, cmds, json_output=False):
2598
2603
  else:
2599
2604
  type = CONTACT_TYPENAMES[n['node_type']]
2600
2605
 
2601
- print(f" {name:16} {type:>4} SNR: {n['SNR_in']:6,.2f}->{n['SNR']:6,.2f} RSSI: ->{n['RSSI']:4}")
2606
+ print(f" {name:22} {type:>4} SNR: {n['SNR_in']:6,.2f}->{n['SNR']:6,.2f} RSSI: ->{n['RSSI']:4}")
2602
2607
 
2603
2608
  case "req_telemetry"|"rt" :
2604
2609
  argnum = 1
@@ -3327,12 +3332,15 @@ def get_help_for (cmdname, context="line") :
3327
3332
  lat <lat> : latitude
3328
3333
  lon <lon> : longitude
3329
3334
  coords <lat,lon> : coordinates
3330
- auto_update_contacts <> : automatically updates contact list
3331
3335
  multi_ack <on/off> : multi-acks feature
3332
3336
  telemetry_mode_base <mode> : set basic telemetry mode all/selected/off
3333
3337
  telemetry_mode_loc <mode> : set location telemetry mode all/selected/off
3334
3338
  telemetry_mode_env <mode> : set env telemetry mode all/selected/off
3335
3339
  advert_loc_policy <policy> : "share" means loc will be shared in adv
3340
+ manual_add_contacts <on/off>: let user manually add contacts to device
3341
+ - when off device automatically adds contacts from adverts
3342
+ - when on contacts must be added manually using add_pending
3343
+ (pending contacts list is built by meshcli from adverts while connected)
3336
3344
  display:
3337
3345
  print_snr <on/off> : toggle snr display in messages
3338
3346
  print_adverts <on/off> : display adverts as they come
@@ -3342,12 +3350,13 @@ def get_help_for (cmdname, context="line") :
3342
3350
  channel_echoes <on/off> : print repeats for channel data
3343
3351
  echo_unk_channels <on/off> : also dump unk channels (encrypted)
3344
3352
  color <on/off> : color off should remove ANSI codes from output
3345
- prompt:
3353
+ meshcore-cli behaviour:
3346
3354
  classic_prompt <on/off> : activates less fancier prompt
3347
3355
  arrow_head <string> : change arrow head in prompt
3348
3356
  slash_start <string> : idem for slash start
3349
3357
  slash_end <string> : slash end
3350
3358
  invert_slash <on/off> : apply color inversion to slash
3359
+ auto_update_contacts <on/of>: auto sync contact list with device
3351
3360
  """)
3352
3361
 
3353
3362
  elif cmdname == "scope":
@@ -3371,6 +3380,20 @@ Managing Flood Scope in interactive mode
3371
3380
  - contact_type (ct)
3372
3381
  """)
3373
3382
 
3383
+ elif cmdname == "pending_contacts" or cmdname == "flush_pending" or cmdname == "add_pending":
3384
+ print("""Contact management
3385
+
3386
+ To receive a message from another user, it is necessary to have its public key. This key is stored on a contact list in the device, and this list has a finite size (50 when meshcore started, now over 350 for most devices).
3387
+
3388
+ By default contacts are automatically added to the device contact list when an advertisement is received, so as soon as you receive an advert, you can talk with your buddy.
3389
+
3390
+ With growing number of users, it becomes necessary to manage contact list and one of the ways is to add contacts manually to the device. This is done by turning on manual_add_contacts. Once this option has been turned on, a pending list is built by meshcore-cli from the received adverts. You can view the list issuing a pending_contacts command, flush the list using flush_pending or add a contact from the list with add_pending followed by the key of the contact or its name (both will be auto-completed with tab).
3391
+
3392
+ This feature only really works in interactive mode.
3393
+
3394
+ Note: There is also an auto_update_contacts setting that has nothing to do with adding contacts, it permits to automatically sync contact lists between device and meshcore-cli (when there is an update in name, location or path).
3395
+ """)
3396
+
3374
3397
  else:
3375
3398
  print(f"Sorry, no help yet for {cmdname}")
3376
3399
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcore-cli
3
- Version: 1.3.1
3
+ Version: 1.3.3
4
4
  Summary: Command line interface to meshcore companion radios
5
5
  Project-URL: Homepage, https://github.com/fdlamotte/meshcore-cli
6
6
  Project-URL: Issues, https://github.com/fdlamotte/meshcore-cli/issues
@@ -10,7 +10,7 @@ License-File: LICENSE
10
10
  Classifier: Operating System :: OS Independent
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: >=3.10
13
- Requires-Dist: meshcore>=2.1.24
13
+ Requires-Dist: meshcore>=2.2.1
14
14
  Requires-Dist: prompt-toolkit>=3.0.50
15
15
  Requires-Dist: pycryptodome
16
16
  Requires-Dist: requests>=2.28.0
@@ -198,6 +198,18 @@ f1down/#fdl|*> 8
198
198
  #fdl f1down: 8 [2521] 1.00-109
199
199
  ```
200
200
 
201
+ ### Contact management
202
+
203
+ To receive a message from another user, it is necessary to have its public key. This key is stored on a contact list in the device, and this list has a finite size (50 when meshcore started, now over 350 for most devices).
204
+
205
+ By default contacts are automatically added to the device contact list when an advertisement is received, so as soon as you receive an advert, you can talk with your buddy.
206
+
207
+ With growing number of users, it becomes necessary to manage contact list and one of the ways is to add contacts manually to the device. This is done by turning on `manual_add_contacts`. Once this option has been turned on, a pending list is built by meshcore-cli from the received adverts. You can view the list issuing a `pending_contacts` command, flush the list using `flush_pending` or add a contact from the list with `add_pending` followed by the key of the contact or its name (both will be auto-completed with tab).
208
+
209
+ This feature only really works in interactive mode.
210
+
211
+ Note: There is also an `auto_update_contacts` setting that has nothing to do with adding contacts, it permits to automatically sync contact lists between device and meshcore-cli (when there is an update in name, location or path).
212
+
201
213
  ### Issuing batch commands to contacts with apply to
202
214
 
203
215
  `apply_to <f> <cmd>` : applies cmd to contacts matching filter `<f>` it can be used to apply the same command to a pool of repeaters, or remove some contacts matching a condition.
@@ -0,0 +1,8 @@
1
+ meshcore_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ meshcore_cli/__main__.py,sha256=PfYgibmu2LEtC-OV7L1UgmvV3swJ5rQ4bbXHlwUFlgE,83
3
+ meshcore_cli/meshcore_cli.py,sha256=9QoU-ERTiGkNRyuecAm2rET_ncN7VQthZpeyf9ASAy4,151114
4
+ meshcore_cli-1.3.3.dist-info/METADATA,sha256=hNRWTyoFSIOxospg9JyNtJ5KFVox5NJq3Fn9radiSuA,17105
5
+ meshcore_cli-1.3.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ meshcore_cli-1.3.3.dist-info/entry_points.txt,sha256=77V29Pyth11GteDk7tneBN3MMk8JI7bTlS-BGSmxCmI,103
7
+ meshcore_cli-1.3.3.dist-info/licenses/LICENSE,sha256=F9s987VtS0AKxW7LdB2EkLMkrdeERI7ICdLJR60A9M4,1066
8
+ meshcore_cli-1.3.3.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- meshcore_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- meshcore_cli/__main__.py,sha256=PfYgibmu2LEtC-OV7L1UgmvV3swJ5rQ4bbXHlwUFlgE,83
3
- meshcore_cli/meshcore_cli.py,sha256=ZuBGD-H_nXLmHSP3ffat8ZtKNfieKbLmL3TQgv8B4_I,149253
4
- meshcore_cli-1.3.1.dist-info/METADATA,sha256=k3NMG9h1qPemlm8if4A_7JD7yH6Wi8wzhABH_0ijtJo,15873
5
- meshcore_cli-1.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
- meshcore_cli-1.3.1.dist-info/entry_points.txt,sha256=77V29Pyth11GteDk7tneBN3MMk8JI7bTlS-BGSmxCmI,103
7
- meshcore_cli-1.3.1.dist-info/licenses/LICENSE,sha256=F9s987VtS0AKxW7LdB2EkLMkrdeERI7ICdLJR60A9M4,1066
8
- meshcore_cli-1.3.1.dist-info/RECORD,,