From 797ab4947355cd29a3c8eea032d4b27b032d4b56 Mon Sep 17 00:00:00 2001 From: jan iversen Date: Mon, 30 Sep 2024 13:41:01 +0200 Subject: [PATCH] Remove async client.idle_time(). (#2349) --- pymodbus/client/base.py | 10 ---------- test/sub_client/test_client.py | 2 -- 2 files changed, 12 deletions(-) diff --git a/pymodbus/client/base.py b/pymodbus/client/base.py index 9123381fa..cf03882d4 100644 --- a/pymodbus/client/base.py +++ b/pymodbus/client/base.py @@ -86,16 +86,6 @@ def close(self, reconnect: bool = False) -> None: else: self.ctx.close() - def idle_time(self) -> float: - """Time before initiating next transaction (call **sync**). - - Applications can call message functions without checking idle_time(), - this is done automatically. - """ - if self.last_frame_end is None or self.silent_interval is None: - return 0 - return self.last_frame_end + self.silent_interval - def execute(self, request: ModbusRequest): """Execute request and get response (call **sync/async**). diff --git a/test/sub_client/test_client.py b/test/sub_client/test_client.py index d82ce2c5b..894cf4a70 100755 --- a/test/sub_client/test_client.py +++ b/test/sub_client/test_client.py @@ -230,9 +230,7 @@ async def test_client_instanciate( # Test information methods client.last_frame_end = 2 client.silent_interval = 2 - assert client.idle_time() == 4 client.last_frame_end = None - assert not client.idle_time() # a successful execute client.connect = lambda: True