-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Request] Custom Event Support #2965
Comments
My example with |
In theory it should work to set the new event on |
Ah, I hadn't seen that; maybe just throwing a paragraph about using that and the |
In theory, but monkey patching is a bit hackish. By providing a defined hook namespace collisions could also be avoided (imagine two plugins deciding they want to define an event |
The above commit adds a new hook Commit is pushed to |
@foosel: As I read it, it seems that you can only register events for |
Oops, I somehow overlooked this question. Doing it like it's implemented now keeps it consistent with other plugin extended things, e.g. templates, |
1.3.11 was released yesterday. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is your feature request related to a problem? Please describe.
It is not related to a problem.
Describe the solution you'd like
If OctoPrint could support custom events, triggered by plugins, that would be great. If it already (documented or not) supports this, that's even better; I don't need to wait :)
Describe alternatives you've considered
I have not thought of any alternatives.
Additional context
I recently created a plugin for OctoPrint that notififies via IFTTT when the printer sends N or more busy signals. Obviously, that is a very specialized plugin; it would most likely be much more useful to have two plugins: one that adds a EchoBusy event and one that sends some or all events to IFTTT.
I have looked into the source/docs some and found that a plugin could run
self._event_bus.fire("MyHappyCustomEvent", dict(payload_key=payload_val))
and it would (seemingly) work and not destroy OctoPrint, but I haven't thoroughly tested it.The text was updated successfully, but these errors were encountered: