File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 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):
205205 """
206206 self ._client .subscribe ('{0}/groups/{1}' .format (self ._username , group_id ))
207207
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+
208219 def subscribe_weather (self , weather_id , forecast_type ):
209220 """Subscribe to Adafruit IO Weather
210221 :param int weather_id: weather record you want data for
Original file line number Diff line number Diff line change 1212from Adafruit_IO import Client , Feed , RequestError
1313
1414# 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 '
1717
1818# Create an instance of the REST client.
1919aio = Client (ADAFRUIT_IO_USERNAME , ADAFRUIT_IO_KEY )
You can’t perform that action at this time.
0 commit comments