Skip to content

Commit aafdda0

Browse files
author
brentru
committed
handle throttleerrors
1 parent ce611ae commit aafdda0

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

adafruit_io/adafruit_io.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ def _on_message_mqtt(self, client, topic, payload):
174174
messages.append(payload)
175175
topic_name = feeds
176176
message = messages
177+
elif topic_name[1] == "throttle":
178+
raise AdafruitIO_ThrottleError(payload)
177179
elif topic_name[0] == "time":
178180
# Adafruit IO Time Topic
179181
topic_name = topic_name[1]

adafruit_io/adafruit_io_errors.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@
2828

2929

3030
class AdafruitIO_ThrottleError(Exception):
31-
"""Adafruit IO request error class for rate-limiting"""
32-
33-
def __init__(self):
34-
super().__init__(
35-
"Number of Adafruit IO Requests exceeded! \
36-
Please try again in 30 seconds.."
37-
)
31+
"""Adafruit IO request error class for rate-limiting."""
3832

3933

4034
class AdafruitIO_RequestError(Exception):

0 commit comments

Comments
 (0)