meshcore-cli 1.1.39__tar.gz → 1.1.41__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcore-cli
3
- Version: 1.1.39
3
+ Version: 1.1.41
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.17
13
+ Requires-Dist: meshcore>=2.1.19
14
14
  Requires-Dist: prompt-toolkit>=3.0.50
15
15
  Requires-Dist: requests>=2.28.0
16
16
  Description-Content-Type: text/markdown
@@ -4,11 +4,9 @@
4
4
  nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5
5
  };
6
6
 
7
- outputs =
8
- inputs:
7
+ outputs = inputs:
9
8
  inputs.flake-utils.lib.eachDefaultSystem (
10
- system:
11
- let
9
+ system: let
12
10
  pkgs = inputs.nixpkgs.legacyPackages.${system};
13
11
 
14
12
  lib = pkgs.lib;
@@ -17,15 +15,15 @@
17
15
 
18
16
  meshcore = python3Packages.buildPythonPackage rec {
19
17
  pname = "meshcore";
20
- version = "2.1.9";
18
+ version = "2.1.19";
21
19
  pyproject = true;
22
20
 
23
21
  src = python3Packages.fetchPypi {
24
22
  inherit pname version;
25
- sha256 = "sha256-FhTOuVHhpYvmITgxfhXys8AJhRfYnMwCJ3fWJhMf53w=";
23
+ sha256 = "sha256-R11puo30ozFVqsIZcbNtg/NFukm8ahFzkMVqX4XEIe0=";
26
24
  };
27
25
 
28
- build-system = [ python3Packages.hatchling ];
26
+ build-system = [python3Packages.hatchling];
29
27
 
30
28
  dependencies = [
31
29
  python3Packages.bleak
@@ -33,13 +31,12 @@
33
31
  python3Packages.pyserial-asyncio
34
32
  ];
35
33
 
36
- pythonImportsCheck = [ "meshcore" ];
34
+ pythonImportsCheck = ["meshcore"];
37
35
  };
38
36
 
39
37
  pyproject = lib.importTOML ./pyproject.toml;
40
38
  version = pyproject.project.version;
41
- in
42
- {
39
+ in {
43
40
  packages.meshcore-cli = python3Packages.buildPythonPackage {
44
41
  pname = "meshcore-cli";
45
42
  inherit version;
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "meshcore-cli"
7
- version = "1.1.39"
7
+ version = "1.1.41"
8
8
  authors = [
9
9
  { name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
10
10
  ]
@@ -17,7 +17,7 @@ classifiers = [
17
17
  ]
18
18
  license = "MIT"
19
19
  license-files = ["LICEN[CS]E*"]
20
- dependencies = [ "meshcore >= 2.1.17", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0" ]
20
+ dependencies = [ "meshcore >= 2.1.19", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0" ]
21
21
 
22
22
  [project.urls]
23
23
  Homepage = "https://github.com/fdlamotte/meshcore-cli"
@@ -9,6 +9,7 @@ import getopt, json, shlex, re
9
9
  import logging
10
10
  import requests
11
11
  from bleak import BleakScanner, BleakClient
12
+ from bleak.exc import BleakError
12
13
  import serial.tools.list_ports
13
14
  from pathlib import Path
14
15
  import traceback
@@ -23,7 +24,7 @@ from prompt_toolkit.shortcuts import radiolist_dialog
23
24
  from meshcore import MeshCore, EventType, logger
24
25
 
25
26
  # Version
26
- VERSION = "v1.1.39"
27
+ VERSION = "v1.1.41"
27
28
 
28
29
  # default ble address is stored in a config file
29
30
  MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/"
@@ -398,6 +399,7 @@ def make_completion_dict(contacts, pending={}, to=None, channels=None):
398
399
  "telemetry_mode_env" : {"always" : None, "device":None, "never":None},
399
400
  "advert_loc_policy" : {"none" : None, "share" : None},
400
401
  "auto_update_contacts" : {"on":None, "off":None},
402
+ "multi_acks" : {"on": None, "off":None},
401
403
  "max_attempts" : None,
402
404
  "max_flood_attempts" : None,
403
405
  "flood_after" : None,
@@ -424,6 +426,7 @@ def make_completion_dict(contacts, pending={}, to=None, channels=None):
424
426
  "telemetry_mode_env":None,
425
427
  "advert_loc_policy":None,
426
428
  "auto_update_contacts":None,
429
+ "multi_acks":None,
427
430
  "max_attempts":None,
428
431
  "max_flood_attempts":None,
429
432
  "flood_after":None,
@@ -1389,6 +1392,13 @@ async def next_cmd(mc, cmds, json_output=False):
1389
1392
  print(f"Error : {res}")
1390
1393
  else :
1391
1394
  print(f"manual add contact: {mac}")
1395
+ case "multi_acks":
1396
+ ma = (cmds[2] == "on") or (cmds[2] == "true") or (cmds[2] == "yes") or (cmds[2] == "1")
1397
+ res = await mc.commands.set_multi_acks(ma)
1398
+ if res.type == EventType.ERROR:
1399
+ print(f"Error : {res}")
1400
+ else :
1401
+ print(f"multi_acks: {ma}")
1392
1402
  case "auto_update_contacts":
1393
1403
  auc = (cmds[2] == "on") or (cmds[2] == "true") or (cmds[2] == "yes") or (cmds[2] == "1")
1394
1404
  mc.auto_update_contacts=auc
@@ -1579,6 +1589,12 @@ async def next_cmd(mc, cmds, json_output=False):
1579
1589
  print(json.dumps(res.payload, indent=4))
1580
1590
  else:
1581
1591
  print(f"Using {res.payload['used_kb']}kB of {res.payload['total_kb']}kB")
1592
+ case "multi_acks" :
1593
+ await mc.commands.send_appstart()
1594
+ if json_output :
1595
+ print(json.dumps({"multi_acks" : mc.self_info["multi_acks"]}))
1596
+ else :
1597
+ print(f"multi_acks: {mc.self_info['multi_acks']}")
1582
1598
  case "manual_add_contacts" :
1583
1599
  await mc.commands.send_appstart()
1584
1600
  if json_output :
@@ -2585,23 +2601,30 @@ async def main(argv):
2585
2601
  return
2586
2602
  case "-l" :
2587
2603
  print("BLE devices:")
2588
- devices = await BleakScanner.discover(timeout=timeout)
2589
- if len(devices) == 0:
2590
- print(" No ble device found")
2591
- for d in devices :
2592
- if not d.name is None and d.name.startswith("MeshCore-"):
2593
- print(f" {d.address} {d.name}")
2604
+ try :
2605
+ devices = await BleakScanner.discover(timeout=timeout)
2606
+ if len(devices) == 0:
2607
+ print(" No ble device found")
2608
+ for d in devices :
2609
+ if not d.name is None and d.name.startswith("MeshCore-"):
2610
+ print(f" {d.address} {d.name}")
2611
+ except BleakError:
2612
+ print(" No BLE HW")
2594
2613
  print("\nSerial ports:")
2595
2614
  ports = serial.tools.list_ports.comports()
2596
2615
  for port, desc, hwid in sorted(ports):
2597
2616
  print(f" {port:<18} {desc} [{hwid}]")
2598
2617
  return
2599
2618
  case "-S" :
2600
- devices = await BleakScanner.discover(timeout=timeout)
2601
2619
  choices = []
2602
- for d in devices:
2603
- if not d.name is None and d.name.startswith("MeshCore-"):
2604
- choices.append(({"type":"ble","device":d}, f"{d.address:<22} {d.name}"))
2620
+
2621
+ try :
2622
+ devices = await BleakScanner.discover(timeout=timeout)
2623
+ for d in devices:
2624
+ if not d.name is None and d.name.startswith("MeshCore-"):
2625
+ choices.append(({"type":"ble","device":d}, f"{d.address:<22} {d.name}"))
2626
+ except BleakError:
2627
+ logger.info("No BLE Device")
2605
2628
 
2606
2629
  ports = serial.tools.list_ports.comports()
2607
2630
  for port, desc, hwid in sorted(ports):
File without changes
File without changes
File without changes
File without changes