From cf106dfe4c687070a25d3759c422182a83af78ac Mon Sep 17 00:00:00 2001 From: Florent de Lamotte Date: Fri, 18 Jul 2025 14:16:12 +0200 Subject: [PATCH] only log errors if json_output --- pyproject.toml | 4 ++-- src/meshcore_cli/meshcore_cli.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 883e6f4..daaa826 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "meshcore-cli" -version = "1.1.5" +version = "1.1.6" authors = [ { name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, ] @@ -17,7 +17,7 @@ classifiers = [ ] license = "MIT" license-files = ["LICEN[CS]E*"] -dependencies = [ "meshcore >= 1.9.16", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0" ] +dependencies = [ "meshcore >= 1.9.17", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0" ] [project.urls] Homepage = "https://github.com/fdlamotte/meshcore-cli" diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index 6a73ba0..29cf8f9 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -2108,9 +2108,9 @@ async def main(argv): mc = None if not hostname is None : # connect via tcp - mc = await MeshCore.create_tcp(host=hostname, port=port, debug=debug) + mc = await MeshCore.create_tcp(host=hostname, port=port, debug=debug, only_error=json_output) elif not serial_port is None : # connect via serial port - mc = await MeshCore.create_serial(port=serial_port, baudrate=baudrate, debug=debug) + mc = await MeshCore.create_serial(port=serial_port, baudrate=baudrate, debug=debug, only_error=json_output) else : #connect via ble if address is None or address == "" or len(address.split(":")) != 6 : logger.info(f"Scanning BLE for device matching {address}") @@ -2127,7 +2127,7 @@ async def main(argv): logger.info(f"Couldn't find device {address}") return - mc = await MeshCore.create_ble(address=address, debug=debug) + mc = await MeshCore.create_ble(address=address, debug=debug, only_error=json_output) # Store device address in configuration if os.path.isdir(MCCLI_CONFIG_DIR) :