-
Notifications
You must be signed in to change notification settings - Fork 24
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
'Plugin' loader #35
base: master
Are you sure you want to change the base?
'Plugin' loader #35
Conversation
* Hooks into System UI menu * Sends MQTT messages to Ender's hand * Intensity (duration) of the trigger is controlled by a fun slider-based interface * Hopefully a well commented example of how to do some things ... including things you maybe aren't supposed to like stomp on the System UI :)
* Sent acks back to a different topic (/shake), and tag with the shakers identifier for future success/failure indicator (right now it's basically UDP! :)
This is very useful to add persistant code to your badge, while retaining the functionlity of the boot application. You can extend or add functionality, test random code snippits and experiments in a persistant but easily revertable way. I admit this may be more useful for a 'always-on' wearable like a badge, and not all Aiko implementations... so if it's not acceptable globally in main.py, let me know and I'll refactor the patch :)
great, I was considering something similar. I see you are loading other code, but I didn't see anything that runs initialise() or run() in that imported code. How does that part work? |
At the moment, the plugin just calls it's own init functions at the bottom of the file: I'm hoping to extend this with some UI to enable/disable plugins in the future - at that point it would be a more selective load process, so each plugin may need explicit constructor and destructor functions. Left as an exercise to the reader for now tho! |
I hacked up another plugin system in another branch, not realising @Enderboi'd already raised a PR—my comments above were on his commit. I'm sorry for the toe-treading. A couple paragraphs from its README might still be appropriate for this version:
The not-applications part riffs off comments by @geekscape in Spectrum and the BOF chat; sorry in advance if I got your take wrong there Andy. Differences between the systems, documentation aside:
Other handy changes:
Steal what you want. :) |
I find adding this little bit of code very useful for Badge Development - so putting it out there in case someone else does.
Why for Vogons-sake did I write this, instead of using the application framework?
Well, this little hack allows you to add chunks of persistent code to your badge, while retaining the functionality of the boot application (eg. conf schedule, or any future functionality like secure messaging). Not only does it make it easy to extend or add functionality to an existing application (simply upload a file into 'plugins/). And if you are testing chunks of random code or want to try someone elses code snippet, this method is both easily revertible but still persistent (if you want it to be) without modifying too much :)
Notes: