Skip to content

Commit 82f199d

Browse files
authored
Add missing client calls in mixin.py. (#1206)
1 parent b13c093 commit 82f199d

File tree

4 files changed

+297
-277
lines changed

4 files changed

+297
-277
lines changed

API_changes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ PyModbus - API changes.
66
Version 3.1.0
77
-------------
88
Added --host to client_* examples, to allow easier use.
9+
unit= in client calls are no longer converted to slave=, but raises a runtime exception.
10+
Added missing client calls (all standard request are not available as methods).
11+
client.mask_write_register() changed parameters.
912

1013
---------------------
1114
Version 3.0.1 / 3.0.2

examples/client_calls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ async def _handle_holding_registers(client):
180180
"write_address": 1,
181181
"write_registers": [256, 128, 100, 50, 25, 10, 5, 1],
182182
}
183-
_check_call(await client.readwrite_registers(unit=SLAVE, **arguments))
183+
_check_call(await client.readwrite_registers(slave=SLAVE, **arguments))
184184
rr = _check_call(await client.read_holding_registers(1, 8, slave=SLAVE))
185185
assert rr.registers == arguments["write_registers"]
186186

pymodbus/client/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,13 @@ def run():
6060
rr = client.read_coils(0x01)
6161
client.close()
6262
63-
6463
**Application methods, common to all clients**:
6564
"""
6665

66+
state = ModbusTransactionState.IDLE
67+
last_frame_end = 0
68+
silent_interval = 0
69+
6770
@dataclass
6871
class _params: # pylint: disable=too-many-instance-attributes
6972
"""Parameter class."""

0 commit comments

Comments
 (0)