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?
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?