Skip to content

Commit

Permalink
Swap to reuse get_user_rate_info
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Oct 4, 2024
1 parent 5338269 commit 3f118ec
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions adafruit_io/adafruit_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,7 @@ def get_remaining_throttle_limit(self):
See https://io.adafruit.com/api/docs/#get-detailed-user-info
"""
path = self._compose_path("throttle")
user_rates = self._get(path)
user_rates = self.get_user_rate_info()
if user_rates is None:
raise ValueError(
"Could not get user info, get_user_rate_info returned None."
Expand All @@ -907,8 +906,7 @@ def get_throttle_limit(self):
See https://io.adafruit.com/api/docs/#get-detailed-user-info
"""
path = self._compose_path("throttle")
user_rates = self._get(path)
user_rates = self.get_user_rate_info()
if user_rates is None:
raise ValueError(
"Could not get user info, get_user_rate_info returned None."
Expand All @@ -921,8 +919,7 @@ def get_current_usage(self):
See https://io.adafruit.com/api/docs/#get-detailed-user-info
"""
path = self._compose_path("throttle")
user_rates = self._get(path)
user_rates = self.get_user_rate_info()
if user_rates is None:
raise ValueError(
"Could not get user info, get_user_rate_info returned None."
Expand Down

0 comments on commit 3f118ec

Please sign in to comment.