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

Commit

Permalink
Merge pull request #263 from cdjackson/bug_465079-thing_item
Browse files Browse the repository at this point in the history
Move update of thing to after update of item to ensure information is correctly presented
  • Loading branch information
dnobel committed Apr 21, 2015
2 parents cff3beb + e473d95 commit cee40aa
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ public Response updateThing(ThingBean thingBean) throws IOException {
Configuration configuration = getConfiguration(thingBean);

Thing thing = thingSetupManager.getThing(thingUID);
if (thing != null) {
if (bridgeUID != null) {
thing.setBridgeUID(bridgeUID);
}
updateConfiguration(thing, configuration);
thingSetupManager.updateThing(thing);
}

String label = thingBean.item.label;
List<String> groupNames = thingBean.item.groupNames;
Expand All @@ -111,6 +104,14 @@ public Response updateThing(ThingBean thingBean) throws IOException {
}
}
}

if (thing != null) {
if (bridgeUID != null) {
thing.setBridgeUID(bridgeUID);
}
updateConfiguration(thing, configuration);
thingSetupManager.updateThing(thing);
}

return Response.ok().build();
}
Expand Down

0 comments on commit cee40aa

Please sign in to comment.