openhab-core
openhab-core copied to clipboard
[RFC] Change loading mechanism for *.things and *.items files
Currently when a file is edited all items from the file get removed and then the items from the file get re-added again. This results in a log of items/things loosing the current state and runtime data.
A better solution would be in case of a file change to build a diff between the already existing items/things from the file. Objects that were removed get deleted, objects that were change get changed and objects that were added can be added normally.
AFAIK, this is no longer the case in 4.x? i.e. it now leaves the unchanged items alone and their states remain unchanged?
I think there was some work on the items loader so at least for *.items files this should work now. I'm unsure about the *.things files - I think it's still an issue there.
I'm unsure about the *.things files - I think it's still an issue there.
~~Can you try and post steps to reproduce the issue? I just did some quick tests, it seems that changes are picked up.~~ I can confirm this. I tried with two things in one .things file, changing one's settings also caused the other one to be "updated".
I posted a PR to fix detecting changes in .items channel configuration (e.g. for profiles), hopefully that'll get merged in the next few days.