b1d475b4f9ffd8b899f433a165a00f5301faadd5
[saartuer.git] / waker.py
1 from libtuer import ThreadRepeater
2 from statemachine import StateMachine
3
4 class Waker():
5         def __init__(self, sm):
6                 self._sm = sm
7                 self._t = ThreadRepeater(self._wake, 0.5)
8         
9         def _wake(self):
10                 self._sm.callback(StateMachine.CMD_WAKEUP)
11         
12         def stop(self):
13                 self._t.stop()