path: root/tools
diff options
authorPhilipp Zabel <>2021-06-17 18:14:53 +0200
committerPhilipp Zabel <>2021-06-17 18:14:53 +0200
commit2949136b152e94aa3b57da5130bcb9022724debe (patch)
tree587cd77976db77881ef6b556e526f83d57086e06 /tools
parent0f2837acded0bf82acedf5caafc81684e1919c89 (diff)
linux: Fix < 0.01 W energy-rate readings from power_now sysfs property
Currently, if a power supplies' power_now sysfs file reports discharge rates < 0.01 W, the code will try to calculate the discharge rate from the legacy sysfs files. On new kernels where those don't exist, this produces wrong results. For example, on a dual-battery Thinkpad T450s, while the external battery is discharging, the internal battery reports power_now = 0, but the corresponding upower energy-rate field incorrectly reads about 2.3 W. This patch fixes the issue by falling back to the legacy code only if the legacy current_now sysfs file exists. Closes: #7, #44
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions