changed region methods to async

This commit is contained in:
Devaev Maxim
2020-03-02 01:26:43 +03:00
parent e855976f05
commit 8972357dbc
5 changed files with 31 additions and 32 deletions

View File

@@ -162,7 +162,7 @@ class Plugin(BaseAtx): # pylint: disable=too-many-instance-attributes
@aiotools.atomic
async def __click(self, name: str, pin: int, delay: float) -> None:
with self.__region.exit_only_on_exception():
async with self.__region.exit_only_on_exception():
await self.__inner_click(name, pin, delay)
@aiotools.tasked
@@ -176,5 +176,5 @@ class Plugin(BaseAtx): # pylint: disable=too-many-instance-attributes
gpio.write(pin, False)
await asyncio.sleep(1)
finally:
self.__region.exit()
await self.__region.exit()
get_logger(0).info("Clicked ATX button %r", name)