diff --git a/bec_widgets/cli/rpc/rpc_base.py b/bec_widgets/cli/rpc/rpc_base.py index db7918eb..c7240f6f 100644 --- a/bec_widgets/cli/rpc/rpc_base.py +++ b/bec_widgets/cli/rpc/rpc_base.py @@ -7,6 +7,7 @@ from functools import wraps from typing import TYPE_CHECKING, Any, cast from bec_lib.client import BECClient +from bec_lib.device import DeviceBaseWithConfig from bec_lib.endpoints import MessageEndpoints from bec_lib.utils.import_utils import lazy_import, lazy_import_from @@ -49,12 +50,22 @@ def rpc_call(func): out = [] for arg in args: - if hasattr(arg, "name"): + if isinstance( + arg, DeviceBaseWithConfig + ): # if dev. is passed to GUI, it passes full_name + if hasattr(arg, "full_name"): + arg = arg.full_name + elif hasattr(arg, "name"): arg = arg.name out.append(arg) args = tuple(out) for key, val in kwargs.items(): - if hasattr(val, "name"): + if isinstance( + val, DeviceBaseWithConfig + ): # if dev. is passed to GUI, it passes full_name + if hasattr(val, "full_name"): + kwargs[key] = val.full_name + elif hasattr(val, "name"): kwargs[key] = val.name if not self._root._gui_is_alive(): raise RuntimeError("GUI is not alive") diff --git a/bec_widgets/utils/entry_validator.py b/bec_widgets/utils/entry_validator.py index 1c777d93..2c8e6d79 100644 --- a/bec_widgets/utils/entry_validator.py +++ b/bec_widgets/utils/entry_validator.py @@ -28,6 +28,10 @@ class EntryValidator: if not available_entries: available_entries = [name] + # edge case for if name is passed instead of full_name, should not happen + if entry in signals_dict: + entry = signals_dict[entry].get("obj_name", entry) + if entry is None or entry == "": entry = next(iter(device._hints), name) if hasattr(device, "_hints") else name if entry not in available_entries: