Updated bridge to be robust on put/post calls and testing. HAd to add a

body for off types.
This commit is contained in:
Admin
2015-10-02 16:35:17 -05:00
parent 2789d8c180
commit 7514e36edb
12 changed files with 142 additions and 40 deletions

View File

@@ -204,8 +204,12 @@ public class HueMulator {
}
//quick template
String body;
url = replaceIntensityValue(url, state.getBri());
String body = replaceIntensityValue(device.getContentBody(), state.getBri());
if (state.isOn())
body = replaceIntensityValue(device.getContentBody(), state.getBri());
else
body = replaceIntensityValue(device.getContentBodyOff(), state.getBri());
//make call
if(!doHttpRequest(url, device.getHttpVerb(), device.getContentType(), body)){
response.status(HttpStatus.SC_SERVICE_UNAVAILABLE);