Commit c04dff75 authored by Ralf's avatar Ralf
Browse files

tell the SpaceAPI we're closed on shutdown

parent 83c2a92d
......@@ -64,4 +64,4 @@ class I2C:
return bool(byte & mask)
# kate: space-indent off; tab-width 4; indent-width 4;
\ No newline at end of file
# kate: space-indent off; tab-width 4; indent-width 4;
......@@ -84,4 +84,4 @@ class PinsWatcher():
def stop(self):
self._t.stop()
# kate: space-indent off; tab-width 4; indent-width 4;
\ No newline at end of file
# kate: space-indent off; tab-width 4; indent-width 4;
......@@ -18,6 +18,7 @@ class SpaceApi:
waker.register(self.set_state, RETRY_TIME)
def stop (self):
self.set_state(False) # mark as offline
self.set_state.stop()
def _do_request(self, state):
......@@ -53,3 +54,5 @@ class SpaceApi:
self._fail_count += 1
if self._fail_count in (5, 100):
logger.critical("SpaceAPI: Updating failed {} times in a row".format(self._fail_count))
# kate: space-indent off; tab-width 4; indent-width 4;
......@@ -404,3 +404,5 @@ class StateMachine():
logger.info("StateMachine: Doing state transition %s -> %s" % (self.current_state.__class__.__name__, newstate.__class__.__name__))
self.current_state = newstate
newstate = self.current_state.handle_event(StateMachine.CMD_PINS, self.pins)
# kate: space-indent off; tab-width 4; indent-width 4;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment