From a68f860b8eb5b2c31f29a778d4380e6d9404e4fc Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Thu, 19 Jun 2025 03:46:42 +0300 Subject: [PATCH] switch: heartbeat --- kvmd/apps/kvmd/switch/chain.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kvmd/apps/kvmd/switch/chain.py b/kvmd/apps/kvmd/switch/chain.py index 122d6203..f17777d2 100644 --- a/kvmd/apps/kvmd/switch/chain.py +++ b/kvmd/apps/kvmd/switch/chain.py @@ -331,13 +331,21 @@ class Chain: # pylint: disable=too-many-instance-attributes self.__device.request_state() self.__device.request_atx_leds() while not self.__stop_event.is_set(): + count = 0 if self.__select(): + count = 0 for resp in self.__device.read_all(): self.__update_units(resp) self.__adjust_quirks() self.__adjust_start_port() self.__finish_changing_request(resp) self.__consume_commands() + else: + count += 1 + if count >= 5: + # Heartbeat + self.__device.request_state() + count = 0 self.__ensure_config() def __select(self) -> bool: