@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 };
}
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";
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";
*/
@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>();