Skip to content

Commit

Permalink
Always check uevent batt status before comparing current
Browse files Browse the repository at this point in the history
  • Loading branch information
VR-25 committed Jun 12, 2022
1 parent 5746f7e commit 9110ed8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions install/batt-interface.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ discharging() {


idle() {
grep -iq 'Not charging' $battStatus || {
#grep -iq 'Not charging' $battStatus || {
[ $curThen != null ] && {
if $plusChgPolarity; then
[ $curNow -ge -$idleThresholdL ] && [ $curNow -le $idleThresholdH ]
else
[ $curNow -le $idleThresholdL ] && [ $curNow -ge -$idleThresholdH ]
fi
} || return 1
}
#}
_status=Idle
}

Expand Down Expand Up @@ -75,7 +75,11 @@ status() {
_status=$(set -eu; eval '$battStatusOverride') || :
fi
elif $battStatusWorkaround; then
idle || discharging || :
#idle || discharging || :
case $_status in
Charging) idle || discharging || :;;
Discharging) idle || :;;
esac
fi

for i in Discharging DischargingDischarging Idle IdleIdle; do
Expand Down

0 comments on commit 9110ed8

Please sign in to comment.