Skip to content

Commit ccf999b

Browse files
Copilotdorkmo
andcommitted
Fix percent threshold check for empty tanks
Co-authored-by: dorkmo <[email protected]>
1 parent 558840f commit ccf999b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

TankAlarm-112025-Server-BluesOpta/TankAlarm-112025-Server-BluesOpta.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7751,8 +7751,8 @@ static void handleCalibrationPost(EthernetClient &client, const String &body) {
77517751
gTankRecords[i].tankNumber == tankNumber) {
77527752
// Use stored percent if available, otherwise calculate from level/height
77537753
float percent = gTankRecords[i].percent;
7754-
if (percent < 0.1f && gTankRecords[i].heightInches > 1.0f) {
7755-
// Calculate percent from level/height as fallback
7754+
if (percent <= 0.0f && gTankRecords[i].heightInches > 1.0f) {
7755+
// Percent not set, calculate from level/height as fallback
77567756
percent = (gTankRecords[i].levelInches / gTankRecords[i].heightInches) * 100.0f;
77577757
}
77587758
// Convert percent (0-100) to mA (4-20)

0 commit comments

Comments
 (0)