use of com.alliander.osgp.webdevicesimulator.domain.entities.Device in project Protocol-Adapter-OSLP by OSGP.
the class AutonomousDeviceRegister method run.
@Override
public void run() {
if (this.deviceManagementService.getDevRegistration()) {
LOGGER.info("Registering devices");
final List<Device> devices = this.deviceRepository.findAll();
for (final Device device : devices) {
LOGGER.info("Autonomous device register for : {}: {} ", device.getId(), device.getDeviceIdentification());
this.registerDevice.sendRegisterDeviceCommand(device.getId(), false);
LOGGER.info("Autonomous device register confirmation for : {}: {} ", device.getId(), device.getDeviceIdentification());
this.registerDevice.sendConfirmDeviceRegistrationCommand(device.getId());
}
}
}
use of com.alliander.osgp.webdevicesimulator.domain.entities.Device in project Protocol-Adapter-OSLP by OSGP.
the class EveningMorningBurnersLightSwitchingOff method run.
@Override
public void run() {
if (this.deviceManagementService.getLightSwitching()) {
LOGGER.info("Publiclighting Switching off for devices with Evening/Morning Burners");
final List<Device> devices = this.deviceRepository.findByHasEveningMorningBurner(true);
for (final Device device : devices) {
LOGGER.info("Light switching for : {}: {} ", device.getId(), device.getDeviceIdentification());
// Switching off Light
this.switchingServices.lightSwitchOff(device.getId());
// Send EventNotifications for LightSwitching Off
LOGGER.info("Sending LIGHT_EVENTS_LIGHT_OFF event for device : {}: {} ", device.getId(), device.getDeviceIdentification());
// The event index for Evening/Morning Burners is 3.
this.registerDevice.sendEventNotificationCommand(device.getId(), Oslp.Event.LIGHT_EVENTS_LIGHT_OFF_VALUE, "LIGHT_EVENTS_LIGHT_OFF event occurred on Light Switching off ", 3);
}
}
}
use of com.alliander.osgp.webdevicesimulator.domain.entities.Device in project Protocol-Adapter-OSLP by OSGP.
the class LightSwitchingOff method run.
@Override
public void run() {
if (this.deviceManagementService.getLightSwitching()) {
LOGGER.info("Publiclighting Switching off for devices without Evening/Morning Burners");
final List<Device> devices = this.deviceRepository.findByHasEveningMorningBurner(false);
for (final Device device : devices) {
LOGGER.info("Light switching for : {}: {} ", device.getId(), device.getDeviceIdentification());
// Switching off Light
this.switchingServices.lightSwitchOff(device.getId());
// Send EventNotifications for LightSwitching Off
LOGGER.info("Sending LIGHT_EVENTS_LIGHT_OFF event for device : {}: {} ", device.getId(), device.getDeviceIdentification());
this.registerDevice.sendEventNotificationCommand(device.getId(), Oslp.Event.LIGHT_EVENTS_LIGHT_OFF_VALUE, "LIGHT_EVENTS_LIGHT_OFF event occurred on Light Switching off ", null);
}
}
}
use of com.alliander.osgp.webdevicesimulator.domain.entities.Device in project Protocol-Adapter-OSLP by OSGP.
the class LightSwitchingOn method run.
@Override
public void run() {
if (this.deviceManagementService.getLightSwitching()) {
LOGGER.info("Publiclighting Switching on for devices without Evening/Morning Burners");
final List<Device> devices = this.deviceRepository.findByHasEveningMorningBurner(false);
for (final Device device : devices) {
LOGGER.info("Light switching for : {}: {} ", device.getId(), device.getDeviceIdentification());
// Switching on Light
this.switchingServices.lightSwitchOn(device.getId());
// Send EventNotifications for LightSwitching on
LOGGER.info("Sending LIGHT_EVENTS_LIGHT_ON event for device : {}: {} ", device.getId(), device.getDeviceIdentification());
this.registerDevice.sendEventNotificationCommand(device.getId(), Oslp.Event.LIGHT_EVENTS_LIGHT_ON_VALUE, "LIGHT_EVENTS_LIGHT_ON event occurred on Light Switching on ", null);
}
}
}
use of com.alliander.osgp.webdevicesimulator.domain.entities.Device in project Protocol-Adapter-OSLP by OSGP.
the class TariffSwitchingHigh method run.
@Override
public void run() {
if (this.deviceManagementService.getTariffSwitching()) {
LOGGER.info("TariffSwitching on for devices");
final List<Device> devices = this.deviceRepository.findAll();
for (final Device device : devices) {
LOGGER.info("Tariff switching on for : {}: {} ", device.getId(), device.getDeviceIdentification());
// Switching on Tariff
this.switchingServices.tariffSwitchHigh(device.getId());
// Send EventNotifications for TariffSwitching Off
LOGGER.info("Sending TARIFF_EVENTS_TARIFF_ON event for device : {}: {} ", device.getId(), device.getDeviceIdentification());
this.registerDevice.sendEventNotificationCommand(device.getId(), Oslp.Event.TARIFF_EVENTS_TARIFF_ON_VALUE, "TARIFF_EVENTS_TARIFF_ON event occurred on Tariff Switching high ", 1);
}
}
}
Aggregations