Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charge threshold doesn't work with suspend-then-hibernate #15

Closed
GWFrank opened this issue Aug 11, 2021 · 2 comments
Closed

Charge threshold doesn't work with suspend-then-hibernate #15

GWFrank opened this issue Aug 11, 2021 · 2 comments

Comments

@GWFrank
Copy link

GWFrank commented Aug 11, 2021

Expected Behavior

After resuming from suspend-then-hibernate, if battery level is above charge threshold (80), it shouldn't be charging.

Actual Behavior

The battery is charging despite that battery level is above threshold (80) after resuming from suspend-then-hibernate.
bat -t correctly shows the threshold I configured. Manually setting charge threshold again makes it work properly.

Steps to reproduce

  1. Set threshold and persist. sudo bat -t 80 sudo bat -p.
  2. Set appropriate HibernateDelaySec (like 20 for testing) in /etc/systemd/sleep.conf.
  3. Charge the battery until it meets the threshold. Check that the battery is not charging with bat -s.
  4. sudo systemctl suspend-then-hibernate and wait for it to enter hibernate mode.
  5. Resume from hibernate. Check battery status with bat -s and it says it's charging.
  6. Run sudo bat -t 80 then check battery status. This time the threshold works and battery isn't charging.

Additional Notes

With both suspend and hibernate the threshold works properly.
I tried both 0.8 and 0.8.1, neither works.

System Info

OS: Manjaro Linux x86_64 
Host: ZenBook UX425EA_UX425EA 1.0 
Kernel: 5.13.8-1-MANJARO 
Packages: 1373 (pacman), 5 (flatpak), 10 (snap) 
Shell: zsh 5.8 
Resolution: 1920x1080 
DE: Plasma 5.22.4 
WM: KWin 
CPU: 11th Gen Intel i5-1135G7 (8) @ 4.200GHz 
GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics] 
Memory: 2203MiB / 15701MiB 
@tshakalekholoane
Copy link
Owner

Thank you for filing the issue. Here's a proposed fix. Let me know if works and confirm that the version is 0.8.2-alpha before running it.

@GWFrank
Copy link
Author

GWFrank commented Aug 12, 2021

After using the new version to do sudo bat -t 80 and sudo bat -p then reboot the system, it seems to work !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants