mirror of
https://github.com/ivan-usov-org/bec.git
synced 2025-04-21 02:10:01 +02:00
fix(device_server): fixed readout of objects that are neither devices nor signals
This commit is contained in:
parent
30c4e0b919
commit
b4ee7865ca
@ -103,18 +103,14 @@ class RPCMixin:
|
||||
self.device_manager.devices[device_root].obj,
|
||||
instr_params.get("func").split(".read")[0],
|
||||
)
|
||||
if isinstance(obj, ophyd.Device):
|
||||
return self._rpc_read_and_return(instr)
|
||||
if isinstance(obj, ophyd.Signal):
|
||||
if hasattr(obj, "kind"):
|
||||
if obj.kind not in [ophyd.Kind.omitted, ophyd.Kind.config]:
|
||||
return self._rpc_read_and_return(instr)
|
||||
if obj.kind == ophyd.Kind.config:
|
||||
return self._rpc_read_configuration_and_return(instr)
|
||||
if obj.kind == ophyd.Kind.omitted:
|
||||
return obj.read()
|
||||
raise ValueError(
|
||||
f"Cannot read from object {obj}. The object is not a valid ophyd object (Device or Signal)."
|
||||
)
|
||||
return self._rpc_read_and_return(instr)
|
||||
|
||||
def _handle_rpc_property_set(self, instr: messages.DeviceInstructionMessage) -> None:
|
||||
instr_params = instr.content.get("parameter")
|
||||
|
Loading…
x
Reference in New Issue
Block a user