Skip to content

Feature request --charge-limit: allow setting the min level #360

Description

@ttk592

framework_tool --charge-limit can read min/max percentage battery charge limits but can only set the max level. Could you extend the interface to also allow setting the minimum level?

# framework_tool --charge-limit
Minimum 0%, Maximum 60%

# framework_tool --charge-limit 50        # this only sets the max limit
Minimum 0%, Maximum 50%

Since handle_charge_limit() already has functionality to set min/max limits, why not expose both?

fn handle_charge_limit(ec: &CrosEc, maybe_limit: Option<u8>) -> EcResult<()> {
    let (cur_min, _cur_max) = ec.get_charge_limit()?;
...
        ec.set_charge_limit(cur_min, limit)?;
}

Use case: a laptop mostly connected via mains, but disconnected over night, would micro-cycle every day for a few seconds to go from say 59% back to 60%, which is not good for longevity. With the min level set to greater 0, it would not initiate charging, unless the battery falls below the min threshold.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions