From aa143577f8ac21270ca0de7a7bb4d3a4634f8a7f Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Mon, 16 Jul 2018 15:16:23 +0200 Subject: [PATCH] Amazfit Cor: Support language switching on newer firmwares I shamelessly assumed the firmware version (chose the version that was included in the same Mi Fit version when bip started to support the new command) --- CHANGELOG.md | 1 + .../service/devices/huami/amazfitbip/AmazfitBipSupport.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 394f48eb2..a1aa19197 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Inital support for ZeTime * Amazfit Bip/Cor: Rework firmware detection to cope with new version scheme * Amazfit Bip: Support setting language to Russian +* Amazfit Cor: Support language switching on newer firmwares * Mi Band 3: support setting language (english and spanish tested) * Mi Band 3: Fix pairing * Mi Band 3: Send AQI to enable display of current temperature diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/AmazfitBipSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/AmazfitBipSupport.java index e4edd33e7..9d7a7277b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/AmazfitBipSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/AmazfitBipSupport.java @@ -462,7 +462,9 @@ public class AmazfitBipSupport extends MiBand2Support { builder.add(new ConditionalWriteAction(getCharacteristic(MiBand2Service.UUID_CHARACTERISTIC_3_CONFIGURATION)) { @Override protected byte[] checkCondition() { - if (gbDevice.getType() == DeviceType.MIBAND3 || (gbDevice.getType() == DeviceType.AMAZFITBIP && new Version(gbDevice.getFirmwareVersion()).compareTo(new Version("0.1.0.77")) >= 0)) { + if (gbDevice.getType() == DeviceType.MIBAND3 || + (gbDevice.getType() == DeviceType.AMAZFITBIP && new Version(gbDevice.getFirmwareVersion()).compareTo(new Version("0.1.0.77")) >= 0) || + (gbDevice.getType() == DeviceType.AMAZFITCOR && new Version(gbDevice.getFirmwareVersion()).compareTo(new Version("1.0.7.23")) >= 0)) { return command_new; } else { return command_old;