Disable charging only if enabled

This commit is contained in:
Alex Ibrado
2023-09-19 08:14:19 +08:00
parent d3bc676814
commit 7977d5f874

View File

@@ -453,7 +453,9 @@ if [[ "$action" == "maintain_synchronous" ]]; then
if [[ "$battery_percentage" -ge "$setting" && ( "$is_charging" == "enabled" || "$ac_attached" == "1" ) ]]; then
log "Charge above $setting"
disable_charging
if [[ "$is_charging" == "enabled" ]]; then
disable_charging
fi
change_magsafe_led_color "green"
elif [[ "$battery_percentage" -lt "$setting" && "$is_charging" == "disabled" ]]; then