fixes in convergence and statemachine

- set spent_inside to 0 on set_target
- additional debug log messages in statemachine
This commit is contained in:
2022-06-14 14:07:24 +02:00
parent a35231f5bd
commit f855b9db40
2 changed files with 6 additions and 4 deletions

View File

@ -186,6 +186,7 @@ class StateMachine:
ret = self.state(self)
self.init = False
if self.stopped:
self.log.debug('%r', self.stopped)
self.last_error = self.stopped
self.cleanup(self)
self.stopped = False
@ -268,6 +269,7 @@ class StateMachine:
self.stopped = Restart
with self._lock: # wait for running cycle finished
if self.stopped: # cleanup is not yet done
self.log.debug('restart')
self.last_error = self.stopped
self.cleanup(self) # ignore return state on restart
self.stopped = False