It transitions the station to the READY state, which causes the stations onReady() method to get called. Then it calls the station's start() method, which seems like the right place to put initialization code. start() should only get called once, but onReady() will get called every time the station receives a Reset message from the MS. So, I think start() should get called before the state transition to READY. I propose to change the code to this:
self._station.start() # initialize the station
self.State = State.READY # transition the station to READY state
self._connectionManager.startListening()
Please let me know if this will break your stuff. It would also be nice to let me know if you agree.
@scortiz1, @sminster: I'm opening an issue for this so you can respond to it.
In StationLoader (
main.py
), the StationLoader.start() method contains the following code:It transitions the station to the READY state, which causes the stations onReady() method to get called. Then it calls the station's start() method, which seems like the right place to put initialization code. start() should only get called once, but onReady() will get called every time the station receives a Reset message from the MS. So, I think start() should get called before the state transition to READY. I propose to change the code to this:
Please let me know if this will break your stuff. It would also be nice to let me know if you agree.