moonraker: Store info received from initial "info" request to klippy
This allows moonraker plugins to look up the stored info without needing to make an addition "info" request to Klippy. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
b0469da462
commit
df81854f89
|
@ -47,6 +47,7 @@ class Server:
|
||||||
'klippy_uds_address', "/tmp/klippy_uds")
|
'klippy_uds_address', "/tmp/klippy_uds")
|
||||||
self.klippy_connection = KlippyConnection(
|
self.klippy_connection = KlippyConnection(
|
||||||
self.process_command, self.on_connection_closed)
|
self.process_command, self.on_connection_closed)
|
||||||
|
self.klippy_info = {}
|
||||||
self.init_list = []
|
self.init_list = []
|
||||||
self.init_handle = None
|
self.init_handle = None
|
||||||
self.init_attempts = 0
|
self.init_attempts = 0
|
||||||
|
@ -164,6 +165,9 @@ class Server:
|
||||||
hostname = socket.gethostname()
|
hostname = socket.gethostname()
|
||||||
return hostname, self.port
|
return hostname, self.port
|
||||||
|
|
||||||
|
def get_klippy_info(self):
|
||||||
|
return dict(self.klippy_info)
|
||||||
|
|
||||||
# ***** Klippy Connection *****
|
# ***** Klippy Connection *****
|
||||||
async def _connect_klippy(self):
|
async def _connect_klippy(self):
|
||||||
if not self.server_running:
|
if not self.server_running:
|
||||||
|
@ -283,6 +287,7 @@ class Server:
|
||||||
return
|
return
|
||||||
if send_id:
|
if send_id:
|
||||||
self.init_list.append("identified")
|
self.init_list.append("identified")
|
||||||
|
self.klippy_info = result
|
||||||
# Update filemanager fixed paths
|
# Update filemanager fixed paths
|
||||||
fixed_paths = {k: result[k] for k in
|
fixed_paths = {k: result[k] for k in
|
||||||
['klipper_path', 'python_path',
|
['klipper_path', 'python_path',
|
||||||
|
|
Loading…
Reference in New Issue