Permalink
Browse files

fixed not calculate the recovery_quantity

  • Loading branch information...
1 parent a123e3f commit c98f348bed85522e491a6427e45e6ed527396eea @incl incl committed Nov 5, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 energy.py
View
@@ -194,7 +194,9 @@ def recovered(self, time=None):
passed = self.passed(time)
if passed is None:
return 0
- return min(int(passed / self.recovery_interval), self.used)
+ recover = self.recovery_quantity
+ recover = int(passed / self.recovery_interval) * recover
+ return min(recover, self.used)
def passed(self, time=None):
"""Calculates the seconds passed from using the energy first.

0 comments on commit c98f348

Please sign in to comment.