evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Add persistent settings

Open andig opened this issue 3 years ago • 0 comments

This PR adds a simple interface for storing/retrieving settings from database. Settings provide additional abstractor over the plain db.Instance.

Settings are only saved when settings.Persist() is called. A corresponding shutdown hook is registered during setup.

store.Provider and store.Store provide abstraction for creating a store for a single value and load/save against that store. Using these, individual devices do not need to depend on the settings implementation. See https://github.com/evcc-io/evcc/pull/4838 for example usage.

andig avatar Oct 07 '22 16:10 andig