In https://github.com/DiamondLightSource/hyperion/issues/1450 we had the usecase where we wanted to monitor multiple signals and raise under one condition or stop monitoring cleanly under another. To aid in this it would be good to have an ophyd-async helper that observed multiple signals and gave you any updates that occured e.g.
async def pin_mounted_or_no_pin_found(self):
async for signal, value in observe_signals_value(self.error_code, self.goinio_pin_sensor):
if signal is self.error_code and value == self.NO_PIN_ERROR_CODE:
# We didn't get a pin
raise RobotLoadFailed(self.NO_PIN_ERROR_CODE, "Pin was not detected")
elif signal is self.goinio_pin_sensor and value == PinMounted.PIN_MOUNTED:
# We did get a pin
break
In https://github.com/DiamondLightSource/hyperion/issues/1450 we had the usecase where we wanted to monitor multiple signals and raise under one condition or stop monitoring cleanly under another. To aid in this it would be good to have an
ophyd-async
helper that observed multiple signals and gave you any updates that occured e.g.