Closed andrew01144 closed 1 month ago
There is no easy way for persist
module to detect changes in sub-objects like lists or arrays. There are now 2 options:
persist.dirty()
to indicate that you changed datapersist.save(true)
to force saving even if the dirty flag is falseNow included in: https://github.com/arendst/Tasmota/pull/22246
Thanks!
PROBLEM DESCRIPTION
A clear and concise description of what the problem is.
In Berry, persist.save() should save the new state of of an array to _persist.json if its state has changed. It does not. This used to work on V12.0.2. Does not work on V14.2.0
Workaround: update a simple variable before doing persist.save().
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Status 0
:TO REPRODUCE
Steps to reproduce the behavior:
I find this easiest to replicate by pasting each of these Berry lines, one at a time, into the Berry scripting console.
EXPECTED BEHAVIOUR
A clear and concise description of what you expected to happen.
persist.save() should save the new state of a1[] to _persist.json if the state has changed. This used to work on V12.0.2. Does not work on V14.2.0
Workaround: update a simple variable before doing persist.save().
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
ADDITIONAL CONTEXT
Add any other context about the problem here.
(Please, remember to close the issue when the problem has been addressed)