battery: Prioritize full-at over state (#2019)
* Prioritize battery full-at over state The `full-at` option should take priority over the charging state of the battery. Closes #1622 (issue for Thinkpad laptops) * Remove typo from clamp_percentage
This commit is contained in:
parent
b0e9e3ff61
commit
be64da3bda
@ -286,12 +286,12 @@ namespace modules {
|
||||
* Get the current battery state
|
||||
*/
|
||||
battery_module::state battery_module::current_state() {
|
||||
if (!read(*m_state_reader)) {
|
||||
return battery_module::state::DISCHARGING;
|
||||
} else if (read(*m_capacity_reader) < m_fullat) {
|
||||
return battery_module::state::CHARGING;
|
||||
} else {
|
||||
if (read(*m_capacity_reader) >= m_fullat) {
|
||||
return battery_module::state::FULL;
|
||||
} else if (!read(*m_state_reader)) {
|
||||
return battery_module::state::DISCHARGING;
|
||||
} else {
|
||||
return battery_module::state::CHARGING;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user