File tree 1 file changed +18
-8
lines changed
1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change 1
1
# Simple example of sending and receiving values from Adafruit IO with the REST
2
2
# API client.
3
- # Author: Tony Dicola, Justin Cooper
3
+ # Author: Tony Dicola, Justin Cooper, Brent Rubell
4
4
5
5
# Import Adafruit IO REST client.
6
6
from Adafruit_IO import Client , Feed
19
19
aio = Client (ADAFRUIT_IO_USERNAME , ADAFRUIT_IO_KEY )
20
20
21
21
# List all of your feeds
22
+ print ("Obtaining user's feeds..." )
22
23
feeds = aio .feeds ()
23
- print (feeds )
24
+ print ('Feeds: ' , feeds )
24
25
25
26
# Create a new feed
27
+ print ("Creating new feed..." )
26
28
feed = Feed (name = "PythonFeed" )
27
29
response = 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 )
34
31
35
32
# Delete a feed
36
33
aio .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