Skip to content

Commit 4b2a384

Browse files
author
brentru
committed
addressing #104
1 parent 9cc19e4 commit 4b2a384

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Adafruit_IO/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,15 @@ def feeds(self, feed=None):
273273
path = "feeds/{0}".format(feed)
274274
return Feed.from_dict(self._get(path))
275275

276-
def create_feed(self, feed):
276+
def create_feed(self, feed, group_key=None):
277277
"""Create the specified feed.
278-
:param string feed: Name/Key/ID of Adafruit IO feed.
278+
:param string feed: Key of Adafruit IO feed.
279+
:param group_key group: Group to place new feed in.
279280
"""
280281
path = "feeds/"
282+
if group_key is not None: # create feed in a group
283+
path="/groups/%s/feeds"%group_key
284+
return Feed.from_dict(self._post(path, {"feed": feed._asdict()}))
281285
return Feed.from_dict(self._post(path, {"feed": feed._asdict()}))
282286

283287
def delete_feed(self, feed):

0 commit comments

Comments
 (0)