Skip to content

Commit

Permalink
go coro
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Wegmann committed Aug 16, 2024
1 parent 124d432 commit 205247d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/secop_ophyd/SECoPDevices.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,15 @@ def __init__(self, secclient: AsyncFrappyClient, module_name: str):

super().__init__(secclient, module_name)

async def __go_coro(self):
await self._secclient.exec_command(module=self._module,command="go")
await self.wait_for_idle()

def trigger(self) -> AsyncStatus:
async def go_coro(self):
await self._secclient.exec_command(module=self._module, command="go")
await self.wait_for_idle()
return AsyncStatus(awaitable=self.__go_coro())



return AsyncStatus(awaitable=go_coro())


class SECoPWritableDevice(SECoPReadableDevice):
Expand Down Expand Up @@ -754,12 +757,10 @@ def class_from_instance(self, path_to_module: str | None = None):
# Modules
if isinstance(
attr_value,
(
SECoPReadableDevice,
SECoPWritableDevice,
SECoPMoveableDevice,
SECoPTriggerableDevice,
),
(SECoPReadableDevice,
SECoPWritableDevice,
SECoPMoveableDevice,
SECoPTriggerableDevice),
):
attr_type = type(attr_value)
module = str(getattr(attr_type, "__module__", None))
Expand Down

0 comments on commit 205247d

Please sign in to comment.