self.set_state = ThreadFunction(self._set_state, "Space API")
waker.register(self.set_state, RETRY_TIME)
self.set_state = ThreadFunction(self._set_state, "Space API")
waker.register(self.set_state, RETRY_TIME)
if self._local_state is not None and (self._local_state != self._remote_state or now > self._last_set_at+HEARTBEAT_TIME):
# take action!
success = self._do_request(self._local_state)
if self._local_state is not None and (self._local_state != self._remote_state or now > self._last_set_at+HEARTBEAT_TIME):
# take action!
success = self._do_request(self._local_state)