Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pymodbus/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def execute(self, request: ModbusRequest | None = None):
# ----------------------------------------------------------------------- #
# Merged client methods
# ----------------------------------------------------------------------- #
async def async_execute(self, request=None) -> ModbusResponse:
async def async_execute(self, request) -> ModbusResponse:
"""Execute requests asynchronously."""
request.transaction_id = self.transaction.getNextTID()
packet = self.framer.buildPacket(request)
Expand Down Expand Up @@ -186,7 +186,7 @@ def callback_data(self, data: bytes, addr: tuple | None = None) -> int:
self.framer.processIncomingPacket(data, self._handle_response, slave=0)
return len(data)

async def connect(self):
async def connect(self) -> bool: # type: ignore[empty-body]
"""Connect to the modbus remote host."""

def raise_future(self, my_future, exc):
Expand Down Expand Up @@ -241,7 +241,7 @@ async def __aenter__(self):
return self

async def __aexit__(self, klass, value, traceback):
"""Implement the client with exit block."""
"""Implement the client with aexit block."""
self.close()

def __str__(self):
Expand Down Expand Up @@ -414,7 +414,7 @@ def get_address_family(cls, address):
return socket.AF_INET
return socket.AF_INET6

def connect(self):
def connect(self) -> bool: # type: ignore[empty-body]
"""Connect to other end, overwritten."""

def close(self):
Expand Down
1 change: 1 addition & 0 deletions test/sub_client/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ async def test_client_build_response():
with pytest.raises(ConnectionException):
await client.build_response(0)


async def test_client_mixin_execute():
"""Test dummy execute for both sync and async."""
client = ModbusClientMixin()
Expand Down