1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-15 21:27:51 +01:00

Mi Band 6: Fix night mode on latest firmware

This commit is contained in:
José Rebelo 2022-06-07 12:12:21 +01:00
parent c188eccff7
commit 5e33e8e58f

View File

@ -93,10 +93,10 @@ public class MiBand3Support extends AmazfitBipSupport {
switch (nightMode) {
case MiBandConst.PREF_NIGHT_MODE_SUNSET:
builder.write(getCharacteristic(HuamiService.UUID_CHARACTERISTIC_3_CONFIGURATION), MiBand3Service.COMMAND_NIGHT_MODE_SUNSET);
writeToConfiguration(builder, MiBand3Service.COMMAND_NIGHT_MODE_SUNSET);
break;
case MiBandConst.PREF_NIGHT_MODE_OFF:
builder.write(getCharacteristic(HuamiService.UUID_CHARACTERISTIC_3_CONFIGURATION), MiBand3Service.COMMAND_NIGHT_MODE_OFF);
writeToConfiguration(builder, MiBand3Service.COMMAND_NIGHT_MODE_OFF);
break;
case MiBandConst.PREF_NIGHT_MODE_SCHEDULED:
byte[] cmd = MiBand3Service.COMMAND_NIGHT_MODE_SCHEDULED.clone();
@ -113,7 +113,7 @@ public class MiBand3Support extends AmazfitBipSupport {
cmd[4] = (byte) calendar.get(Calendar.HOUR_OF_DAY);
cmd[5] = (byte) calendar.get(Calendar.MINUTE);
builder.write(getCharacteristic(HuamiService.UUID_CHARACTERISTIC_3_CONFIGURATION), cmd);
writeToConfiguration(builder, cmd);
break;
default:
LOG.error("Invalid night mode: " + nightMode);