30 lines
834 B
Java
30 lines
834 B
Java
package de.ph87.homeautomation;
|
|
|
|
import de.ph87.homeautomation.knx.group.KnxGroupImportService;
|
|
import de.ph87.homeautomation.property.PropertyWriter;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.boot.context.event.ApplicationStartedEvent;
|
|
import org.springframework.context.event.EventListener;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@Slf4j
|
|
@Service
|
|
@RequiredArgsConstructor
|
|
public class StartupService {
|
|
|
|
private final KnxGroupImportService knxGroupImportService;
|
|
|
|
private final DemoDataService demoDataService;
|
|
|
|
private final PropertyWriter propertyWriter;
|
|
|
|
@EventListener(ApplicationStartedEvent.class)
|
|
public void startup() {
|
|
knxGroupImportService.importGroups();
|
|
demoDataService.insertDemoData();
|
|
propertyWriter.updateAllProperties();
|
|
}
|
|
|
|
}
|