meshcore-cli 1.1.40__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.40
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
@@ -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.40"
7
+ version = "1.1.41"
8
8
  authors = [
9
9
  { name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
10
10
  ]
@@ -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.40"
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/"
@@ -2600,23 +2601,30 @@ async def main(argv):
2600
2601
  return
2601
2602
  case "-l" :
2602
2603
  print("BLE devices:")
2603
- devices = await BleakScanner.discover(timeout=timeout)
2604
- if len(devices) == 0:
2605
- print(" No ble device found")
2606
- for d in devices :
2607
- if not d.name is None and d.name.startswith("MeshCore-"):
2608
- 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")
2609
2613
  print("\nSerial ports:")
2610
2614
  ports = serial.tools.list_ports.comports()
2611
2615
  for port, desc, hwid in sorted(ports):
2612
2616
  print(f" {port:<18} {desc} [{hwid}]")
2613
2617
  return
2614
2618
  case "-S" :
2615
- devices = await BleakScanner.discover(timeout=timeout)
2616
2619
  choices = []
2617
- for d in devices:
2618
- if not d.name is None and d.name.startswith("MeshCore-"):
2619
- 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")
2620
2628
 
2621
2629
  ports = serial.tools.list_ports.comports()
2622
2630
  for port, desc, hwid in sorted(ports):
File without changes
File without changes
File without changes
File without changes