From 5c1d5a1825930f78b873bee23b26e94a92c18997 Mon Sep 17 00:00:00 2001 From: Jordan <31575189+jordanruthe@users.noreply.github.com> Date: Fri, 18 Dec 2020 13:02:10 -0500 Subject: [PATCH] screen: Better error display for klippy --- screen.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/screen.py b/screen.py index bb19ef8a..5ac787ca 100644 --- a/screen.py +++ b/screen.py @@ -474,10 +474,19 @@ class KlipperScreen(Gtk.Window): if printer_info['result']['state'] in ("error","shutdown","startup"): if printer_info['result']['state'] == "startup": self.printer_initializing(_("Klipper is attempting to start")) - elif "FIRMWARE_RESTART" in printer_info['result']['state_message']: - self.printer_initializing( - _("Klipper has encountered an error.\nIssue a FIRMWARE_RESTART to attempt fixing the issue.") - ) + elif printer_info['result']['state'] == "error": + if "FIRMWARE_RESTART" in printer_info['result']['state_message']: + self.printer_initializing( + _("Klipper has encountered an error.\nIssue a FIRMWARE_RESTART to attempt fixing the issue.") + ) + elif "micro-controller" in printer_info['result']['state_message']: + self.printer_initializing( + _("Klipper has encountered an error with the micro-controller.\nPlease recompile and flash.") + ) + else: + self.printer_initializing( + _("Klipper has encountered an error.") + ) else: self.printer_initializing(_("Klipper has shutdown")) return