Skip to content

Commit e0d3fc7

Browse files
committed
fix
1 parent 6db0df8 commit e0d3fc7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

classes/transports/modbus_rtu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, settings : SectionProxy, protocolSettings : protocol_settings
5454
# Get the signature of the __init__ method
5555
init_signature = inspect.signature(ModbusSerialClient.__init__)
5656

57-
client_str = self.port+"("+self.baudrate+")"
57+
client_str = self.port+"("+str(self.baudrate)+")"
5858

5959
if client_str in modbus_base.clients:
6060
self.client = modbus_base.clients[client_str]

classes/transports/modbus_tcp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self, settings : SectionProxy, protocolSettings : protocol_settings
3333
if 'slave' in inspect.signature(ModbusTcpClient.read_holding_registers).parameters:
3434
self.pymodbus_slave_arg = 'slave'
3535

36-
client_str = self.host+"("+self.port+")"
36+
client_str = self.host+"("+str(self.port)+")"
3737
#check if client is already initialied
3838
if client_str in modbus_base.clients:
3939
self.client = modbus_base.clients[client_str]
@@ -43,7 +43,7 @@ def __init__(self, settings : SectionProxy, protocolSettings : protocol_settings
4343

4444
#add to clients
4545
self.clients[client_str] = self.client
46-
46+
4747
super().__init__(settings, protocolSettings=protocolSettings)
4848

4949
def read_registers(self, start, count=1, registry_type : Registry_Type = Registry_Type.INPUT, **kwargs):

0 commit comments

Comments
 (0)