Skip to content
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

use of . and dot and groups (using circuitpython) #76

Open
slootsky opened this issue Jun 28, 2021 · 0 comments
Open

use of . and dot and groups (using circuitpython) #76

slootsky opened this issue Jun 28, 2021 · 0 comments

Comments

@slootsky
Copy link

I posted in one of the adafruit forums, and it was suggested that I submit an issue here.

So, I'm playing with the funhouse, sending feeds for different sensors, and I want to create a group "Test" for my test feeds to go into before deploying it to my Garage, and putting those feeds into the group "Garage"

I created a group Test and a group Garage.

I didn't create any feeds, I was going to let the circuitpython create the feeds as it pushes data.

Then in my circuitpython, I got it to push data to "test.temperature" but what it created was a feed with the name "test.temperature" and the key "test-dot-temperature" :-D

That's not too bad, and kindof understandable, but then it can't continue to push to that feed.

I get the error

  File "adafruit_portalbase/network.py", line 380, in push_to_io
  File "adafruit_io/adafruit_io.py", line 682, in create_new_feed
  File "adafruit_io/adafruit_io.py", line 518, in _post
  File "adafruit_io/adafruit_io.py", line 498, in _handle_error
AdafruitIO_RequestError: Adafruit IO Error 400: ['Name must be unique within the selected group', 'Key must be unique within the selected group', 'Group feeds is invalid']

So it seems there's an inconsistency between the servercode behind
GET feeds/{0} (called from get_feed in adafruit_io/adafruit_io.py
and the server code behind
POST feeds {"name": feed_key ... } (called from create_new_feed in adafruit_io/adafruit_io.py

looks like create_new_feed replaces the . with -dot- but that same replacement isn't done when get_feed is called.

I worked around it by pre-creating my feeds in the group, and then the code behaves as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant