34 lines
972 B
Java
34 lines
972 B
Java
package de.ph87.homeautomation.device;
|
|
|
|
import de.ph87.homeautomation.device.devices.DeviceNumber;
|
|
import de.ph87.homeautomation.device.devices.DeviceSwitch;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
@Slf4j
|
|
@Service
|
|
@Transactional
|
|
@RequiredArgsConstructor
|
|
public class DeviceWriteService {
|
|
|
|
private final DeviceRepository deviceRepository;
|
|
|
|
@PostConstruct
|
|
public void postConstruct() {
|
|
final DeviceSwitch deviceSwitch = new DeviceSwitch();
|
|
deviceSwitch.setName("TEST");
|
|
deviceSwitch.setStatePropertyName("knx.group.0.3.6");
|
|
deviceRepository.save(deviceSwitch);
|
|
|
|
final DeviceNumber deviceNumber = new DeviceNumber();
|
|
deviceNumber.setName("Helligkeit");
|
|
deviceNumber.setValuePropertyName("knx.group.0.5.6");
|
|
deviceRepository.save(deviceNumber);
|
|
}
|
|
|
|
}
|