I have HP Pavilion X360 laptop which runs: Ubuntu 18.04 Python 2.7 and 3.7

import psutil

if on AC power

>>> psutil.sensors_battery()
sbattery(percent=79.77341807129041, secsleft=-2, power_plugged=True)

if on battery power

>>> psutil.sensors_battery()
#returns None

return 'None'

On a Mac Book Pro 2017 (High Sierra), it works fine.

It seems to be a hardware problem with HP Pavilion X360. Any thought how to fix it or diagnose it further?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.