Fix some bugs for brightness decode in tcp and udp plugins

Fixes #434
Fixes #435
This commit is contained in:
bwssystems
2017-02-04 18:40:13 -06:00
parent 0ce23c0f00
commit 71258c7e52
4 changed files with 12 additions and 10 deletions

View File

@@ -49,11 +49,12 @@ public class TCPHome implements Home {
// noop
}
theUrlBody = BrightnessDecode.calculateReplaceIntensityValue(theUrlBody, intensity, targetBri, targetBriInc, true);
theUrlBody = TimeDecode.replaceTimeValue(theUrlBody);
if (theUrlBody.startsWith("0x")) {
theUrlBody = BrightnessDecode.calculateReplaceIntensityValue(theUrlBody, intensity, targetBri, targetBriInc, true);
sendData = DatatypeConverter.parseHexBinary(theUrlBody.substring(2));
} else {
theUrlBody = BrightnessDecode.calculateReplaceIntensityValue(theUrlBody, intensity, targetBri, targetBriInc, false);
sendData = theUrlBody.getBytes();
}