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

here
cpfeiffer 2016-10-21 01:01:30 +02:00
parent 15954d4561
commit ee24443b6a
1 changed files with 6 additions and 3 deletions

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) {