diff --git a/pymodbus/repl/client/main.py b/pymodbus/repl/client/main.py index 5510a94e3..29033ba7f 100644 --- a/pymodbus/repl/client/main.py +++ b/pymodbus/repl/client/main.py @@ -197,7 +197,7 @@ def _print_command_help(self, commands): ) ) - def _process_client(self, text, client): + def _process_client(self, text, client) -> Result: """Process client commands.""" text = text.strip().split() cmd = text[0].split(".")[1] @@ -209,6 +209,7 @@ def _process_client(self, text, client): else: result = Result(getattr(client, cmd)(**kwargs)) result.print_result() + return result def _process_result(self, text, result): """Process result commands.""" @@ -233,7 +234,7 @@ def run(self): elif text.strip().lower() == "exit": raise EOFError() elif text.strip().lower().startswith("client."): - self._process_client(text, self.client) + result = self._process_client(text, self.client) elif text.strip().lower().startswith("result.") and result: self._process_result(text, result) except KeyboardInterrupt: