diff options
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/apps/kvmd/atx.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kvmd/apps/kvmd/atx.py b/kvmd/apps/kvmd/atx.py index 8444c097..7bf237c9 100644 --- a/kvmd/apps/kvmd/atx.py +++ b/kvmd/apps/kvmd/atx.py @@ -66,7 +66,13 @@ class Atx: # pylint: disable=too-many-instance-attributes get_logger().info("Clicked reset") async def __click(self, pin: int, delay: float) -> None: - with self.__region: + self.__region.enter() + asyncio.ensure_future(self.__inner_click(pin, delay)) + + async def __inner_click(self, pin: int, delay: float) -> None: + try: for flag in (True, False): gpio.write(pin, flag) await asyncio.sleep(delay) + finally: + self.__region.exit() |