use of com.alliander.osgp.webdevicesimulator.domain.entities.Device in project Protocol-Adapter-OSLP by OSGP.
the class SwitchingServices method tariffSwitchHigh.
public void tariffSwitchHigh(final long deviceId) {
// Find device
Device device = this.deviceManagementService.findDevice(deviceId);
device.setTariffOn(true);
device = this.deviceManagementService.updateDevice(device);
}
use of com.alliander.osgp.webdevicesimulator.domain.entities.Device in project Protocol-Adapter-OSLP by OSGP.
the class SwitchingServices method lightSwitchOff.
public void lightSwitchOff(final long deviceId) {
// Find device
Device device = this.deviceManagementService.findDevice(deviceId);
device.setLightOn(false);
device = this.deviceManagementService.updateDevice(device);
}
use of com.alliander.osgp.webdevicesimulator.domain.entities.Device in project Protocol-Adapter-OSLP by OSGP.
the class SwitchingServices method lightSwitchOn.
public void lightSwitchOn(final long deviceId) {
// Find device
Device device = this.deviceManagementService.findDevice(deviceId);
device.setLightOn(true);
device = this.deviceManagementService.updateDevice(device);
}
use of com.alliander.osgp.webdevicesimulator.domain.entities.Device in project Protocol-Adapter-OSLP by OSGP.
the class SwitchingServices method tariffSwitchLow.
public void tariffSwitchLow(final long deviceId) {
// Find device
Device device = this.deviceManagementService.findDevice(deviceId);
device.setTariffOn(true);
device = this.deviceManagementService.updateDevice(device);
}
use of com.alliander.osgp.webdevicesimulator.domain.entities.Device in project Protocol-Adapter-OSLP by OSGP.
the class DeviceManagementController method sendEventNotificationCommandAll.
@RequestMapping(value = COMMAND_SENDNOTIFICATION_URL, method = RequestMethod.POST)
@ResponseBody
public String sendEventNotificationCommandAll(@RequestBody final SendEventNotificationRequest request) {
// Find device
final Device device = this.deviceManagementService.findDevice(request.getDeviceId());
final DeviceMessageStatus status = this.registerDevice.sendEventNotificationCommand(request.getDeviceId(), request.getEvent(), request.getDescription(), request.getIndex(), request.getHasTimestamp());
if (status == DeviceMessageStatus.OK) {
return this.getFeedbackMessage(FEEDBACK_MESSAGE_KEY_EVENTNOTIFICATION_SENT, device.getDeviceIdentification());
} else if (status == DeviceMessageStatus.FAILURE) {
return this.getFeedbackMessage(FEEDBACK_MESSAGE_KEY_DEVICE_ERROR, device.getDeviceIdentification(), this.registerDevice.getErrorMessage());
} else {
return FAILURE_URL;
}
}
Aggregations