Skip to content

Commit

Permalink
Delay power renormalization
Browse files Browse the repository at this point in the history
  • Loading branch information
Etn40ff authored and ramnes committed Jul 5, 2019
1 parent 607db77 commit fdb3a32
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libqtile/widget/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,19 +284,19 @@ def update_status(self) -> BatteryStatus:
else:
percent = now / full

if power_unit == 'uA':
voltage = float(self._get_param('voltage_now_file')[0])
power = voltage * power / 1e12
elif power_unit == 'uW':
power = power / 1e6

if power == 0:
time = 0
elif state == BatteryState.DISCHARGING:
time = int(now / power)
else:
time = int((full - now) / power)

if power_unit == 'uA':
voltage = float(self._get_param('voltage_now_file')[0])
power = voltage * power / 1e12
elif power_unit == 'uW':
power = power / 1e6

return BatteryStatus(state=state, percent=percent, power=power, time=time)


Expand Down

0 comments on commit fdb3a32

Please sign in to comment.