Updating for moonraker change from printer.info to server.info
This commit is contained in:
1 parent
de04e6688d
commit
bbf730de5a
2 files changed
+5
-4
No files matched your search
+1
-1
@@ -10,7 +10,7 @@ class KlippyRest:
|
||||
self.port = port
|
||||
|
||||
def get_info(self):
|
||||
return self.send_request("printer/info")
|
||||
return self.send_request("server/info")
|
||||
|
||||
def send_request(self, method):
|
||||
r = requests.get("http://%s:%s/%s" % (self.ip, self.port, method))
|
||||
|
||||
@@ -57,7 +57,6 @@ logger.addHandler(ch)
|
||||
|
||||
klipperscreendir = os.getcwd()
|
||||
config = klipperscreendir + "/KlipperScreen.config"
|
||||
logger.warning("test test")
|
||||
logger.info("Config file: " + config)
|
||||
|
||||
class KlipperScreen(Gtk.Window):
|
||||
@@ -105,7 +104,8 @@ class KlipperScreen(Gtk.Window):
|
||||
if not hasattr(self, "_ws"):
|
||||
self.create_websocket()
|
||||
|
||||
if info['result']['state'] == "ready" and "M112" in info['result']['state_message']:
|
||||
if (info['result']['klippy_state'] == "ready" and "state_message" in info['result'] and
|
||||
"M112" in info['result']['state_message']):
|
||||
logger.warning("Printer is emergency stopped")
|
||||
self.printer_initializing("Shutdown due to Emergency Stop")
|
||||
|
||||
@@ -131,6 +131,7 @@ class KlipperScreen(Gtk.Window):
|
||||
}
|
||||
|
||||
#TODO: Check that we get good data
|
||||
print (r.content)
|
||||
data = json.loads(r.content)
|
||||
data = data['result']['status']
|
||||
for x in data:
|
||||
@@ -146,7 +147,7 @@ class KlipperScreen(Gtk.Window):
|
||||
print (info)
|
||||
if (data['print_stats']['state'] == "printing" or data['print_stats']['state'] == "paused"):
|
||||
self.printer_printing()
|
||||
elif info['result']['state'] == "ready":
|
||||
elif info['result']['klippy_state'] == "ready":
|
||||
self.printer_ready()
|
||||
|
||||
while (self._ws.is_connected() == False):
|
||||
|
||||
Reference in new issue
Block a user