moonraker: add "klippy_identified" event
This allows Moonraker to update its paths to Klippy immediately upon a successful response from the info endpoint. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
0a7080741c
commit
6bf4ef8b00
|
@ -286,10 +286,11 @@ class Server:
|
|||
f"Klippy may have experienced an error during startup.\n"
|
||||
f"Please check klippy.log for more information")
|
||||
return
|
||||
if send_id:
|
||||
self.init_list.append("identified")
|
||||
self.klippy_info = dict(result)
|
||||
self.klippy_state = result.get('state', "unknown")
|
||||
if send_id:
|
||||
self.init_list.append("identified")
|
||||
self.send_event("server:klippy_identified")
|
||||
if self.klippy_state == "ready":
|
||||
await self._verify_klippy_requirements()
|
||||
logging.info("Klippy ready")
|
||||
|
|
|
@ -46,7 +46,7 @@ class FileManager:
|
|||
self.server.register_upload_handler("/api/files/local")
|
||||
|
||||
self.server.register_event_handler(
|
||||
"server:klippy_ready", self._update_fixed_paths)
|
||||
"server:klippy_identified", self._update_fixed_paths)
|
||||
|
||||
# Register Klippy Configuration Path
|
||||
config_path = config.get('config_path', None)
|
||||
|
|
Loading…
Reference in New Issue