4 __init__ (self, waker):
5 self._state_to_set = None # public write
6 self._state_last_set = None # public read FIXME why? getter?
8 self.set_state = ThreadFunction(self._set_state, "Space API")
9 waker.register(self.set_state, 10.0) # re-try setting the state every 10 seconds
14 def _set_state (self, state = None):
15 '''Sets the state, if None: leave state unchanged and re-try if previous attempts failed'''
17 self._state_to_set = state
18 # check if there's something we need to do
19 if self._state_last_set == self._state_to_set: return
21 error = do_request(stts) # TODO
24 self.state_last_set = stts