klippy_connection: log klippy version as received

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-04-18 19:22:09 -04:00
parent d3003a1584
commit fe84226908
No known key found for this signature in database
GPG Key ID: 7027245FBBDDF59A
1 changed files with 6 additions and 0 deletions

View File

@ -56,6 +56,7 @@ class KlippyConnection:
self.closing: bool = False self.closing: bool = False
self._klippy_info: Dict[str, Any] = {} self._klippy_info: Dict[str, Any] = {}
self.init_list: List[str] = [] self.init_list: List[str] = []
self._klipper_version: str = ""
self._missing_reqs: Set[str] = set() self._missing_reqs: Set[str] = set()
self._peer_cred: Dict[str, int] = {} self._peer_cred: Dict[str, int] = {}
self.init_attempts: int = 0 self.init_attempts: int = 0
@ -319,6 +320,11 @@ class KlippyConnection:
f"Klippy may have experienced an error during startup.\n" f"Klippy may have experienced an error during startup.\n"
f"Please check klippy.log for more information") f"Please check klippy.log for more information")
return return
version = result.get("software_version", "")
if version != self._klipper_version:
self._klipper_version = version
msg = f"Klipper Version: {version}"
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") self._state = result.get('state', "unknown")
if send_id: if send_id: