Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

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.java
index 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)));
}
}
}