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

fixed incorrect formatting of enum values on soft signal set #417

Closed evalott100 closed 6 days ago

evalott100 commented 6 days ago

Currently the code incorrectly formats enum put values into their string version on SoftSignalBackend leading to the following bug:

    soft_signal = SoftSignalBackend(MyEnum)
    await soft_signal.connect()
    assert (await soft_signal.get_value()) is MyEnum.a
    await soft_signal.put(MyEnum.b)
    # fails, the value is now the string form
    assert (await soft_signal.get_value()) is MyEnum.b

@DiamondJoseph This was the cause of the error in the tetramm tests https://github.com/DiamondLightSource/dodal/issues/649