Skip to content

Commit

Permalink
write_register/s accept bytes or int.
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed Oct 10, 2024
1 parent 317f3c8 commit cc61952
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 @@ -111,7 +111,7 @@ def write_coil(self, address: int, value: bool, slave: int = 1) -> T:
"""
return self.execute(pdu_bit_write.WriteSingleCoilRequest(address, value, slave=slave))

def write_register(self, address: int, value: bytes, slave: int = 1) -> T:
def write_register(self, address: int, value: bytes | int, slave: int = 1) -> T:
"""Write register (code 0x06).
:param address: Address to write to
Expand Down Expand Up @@ -322,7 +322,7 @@ def write_coils(
)

def write_registers(
self, address: int, values: list[bytes], slave: int = 1, skip_encode: bool = False) -> T:
self, address: int, values: list[bytes | int], slave: int = 1, skip_encode: bool = False) -> T:
"""Write registers (code 0x10).
:param address: Start address to write to
Expand Down

0 comments on commit cc61952

Please sign in to comment.