only log errors if json_output

This commit is contained in:
Florent de Lamotte 2025-07-18 14:16:12 +02:00
parent a726309a89
commit cf106dfe4c
2 changed files with 5 additions and 5 deletions

View file

@ -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"

View file

@ -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) :