SarahB
January 8, 2022, 7:09pm
1
Hi !
I'm developing a plugin and I would like to add my plugin url into the config.yaml. But it doesn't work or I don't take the good config.yaml.
I take the example of the "hello word" tutorial to add like this :
plugins:
MyPlugin:
url: Hallo-Welt-Programm β Wikipedia
But nothing happens. Can you say me what "config.yaml" I need to update please ?
Is there already a plugins
section? Did you restart OctoPrint after editing it?
SarahB
January 8, 2022, 9:37pm
3
Yeah ! I think I've not the right method to debug. Do you know how to debug dynamically the plugin ?
If you install the plugin locally (ideally in editable mode) you can use IDE tools like PyCharm or VS Code to debug while running OctoPrint.
Maybe it is not clear:
The config.yaml is only updated(inserted) if the value of your default setting is different than the default.
E.g.
def get_settings_defaults(self):
return dict(url="https://en.wikipedia.org/wiki/Hello_world")
The url does not appear in the config.yaml.
But if you change the value via your programm (UI-Settings), the new value will be stored in the config.
...some event occurs...
self._settings.set(["url"], "https://de.wikipedia.org/wiki/Hallo-Welt-Programm"))
Then your config.yaml looks like this:
# [...]
plugins:
helloworld:
url: https://de.wikipedia.org/wiki/Hallo-Welt-Programm
# [...]
Btw. if you manually enter data into the config-file make sure you use the correct indentations.
1 Like