comparison py/fridge.py @ 168:bfc3213edee4

add nowort mode
author Matt Johnston <matt@ucc.asn.au>
date Wed, 20 Feb 2013 21:08:42 +0800
parents 5d5424acfed0
children 78255c49bf9a
comparison
equal deleted inserted replaced
167:aeeaee643711 168:bfc3213edee4
102 overshoot = params.overshoot_factor \ 102 overshoot = params.overshoot_factor \
103 * min(self.OVERSHOOT_MAX_DIV, on_time) \ 103 * min(self.OVERSHOOT_MAX_DIV, on_time) \
104 / self.OVERSHOOT_MAX_DIV 104 / self.OVERSHOOT_MAX_DIV
105 D("on_time %(on_time)f, overshoot %(overshoot)f" % locals()) 105 D("on_time %(on_time)f, overshoot %(overshoot)f" % locals())
106 106
107 if wort is not None and (wort - overshoot) < params.fridge_setpoint: 107 if not params.nowort \
108 and wort is not None \
109 and (wort - overshoot) < params.fridge_setpoint:
108 L("wort has cooled enough, %(wort)f" % locals() ) 110 L("wort has cooled enough, %(wort)f" % locals() )
109 turn_off = True 111 turn_off = True
110 elif fridge is not None and fridge < fridge_min: 112 elif fridge is not None and fridge < fridge_min:
111 W("fridge off fallback, fridge %(fridge)f, min %(fridge_min)f" % locals()) 113 W("fridge off fallback, fridge %(fridge)f, min %(fridge_min)f" % locals())
112 turn_off = True 114 turn_off = True
117 self.fridge_off_clock = self.server.now() 119 self.fridge_off_clock = self.server.now()
118 120
119 else: 121 else:
120 # fridge is off 122 # fridge is off
121 turn_on = False 123 turn_on = False
122 if wort is not None and wort >= wort_max: 124 if not params.nowort \
125 and wort is not None \
126 and wort >= wort_max:
123 L("Wort is too hot %f, max %f" % (wort, wort_max)) 127 L("Wort is too hot %f, max %f" % (wort, wort_max))
124 turn_on = True 128 turn_on = True
125 elif fridge is not None and fridge >= fridge_max: 129 elif fridge is not None and fridge >= fridge_max:
126 W("frdge on fallback, fridge %(fridge)f, max %(fridge_max)f" % locals()) 130 W("frdge on fallback, fridge %(fridge)f, max %(fridge_max)f" % locals())
127 turn_on = True 131 turn_on = True