Merge pull request #12 from weiyou/fix-plus-one-issue

change '-gt' to '-ge' so the maintained battery level does not have a…
This commit is contained in:
Mentor Palokaj
2022-10-13 17:16:54 -04:00
committed by GitHub

View File

@@ -242,7 +242,7 @@ if [[ "$action" == "maintain_synchronous" ]]; then
# Keep track of status
is_charging=$( get_smc_charging_status )
if [[ "$battery_percentage" -gt "$setting" && "$is_charging" == "enabled" ]]; then
if [[ "$battery_percentage" -ge "$setting" && "$is_charging" == "enabled" ]]; then
log "Charge above $setting"
disable_charging
@@ -364,4 +364,4 @@ if [[ "$action" == "remove_daemon" ]];then
rm $daemon_path 2> /dev/null
exit 0
fi
fi