bluesky / ophyd-async

Hardware abstraction for bluesky written using asyncio
https://blueskyproject.io/ophyd-async
BSD 3-Clause "New" or "Revised" License
7 stars 21 forks source link

epics_signal_rw fail to connect with typeerror when they are not set at epics #353

Open Relm-Arrowny opened 1 month ago

Relm-Arrowny commented 1 month ago

Describe the bug epics_signal_rw requires/expects (str, enum) type even when the epics enum is empty, resulting in a TypeError when attempt to connect.

To Reproduce Connect to an epics pv that has empty enum.
One example would be the xpress3 erase signal (BLXXI-XX-XSP3-01:ERASE)

Expected behavior We expected to be able to use:

class EraseEnum(int, Enum):

or int when pv enum is empty or of an unknown type.

Additional context dodal PR/discussion where I ran into this issue

coretl commented 4 weeks ago

I would suggest you use SignalX instead of SignalRW, then you don't need to provide the datatype, it is a signal you trigger() rather than set(value)