comparison py/fridge.py @ 555:9dea75bd765f

merge
author Matt Johnston <matt@ucc.asn.au>
date Mon, 08 Jun 2015 22:33:04 +0800
parents 39540ddacdca
children 26eee8591f61
comparison
equal deleted inserted replaced
553:d16afb5b5cd9 555:9dea75bd765f
33 @asyncio.coroutine 33 @asyncio.coroutine
34 def run(self): 34 def run(self):
35 if self.server.params.disabled: 35 if self.server.params.disabled:
36 L("Fridge is disabled") 36 L("Fridge is disabled")
37 while True: 37 while True:
38 self.do()
39 try: 38 try:
39 self.do()
40 yield from self.server.sleep(config.FRIDGE_SLEEP) 40 yield from self.server.sleep(config.FRIDGE_SLEEP)
41 except Exception as e: 41 except Exception as e:
42 EX("fridge failed") 42 EX("fridge failed")
43 43
44 def do(self): 44 def do(self):
109 self.off() 109 self.off()
110 110
111 else: 111 else:
112 # fridge is off 112 # fridge is off
113 turn_on = False 113 turn_on = False
114 D("fridge %(fridge)f max %(fridge_max)f wort %(wort)f wort_max %(wort_max)f" % locals()) 114 D("fridge %(fridge)s max %(fridge_max)s wort %(wort)s wort_max %(wort_max)s" % locals())
115 if not params.nowort \ 115 if not params.nowort \
116 and wort is not None \ 116 and wort is not None \
117 and wort >= wort_max: 117 and wort >= wort_max:
118 L("Wort is too hot %f, max %f" % (wort, wort_max)) 118 L("Wort is too hot %f, max %f" % (wort, wort_max))
119 turn_on = True 119 turn_on = True