aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/mcu.py
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r--klippy/mcu.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py
index a8e823c7..ee0cbd1a 100644
--- a/klippy/mcu.py
+++ b/klippy/mcu.py
@@ -423,6 +423,8 @@ class MCU:
if self._name.startswith('mcu '):
self._name = self._name[4:]
self._printer.register_event_handler("klippy:shutdown", self._shutdown)
+ self._printer.register_event_handler("klippy:disconnect",
+ self._disconnect)
# Serial port
self._serialport = config.get('serial', '/dev/ttyS0')
baud = 0
@@ -768,8 +770,6 @@ class MCU:
def printer_state(self, state):
if state == 'connect':
self._connect()
- elif state == 'disconnect':
- self._disconnect()
def __del__(self):
self._disconnect()