Skip to content

Commit

Permalink
to allow to use write_registers typecorrectly with values as inhomoge…
Browse files Browse the repository at this point in the history
…neous lists of type list[int] or list[bytes] we promote the type of values from list to Sequence (see Issue pymodbus-dev#2368)
  • Loading branch information
MAKOMO committed Oct 24, 2024
1 parent 13d29a7 commit a2554b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pymodbus/client/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import struct
from enum import Enum
from typing import Generic, TypeVar
from typing import Generic, TypeVar, Sequence

import pymodbus.pdu.bit_read_message as pdu_bit_read
import pymodbus.pdu.bit_write_message as pdu_bit_write
Expand Down Expand Up @@ -341,7 +341,7 @@ def write_coils(
def write_registers(
self,
address: int,
values: list[bytes | int],
values: Sequence[bytes | int],
slave: int = 1,
skip_encode: bool = False,
no_response_expected: bool = False
Expand Down

0 comments on commit a2554b0

Please sign in to comment.