# Buggy code
async def read_gatt_char(self, _uuid: str) -> bytearray:
    """Read the data on a GATT characteristic.

    Args:
        _uuid (str or uuid.UUID): UUID for the characteristic to read from.

    Returns:
        Byte array of data.

    """
    char_props = self.characteristics.get(str(_uuid))
    if not char_props:
        # TODO: Raise error instead?
        return None

    value = bytearray(
        await self._bus.callRemote(
            char_props.get("Path"),
            "ReadValue",
            interface=defs.GATT_CHARACTERISTIC_INTERFACE,
            destination=defs.BLUEZ_SERVICE,
            signature="a{sv}",
            body=[{}],
            returnSignature="ay",
        ).asFuture(self.loop)
    )

    logger.debug(
        "Read Characteristic {0} | {1}: {2}".format(
            _uuid, char_props.get("Path"), value
        )
    )
    return value


# 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 read_gatt_char(self, _uuid: str) -> bytearray:
    """Read the data on a GATT characteristic.

    Args:
        _uuid (str or uuid.UUID): UUID for the characteristic to read from.

    Returns:
        Byte array of data.

    """
    characteristic = self.services.get_characteristic(str(_uuid))
    if not characteristic:
        # Special handling for BlueZ >= 5.48, where Battery Service (0000180f-0000-1000-8000-00805f9b34fb:)
        # has been moved to interface org.bluez.Battery1 instead of as a regular service.
        if _uuid == "00002a19-0000-1000-8000-00805f9b34fb" and (
            self._bluez_version[0] == 5 and self._bluez_version[1] >= 48
        ):
            props = await self._get_device_properties(interface=defs.BATTERY_INTERFACE)
            # Simulate regular characteristics read to be consistent over all platforms.
            value = bytearray([props.get("Percentage", "")])
            logger.debug(
                "Read Battery Level {0} | {1}: {2}".format(
                    _uuid, self._device_path, value
                )
            )
            return value
        raise BleakError(
            "Characteristic with UUID {0} could not be found!".format(_uuid)
        )

    value = bytearray(
        await self._bus.callRemote(
            characteristic.path,
            "ReadValue",
            interface=defs.GATT_CHARACTERISTIC_INTERFACE,
            destination=defs.BLUEZ_SERVICE,
            signature="a{sv}",
            body=[{}],
            returnSignature="ay",
        ).asFuture(self.loop)
    )

    logger.debug(
        "Read Characteristic {0} | {1}: {2}".format(_uuid, characteristic.path, value)
    )
    return value