diff --git a/ks_includes/printer.py b/ks_includes/printer.py index 897f47c8..07f68017 100644 --- a/ks_includes/printer.py +++ b/ks_includes/printer.py @@ -106,18 +106,19 @@ class Printer: self.evaluate_state() def evaluate_state(self): - wh_state = self.data['webhooks']['state'] # possible values: startup, ready, shutdown, error + wh_state = self.data['webhooks']['state'].lower() # possible values: startup, ready, shutdown, error idle_state = self.data['idle_timeout']['state'].lower() # possible values: Idle, printing, ready - print_state = self.data['print_stats']['state'] # possible values: complete, paused, printing, standby + print_state = self.data['print_stats']['state'].lower() # possible values: complete, paused, printing, standby + logger.debug("State evaluations: %s %s %s" % (wh_state, idle_state, print_state)) if wh_state == "ready": new_state = "ready" - if idle_state == "printing" and print_state != "printing": # Not printing a file, toolhead moving - new_state = "busy" - elif idle_state == "printing" and print_state == "printing": - new_state = "printing" - elif print_state == "paused": + if print_state == "paused": new_state = "paused" + elif idle_state == "printing" and print_state != "printing": # Not printing a file, toolhead moving + new_state = "busy" + elif idle_state == "printing": + new_state = "printing" if new_state != "busy": self.change_state(new_state) diff --git a/screen.py b/screen.py index 81bf8144..577d2051 100644 --- a/screen.py +++ b/screen.py @@ -424,8 +424,8 @@ class KlipperScreen(Gtk.Window): logger.debug("Received notify_klippy_disconnected") self.printer.change_state("disconnected") return - #elif action == "notify_klippy_ready": - # self.printer.change_state("ready") + elif action == "notify_klippy_ready": + self.printer.change_state("ready") elif action == "notify_status_update" and self.printer.get_state() != "shutdown": self.printer.process_update(data) elif action == "notify_filelist_changed":