From ae17b57a4cda288d577360c1d21fae43d542f9a2 Mon Sep 17 00:00:00 2001 From: quthla Date: Sun, 8 May 2022 11:57:54 +0200 Subject: [PATCH] Fix senssun excessive toasts (#850) --- .../health/openscale/core/bluetooth/BluetoothSenssun.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothSenssun.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothSenssun.java index 0d3cb00a..39d4873f 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothSenssun.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothSenssun.java @@ -115,7 +115,7 @@ public class BluetoothSenssun extends BluetoothCommunication { switch(data[5]) { case (byte)0xAA: case (byte)0xA0: - if (values > 1) { + if (weightStabilized) { return; } if (!stepMessageDisplayed) { @@ -127,13 +127,9 @@ public class BluetoothSenssun extends BluetoothCommunication { Timber.d("the byte is %d stable is %s", (data[5] & 0xff), weightStabilized ? "true": "false"); lastWeight = ((data[1] & 0xff) << 8) | (data[2] & 0xff); - if (lastWeight > 0) { - sendMessage(R.string.info_measuring, lastWeight / 10.0f); - - } - if (weightStabilized) { values |= 1; + sendMessage(R.string.info_measuring, lastWeight / 10.0f); synchroniseUser(); } break;