diff --git a/pymodbus/client/base.py b/pymodbus/client/base.py index e0772cf5c..2cd9270da 100644 --- a/pymodbus/client/base.py +++ b/pymodbus/client/base.py @@ -161,7 +161,7 @@ async def async_execute(self, request=None) -> ModbusResponse: if not count or not self.no_resend_on_retry: self.transport_send(packet) if self.broadcast_enable and not request.slave_id: - resp = b"Broadcast write sent - no response expected" + resp = None break try: resp = await asyncio.wait_for( diff --git a/test/sub_client/test_client.py b/test/sub_client/test_client.py index a75ba1bc7..298fb41e6 100755 --- a/test/sub_client/test_client.py +++ b/test/sub_client/test_client.py @@ -424,8 +424,7 @@ async def test_client_execute_broadcast(): transport = MockTransport(base, request) base.connection_made(transport=transport) - response = await base.async_execute(request) - assert response == b'Broadcast write sent - no response expected' + assert not await base.async_execute(request) async def test_client_protocol_retry(): """Test the client protocol execute method with retries."""