File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,17 @@ def subscribe_group(self, group_id):
205
205
"""
206
206
self ._client .subscribe ('{0}/groups/{1}' .format (self ._username , group_id ))
207
207
208
+ def subscribe_randomizer (self , randomizer_id ):
209
+ """Subscribe to changes on a specified random data stream from
210
+ Adafruit IO's random data service.
211
+
212
+ MQTT random word subscriptions will publish data once per minute to
213
+ every client that is subscribed to the same topic.
214
+
215
+ :param int randomizer_id: ID of the random word record you want data for.
216
+ """
217
+ self ._client .subscribe ('{0}/integration/words/{1}' .format (self ._username , randomizer_id ))
218
+
208
219
def subscribe_weather (self , weather_id , forecast_type ):
209
220
"""Subscribe to Adafruit IO Weather
210
221
:param int weather_id: weather record you want data for
Original file line number Diff line number Diff line change 12
12
from Adafruit_IO import Client , Feed , RequestError
13
13
14
14
# Set to your Adafruit IO key.
15
- ADAFRUIT_IO_USERNAME = 'USER '
16
- ADAFRUIT_IO_KEY = 'KEY '
15
+ ADAFRUIT_IO_USERNAME = 'brubell '
16
+ ADAFRUIT_IO_KEY = '6ec4b31bd2c54a09be911e0c1909b7ab '
17
17
18
18
# Create an instance of the REST client.
19
19
aio = Client (ADAFRUIT_IO_USERNAME , ADAFRUIT_IO_KEY )
You can’t perform that action at this time.
0 commit comments