I have picked up the challenge of writing my first binding (for Phlips Air Purifiers, since that is a simple device to ease the learing curve - being new to Java and new to OH Bindings).
The communication with the device is encrypted and uses a somewhat simplified (or beter: stupified) Diffie-Hellman key exchange. I need to persist the calculated key inside the binding. I’ve implemented it using the Java Preferences class, but I was wondering whether there is a standard or prefered way for persisting data within a binding.
I can’t speak to the current preferred way but it does appear that this type of info is often stored in the Thing that represents the device, or more commonly in the Bridge Thing.
Store the data in the thing/bridge configuration as suggested by @rlkoshak.
There is also a binding configuration that can be used (stores it’s data via the ConfigAdmin OSGi service).
And for all other purposes you can get a reference to the StorageService and store data over there (not recommended for bindings though)
Thanks @rlkoshak and @David_Graeff. I’ll look into it.