File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change 11# Simple example of sending and receiving values from Adafruit IO with the REST
22# API client.
3- # Author: Tony Dicola, Justin Cooper
3+ # Author: Tony Dicola, Justin Cooper, Brent Rubell
44
55# Import Adafruit IO REST client.
66from Adafruit_IO import Client , Feed
1919aio = Client (ADAFRUIT_IO_USERNAME , ADAFRUIT_IO_KEY )
2020
2121# List all of your feeds
22+ print ("Obtaining user's feeds..." )
2223feeds = aio .feeds ()
23- print (feeds )
24+ print ('Feeds: ' , feeds )
2425
2526# Create a new feed
27+ print ("Creating new feed..." )
2628feed = Feed (name = "PythonFeed" )
2729response = aio .create_feed (feed )
28- print (response )
29-
30- # List a specific feed
31- feed = aio .feeds (response .key )
32- print (feed )
33-
30+ print ("New feed: " , response )
3431
3532# Delete a feed
3633aio .delete_feed (response .key )
34+
35+ # Create feed in a group
36+ feed = Feed (name = "PythonGroupFeed" )
37+ group_key = "example"
38+ print ("Creating feed in group %s" % group_key )
39+ response = aio .create_feed (feed , group_key )
40+ print ("New feed: " , response )
41+
42+ print (response .key )
43+
44+ # Delete a feed within a group
45+ print ("Deleting feed within group %s" % group_key )
46+ aio .delete_feed (response .key )
You can’t perform that action at this time.
0 commit comments