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

Idea: Use parse.js to automatically create Summon UIs #26

Open
bradjc opened this issue Dec 2, 2016 · 0 comments
Open

Idea: Use parse.js to automatically create Summon UIs #26

bradjc opened this issue Dec 2, 2016 · 0 comments

Comments

@bradjc
Copy link
Member

bradjc commented Dec 2, 2016

To use our generic gateway, devices create a parse.js file which translates BLE advertisements to JSON blobs. An idea I had is to use the parse.js file in Summon to create the JSON blob, then that could be passed to an application (removing the need to write the parsing code twice in some cases) which would then display it. That idea could be extended, however, to just display the JSON blob itself if the device does not have an application. The keys are intended to be humanly readable with units, so theoretically a UI could be autogenerated by parsing the JSON keys.

This could also be potentially further expanded to allow a device creator to define a simple file that would essentially be a list of macro substantiations. Something like:

 [
     {"display_type": "integer",
      "parsejs_key": "sensor_reading_1"},
    {"display_type": "time_series_graph",
     "parsejs_key": "temperature",
     "units": "celsius"}
 ]

Then Summon would generate a UI based on that.

I have been successful in getting parse.js to work in cordova: https://github.com/lab11/gateway/blob/master/smartphone/cordova/www/js/index.js

Thoughts?

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