Comments (7)
Hi, thank you very much :)
I like the idea to have action of other plugins included in my plugin! I'll have a look at if and how this can be achieved!
Cheers,
Sam
from physicalbutton.
I'm sorry but I cannot find out how to get the available commands from other plugins 😅
If someone knows how to achieve this, I would be happy to get a hint on that or a PR :)
from physicalbutton.
I'll see if there is any information on the weekend.
from physicalbutton.
Hi @LuxuSam,
if the plugin author doesn't provide a public api (web or internal) to execute tasks or read data you can directly get the plugin implementation and call the function directly...but this is a risky thing.
I wrote a helper function in my PrintJobHistory-Plugin that delivers the 3rd party plugin instance. On that instance you can call the needed function.
See https://github.com/OllisGit/OctoPrint-PrintJobHistory/blob/1.16.0/octoprint_PrintJobHistory/__init__.py#L291-L332
Usage:
pluginInfo = self._getPluginInformation({ "key": "costestimation", "minVersion": "3.4.0"})
self._costEstimationPluginImplementationState = pluginInfo[0]
self._costEstimationPluginImplementation = pluginInfo[1]
..do some state checks (installed/disabled)
self._costEstimationPluginImplementation.getCostData()
If the 3rd party plugin is willing to provide an api, it should use the "helpers-feature"
https://docs.octoprint.org/en/master/plugins/helpers.html#helpers
Or depending of the "usecase" it could fire an custom-event and a listener-plugin can react in "realtime" instead of polling the information from the plugin.
See
https://github.com/OllisGit/OctoPrint-DisplayLayerProgress#events
from physicalbutton.
Hi @OllisGit,
Thank you for the clarification, provided documentation, and your code examples :D
I'll look into it in more detail as soon as I'll have time to work on the plugin again! Exams are coming up.
from physicalbutton.
For the original request, PSU Control supports CLI commands so you could use system and the command /home/pi/oprint/bin/octoprint plugins psucontrol:toggle
I think.
https://github.com/kantlivelong/OctoPrint-PSUControl/wiki/CLI
from physicalbutton.
There are helper functions available.
https://github.com/kantlivelong/OctoPrint-PSUControl/wiki/Developers
from physicalbutton.
Related Issues (20)
- Button action on Raspi startup HOT 2
- [QUESTION] Run a system command HOT 7
- [FEATURE] Prevent button execution while printing HOT 17
- [FEATURE] Temporarily disable a button? HOT 6
- [FEATURE] Add button on navbar HOT 2
- [FEATURE] Add more actions HOT 1
- [BUG] GCODE button only works with a connected printer in the Octoprint interface HOT 6
- [FEATURE] GCODE Toggle button HOT 2
- [BUG] OctoPrint enters Safe Mode after enabling Physical Button plugin (only for the first time) HOT 1
- increase or decrease bed- or hotendtemp HOT 1
- [FEATURE] Short and Long press functions for ONE physical button HOT 1
- [QUESTION] Sometimes save doesn't save changes HOT 3
- [FEATURE] USB HOT 1
- [BUG] Plugin fails to install Octoprint 1.9.2 HOT 1
- Doesn't work on new installation HOT 9
- [QUESTION] How to setup keyboard hot keys HOT 1
- [QUESTION] Does this support Waveshare 2.7" HAT on Raspberry Pi? HOT 1
- Cannot Install - "Install Unknown" HOT 4
- [FEATURE] toggle power HOT 2
- Not Working After Install HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from physicalbutton.