Reorder arguments of iec_to_modbus function.
This commit is contained in:
@@ -304,9 +304,9 @@ class Address:
|
||||
def iec_to_modbus(
|
||||
cls,
|
||||
iec_address: str,
|
||||
digits: int = 6,
|
||||
string_length: int | str = 0,
|
||||
string_parity: StringParity | str = StringParity.L,
|
||||
digits: int = 6,
|
||||
) -> str:
|
||||
"""Convert an address from IEC to Modbus without raising an error."""
|
||||
try:
|
||||
@@ -388,5 +388,5 @@ class Address:
|
||||
if self.bit is not None:
|
||||
parts.append(f".{self.bit:02d}")
|
||||
elif self.string_length > 0:
|
||||
parts.append(f".{self.string_length}{self.string_parity}")
|
||||
parts.append(f".{self.string_length}{self.string_parity.upper()}")
|
||||
return "".join(parts)
|
||||
|
||||
Reference in New Issue
Block a user