1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-25 18:15:49 +01:00

Make it really clear, that only the first alarm works #323

This commit is contained in:
cpfeiffer 2016-10-21 01:01:30 +02:00
parent 15954d4561
commit ee24443b6a

View File

@ -1056,6 +1056,11 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
Calendar calendar = alarm.getAlarmCal();
int daysMask = 0;
if (alarm.getIndex() != 0 && alarm.isEnabled()) {
GB.toast(getContext(), "Only the first alarm is currently supported.", Toast.LENGTH_LONG, GB.WARN);
return;
}
if (alarm.isEnabled()) {
if (alarm.getRepetition(Alarm.ALARM_MON)) {
daysMask |= 1;
@ -1087,9 +1092,7 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
(byte) calendar.get(Calendar.MINUTE),
(byte) daysMask,
};
if (alarm.isEnabled()) {
builder.write(characteristic, alarmMessage);
}
builder.write(characteristic, alarmMessage);
}
private void handleControlPointResult(byte[] value, int status) {