From e485ca02d91fb408be5b6d27b65b48bd5febf83a Mon Sep 17 00:00:00 2001 From: eleksir Date: Fri, 27 Sep 2024 20:57:58 +0300 Subject: [PATCH] Show ramaining battery charge, not drianed --- internal/lib/batteries.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/lib/batteries.go b/internal/lib/batteries.go index 7a1573e..1be34c2 100644 --- a/internal/lib/batteries.go +++ b/internal/lib/batteries.go @@ -48,7 +48,7 @@ func (c *MyConfig) UpdateBatteryInfo() { // N.B. there can be case when battery is overcharged and shows >100%. It also can indicate that // calibration data is out of date and battery should be re-calibrated. - ch = int(math.Round((b.Full - b.Current) * (100 / b.Full))) + ch = int(math.Round((b.Full - (b.Full - b.Current)) * (100 / b.Full))) switch { case ch > 85: