Skip to content

Commit

Permalink
block[battery]: give priority to charging over empty (#2060)
Browse files Browse the repository at this point in the history
  • Loading branch information
bim9262 authored Jun 17, 2024
1 parent 2c2c19b commit 47d0687
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/blocks/battery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ pub async fn run(config: &Config, api: &CommonApi) -> Result<()> {
if let Some(info) = &mut info {
if info.capacity >= config.full_threshold {
info.status = BatteryStatus::Full;
} else if info.capacity <= config.empty_threshold {
} else if info.capacity <= config.empty_threshold
&& info.status != BatteryStatus::Charging
{
info.status = BatteryStatus::Empty;
}
}
Expand Down

0 comments on commit 47d0687

Please sign in to comment.