From d7b07809512e0e6fcf8387c42189615d7fd61aec Mon Sep 17 00:00:00 2001 From: jan iversen Date: Tue, 30 May 2023 20:54:01 +0200 Subject: [PATCH] Remove is_socket_open from base. --- pymodbus/client/base.py | 7 +------ test/test_client.py | 5 +---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/pymodbus/client/base.py b/pymodbus/client/base.py index 63cf8732bc..51bc4ce834 100644 --- a/pymodbus/client/base.py +++ b/pymodbus/client/base.py @@ -8,7 +8,7 @@ from pymodbus.client.mixin import ModbusClientMixin from pymodbus.constants import Defaults -from pymodbus.exceptions import ConnectionException, NotImplementedException +from pymodbus.exceptions import ConnectionException from pymodbus.factory import ClientDecoder from pymodbus.framer import ModbusFramer from pymodbus.logging import Log @@ -135,7 +135,6 @@ def __init__( # pylint: disable=too-many-arguments self.state = ModbusTransactionState.IDLE self.last_frame_end: float = 0 self.silent_interval: float = 0 - self._reconnect_task: asyncio.Task = None # Initialize mixin ModbusClientMixin.__init__(self) @@ -154,10 +153,6 @@ def register(self, custom_response_class: ModbusResponse) -> None: """ self.framer.decoder.register(custom_response_class) - def is_socket_open(self) -> bool: - """Return whether socket/serial is open or not (call **sync**).""" - raise NotImplementedException - def idle_time(self) -> float: """Time before initiating next transaction (call **sync**). diff --git a/test/test_client.py b/test/test_client.py index 3ae5cfe6a4..8d36219fd5 100755 --- a/test/test_client.py +++ b/test/test_client.py @@ -16,7 +16,7 @@ from pymodbus.client.base import ModbusBaseClient from pymodbus.client.mixin import ModbusClientMixin from pymodbus.constants import Defaults -from pymodbus.exceptions import ConnectionException, NotImplementedException +from pymodbus.exceptions import ConnectionException from pymodbus.framer.ascii_framer import ModbusAsciiFramer from pymodbus.framer.rtu_framer import ModbusRtuFramer from pymodbus.framer.socket_framer import ModbusSocketFramer @@ -271,9 +271,6 @@ async def test_client_modbusbaseclient(): assert client.send(buffer) == buffer assert client.recv(10) == 10 - with pytest.raises(NotImplementedException): - client.is_socket_open() - with mock.patch( "pymodbus.client.base.ModbusBaseClient.connect" ) as p_connect, mock.patch(