Skip to content

Commit

Permalink
collect: Fix reading of battery power draw on Linux
Browse files Browse the repository at this point in the history
This was erroneously set to read from the current battery charge.

Fixes #770.
  • Loading branch information
Derppening committed Feb 13, 2024
1 parent fd2a2ac commit e031cce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/linux/btop_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ namespace Cpu {
if (b.use_power) {
if (not b.power_now.empty()) {
try {
watts = (float)stoll(readfile(b.energy_now, "-1")) / 1000000.0;
watts = (float)stoll(readfile(b.power_now, "-1")) / 1000000.0;
}
catch (const std::invalid_argument&) { }
catch (const std::out_of_range&) { }
Expand Down

0 comments on commit e031cce

Please sign in to comment.