It recently has been pointed out to me that as it currently stands, SAVE_VARIABLE command only works correctly with lower-case variable names.
Under the hood, this module uses python’s configparser, and that one is documented that while sections are case-sensitive, the entry names are all stored in lower-case.
As you can see here, non-lower-case variable names are completely ignored for updates (it does create it when it is a new variable name), and all names are stored in lower-case.
So, either this is considered a bug and a fix is required, or the documentation needs to be updated to ensure users MUST use lower-case variable names to avoid errors!
I think I found the explanation for the bug:
in save_variables.py
the dict used to sort the variables is case sensitive → a new value that isnt all lower case is a second entry of that key.
The later use of sorted sorts the keys by their ascii value (upper case before lower case) and therefore the new upper case value will immediately be overwritten by the old lowercase entry.
My suggestion would be to transform VARIABLE to lower case when it is read.
varname = gcmd.get(‘VARIABLE’).lower()