fix(battery): start and end threshold check
end limits should be greater than start and end should be < 100 for it to be considered enabled
This commit is contained in:
parent
3ba34931e7
commit
ba1e379a75
1 changed files with 1 additions and 1 deletions
|
|
@ -220,7 +220,7 @@ pub async fn get_charging_limit() -> anyhow::Result<bool> {
|
||||||
match backend {
|
match backend {
|
||||||
Backend::S76PowerDaemon(proxy) => {
|
Backend::S76PowerDaemon(proxy) => {
|
||||||
if let Ok((start, end)) = proxy.get_charge_thresholds().await {
|
if let Ok((start, end)) = proxy.get_charge_thresholds().await {
|
||||||
return Ok(start > 0 || end > 0);
|
return Ok(end > start && end < 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Backend::PowerProfilesDaemon(_) => {
|
Backend::PowerProfilesDaemon(_) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue