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

Save successfully login sessions, re-use them next time + small code cleanup #175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Arecsu
Copy link

@Arecsu Arecsu commented Nov 17, 2024

Implemented a new class: EzvizSessionManager.

  • It manages persistent token and session data on disk
  • Uses sane default config locations across Linux, Windows and macOS
  • If EzvizClient email + api_url does not coincide with saved token, it will attempt to login again.
  • Config dir can change via arguments

Small code cleanup:

  • Using new match case in _login
  • Added a new error code for wrong username and password
  • Replacing initial call of client.login() with client.start(). Name and logic should make more sense now that we have persistent login.

I did this in fear of calling login API endpoints to Ezviz so many times that it might break something. It also saves a potential API call by skipping the login process if there's a saved session. Not that much but feels good :)

@RenierM26
Copy link
Collaborator

Hi @Arecsu,

The original pypi package maintainer is no longer available to add a verified email address. I have decided to move this project to a new github repository with a corresponding pypi package.

https://github.com/RenierM26/pyEzvizApi

Could you open a new pull request? Sorry for the extra effort but this is required otherwise we won't be able to do new pypi releases.

@Arecsu
Copy link
Author

Arecsu commented Jan 4, 2025

Hi @Arecsu,

The original pypi package maintainer is no longer available to add a verified email address. I have decided to move this project to a new github repository with a corresponding pypi package.

https://github.com/RenierM26/pyEzvizApi

Could you open a new pull request? Sorry for the extra effort but this is required otherwise we won't be able to do new pypi releases.

Alright! I'll try to make a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants