8000 use of . and dot and groups (using circuitpython) · Issue #76 · adafruit/Adafruit_CircuitPython_AdafruitIO · GitHub 8000
[go: up one dir, main page]

Skip to content
use of . and dot and groups (using circuitpython) #76
Open
@slootsky

Description

@slootsky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0