comparison py/fridge.py @ 233:19569cb5ed46

better arg parser. seems close to ready
author Matt Johnston <matt@ucc.asn.au>
date Sat, 11 Apr 2015 23:32:59 +0800
parents a01b7bccccd3
children ffe25107d520
comparison
equal deleted inserted replaced
232:a01b7bccccd3 233:19569cb5ed46
79 return 79 return
80 80
81 if fridge is None: 81 if fridge is None:
82 W("Invalid fridge sensor") 82 W("Invalid fridge sensor")
83 83
84 D("fridge on %s" % self.is_on())
85
84 if self.is_on(): 86 if self.is_on():
85 turn_off = False 87 turn_off = False
86 on_time = self.server.now() - self.fridge_on_clock 88 on_time = self.server.now() - self.fridge_on_clock
87 89
88 overshoot = 0 90 overshoot = 0
107 self.off() 109 self.off()
108 110
109 else: 111 else:
110 # fridge is off 112 # fridge is off
111 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())
112 if not params.nowort \ 115 if not params.nowort \
113 and wort is not None \ 116 and wort is not None \
114 and wort >= wort_max: 117 and wort >= wort_max:
115 L("Wort is too hot %f, max %f" % (wort, wort_max)) 118 L("Wort is too hot %f, max %f" % (wort, wort_max))
116 turn_on = True 119 turn_on = True