From 3e749353b64e8a2168ae3395c7e806a049345923 Mon Sep 17 00:00:00 2001 From: Alex Ruddick Date: Tue, 23 Jul 2024 20:00:21 -0500 Subject: [PATCH] buildPacket can be used for Request and Response --- pymodbus/framer/old_framer_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymodbus/framer/old_framer_base.py b/pymodbus/framer/old_framer_base.py index 4982d27a9..b737a1b47 100644 --- a/pymodbus/framer/old_framer_base.py +++ b/pymodbus/framer/old_framer_base.py @@ -8,7 +8,7 @@ from pymodbus.factory import ClientDecoder, ServerDecoder from pymodbus.framer.base import FramerBase from pymodbus.logging import Log -from pymodbus.pdu import ModbusRequest +from pymodbus.pdu import ModbusRequest, ModbusResponse if TYPE_CHECKING: @@ -158,7 +158,7 @@ def frameProcessIncomingPacket( ) -> None: """Process new packet pattern.""" - def buildPacket(self, message: ModbusRequest) -> bytes: + def buildPacket(self, message: ModbusRequest | ModbusResponse) -> bytes: """Create a ready to send modbus packet. :param message: The populated request/response to send