websocket: identify the client to moonraker
This commit is contained in:
parent
ad2df873d3
commit
135e1858a8
@ -328,3 +328,16 @@ class MoonrakerApi:
|
||||
return self._ws.send_method(
|
||||
"printer.firmware_restart"
|
||||
)
|
||||
|
||||
def identify_client(self, version, api_key):
|
||||
logging.debug("Sending printer.firmware_restart")
|
||||
return self._ws.send_method(
|
||||
"server.connection.identify",
|
||||
{
|
||||
"client_name": "KlipperScreen",
|
||||
"version": f"{version}",
|
||||
"type": "display",
|
||||
"url": "https://github.com/KlipperScreen/KlipperScreen",
|
||||
"api_key": f"{api_key}"
|
||||
},
|
||||
)
|
||||
|
@ -665,6 +665,7 @@ class KlipperScreen(Gtk.Window):
|
||||
|
||||
def websocket_connected(self):
|
||||
logging.debug("### websocket_connected")
|
||||
self._ws.klippy.identify_client(functions.get_software_version(), self._ws.api_key)
|
||||
self.reinit_count = 0
|
||||
self.connecting = False
|
||||
self.connected_printer = self.connecting_to_printer
|
||||
|
Loading…
x
Reference in New Issue
Block a user