From 0fdcbba01bdb89826ba6b3c72405b87a5e19dc1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= <63239207+Klagarge@users.noreply.github.com> Date: Sun, 11 Jun 2023 18:33:44 +0200 Subject: [PATCH] do stuff only for DataPoints who have a register --- src/main/java/ch/hevs/isi/field/FieldConnector.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/ch/hevs/isi/field/FieldConnector.java b/src/main/java/ch/hevs/isi/field/FieldConnector.java index 26b00a1..23a372c 100644 --- a/src/main/java/ch/hevs/isi/field/FieldConnector.java +++ b/src/main/java/ch/hevs/isi/field/FieldConnector.java @@ -95,6 +95,8 @@ public class FieldConnector implements DataPointListener { @Override public void onNewValue(DataPoint dp) { ModbusRegister mR = ModbusRegister.getRegisterFromDatapoint(dp); //search the corresponding register to the datapoint + if(mR == null) return; //if the register is not found, return + if(dp.isOutput()){ //write only on the datapoints, which are outputs if(dp.getLabel().equals("REMOTE_SOLAR_SW") //write only boolean outputs ||dp.getLabel().equals("REMOTE_WIND_SW")