1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00
This commit is contained in:
tychovrahe 2023-07-25 12:07:29 +02:00
parent 70d16d4523
commit 90677e5482
2 changed files with 7 additions and 2 deletions

View File

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

View File

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