The static type annotation for the values parameter in the async_setValues method of ModbusBaseSlaveContext is Sequence, which allows passing a tuple. However, when subclass objects use this method with a tuple, it doesn‘t work correctly.
After tracing the execution, I found the root cause: the classes of datablock ModbusSequentialDataBlock and ModbusSparseDataBlock handle non-list inputs by wrapping the entire input into a single-element list , for example (1,2,3) ->[ (1,2,3) ] ,1->[1] .It works when passing a single data to the method . I think we should add logic to handle tuple inputs in classes of datablock or simply change the static annotation from Sequence to `list in order to prevent misunderstanding.
pymodbus version : 3.9.2 ( it is the same on the dev latest branch )