Skip to content

Include event keys in result data structure #57

Description

@rflemming

Adding @bsileo since he might be interested:

The data returned via socketio events could benefit on being standardized. Regardless of whether you are asking for "all", "circuit", "temp", etc the resulting data structure should contain the appropriate event keys. ie

"all" would produce: "{ 'circuits': ..., 'temperatures': ...}"
"circuit" would produce: "{ 'circuits': ... }"
"temp" would produce: "{ 'temp': ...}"

As-is the event key is left out when subscribing to the more specific event type. The issue is, that means the parser needs to know what type of message it's getting in each case. If you're just sending the data somewhere else you might need to pass along that metadata via an alternate channel. If the data structure produced had the event key names in place the same parser can be used for every event without additional info or trying to guess.

Make sense?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions