Skip to content

Commit

Permalink
fix(pymodbus): Fix deprecation notice in version 3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ahinko committed Dec 11, 2024
1 parent bd469a2 commit 67e9b80
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
from pymodbus import pymodbus_apply_logging_config
from pymodbus.client import ModbusTcpClient
from pymodbus.exceptions import ModbusException
from pymodbus.constants import Endian
from pymodbus.payload import BinaryPayloadDecoder

VERSION = "1.1.2"

Expand Down Expand Up @@ -460,14 +458,11 @@ def main(self):
2,
)

decoder = BinaryPayloadDecoder.fromRegisters(
value = ModbusTcpClient.convert_from_registers(
values,
byteorder=Endian.BIG,
wordorder=Endian.BIG,
data_type=ModbusTcpClient.DATATYPE.INT32,
)

value = str(decoder.decode_32bit_int())

elif sensor["modbus"]["read_type"] == "composed_datetime":
values = self.pick_from_registers(
registers,
Expand Down

0 comments on commit 67e9b80

Please sign in to comment.