Use absolute value of current_now

It seems on my system that there has been a recent kernel change where `current_now` is reported negative when discharging, leading to no reported time remaining, only a dash; given this is only on certain kernel versions, it is perhaps better to just take the absolute value of `current_now` when calculating time remaining, just to remain compatible with both
This commit is contained in:
goose121 2025-07-09 15:13:34 -06:00 committed by GitHub
parent 1e3fa7abae
commit 8851f78a2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -209,7 +209,7 @@
(sysfs-int-field path "charge_now")))
(consumption ()
(or (sysfs-int-field path "power_now")
(sysfs-int-field path "current_now")))
(abs (sysfs-int-field path "current_now"))))
(capacity-native ()
(sysfs-int-field path "capacity"))
(capacity-calculate ()