Fix force discharge option for users using a shell other than zsh.

This commit is contained in:
base47
2025-11-19 22:00:39 +01:00
parent 3ec12357d9
commit 8761f97a0e

View File

@@ -667,9 +667,9 @@ if [[ "$action" == "maintain_synchronous" ]]; then
fi fi
# Parse setting - could be single value or range # Parse setting - could be single value or range
local lower_bound="" lower_bound=""
local upper_bound="" upper_bound=""
local is_range=false is_range=false
if valid_percentage_range "$setting"; then if valid_percentage_range "$setting"; then
# Range format: lower-upper # Range format: lower-upper
@@ -689,7 +689,7 @@ if [[ "$action" == "maintain_synchronous" ]]; then
# Check if the user requested that the battery maintenance first discharge to the desired level # Check if the user requested that the battery maintenance first discharge to the desired level
if [[ "$subsetting" == "--force-discharge" ]]; then if [[ "$subsetting" == "--force-discharge" ]]; then
# Before we start maintaining the battery level, first discharge to the target level # Before we start maintaining the battery level, first discharge to the target level
local discharge_target="$lower_bound" discharge_target="$lower_bound"
log "Triggering discharge to $discharge_target before enabling charging limiter" log "Triggering discharge to $discharge_target before enabling charging limiter"
$battery_binary discharge "$discharge_target" $battery_binary discharge "$discharge_target"
log "Discharge pre battery-maintenance complete, continuing to battery maintenance loop" log "Discharge pre battery-maintenance complete, continuing to battery maintenance loop"