Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional logging, fix blinksync json #844

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions blinkpy/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,11 @@ async def query(
url=url, data=data, headers=headers, timeout=timeout
)
return await self.validate_response(response, json_resp)
except (ClientConnectionError, TimeoutError):
except (ClientConnectionError, TimeoutError) as er:
_LOGGER.error(
"Connection error. Endpoint %s possibly down or throttled.",
"Connection error. Endpoint %s possibly down or throttled. Error: %s",
url,
er,
)
except BlinkBadResponse:
code = None
Expand Down Expand Up @@ -220,8 +221,11 @@ async def send_auth_key(self, blink, key):
if not blink.available:
_LOGGER.error("%s", json_resp["message"])
return False
except (KeyError, TypeError, ContentTypeError):
_LOGGER.error("Did not receive valid response from server.")
except (KeyError, TypeError, ContentTypeError) as er:
_LOGGER.error(
"Did not receive valid response from server. Error: %s",
er,
)
return False
return True

Expand Down
1 change: 1 addition & 0 deletions blinksync/blinksync.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ async def main():
working = None
frame = None
await session.close()
await blink.save(f"{path}/blink.json")


# Run the program
Expand Down
Loading