How can I modify config.yaml


#1

for example

my config.yaml :

plugins:
  BBB:
    PWMSS:
    - NAME: 11
      PWM11: 1111
    - NAME: 99
      PWM12: 9999 

and I wanna modify some value by using self._settings.set([])
I could modify PWMSS
self._settings.set(['PWMSS'], int(data))

but how? second Name(value=1) in PWMSS?

is it possible? ot there is any way?


#2

You can't change individual list entries. You'll need to get the current list with self._settings.get, change whatever you need to change, then write the whole list back with self._settings.set.


#3

Thank you!

only way is reloading all then save??


#4

That's what I wrote, didn't I? :wink:


#5

Mutate