chromo23 wrote: ↑03 Dec 2023, 19:23
By the way... i want to experiment a bit. Can you point me in the right direction for adding the ability to set (and maybe read) the values via html request? Or is it too hard to accomplish because the structure doesn´t allow it?
That should best be done via the PLUGIN_SET_CONFIG, or PLUGIN_WRITE, and PLUGIN_GET_CONFIG_VALUE functions in the plugin. There are several examples available, f.e. in P021 (*_SET_*), P104 (*_WRITE), and P008, P021, P026 etc. (*_GET_*). The command to set a value is config, like:
Code: Select all
config,task,<taskname>,setwhatever,<value>
the "setwhatever" part is different per plugin and what value you want to implement/set. The 'set' prefix isn't mandatory, or maybe not even desirable, IMHO, the 'config' part of the command already implies you're changing something
To get a value via the *_GET_* function is just by using the usual [<taskname>#<valuename>], where you handle the <valuename> part. It's easiest to have unique value names from the regular value names, so 'output' wouldn't be the happiest choice
For using the PLUGIN_WRITE method you can be as creative as you want, taking from the many examples.
Import issue to take with you is that saving the data to flash should best be a separate command to send from remote (the global save command will do perfectly fine, no need to implement that in a plugin, P021 is a real exception, but mostly for historical reasons). And saving should be as sparse as possible, to not wear out the flash.
And, of course, when you need more detailed help, just ask