adafruit / Adafruit_CircuitPython_AdafruitIO

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

add_feed_to_group() is not working - used adafruit_io_groups.py example as a test case. #119

Closed thejunglejim closed 4 months ago

thejunglejim commented 4 months ago

Running the adafruit_io_groups.py example causes the following error:

Adafruit IO Error 404: not found - API documentation can be found at https://io.adafruit.com/api/docs

The line causes that error: https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/blob/c9ad360969a4c5f26aa172c2f945b7b389fa4a3c/examples/adafruit_io_http/adafruit_io_groups.py#L68

tyeth commented 4 months ago

Ignoring the Curl option for one moment... I didn't get two feeds of the same name created when running the newer group example, although it looks initially like that on the website, but instead it gets associated to two groups. Check the feed test, you should see it is one feed with two entries in the groups collection.

If you alter the new group demo to re-fetch the humidity group where it re-fetches the latest group data, and print it, you should see the feed has two groups associated (the original - default in this case - and envvars or whatever was passed to add_feed_to_group). You could add a pause, or comment out the deletion code, then inspect the website and fetch the feed data freshly again then print the objects/json.

On Tue, 25 Jun 2024, 22:10 Jungle Jim, @.***> wrote:

I believe I found the bug - It is the API. It wants a feed that already exists .... but then goes and creates a new feed in the group regardless.

Not sure how to re-open this issue

— Reply to this email directly, view it on GitHub https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/issues/119#issuecomment-2189975431, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTBZ4YFEAQIXKL6QF4B7YTZJHMDBAVCNFSM6AAAAABJ2ME4T2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBZHE3TKNBTGE . You are receiving this because you were assigned.Message ID: @.*** com>

thejunglejim commented 4 months ago

A feed can belong to more than one group but it is still the same feed - now it makes sense.

Thanks @tyeth for the help and explanation.