Skip to content

Commit

Permalink
Adding more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
SeraphicRav committed Jan 12, 2025
1 parent 43660ac commit 69e9c6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "switchbot_api"
version = "2.3.0"
version = "2.3.1"
description = "An asynchronous library to use Switchbot API"
authors = ["Ravaka Razafimanantsoa <[email protected]>"]
license = "MIT"
Expand Down
3 changes: 2 additions & 1 deletion switchbot_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ async def _request(self, path: str = "", callback: str = "get", json=None):
body = await response.json()

if response.status >= 400:
_LOGGER.error("Error %d: %s", response.status, body)
raise CannotConnect()

match body.get("statusCode"):
Expand All @@ -232,7 +233,7 @@ async def _request(self, path: str = "", callback: str = "get", json=None):
# online too.
raise DeviceOffline()
case _:
_LOGGER.error("Error %s: %s", response.status, body)
_LOGGER.error("Error %d: %s", response.status, body)
raise CannotConnect()

async def list_devices(self) -> list[Device | Remote]:
Expand Down

0 comments on commit 69e9c6b

Please sign in to comment.