# HG changeset patch # User Matt Johnston # Date 1374710740 -28800 # Node ID a0ea542256bad1ae8138287449c251ff505a580f # Parent ccebadce4619957e3be9e7da46f3a8804751106c workaround for invalid wort time diff -r ccebadce4619 -r a0ea542256ba py/fridge.py --- a/py/fridge.py Thu Jul 25 08:03:55 2013 +0800 +++ b/py/fridge.py Thu Jul 25 08:05:40 2013 +0800 @@ -68,6 +68,9 @@ off_time = self.server.now() - self.fridge_off_clock + if wort is not None: + self.wort_valid_clock = self.server.now() + if off_time < config.FRIDGE_DELAY: L("fridge skipping, too early") return @@ -79,9 +82,8 @@ return # handle broken wort sensor - if wort is not None: + if wort is None: self.wort_valid_clock = self.server.now() - else: W("Invalid wort sensor") invalid_time = self.server.now() - self.wort_valid_clock if invalid_time < config.FRIDGE_WORT_INVALID_TIME: @@ -109,6 +111,8 @@ turn_off = True elif fridge is not None and fridge < fridge_min: W("fridge off fallback, fridge %(fridge)f, min %(fridge_min)f" % locals()) + if wort is None: + W("wort has been invalid for %d" % (self.server.now() - self.wort_valid_clock)) turn_off = True if turn_off: