diff --git a/pymodbus/file_message.py b/pymodbus/file_message.py index f9a7622b93..f619ace54c 100644 --- a/pymodbus/file_message.py +++ b/pymodbus/file_message.py @@ -2,6 +2,7 @@ Currently none of these messages are implemented """ +from __future__ import annotations __all__ = [ "FileRecord", @@ -147,7 +148,7 @@ def execute(self, _context): # TODO do some new context operation here # pylint: disable=fixme # if file number, record number, or address + length # is too big, return an error. - files = [] + files: list[FileRecord] = [] return ReadFileRecordResponse(files) diff --git a/pymodbus/mei_message.py b/pymodbus/mei_message.py index 1291fbed8e..8d94d3fc79 100644 --- a/pymodbus/mei_message.py +++ b/pymodbus/mei_message.py @@ -147,7 +147,7 @@ def __init__(self, read_code=None, information=None, **kwargs): self.conformity = 0x83 # I support everything right now self.next_object_id = 0x00 self.more_follows = MoreData.NOTHING - self.space_left = None + self.space_left = 253 - 6 def _encode_object(self, object_id, data): """Encode object.""" @@ -170,7 +170,6 @@ def encode(self): packet = struct.pack( ">BBB", self.sub_function_code, self.read_code, self.conformity ) - self.space_left = 253 - 6 objects = b"" try: for object_id, data in iter(self.information.items()):