enkore / i3pystatus

A complete replacement for i3status

Home Page:https://i3pystatus.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BatteryCharge & Battery do not handle negative CURRENT_NOW values

lucible opened this issue · comments

I have i3pystatus on my laptop, and when I unplug the power cable, the {consumption} wattage shows 0.00 Watts. When I plug in the power cable, I get some number of Watts appearing.

This is happening because

  • the CURRENT_NOW in my uevent is negative
  • BatteryCharge.consumption then multiplies this with the voltage & passes a negative value to
  • Battery.consumption, which returns 0 if the value is less than 0.1

I have another utility that calculates watt consumption, and when I'm on battery it returns a negative watt value and when I'm on power it returns the positive value (very close to the value reported by i3pystatus). My electricity knowledge is almost nil, but I think the values mean

  • watts being drawn from the battery when negative
  • watts being put into the battery when positive

in which case having the negative value available in the status bar would be useful and good.

Closing b/c my fix was merged a long time ago! 😅