Closed tyeth closed 3 weeks ago
👋 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.
@brentru this is ready for review
I was unkeen on get throttle limit as it returns a lot more, also when I added the example output it caused no end of pylint issues so I removed it. I'll have another go
On Fri, 9 Aug 2024 at 19:53, Brent Rubell @.***> wrote:
@.**** requested changes on this pull request.
In adafruit_io/adafruit_io.py https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/pull/127#discussion_r1711994945 :
@@ -855,6 +855,23 @@ def receive_random_data(self, generator_id: int): path = self._compose_path("integrations/words/{0}".format(generator_id)) return self._get(path)
- def receive_user_info(self):
- """
- Get detailed account information for the current user.
- See https://io.adafruit.com/api/docs/#get-user-info
- """
- return self._get("https://io.adafruit.com/api/v2/user")
- def receive_user_rate_info(self):
If we don't include this as an example, please add example output to the docstring so people know roughly what will happen when they call this method
In adafruit_io/adafruit_io.py https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/pull/127#discussion_r1711995938 :
@@ -855,6 +855,23 @@ def receive_random_data(self, generator_id: int): path = self._compose_path("integrations/words/{0}".format(generator_id)) return self._get(path)
- def receive_user_info(self):
- """
- Get detailed account information for the current user.
- See https://io.adafruit.com/api/docs/#get-user-info
- """
- return self._get("https://io.adafruit.com/api/v2/user")
- def receive_user_rate_info(self):
maybe get_throttle_limit instead
— Reply to this email directly, view it on GitHub https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/pull/127#pullrequestreview-2230857014, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTBZ44ABVB2BZ7V7NSL5RDZQUFZJAVCNFSM6AAAAABMAPAH36VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDEMZQHA2TOMBRGQ . You are receiving this because you authored the thread.Message ID: <adafruit/Adafruit_CircuitPython_AdafruitIO/pull/127/review/2230857014@ github.com>
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.
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
@brentru ready for re-review
Spotted I'd not noticed CI was passing two commits before (I was just trying to please Sphynx) so dropped last two commits.
Example added as part of testing before merge. Closing out
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