Skip to content

Commit 17d66c6

Browse files
removes undue reported error when forwarding (#1134)
* removes undue reported error when forwarding cf #1110 (comment) this removes the error, when running a TCP server forwarding a serial server : ``` 17:10:21 ERROR mixin:113 Please do not use unit=, convert to slave=. ```` * homogeneisation ReadRegistersRequestBase cf ResponseBase
1 parent 931dc65 commit 17d66c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pymodbus/datastore/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __build_mapping(self):
7373
"""Build the function code mapper."""
7474
kwargs = {}
7575
if self.unit:
76-
kwargs["unit"] = self.unit
76+
kwargs["slave"] = self.unit
7777
self.__get_callbacks = {
7878
"d": lambda a, c: self._client.read_discrete_inputs( # pylint: disable=unnecessary-lambda
7979
a, c, **kwargs

pymodbus/register_read_message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __str__(self):
4949
5050
:returns: A string representation of the instance
5151
"""
52-
return f"ReadRegisterRequest ({self.address},{self.count})"
52+
return f"{self.__class__.__name__} ({self.address},{self.count})"
5353

5454

5555
class ReadRegistersResponseBase(ModbusResponse):

0 commit comments

Comments
 (0)