File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
examples/adafruit_io_http Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 63
63
print ("Creating a new Adafruit IO Group..." )
64
64
sensor_group = io .create_new_group ("envsensors" , "a group of environmental sensors" )
65
65
66
- # Add the 'temperature' feed to the group
67
- print ("Adding feed temperature to group..." )
68
- io .add_feed_to_group (sensor_group ["key" ], "temperature" )
66
+ # Create the 'temperature' feed in the group
67
+ print ("Creating feed temperature inside group..." )
68
+ io .create_feed_in_group (sensor_group ["key" ], "temperature" )
69
+
70
+ # Create the 'humidity' feed then add to group (it will still be in Default group too)
71
+ print ("Creating feed humidity then adding to group..." )
72
+ humidity_feed = io .create_new_feed ("humidity" , "a feed for humidity data" )
73
+ io .add_feed_to_group (sensor_group ["key" ], humidity_feed ["key" ])
69
74
70
75
# Get info from the group
76
+ print ("Getting fresh group info..." )
77
+ sensor_group = io .get_group ("envsensors" ) # refresh data via HTTP API
71
78
print (sensor_group )
72
79
73
80
# Delete the group
74
81
print ("Deleting group..." )
75
82
io .delete_group ("envsensors" )
83
+
84
+ # Delete the remaining humidity feed (it was in Two Groups so not deleted with our group)
85
+ print ("Deleting feed humidity (still in default group)..." )
86
+ io .delete_feed (humidity_feed ["key" ])
You can’t perform that action at this time.
0 commit comments