From 7945694ce050fd945af8e230604a3053cfd41529 Mon Sep 17 00:00:00 2001 From: Manuel Pietschmann Date: Mon, 22 Jul 2024 16:25:52 +0200 Subject: [PATCH] Fix raw JSON DDF load order for user location (#7851) If a system location DDF already existed the user location DDF wasn't picket up correctly. The problem occured only for raw JSON DDFs not bundles. Part of https://github.com/dresden-elektronik/deconz-rest-plugin/issues/7845 --- device_descriptions.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/device_descriptions.cpp b/device_descriptions.cpp index c09e7aa0e0..b782859a36 100644 --- a/device_descriptions.cpp +++ b/device_descriptions.cpp @@ -1180,6 +1180,11 @@ const DeviceDescription &DeviceDescriptions::get(const Resource *resource, DDF_M { rawJsonIndex = matchedIndices[i]; } + else if (ddf1.storageLocation == deCONZ::DdfUserLocation && d->descriptions[rawJsonIndex].storageLocation == deCONZ::DdfLocation) + { + // already had a match but user location has more precedence than system location + rawJsonIndex = matchedIndices[i]; + } continue; }