Improve reconnection of controller.

This commit is contained in:
Matthew Stratford 2021-05-02 18:12:38 +01:00
parent c0cc6ff418
commit 49f9e9d05a

View file

@ -91,7 +91,8 @@ class MattchBox(Controller):
elif line in [2, 4, 6]: elif line in [2, 4, 6]:
self.sendToPlayer(int(line / 2) - 1, "STOP") self.sendToPlayer(int(line / 2) - 1, "STOP")
except Exception: except Exception:
continue time.sleep(5)
self.connect(self.port)
finally: finally:
time.sleep(0.01) time.sleep(0.01)