Skip to content

Commit

Permalink
Remove is_socket_open from base.
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed May 31, 2023
1 parent 7ff338e commit 18494b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
7 changes: 1 addition & 6 deletions pymodbus/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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**).
Expand Down
5 changes: 1 addition & 4 deletions test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 18494b7

Please sign in to comment.