Skip to content

Highlight usage of different methods for group feeds + cleanup multigroup feeds #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions examples/adafruit_io_http/adafruit_io_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,24 @@
print("Creating a new Adafruit IO Group...")
sensor_group = io.create_new_group("envsensors", "a group of environmental sensors")

# Add the 'temperature' feed to the group
print("Adding feed temperature to group...")
io.add_feed_to_group(sensor_group["key"], "temperature")
# Create the 'temperature' feed in the group
print("Creating feed temperature inside group...")
io.create_feed_in_group(sensor_group["key"], "temperature")

# Create the 'humidity' feed then add to group (it will still be in Default group too)
print("Creating feed humidity then adding to group...")
humidity_feed = io.create_new_feed("humidity", "a feed for humidity data")
io.add_feed_to_group(sensor_group["key"], humidity_feed["key"])

# Get info from the group
print("Getting fresh group info...")
sensor_group = io.get_group("envsensors") # refresh data via HTTP API
print(sensor_group)

# Delete the group
print("Deleting group...")
io.delete_group("envsensors")

# Delete the remaining humidity feed (it was in Two Groups so not deleted with our group)
print("Deleting feed humidity (still in default group)...")
io.delete_feed(humidity_feed["key"])
Loading