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:
Arksine
2020-12-30 11:53:16 -05:00
parent 0a7080741c
commit 6bf4ef8b00
2 changed files with 4 additions and 3 deletions

View File

@@ -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")