Fix GenericThingProvider (#3779)

When things from multiple handler factories are provisioned from the same file the internal thing map was not properly updated.

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K 2023-08-28 09:26:52 +02:00 committed by GitHub
parent 9cc7b58ac0
commit b426cccf9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -614,9 +614,9 @@ class GenericThingProvider extends AbstractProviderLazyNullness<Thing> implement
createThing(newThings, factory)
]
}
thingsMap.put(modelName, newThings)
newThings.forEach [ newThing |
thingsMap.get(modelName).add(newThing)
val oldThing = oldThings.findFirst[it.UID == newThing.UID]
if (oldThing !== null) {
if (!ThingHelper.equals(oldThing, newThing)) {