"Critical power" action taken even with power supply plugged in
Hello,
I'm seeing a bug in the Power Manager. When a critical battery power level is encountered, the designated action is taken (e.g. Hibernate), even when a power supply is plugged in. This is unlikely to be beneficial.
Use case/repro:
- Set critical level to 10% and action to Hibernate
- Suspend laptop at 15%
- Wait a few hours until the laptop is down to <10%. Discharge levels while suspended can be very low
- Plug in laptop to power supply
- Resume laptop
- Laptop wakes up, sees critical battery level (even tho it's powered by AC), and hibernates
Excerpt from /var/lib/upower/history-charge-foo.dat
:
1643335358 64.000 discharging
1643335479 62.000 discharging
1643335599 60.000 discharging
1643378573 0.000 charging
1643378584 44.000 charging
1643378600 45.000 charging
1643378696 46.000 charging
For a short time, after waking up, Upower reported 0% charge while charging.
I see three problems here
- A single spurious reading of wrong charge level can happen occasionally on various laptops, and should ideally be disregarded
- Power Manager should probably not take acton immediately after a laptop has woken from suspend/hibernate
- Power Manager shouldn't take action at all when the machine is plugged in, i.e. charging
Xfce Power Manager 4.16.0
Thanks!