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

Add support for dynamic importing of sensor implementations (sensor registry) #24

Open
yatharthranjan opened this issue Apr 6, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@yatharthranjan
Copy link
Member

This would enable keeping a separate registry of sensor implementations and does not need to package in this repo ( as it can grow quite large).
Then the sensor module is loaded at runtime when and where needed based on the configuration provided. We can keep these sensor implementations in a separate repo on github (similar to how we do with questionnaire definitions for the aRMT app).

This would require an abstraction to be added to the loading of Sensors, called SensorLoader, then the default implementation could be LocalSensorLoader which will represent the current behaviour of loading through the local filesystem and another can be added RemoteHttpSensorLoader which will fetch sensor module from HTTP URL. For the latter, the httpimport library can be used. The implementations can then be used here based on what is configured for each sensor.

Another option is to publish the sensor implementations as a python package, install via requirements file and import normally like a module (it does mean that the install (and docker image) size can be large as all senor definitions will be packaged, even the ones that are not used)

@yatharthranjan yatharthranjan added the enhancement New feature or request label Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant