From 69b4121e8c978db0e2dd1370c76518a4617f2f20 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Tue, 25 Jul 2023 12:07:29 +0200 Subject: [PATCH] python --- python/src/trezorlib/cli/ble.py | 1 + python/src/trezorlib/transport/ble.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/src/trezorlib/cli/ble.py b/python/src/trezorlib/cli/ble.py index 1a1411259..bef455f90 100644 --- a/python/src/trezorlib/cli/ble.py +++ b/python/src/trezorlib/cli/ble.py @@ -99,6 +99,7 @@ def disconnect_device(client: "TrezorClient") -> None: click.echo(f"Disconnect failed: {e}") sys.exit(3) + @cli.command() @click.option("--device", is_flag=True, help="Disconnect from device side.") def disconnect(device: bool) -> None: diff --git a/python/src/trezorlib/transport/ble.py b/python/src/trezorlib/transport/ble.py index 54c24874f..a9da0f5e4 100644 --- a/python/src/trezorlib/transport/ble.py +++ b/python/src/trezorlib/transport/ble.py @@ -218,10 +218,14 @@ class BleAsync: return ble_device = self.devices[self.current] if ble_device.connected: - LOG.info("Disconnecting from %s (%s)..." % (ble_device.name, ble_device.address)) + LOG.info( + "Disconnecting from %s (%s)..." % (ble_device.name, ble_device.address) + ) await ble_device.disconnect() else: - LOG.info("Disconnected from %s (%s)." % (ble_device.name, ble_device.address)) + LOG.info( + "Disconnected from %s (%s)." % (ble_device.name, ble_device.address) + ) self.current = None self.rx = None self.tx = None