1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-13 16:40:50 +02:00

Mi2: Attempt to support non-repetitive alarms #323

This commit is contained in:
cpfeiffer 2016-10-28 23:18:10 +02:00
parent e5ade5c0ef
commit 3db9748136

View File

@ -1070,9 +1070,14 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
return;
}
int base = 0;
if (alarm.isEnabled()) {
base = 128;
}
int daysMask = alarm.getRepetitionMask();
int base = alarm.isEnabled() ? 128 : 0;
if (!alarm.isRepetitive()) {
daysMask = 128;
}
byte[] alarmMessage = new byte[] {
(byte) 0x2, // TODO what is this?
(byte) (base + alarm.getIndex()), // 128 is the base, alarm slot is added