🐛 Only try to send script if already connected

This commit is contained in:
Gina Häußge committed 2021-05-21 14:47:58 +02:00
1 parent 995d3572fc
commit 64ac824fb8
1 file changed
+1 -1
@@ -1637,7 +1637,7 @@ class ReprapGcodeProtocol(
self._sd_status_poller.cancel()
self._sd_status_poller = None
if not error:
if not error and self.state in ProtocolState.OPERATIONAL_STATES:
try:
self.send_script("beforePrinterDisconnected")
stop = time.monotonic() + 10.0 # TODO make somehow configurable