comparison py/fridge.py @ 149:d686b111dab4

working better. logging works properly, cleanup fridge.off() happens.
author Matt Johnston <matt@ucc.asn.au>
date Sun, 16 Dec 2012 22:14:46 +0800
parents b32e5a11a4cb
children a6612745b4a3
comparison
equal deleted inserted replaced
148:b32e5a11a4cb 149:d686b111dab4
13 gevent.Greenlet.__init__(self) 13 gevent.Greenlet.__init__(self)
14 self.server = server 14 self.server = server
15 self.setup_gpio() 15 self.setup_gpio()
16 self.wort_valid_clock = 0 16 self.wort_valid_clock = 0
17 self.fridge_on_clock = 0 17 self.fridge_on_clock = 0
18 self.fridge_off_clock = 0 18 self.fridge_off_clock = server.now()
19 19
20 def setup_gpio(self): 20 def setup_gpio(self):
21 dir_fn = '%s/direction' % config.FRIDGE_GPIO 21 dir_fn = '%s/direction' % config.FRIDGE_GPIO
22 with open(dir_fn, 'w') as f: 22 with open(dir_fn, 'w') as f:
23 f.write('low') 23 f.write('low')