atomic fixes, removed tasked and muted

This commit is contained in:
Devaev Maxim
2020-03-03 23:48:53 +03:00
parent 3b16242cfa
commit 552bb93212
6 changed files with 124 additions and 153 deletions

View File

@@ -64,13 +64,10 @@ class WakeOnLan:
async def wakeup(self) -> None:
if not self.__magic:
raise WolDisabledError()
await self.__inner_wakeup()
@aiotools.tasked
@aiotools.muted("Can't perform Wake-on-LAN or operation was not completed")
async def __inner_wakeup(self) -> None:
logger = get_logger(0)
logger.info("Waking up %s (%s:%s) using Wake-on-LAN ...", self.__mac, self.__ip, self.__port)
sock: Optional[socket.socket] = None
try:
# TODO: IPv6 support: http://lists.cluenet.de/pipermail/ipv6-ops/2014-September/010139.html