klippy_connection: request endpoints before setting the state
All of Klipper's endpoints should be available before Moonraker reports the "ready" state. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
3d9f5dc6d9
commit
09ac00ce2e
|
@ -326,13 +326,16 @@ class KlippyConnection:
|
||||||
msg = f"Klipper Version: {version}"
|
msg = f"Klipper Version: {version}"
|
||||||
self.server.add_log_rollover_item("klipper_version", msg)
|
self.server.add_log_rollover_item("klipper_version", msg)
|
||||||
self._klippy_info = dict(result)
|
self._klippy_info = dict(result)
|
||||||
self._state = result.get('state', "unknown")
|
state = result.get('state', "unknown")
|
||||||
|
if state != "startup" and "endpoints_requested" not in self.init_list:
|
||||||
|
await self._request_endpoints()
|
||||||
|
self.init_list.append("endpoints_requested")
|
||||||
|
self._state = state
|
||||||
if send_id:
|
if send_id:
|
||||||
self.init_list.append("identified")
|
self.init_list.append("identified")
|
||||||
await self.server.send_event("server:klippy_identified")
|
await self.server.send_event("server:klippy_identified")
|
||||||
if self._state != "startup":
|
if self._state != "startup":
|
||||||
self.init_list.append('startup_complete')
|
self.init_list.append('startup_complete')
|
||||||
await self._request_endpoints()
|
|
||||||
await self.server.send_event("server:klippy_started",
|
await self.server.send_event("server:klippy_started",
|
||||||
self._state)
|
self._state)
|
||||||
if self._state != "ready":
|
if self._state != "ready":
|
||||||
|
|
Loading…
Reference in New Issue