Fix reset value for max charge level

This commit is contained in:
NGnius (Graham) 2023-11-26 17:27:05 -05:00
parent d481f13144
commit 0b8e3deb92

View file

@ -597,7 +597,7 @@ impl OnPowerEvent for Battery {
// only true when charge_limit_set is false and self.state.charge_limit_set is true
self.state.charge_limit_set = false;
if attr_exists {
self.sysfs_hwmon.set(MAX_BATTERY_CHARGE_LEVEL_ATTR, 100)
self.sysfs_hwmon.set(MAX_BATTERY_CHARGE_LEVEL_ATTR, 0)
.unwrap_or_else(|e| errors.push(
SettingError {
msg: format!("Failed to reset (write to) {:?}: {}", MAX_BATTERY_CHARGE_LEVEL_ATTR, e),