diff py/fridge.py @ 279:6848907f85be

fix missing on_time variable
author Matt Johnston <matt@ucc.asn.au>
date Sat, 28 Nov 2015 08:42:33 +0800
parents af924d27140f
children 6087c692d381
line wrap: on
line diff
--- a/py/fridge.py	Tue Nov 17 22:26:54 2015 +0800
+++ b/py/fridge.py	Sat Nov 28 08:42:33 2015 +0800
@@ -92,7 +92,8 @@
 
         if self.is_on():
             turn_off = False
-            on_percent = self.integrator.integrate() / params.overshoot_delay
+            on_time = self.integrator.integrate()
+            on_percent =  on_time / params.overshoot_delay
 
             overshoot = params.overshoot_factor * on_percent
             D("on_time %(on_percent)f, overshoot %(overshoot)f" % locals())