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

[Linux] psutil couldn't determine the battery status on charging #1658

Open
validatedev opened this issue Jan 8, 2020 · 1 comment
Open

Comments

@validatedev
Copy link

Platform

  • Ubuntu 20.04
  • 5.6.7

Bug description
Trying the following:

(base) validate@validatepc:~/validatedev_github_forks$ sudo python3
Python 3.7.5 (default, Oct 27 2019, 15:43:29) 
[GCC 9.2.1 20191027] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> bat_state = psutil.sensors_battery().power_plugged
>>> print(bat_state)
None
>>> 

As you can see, psutil couldn't determine the battery status correctly when plugged in. When on battery:

>>> print(bat_state)
False
@validatedev validatedev added the bug label Jan 8, 2020
@validatedev validatedev reopened this Jan 8, 2020
AdnanHodzic added a commit to AdnanHodzic/auto-cpufreq that referenced this issue Jan 12, 2020
* temp fix for giampaolo/psutil#1658

* fix for missing set_performance()

* add power package for better power source status detecting

* remove redundant spaces

Co-authored-by: Adnan Hodzic <adnan@hodzic.org>
@frankenstein91
Copy link

Works for me on Version: 5.6.7

AdnanHodzic added a commit to AdnanHodzic/auto-cpufreq that referenced this issue Sep 2, 2020
* temp fix for giampaolo/psutil#1658

* fix for missing set_performance()

* add power package for better power source status detecting

* remove redundant spaces

Co-authored-by: Adnan Hodzic <adnan@hodzic.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants