# HG changeset patch # User Matt Johnston # Date 1374710740 -28800 # Node ID 06de0f2ffa26cdbd527195c8671fc421d0dfc395 # Parent 6af0dcc5da456e7010542349dbe5d02034ca87d9 workaround for invalid wort time diff -r 6af0dcc5da45 -r 06de0f2ffa26 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: