66 lines
1.2 KiB
Java
66 lines
1.2 KiB
Java
package de.ph87.homeautomation.knx.group;
|
|
|
|
import lombok.AccessLevel;
|
|
import lombok.Getter;
|
|
import lombok.Setter;
|
|
import lombok.ToString;
|
|
import tuwien.auto.calimero.GroupAddress;
|
|
|
|
import javax.persistence.*;
|
|
import java.math.BigDecimal;
|
|
import java.time.ZonedDateTime;
|
|
|
|
@Getter
|
|
@Setter
|
|
@ToString
|
|
@Entity
|
|
public class KnxGroup {
|
|
|
|
@Id
|
|
@GeneratedValue
|
|
@Setter(AccessLevel.NONE)
|
|
private Long id;
|
|
|
|
@Column(unique = true)
|
|
private int addressRaw;
|
|
|
|
@Column(unique = true)
|
|
private String addressStr;
|
|
|
|
private String dpt;
|
|
|
|
private String name;
|
|
|
|
private byte[] value;
|
|
|
|
private Boolean booleanValue;
|
|
|
|
private BigDecimal numberValue;
|
|
|
|
private ZonedDateTime valueTimestamp;
|
|
|
|
private byte[] sendValue;
|
|
|
|
private int readInterval;
|
|
|
|
@Embedded
|
|
private KnxGroupLinkInfo read = new KnxGroupLinkInfo();
|
|
|
|
@Embedded
|
|
private KnxGroupLinkInfo send = new KnxGroupLinkInfo();
|
|
|
|
public void setAddress(final int rawAddress) {
|
|
setAddress(new GroupAddress(rawAddress));
|
|
}
|
|
|
|
public void setAddress(final GroupAddress groupAddress) {
|
|
this.addressRaw = groupAddress.getRawAddress();
|
|
this.addressStr = groupAddress.toString();
|
|
}
|
|
|
|
public GroupAddress getAddress() {
|
|
return new GroupAddress(addressRaw);
|
|
}
|
|
|
|
}
|