[ism8] Fix SAT warnings (#14141)

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich 2023-01-03 08:47:51 +01:00 committed by GitHub
parent 8fcfa0438b
commit d1634fbc18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View 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 };
}

View 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";

View 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";

View 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>();