]> git.basschouten.com Git - openhab-addons.git/commitdiff
[ism8] Fix SAT warnings (#14141)
authorHolger Friedrich <holgerfriedrich@users.noreply.github.com>
Tue, 3 Jan 2023 07:47:51 +0000 (08:47 +0100)
committerGitHub <noreply@github.com>
Tue, 3 Jan 2023 07:47:51 +0000 (08:47 +0100)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
bundles/org.openhab.binding.ism8/src/main/java/org/openhab/binding/ism8/server/DataPointBool.java
bundles/org.openhab.binding.ism8/src/main/java/org/openhab/binding/ism8/server/DataPointLongValue.java
bundles/org.openhab.binding.ism8/src/main/java/org/openhab/binding/ism8/server/DataPointValue.java
bundles/org.openhab.binding.ism8/src/main/java/org/openhab/binding/ism8/server/KnxNetFrame.java

index 9cb197a0fde0e857531d50890351bc40519fbdde..5e25cf9ef23382e39292e5ae41ad9e65bf0019e9 100644 (file)
@@ -55,7 +55,7 @@ public class DataPointBool extends DataPointBase<@Nullable Boolean> {
     @Override
     protected byte[] convertWriteValue(Object value) {
         String valueText = value.toString().toLowerCase();
-        if (valueText.equalsIgnoreCase("true") || valueText.equalsIgnoreCase("1")) {
+        if ("true".equalsIgnoreCase(valueText) || "1".equalsIgnoreCase(valueText)) {
             this.setValue(true);
             return new byte[] { 0x01 };
         }
index 08ecf9e6912066adf3c1866846eb156a94b355f4..7a677efef3751fa01acddd3ea3b7d434a01c4a56 100644 (file)
@@ -33,7 +33,7 @@ public class DataPointLongValue extends DataPointBase<@Nullable Double> {
     public DataPointLongValue(int id, String knxDataType, String description) {
         super(id, knxDataType, description);
 
-        if (knxDataType.equals("13.002")) {
+        if ("13.002".equals(knxDataType)) {
             this.setUnit("m³/h");
             this.factor = 0.0001f;
             this.outputFormat = "%.1f";
index 03cc7f84bca715fcceb05d908f5e2bd60a52d761..d279df78af6c0ba70df511070ec3696d77a07887 100644 (file)
@@ -33,15 +33,15 @@ public class DataPointValue extends DataPointBase<@Nullable Double> {
     public DataPointValue(int id, String knxDataType, String description) {
         super(id, knxDataType, description);
         this.factor = 0.0f;
-        if (knxDataType.equals("9.001")) {
+        if ("9.001".equals(knxDataType)) {
             this.setUnit("°C");
             this.factor = 0.01f;
             this.outputFormat = "%.1f";
-        } else if (knxDataType.equals("9.002")) {
+        } else if ("9.002".equals(knxDataType)) {
             this.setUnit("°K");
             this.factor = 0.01f;
             this.outputFormat = "%.1f";
-        } else if (knxDataType.equals("9.006")) {
+        } else if ("9.006".equals(knxDataType)) {
             this.setUnit("Bar");
             this.factor = 0.0000001f;
             this.outputFormat = "%.2f";
index 5cb7ca6aac9d53269d3a776619205d25f6bca20e..7c362aec67a976f55236a9c8e56ea35341754ab6 100644 (file)
@@ -27,8 +27,8 @@ import org.slf4j.LoggerFactory;
  */
 @NonNullByDefault
 public class KnxNetFrame {
-    public static byte[] KNX_HEADER = new byte[6];
-    public static byte[] CONNECTION_HEADER = new byte[4];
+    public static final byte[] KNX_HEADER = new byte[6];
+    public static final byte[] CONNECTION_HEADER = new byte[4];
 
     private static final Logger LOGGER = LoggerFactory.getLogger(KnxNetFrame.class);
     private ArrayList<SetDatapointValueMessage> valueMessages = new ArrayList<SetDatapointValueMessage>();