I have HP Pavilion X360 laptop which runs: Ubuntu 18.04 Python 2.7 and 3.7
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
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?