1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-25 10:05:49 +01:00

Setting the wear location appears to fail for amazfit #274

So as a test, disable that for amazfit. Let's see what happens
next.
This commit is contained in:
cpfeiffer 2016-05-31 22:33:38 +02:00
parent 19d7c03545
commit 9a106667d2

View File

@ -361,10 +361,18 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
LOG.info("Attempting to set wear location...");
BluetoothGattCharacteristic characteristic = getCharacteristic(MiBandService.UUID_CHARACTERISTIC_CONTROL_POINT);
if (characteristic != null) {
int location = MiBandCoordinator.getWearLocation(getDevice().getAddress());
transaction.write(characteristic, new byte[]{
MiBandService.COMMAND_SET_WEAR_LOCATION,
(byte) location
transaction.add(new ConditionalWriteAction() {
@Override
protected byte[] checkCondition() {
if (getDeviceInfo() != null && getDeviceInfo().isAmazFit()) {
return null;
}
int location = MiBandCoordinator.getWearLocation(getDevice().getAddress());
return new byte[]{
MiBandService.COMMAND_SET_WEAR_LOCATION,
(byte) location
};
}
});
} else {
LOG.info("Unable to set Wear Location");