Skip to content

Commit 18494b7

Browse files
committed
Remove is_socket_open from base.
1 parent 7ff338e commit 18494b7

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

pymodbus/client/base.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from pymodbus.client.mixin import ModbusClientMixin
1010
from pymodbus.constants import Defaults
11-
from pymodbus.exceptions import ConnectionException, NotImplementedException
11+
from pymodbus.exceptions import ConnectionException
1212
from pymodbus.factory import ClientDecoder
1313
from pymodbus.framer import ModbusFramer
1414
from pymodbus.logging import Log
@@ -135,7 +135,6 @@ def __init__( # pylint: disable=too-many-arguments
135135
self.state = ModbusTransactionState.IDLE
136136
self.last_frame_end: float = 0
137137
self.silent_interval: float = 0
138-
self._reconnect_task: asyncio.Task = None
139138

140139
# Initialize mixin
141140
ModbusClientMixin.__init__(self)
@@ -154,10 +153,6 @@ def register(self, custom_response_class: ModbusResponse) -> None:
154153
"""
155154
self.framer.decoder.register(custom_response_class)
156155

157-
def is_socket_open(self) -> bool:
158-
"""Return whether socket/serial is open or not (call **sync**)."""
159-
raise NotImplementedException
160-
161156
def idle_time(self) -> float:
162157
"""Time before initiating next transaction (call **sync**).
163158

test/test_client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from pymodbus.client.base import ModbusBaseClient
1717
from pymodbus.client.mixin import ModbusClientMixin
1818
from pymodbus.constants import Defaults
19-
from pymodbus.exceptions import ConnectionException, NotImplementedException
19+
from pymodbus.exceptions import ConnectionException
2020
from pymodbus.framer.ascii_framer import ModbusAsciiFramer
2121
from pymodbus.framer.rtu_framer import ModbusRtuFramer
2222
from pymodbus.framer.socket_framer import ModbusSocketFramer
@@ -271,9 +271,6 @@ async def test_client_modbusbaseclient():
271271
assert client.send(buffer) == buffer
272272
assert client.recv(10) == 10
273273

274-
with pytest.raises(NotImplementedException):
275-
client.is_socket_open()
276-
277274
with mock.patch(
278275
"pymodbus.client.base.ModbusBaseClient.connect"
279276
) as p_connect, mock.patch(

0 commit comments

Comments
 (0)