async def _async_dict_to_api(self, api_dict):
    url = api_dict['url']
    method = api_dict['method']
    access_token = api_dict.get('access_token', None)
    del api_dict['url']
    del api_dict['method']
    if access_token:
        del api_dict['access_token']
    payload = (api_dict.get('params') or api_dict.get('json'))
    if ('headers' not in api_dict):
        api_dict['headers'] = _api_headers(access_token=access_token)
    if ('timeout' not in api_dict):
        api_dict['timeout'] = self._timeout
    _LOGGER.debug('About to call %s with header=%s and payload=%s', url, api_dict['headers'], payload)
    attempts = 0
    while (attempts < API_RETRY_ATTEMPTS):
        attempts += 1
        response = (await self._aiohttp_session.request(method, url, **api_dict))
        _LOGGER.debug('Received API response: %s, %s', response.status, (await response.read()))
        if (response.status == 429):
            _LOGGER.debug('August sent a 429 (attempt: %d), sleeping and trying again', attempts)
            asyncio.sleep(API_RETRY_TIME)
            continue
        break
    _raise_response_exceptions(response)
    return response
async def _async_dict_to_api(self, api_dict):
    url = api_dict['url']
    method = api_dict['method']
    access_token = api_dict.get('access_token', None)
    del api_dict['url']
    del api_dict['method']
    if access_token:
        del api_dict['access_token']
    payload = (api_dict.get('params') or api_dict.get('json'))
    if ('headers' not in api_dict):
        api_dict['headers'] = _api_headers(access_token=access_token)
    if ('timeout' not in api_dict):
        api_dict['timeout'] = self._timeout
    _LOGGER.debug('About to call %s with header=%s and payload=%s', url, api_dict['headers'], payload)
    attempts = 0
    while (attempts < API_RETRY_ATTEMPTS):
        attempts += 1
        response = (await self._aiohttp_session.request(method, url, **api_dict))
        _LOGGER.debug('Received API response: %s, %s', response.status, (await response.read()))
        if (response.status == 429):
            _LOGGER.debug('August sent a 429 (attempt: %d), sleeping and trying again', attempts)
            asyncio.sleep(API_RETRY_TIME)
            continue
        break
    _raise_response_exceptions(response)
    return response