collect: Fix reading of battery power draw on Linux

This was erroneously set to read from the current battery charge.

Fixes #770.
This commit is contained in:
David Mak 2024-02-14 00:59:08 +08:00
parent fd2a2acdad
commit e031cce6ba
1 changed files with 1 additions and 1 deletions

View File

@ -835,7 +835,7 @@ namespace Cpu {
if (b.use_power) { if (b.use_power) {
if (not b.power_now.empty()) { if (not b.power_now.empty()) {
try { 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::invalid_argument&) { }
catch (const std::out_of_range&) { } catch (const std::out_of_range&) { }