Updates for latest moonraker version

This commit is contained in:
Jordan Ruthe 2020-11-13 16:28:37 -05:00
parent 83c0cb07c9
commit 47df413795
2 changed files with 11 additions and 9 deletions

View File

@ -22,7 +22,7 @@ class KlippyFiles:
if not os.path.exists('/tmp/.KS-thumbnails'): if not os.path.exists('/tmp/.KS-thumbnails'):
os.makedirs('/tmp/.KS-thumbnails') os.makedirs('/tmp/.KS-thumbnails')
GLib.idle_add(self.ret_files) GLib.idle_add(self.ret_files, False)
def _callback(self, result, method, params): def _callback(self, result, method, params):
@ -81,9 +81,9 @@ class KlippyFiles:
def add_file_callback(self, callback): def add_file_callback(self, callback):
self.callbacks.append(callback) self.callbacks.append(callback)
def ret_files(self): def ret_files(self, retval=True):
self._screen._ws.klippy.get_file_list(self._callback) self._screen._ws.klippy.get_file_list(self._callback)
return True return retval
def ret_file_data (self, filename): def ret_file_data (self, filename):
print("Getting file info for %s" % (filename)) print("Getting file info for %s" % (filename))

View File

@ -165,12 +165,14 @@ class KlipperScreen(Gtk.Window):
def ws_subscribe(self): def ws_subscribe(self):
requested_updates = { requested_updates = {
"toolhead": [], "objects": {
"virtual_sdcard": [], "toolhead": ["homed_axes","estimated_print_time","print_time","position","extruder"],
"print_stats": [], "virtual_sdcard": ["file_position","is_active","progress"],
"heater_bed": [], "print_stats": ["print_duration","total_duration","filament_used","filename","state","message"],
"extruder": [], "heater_bed": ["target","temperature"],
"configfile": [] "extruder": ["target","temperature","pressure_advance","smooth_time"],
"configfile": ["config"]
}
} }
self._ws.klippy.object_subscription(requested_updates) self._ws.klippy.object_subscription(requested_updates)