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

Add Current User info methods #127

Merged
merged 2 commits into from
Oct 4, 2024
Merged

Add Current User info methods #127

merged 2 commits into from
Oct 4, 2024

Conversation

tyeth
Copy link
Contributor

@tyeth tyeth commented Aug 5, 2024

Adds two new methods related to returning the current users info. One for the complete user info, and one just for the throttle/auth/sms rates+limits

Return User Usage Limits / Current Usage towards Throttle Limits with receive_user_rate_info

Return full account info with receive_user_info

Fixes #126

Copy link

github-actions bot commented Aug 5, 2024

👋 Thanks for this pull request! Unfortunately, it looks like the automated continuous integration (CI) test(s) failed. These can be tricky to fix so we've written a guide on how to fix them locally. It has pages about running pre-commit locally and another about building the docs locally with sphinx. Thanks for contributing to CircuitPython! If you have more questions, feel free to join the Adafruit Discord and post in #circuitpython-dev.

@tyeth tyeth force-pushed the tyeth/issue126 branch 4 times, most recently from cb21c07 to ab2f696 Compare August 5, 2024 15:15
@tyeth tyeth marked this pull request as ready for review August 9, 2024 17:54
@tyeth
Copy link
Contributor Author

tyeth commented Aug 9, 2024

@brentru this is ready for review

@tyeth tyeth requested a review from brentru August 9, 2024 17:54
adafruit_io/adafruit_io.py Outdated Show resolved Hide resolved
adafruit_io/adafruit_io.py Outdated Show resolved Hide resolved
@tyeth
Copy link
Contributor Author

tyeth commented Aug 9, 2024 via email

@brentru
Copy link
Member

brentru commented Aug 9, 2024

I was unkeen on get throttle limit as it returns a lot more

Would it be able to return an int or string? It'd be most useful returning something we could parse and use in a sketch to ensure the sketch abides by the limit.

@tyeth
Copy link
Contributor Author

tyeth commented Aug 16, 2024

Now renamed the functions to use the get prefix instead of receive.
Added convenience functions to request just throttle limit, or just usage, or finally the more helpful remaining throttle limit

@tyeth
Copy link
Contributor Author

tyeth commented Aug 16, 2024

@brentru ready for re-review

@tyeth tyeth requested a review from brentru August 16, 2024 15:17
@tyeth
Copy link
Contributor Author

tyeth commented Aug 16, 2024

Spotted I'd not noticed CI was passing two commits before (I was just trying to please Sphynx) so dropped last two commits.

Copy link
Member

@brentru brentru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

adafruit_io/adafruit_io.py Outdated Show resolved Hide resolved
adafruit_io/adafruit_io.py Outdated Show resolved Hide resolved
adafruit_io/adafruit_io.py Outdated Show resolved Hide resolved
…limit and get_remaining_throttle_limit

Return User Usage Limits / Current Usage towards Throttle Limits with `get_user_rate_info`
Return full account info with `get_user_info`
Fixes #126
@tyeth tyeth force-pushed the tyeth/issue126 branch 2 times, most recently from acf508e to 3eed948 Compare October 4, 2024 15:33
@tyeth tyeth merged commit ccc38de into main Oct 4, 2024
2 checks passed
@tyeth
Copy link
Contributor Author

tyeth commented Oct 4, 2024

Example added as part of testing before merge. Closing out

@tyeth tyeth deleted the tyeth/issue126 branch October 4, 2024 15:53
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 5, 2024
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.

Return User Usage Limits / Current Usage towards Throttle Limits
2 participants