Skip to content

Commit

Permalink
Tidied up API debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-r committed Jan 1, 2024
1 parent ccdae3d commit 929f6f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/ohme/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ async def _post_request(self, url, skip_json=False, data=None):
data=data,
headers=self._get_headers()
) as resp:
_LOGGER.debug(f"POST request to {url}, status code {resp.status}")
await self._handle_api_error(url, resp)

if skip_json:
Expand All @@ -133,6 +134,7 @@ async def _put_request(self, url, data=None):
data=json.dumps(data),
headers=self._get_headers()
) as resp:
_LOGGER.debug(f"PUT request to {url}, status code {resp.status}")
await self._handle_api_error(url, resp)

return True
Expand All @@ -144,7 +146,7 @@ async def _get_request(self, url):
url,
headers=self._get_headers()
) as resp:
_LOGGER.debug(f"API request to {url} status code {resp.status}, text: {await resp.text()}")
_LOGGER.debug(f"GET request to {url}, status code {resp.status}")
await self._handle_api_error(url, resp)

return await resp.json()
Expand Down

0 comments on commit 929f6f3

Please sign in to comment.