Fix connect issues with moonraker. Addresses #328
This commit is contained in:
parent
f6fcb322f5
commit
2f6149c5b7
@ -64,6 +64,12 @@ class KlippyWebsocket(threading.Thread):
|
||||
self.on_open(ws)
|
||||
|
||||
try:
|
||||
state = self._screen.apiclient.get_server_info()
|
||||
if state is False or state['result']['klippy_connected'] is False:
|
||||
return False
|
||||
printer_info = self._screen.apiclient.get_printer_info()
|
||||
if printer_info is False:
|
||||
return False
|
||||
token = self._screen.apiclient.get_oneshot_token()
|
||||
except Exception:
|
||||
logging.debug("Unable to get oneshot token")
|
||||
@ -160,7 +166,8 @@ class KlippyWebsocket(threading.Thread):
|
||||
Gdk.threads_add_idle(
|
||||
GLib.PRIORITY_HIGH_IDLE,
|
||||
self._callback['on_close'],
|
||||
"Lost Connection to Moonraker"
|
||||
"Lost Connection to Moonraker",
|
||||
True
|
||||
)
|
||||
|
||||
def reconnect(self):
|
||||
|
@ -774,10 +774,12 @@ class KlipperScreen(Gtk.Window):
|
||||
def _send_action(self, widget, method, params):
|
||||
self._ws.send_method(method, params)
|
||||
|
||||
def printer_initializing(self, text=None):
|
||||
def printer_initializing(self, text=None, disconnect=False):
|
||||
self.shutdown = True
|
||||
self.close_popup_message()
|
||||
self.show_panel('splash_screen', "splash_screen", "Splash Screen", 2)
|
||||
if disconnect is True and self.printer is not None:
|
||||
self.printer.state = "disconnected"
|
||||
if text is not None:
|
||||
self.panels['splash_screen'].update_text(text)
|
||||
self.panels['splash_screen'].show_restart_buttons()
|
||||
|
Loading…
x
Reference in New Issue
Block a user