From 5e33e8e58f424164050ed7f33c2c098a9a3948a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Tue, 7 Jun 2022 12:12:21 +0100 Subject: [PATCH] Mi Band 6: Fix night mode on latest firmware --- .../service/devices/huami/miband3/MiBand3Support.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/miband3/MiBand3Support.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/miband3/MiBand3Support.java index 734acc1cd..74705d0f9 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/miband3/MiBand3Support.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/miband3/MiBand3Support.java @@ -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);