use of nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SetAlarmRequest in project Gadgetbridge by Freeyourgadget.
the class LefunDeviceSupport method onSetAlarms.
@Override
public void onSetAlarms(ArrayList<? extends Alarm> alarms) {
int i = 0;
for (Alarm alarm : alarms) {
try {
TransactionBuilder builder = performInitialized(SetAlarmRequest.class.getSimpleName());
SetAlarmRequest request = new SetAlarmRequest(this, builder);
request.setIndex(i);
request.setEnabled(alarm.getEnabled());
request.setDayOfWeek(alarm.getRepetition());
request.setHour(alarm.getHour());
request.setMinute(alarm.getMinute());
request.perform();
inProgressRequests.add(request);
performConnected(builder.getTransaction());
} catch (IOException e) {
GB.toast(getContext(), "Failed to set alarm", Toast.LENGTH_SHORT, GB.ERROR, e);
}
++i;
}
}
Aggregations