1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-21 16:02:04 +02:00

Ignore the first measurement that only contains weight

As reported in #282
This commit is contained in:
Erik Johansson
2018-05-31 21:18:05 +02:00
parent fd0cbddcb1
commit 71f7cae682

View File

@@ -84,7 +84,9 @@ public class BluetoothExingtechY1 extends BluetoothCommunication {
public void onBluetoothDataChange(BluetoothGatt bluetoothGatt, BluetoothGattCharacteristic gattCharacteristic) {
final byte[] data = gattCharacteristic.getValue();
if (data != null && data.length == 20) {
// The first notification only includes weight and all other fields are
// either 0x00 (user info) or 0xff (fat, water, etc.)
if (data != null && data.length == 20 && data[6] != 0xff) {
parseBytes(data);
}
}