Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G7 battery warning #3239

Merged
merged 5 commits into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.eveningoutpost.dexdrip.g5model;


import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId;

import com.eveningoutpost.dexdrip.models.JoH;
import com.eveningoutpost.dexdrip.services.G5BaseService;
import com.eveningoutpost.dexdrip.services.Ob1G5CollectionService;
Expand Down Expand Up @@ -93,6 +95,9 @@ public boolean voltageAWarning() {
}

public boolean voltageBWarning() {
if (shortTxId()) { // G7 only
return voltageB() < (G5BaseService.LOW_BATTERY_WARNING_LEVEL - 25);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be best if 25 is a constant

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a copy of a code that uses 10, which was not a constant. I just followed that practice.

}
return voltageB() < (G5BaseService.LOW_BATTERY_WARNING_LEVEL - 10);
};

Expand Down
Loading