Skip to content

Commit

Permalink
Merge pull request #50 from brentru/fix-throttling-message-parsing
Browse files Browse the repository at this point in the history
Fix Throttling Message Parsing
  • Loading branch information
brentru committed Nov 13, 2020
2 parents ce611ae + aafdda0 commit bf20b69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions adafruit_io/adafruit_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def _on_message_mqtt(self, client, topic, payload):
messages.append(payload)
topic_name = feeds
message = messages
elif topic_name[1] == "throttle":
raise AdafruitIO_ThrottleError(payload)
elif topic_name[0] == "time":
# Adafruit IO Time Topic
topic_name = topic_name[1]
Expand Down
8 changes: 1 addition & 7 deletions adafruit_io/adafruit_io_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@


class AdafruitIO_ThrottleError(Exception):
"""Adafruit IO request error class for rate-limiting"""

def __init__(self):
super().__init__(
"Number of Adafruit IO Requests exceeded! \
Please try again in 30 seconds.."
)
"""Adafruit IO request error class for rate-limiting."""


class AdafruitIO_RequestError(Exception):
Expand Down

0 comments on commit bf20b69

Please sign in to comment.