adafruit / Adafruit_CircuitPython_AdafruitIO

Adafruit IO for CircuitPython
http://io.adafruit.com
MIT License
49 stars 33 forks source link

Remove documentation for subscribing to multiple feeds #104

Closed spovlot closed 1 year ago

spovlot commented 1 year ago

The code does not provide for this.

brentru commented 1 year ago

@spovlot The code does allow this, please see: https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/blob/main/adafruit_io/adafruit_io.py#L242

spovlot commented 1 year ago

Looking at the code, I only see that it handles a single feed key.

elif feed_key is not None: validate_feed_key(feed_key) self._client.subscribe("{0}/f/{1}".format(self._user, feed_key)) https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/blob/main/adafruit_io/adafruit_io.py#L269

I would expect to see some code to iterate over the array.

spovlot commented 1 year ago

@brentru See my comment above. Can you explain how multiple feeds are handled in the subscribe method?

dhalbert commented 1 year ago

@brentru I think the point is that this example is in the inline-doc: https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/blob/91efc34c12a9a447f9196683fb66a860ecbbab1c/adafruit_io/adafruit_io.py#L256-L261. But subscribe() does not take a sequence of feed keys, only a single key. I assume you can call it multiple times. So that example should maybe be removed.

brentru commented 1 year ago

@dhalbert @spovlot Yep, I see it now. It used to function this way but does not currently. Approving this PR to remove example code that doesn't match the library. Thank you both!