When writing single register it looks like def _format_response function is expected to get back a list of register values num_registers = len(modbus_values) but since it is a single register is written, there is no list and traceback is generated.
The register does get written though. Here is an example:
modbus.write_holding_register(register_addr=43004, value=38)
Error
Traceback (most recent call last):
File "D:\Data\Python\Projects\solismon3\examples\client_example.py", line 48, in <module>
main()
File "D:\Data\Python\Projects\solismon3\examples\client_example.py", line 43, in main
modbus.write_holding_register(register_addr=43004, value=38)
File "D:\Data\Python\Projects\solismon3\pysolarmanv5\pysolarmanv5.py", line 228, in write_holding_register
value = self._format_response(modbus_values, **kwargs)
File "D:\Data\Python\Projects\solismon3\pysolarmanv5\pysolarmanv5.py", line 179, in _format_response
num_registers = len(modbus_values)
TypeError: object of type 'int' has no len()
When writing single register it looks like
def _format_response
function is expected to get back a list of register valuesnum_registers = len(modbus_values)
but since it is a single register is written, there is no list and traceback is generated. The register does get written though. Here is an example:modbus.write_holding_register(register_addr=43004, value=38)
Error