diff options
author | Maxim Devaev <[email protected]> | 2024-10-21 17:46:59 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2024-10-21 17:46:59 +0300 |
commit | cda32a083faf3e7326cfe317336e473c905c6dfd (patch) | |
tree | 19445e4098d4603f3b2cd296504a648110712af1 /kvmd/apps/vnc/server.py | |
parent | b67a2325842a6f407d3935f8445d50cb8bf307f2 (diff) |
new events model
Diffstat (limited to 'kvmd/apps/vnc/server.py')
-rw-r--r-- | kvmd/apps/vnc/server.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py index f8e97050..a6e89311 100644 --- a/kvmd/apps/vnc/server.py +++ b/kvmd/apps/vnc/server.py @@ -175,17 +175,18 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes self.__kvmd_ws = None async def __process_ws_event(self, event_type: str, event: dict) -> None: - if event_type == "info_meta_state": - try: - host = event["server"]["host"] - except Exception: - host = None - else: - if isinstance(host, str): - name = f"PiKVM: {host}" - if self._encodings.has_rename: - await self._send_rename(name) - self.__shared_params.name = name + if event_type == "info_state": + if "meta" in event: + try: + host = event["meta"]["server"]["host"] + except Exception: + host = None + else: + if isinstance(host, str): + name = f"PiKVM: {host}" + if self._encodings.has_rename: + await self._send_rename(name) + self.__shared_params.name = name elif event_type == "hid_state": if self._encodings.has_leds_state: |