# Buggy code
async def connect(self) -> bool:
    """Connect the BleakClient to the BLE device.

    Returns:
        Boolean from :meth:`~is_connected`.

    """
    # Try to find the desired device.
    devices = await discover(2.0, loop=self.loop)
    sought_device = list(
        filter(lambda x: x.address.upper() == self.address.upper(), devices)
    )

    if len(sought_device):
        self._device_info = sought_device[0].details
    else:
        raise BleakError("Device with address {0} was not found.".format(self.address))

    logger.debug("Connecting to BLE device @ {0}".format(self.address))
    self._requester = await wrap_Task(
        self._bridge.BluetoothLEDeviceFromIdAsync(self._device_info.Id),
        loop=self.loop,
    )

    def _ConnectionStatusChanged_Handler(sender, args):
        logger.debug("_ConnectionStatusChanged_Handler: " + args.ToString())

    self._requester.ConnectionStatusChanged += _ConnectionStatusChanged_Handler

    # Obtain services, which also leads to connection being established.
    await self.get_services()
    await asyncio.sleep(0.2, loop=self.loop)
    connected = await self.is_connected()
    if connected:
        logger.debug("Connection successful.")
    else:
        raise BleakError("Connection to {0} was not successful!".format(self.address))

    return connected


# Traceback (bleak.exc.BleakError)
Traceback (most recent call last):
File "/home/jonas/Schreibtisch/TMRTFlib.py", line 572, in <module>
loop.run_until_complete(connect_device_bleak(address, loop))
File "/usr/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete
return future.result()
File "/home/jonas/Schreibtisch/TMRTFlib.py", line 552, in connect_device_bleak
async with BleakClient(address, loop=loop) as client:
File "/home/jonas/.local/lib/python3.6/site-packages/bleak/backends/client.py", line 35, in __aenter__
await self.connect()
File "/home/jonas/.local/lib/python3.6/site-packages/bleak/backends/bluezdbus/client.py", line 76, in connect
raise BleakError(str(e))
bleak.exc.BleakError: org.freedesktop.DBus.Error.UnknownObject: Method "Connect" with signature "" on interface "org.bluez.Device1" doesn't exist

# Fixed code
async def connect(self) -> bool:
    """Connect the BleakClient to the BLE device.

    Returns:
        Boolean from :meth:`~is_connected`.

    """
    # Try to find the desired device.
    devices = await discover(2.0, loop=self.loop)
    sought_device = list(
        filter(lambda x: x.address.upper() == self.address.upper(), devices)
    )

    if len(sought_device):
        self._device_info = sought_device[0].details
    else:
        raise BleakError("Device with address {0} was not found.".format(self.address))

    logger.debug("Connecting to BLE device @ {0}".format(self.address))
    self._requester = await wrap_IAsyncOperation(
        IAsyncOperation[BluetoothLEDevice](
            BluetoothLEDevice.FromIdAsync(self._device_info.Id)
        ),
        return_type=BluetoothLEDevice,
        loop=self.loop,
    )

    def _ConnectionStatusChanged_Handler(sender, args):
        logger.debug("_ConnectionStatusChanged_Handler: " + args.ToString())

    self._requester.ConnectionStatusChanged += _ConnectionStatusChanged_Handler

    # Obtain services, which also leads to connection being established.
    await self.get_services()
    await asyncio.sleep(0.2, loop=self.loop)
    connected = await self.is_connected()
    if connected:
        logger.debug("Connection successful.")
    else:
        raise BleakError("Connection to {0} was not successful!".format(self.address))

    return connected