100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
NEGATE ConvertypeType fix
Michael Rademaker70c0cc1ef30c
diff --git a/model/src/main/java/org/openremote/model/protocol/ProtocolUtil.java b/model/src/main/java/org/openremote/model/protocol/ProtocolUtil.javaindex 17e00d6bd..0a90118ec 100644--- a/model/src/main/java/org/openremote/model/protocol/ProtocolUtil.java+++ b/model/src/main/java/org/openremote/model/protocol/ProtocolUtil.java@@ -214,10 +214,10 @@ public final class ProtocolUtil {if (node.getNodeType() == JsonNodeType.STRING) {if (AttributeLink.ConverterType.NEGATE.getValue().equals(node.textValue())) {if (Values.isNumber(value.getClass())) {- return new Pair<>(true, (Values.getValueCoerced(value, Double.class).orElse(0D) * -1));+ return new Pair<>(false, (Values.getValueCoerced(value, Double.class).orElse(0D) * -1));}if (Values.isBoolean(value.getClass())) {- return new Pair<>(true, !(Values.getValueCoerced(value, Boolean.class).orElse(false)));+ return new Pair<>(false, !(Values.getValueCoerced(value, Boolean.class).orElse(false)));}}}