Open samskiter opened 1 month ago
Can't get this passing - it seems that serial_for_url is used by this library, but there's no way to use that to produce instances of pyserial's RS485 class. Perhaps the solution is to implement some kind of custom URL scheme for this purpose?
Open to suggestions - I can't seem to fix it!
I have no suggestions, the serial library is only used in serial transport and there are no other libraries being used.
serial_for_url is essential for pymodbus since it allows simulating serial communication on a socket, but it's strange if the rs485 do not supply it.
OK, I think this is actually a bit of an awkward solution, but ultimately the correct thing to do.
The purpose of using the RS485 class is to be able to configure RS485Settings, and without injecting those, I'll have to reach inside pymodbus and grab things I shouldn't to set rs485_mode on the sync_serial client. So I opted to allow these settings to be injected along with us in the commparams - there is precedent for params in there to be unused for some transports (e.g. the port
parameter is not used if you have a serial
commtype)
I hope this is an acceptable fix
It is easiest to run locally "pytest --cov"
We have for other reasons decided to make a v3.6.9 that will be done this weekend, so I need an updated PR from you if you want it included.
Fixes: https://github.com/pymodbus-dev/pymodbus/issues/2204