Conversation
hidpp_battery_N and similar power_supply nodes report type=Battery but expose no charge_control_* files. ListBatteries() returns them, so set/apply/TUI attempted SysfsWriteInt on non-existent paths and aborted before/after writing the real battery (ENOENT), breaking persistence. Backends now return ErrNotChargeable from SetThresholds when the target battery lacks the attributes they would write (per-battery check instead of globally-derived capabilities), and the three call sites skip such batteries instead of failing. Fixed-path backends (Apple, Acer, Samsung, Sony, Huawei, Lenovo-ideapad, LG legacy) are unaffected.
|
I hit this with a Logitech keyboard ( Two things I ran into that this doesn't cover, which I've stacked on your branch as lucserre#1 rather than proposing separately:
Entirely your call whether either is wanted — happy for you to squash, cherry-pick, or ignore. |
hidpp_battery_N and similar power_supply nodes report type=Battery but
expose no charge_control_* files. ListBatteries() returns them, so
set/apply/TUI attempted SysfsWriteInt on non-existent paths and aborted
before/after writing the real battery (ENOENT), breaking persistence.
Backends now return ErrNotChargeable from SetThresholds when the target
battery lacks the attributes they would write (per-battery check instead
of globally-derived capabilities), and the three call sites skip such
batteries instead of failing. Fixed-path backends (Apple, Acer, Samsung,
Sony, Huawei, Lenovo-ideapad, LG legacy) are unaffected.