Skip to content

Commit 9ae6387

Browse files
committed
Fix ModbusServerContext parameter for pymodbus 3.x
Changed 'slaves' parameter to 'devices' to match pymodbus 3.x API. Fixes: TypeError: ModbusServerContext.__init__() got an unexpected keyword argument 'slaves'
1 parent 4b1b8b6 commit 9ae6387

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

emulator/modbus_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def __init__(self, simulator, port: int = 502, slave_id: int = 1):
118118

119119
# Create server context
120120
self.server_context = ModbusServerContext(
121-
slaves={slave_id: self.device_context},
121+
devices={slave_id: self.device_context},
122122
single=False
123123
)
124124

0 commit comments

Comments
 (0)