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 6363print ("Creating a new Adafruit IO Group..." )
6464sensor_group = io .create_new_group ("envsensors" , "a group of environmental sensors" )
6565
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" ])
6974
7075# Get info from the group
76+ print ("Getting fresh group info..." )
77+ sensor_group = io .get_group ("envsensors" ) # refresh data via HTTP API
7178print (sensor_group )
7279
7380# Delete the group
7481print ("Deleting group..." )
7582io .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