Skip to content

set/apply/TUI: skip pseudo-batteries without charge control attributes - #13

Open
lucserre wants to merge 1 commit into
Ooooze:masterfrom
lucserre:fix/hidpp-pseudo-battery-skip
Open

set/apply/TUI: skip pseudo-batteries without charge control attributes#13
lucserre wants to merge 1 commit into
Ooooze:masterfrom
lucserre:fix/hidpp-pseudo-battery-skip

Conversation

@lucserre

@lucserre lucserre commented Sep 2, 2026

Copy link
Copy Markdown

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant