Skip to content

Commit 0b5bb58

Browse files
committed
Pymodbus 3.7.x changes part 2, cherry picking changes from #18
1 parent ebc76e2 commit 0b5bb58

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

pymodbus_repl/client/main.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from pymodbus.exceptions import ParameterException
1515
from pymodbus.transaction import (
1616
ModbusAsciiFramer,
17-
ModbusBinaryFramer,
1817
ModbusRtuFramer,
1918
ModbusSocketFramer,
2019
)
@@ -363,8 +362,6 @@ def serial( # pylint: disable=too-many-arguments
363362
framer = ModbusAsciiFramer
364363
elif method == "rtu":
365364
framer = ModbusRtuFramer
366-
elif method == "binary":
367-
framer = ModbusBinaryFramer
368365
elif method == "socket":
369366
framer = ModbusSocketFramer
370367
else:

pymodbus_repl/client/mclient.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pymodbus.client import ModbusSerialClient as _ModbusSerialClient
77
from pymodbus.client import ModbusTcpClient as _ModbusTcpClient
88
from pymodbus.client.base import ModbusBaseSyncClient as _ModbusBaseSyncClient
9-
from pymodbus.diag_message import (
9+
from pymodbus.pdu.diag_message import (
1010
ChangeAsciiInputDelimiterRequest,
1111
ClearCountersRequest,
1212
ClearOverrunCountRequest,
@@ -27,11 +27,11 @@
2727
ReturnSlaveNoResponseCountRequest,
2828
)
2929
from pymodbus.exceptions import ModbusIOException
30-
from pymodbus.mei_message import (
30+
from pymodbus.pdu.mei_message import (
3131
ReadDeviceInformationRequest,
3232
ReadDeviceInformationResponse,
3333
)
34-
from pymodbus.other_message import (
34+
from pymodbus.pdu.other_message import (
3535
GetCommEventCounterRequest,
3636
GetCommEventCounterResponse,
3737
GetCommEventLogRequest,
@@ -42,7 +42,7 @@
4242
ReportSlaveIdResponse,
4343
)
4444
from pymodbus.pdu import ExceptionResponse, ModbusExceptions
45-
from pymodbus.register_write_message import MaskWriteRegisterResponse
45+
from pymodbus.pdu.register_write_message import MaskWriteRegisterResponse
4646

4747

4848
def make_response_dict(resp):

pymodbus_repl/lib/reactive.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
)
3838
from pymodbus.transaction import (
3939
ModbusAsciiFramer,
40-
ModbusBinaryFramer,
4140
ModbusRtuFramer,
4241
ModbusSocketFramer,
4342
ModbusTlsFramer,
@@ -56,8 +55,7 @@
5655
"rtu": ModbusRtuFramer,
5756
"tls": ModbusTlsFramer,
5857
"udp": ModbusSocketFramer,
59-
"ascii": ModbusAsciiFramer,
60-
"binary": ModbusBinaryFramer,
58+
"ascii": ModbusAsciiFramer
6159
}
6260

6361
DEFAULT_MANIPULATOR = {

pymodbus_repl/server/main.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import typer
1414
from pymodbus import pymodbus_apply_logging_config
15-
from pymodbus.framer.socket_framer import ModbusSocketFramer
15+
from pymodbus.transaction import ModbusSocketFramer
1616
from pymodbus.logging import Log
1717
from typing_extensions import Annotated
1818

@@ -44,12 +44,11 @@ class ModbusServerTypes(str, Enum):
4444
class ModbusFramerTypes(str, Enum):
4545
"""Framer types."""
4646

47-
# ["socket", "rtu", "tls", "ascii", "binary"]
47+
# ["socket", "rtu", "tls", "ascii"]
4848
socket = "socket" # pylint: disable=invalid-name
4949
rtu = "rtu" # pylint: disable=invalid-name
5050
tls = "tls" # pylint: disable=invalid-name
5151
ascii = "ascii" # pylint: disable=invalid-name
52-
binary = "binary" # pylint: disable=invalid-name
5352

5453

5554
def _completer(incomplete: str, valid_values: List[str]) -> List[str]:
@@ -62,13 +61,13 @@ def _completer(incomplete: str, valid_values: List[str]) -> List[str]:
6261

6362

6463
def framers(incomplete: str) -> List[str]:
65-
"""Return an autocompleted list of supported clouds."""
66-
_framers = ["socket", "rtu", "tls", "ascii", "binary"]
64+
"""Return an autocompleted list of supported servers."""
65+
_framers = ["socket", "rtu", "tls", "ascii"]
6766
return _completer(incomplete, _framers)
6867

6968

7069
def servers(incomplete: str) -> List[str]:
71-
"""Return an autocompleted list of supported clouds."""
70+
"""Return an autocompleted list of supported servers."""
7271
_servers = ["tcp", "serial", "tls", "udp"]
7372
return _completer(incomplete, _servers)
7473

0 commit comments

Comments
 (0)