Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

[WIP] Fix thing creation with updated XML #6537

Closed
wants to merge 3 commits into from
Closed

[WIP] Fix thing creation with updated XML #6537

wants to merge 3 commits into from

Conversation

J-N-K
Copy link
Contributor

@J-N-K J-N-K commented Nov 18, 2018

Fixes #2555

This is intended as a design-idea. I would appreciate some comments.

Basically this lets the thing creation wait for the handler factory to be available and then checks if the stored managed thing has all channels a newly created thing of the same type would have.

Missing channels are added, channels with changed ChannelTypeUID or accepted item-types are updated to the new version.

Removed channels are not removed, which is a little bit unsatisfying and still different from the textual configuration. I'll have to check if it is possible to find out which channels (especially in extensible things) are user-added and should be preserved.

@afuechsel
Copy link
Contributor

Looks like it could work - I wonder, if there would be a simpler way e.g. when adding a thing to the registry. Need to think about it.

}
Thing newThing = thingBuilder.build();

if (thingsList.contains(storedThing)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when will this check hold true? New things are only added to the thingsList in the else case in line 226. So the storedThing is not supposed to be in there. Besides that it should also be exchanged by the newThing entity.

@kaikreuzer
Copy link
Contributor

Looks like a good start for me as well.
As ESH is EOL, I would suggest we close this PR here and you create a new one against https://github.com/openhab/openhab-core and we continue from there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants