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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user