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

View File

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