Fix Java and Jetty deprecations (#10349)
Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
package org.openhab.io.imperihome.internal.model.device;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openhab.core.items.Item;
|
||||
@@ -84,6 +85,6 @@ public class RgbLightDevice extends AbstractEnergyLinkDevice {
|
||||
|
||||
private int convertPercentToByte(PercentType percent) {
|
||||
return percent.toBigDecimal().multiply(BigDecimal.valueOf(255))
|
||||
.divide(BigDecimal.valueOf(100), 2, BigDecimal.ROUND_HALF_UP).intValue();
|
||||
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP).intValue();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user