# Buggy code
async def get_services(self) -> dict:
    # Return a list of all services for the device.
    if self.services:
        return self.services
    else:
        logger.debug("Get Services...")
        services = await wrap_Task(
            self._bridge.GetGattServicesAsync(self._requester), loop=self.loop
        )
        if services.Status == GattCommunicationStatus.Success:
            self.services = {s.Uuid.ToString(): s for s in services.Services}
        else:
            raise BleakDotNetTaskError("Could not get GATT services.")

        # TODO: Could this be sped up?
        await asyncio.gather(
            *[
                asyncio.ensure_future(self._get_chars(service), loop=self.loop)
                for service_uuid, service in self.services.items()
            ]
        )
        self._services_resolved = True
        return self.services


# 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 get_services(self) -> BleakGATTServiceCollection:
    # Return the Service Collection.
    if self._services_resolved:
        return self.services
    else:
        logger.debug("Get Services...")
        services_result = await wrap_IAsyncOperation(
            IAsyncOperation[GattDeviceServicesResult](
                self._requester.GetGattServicesAsync()
            ),
            return_type=GattDeviceServicesResult,
            loop=self.loop,
        )

        if services_result.Status != GattCommunicationStatus.Success:
            raise BleakDotNetTaskError("Could not get GATT services.")

        # TODO: Check if fetching yeilds failures...
        for service in services_result.Services:
            characteristics_result = await wrap_IAsyncOperation(
                IAsyncOperation[GattCharacteristicsResult](
                    service.GetCharacteristicsAsync()
                ),
                return_type=GattCharacteristicsResult,
                loop=self.loop,
            )
            self.services.add_service(BleakGATTServiceDotNet(service))
            if characteristics_result.Status != GattCommunicationStatus.Success:
                raise BleakDotNetTaskError(
                    "Could not get GATT characteristics for {0}.".format(service)
                )
            for characteristic in characteristics_result.Characteristics:
                descriptors_result = await wrap_IAsyncOperation(
                    IAsyncOperation[GattDescriptorsResult](
                        characteristic.GetDescriptorsAsync()
                    ),
                    return_type=GattDescriptorsResult,
                    loop=self.loop,
                )
                self.services.add_characteristic(
                    BleakGATTCharacteristicDotNet(characteristic)
                )
                if descriptors_result.Status != GattCommunicationStatus.Success:
                    raise BleakDotNetTaskError(
                        "Could not get GATT descriptors for {0}.".format(characteristic)
                    )
                for descriptor in list(descriptors_result.Descriptors):
                    self.services.add_descriptor(
                        BleakGATTDescriptorDotNet(
                            descriptor, characteristic.Uuid.ToString()
                        )
                    )

        self._services_resolved = True
        return self.services