I started writing a plugin but I have a small problem I would like to edit the settings from a template "Tab" I try but I can not find any other way than to go through settings . is it possible to do otherwise? I see that some plugins do it
example of the parameter I want to edit
self.settings.settings.plugins.OctoWS2812B.pinNum()
You would have to initiate the save from some form of action trigger (ie a button, or onchange event of an input) and call self.settings.saveData() within your javascript file making sure to include the settingsViewModel as a dependency and assigning to the self.settings variable in your js file. You can see an example in my code over here. It's not being done from the tab, but is saving outside of the settings section.
Then you just have to make sure you are binding your tab input to settings.settings.plugins.OctoWS2812B.pinNum() and that you have your plugin's tab id included as a selector in the elements section of your viewmodel registration call.
I am now looking for a simple way to launch a python script from one more tab, it will have to be run with the sudo user. I have done research but I really do not find, I must be null
If you're using the OctoPi image, I'm pretty sure that Guy has tweaked the pi user so that scripts running from within OctoPrint have the ability to run things that would talk to the GPIO, for example. This is usually reserved for root access.
If I understand correctly then I must launch a script that will launch this boot in "sudo".
Then make sure that it communicates with the JS function of my plugin?
Desolate I'm really not used to python I would just comunicate a bit of json so but I do not understand too how to do I try with WebSocket but impossible to communicate