Skip to content

Commit a03f98f

Browse files
re-add tuple and add more typehints
1 parent 04d1a68 commit a03f98f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adafruit_io/adafruit_io.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def subscribe_to_errors(self):
289289
"""
290290
self._client.subscribe("%s/errors" % self._user)
291291

292-
def subscribe_to_randomizer(self, randomizer_id):
292+
def subscribe_to_randomizer(self, randomizer_id: int):
293293
"""Subscribes to a random data stream created by the Adafruit IO Words service.
294294
295295
:param int randomizer_id: Random word record you want data for.
@@ -298,7 +298,7 @@ def subscribe_to_randomizer(self, randomizer_id):
298298
"{0}/integration/words/{1}".format(self._user, randomizer_id)
299299
)
300300

301-
def subscribe_to_weather(self, weather_record, forecast):
301+
def subscribe_to_weather(self, weather_record: int, forecast: str):
302302
"""Subscribes to a weather forecast using the Adafruit IO PLUS weather
303303
service. This feature is only avaliable to Adafruit IO PLUS subscribers.
304304
@@ -324,7 +324,7 @@ def subscribe_to_time(self, time_type):
324324
else:
325325
self._client.subscribe("time/" + time_type)
326326

327-
def unsubscribe(self, feed_key=None, group_key=None, shared_user=None):
327+
def unsubscribe(self, feed_key: str=None, group_key: str=None, shared_user: str=None):
328328
"""Unsubscribes from an Adafruit IO feed or group.
329329
Can also subscribe to someone else's feed.
330330
@@ -364,11 +364,11 @@ def unsubscribe(self, feed_key=None, group_key=None, shared_user=None):
364364
raise AdafruitIO_MQTTError("Must provide a feed_key or group_key.")
365365

366366
# Publishing
367-
def publish_multiple(self, feeds_and_data, timeout=3, is_group=False):
367+
def publish_multiple(self, feeds_and_data: List, timeout: int=3, is_group: bool=False):
368368
"""Publishes multiple data points to multiple feeds or groups with a variable
369369
timeout.
370370
371-
:param str feeds_and_data: List of tuples containing topic strings and data values.
371+
:param list feeds_and_data: List of tuples containing topic strings and data values.
372372
:param int timeout: Delay between publishing data points to Adafruit IO, in seconds.
373373
:param bool is_group: Set to True if you're publishing to a group.
374374

0 commit comments

Comments
 (0)