no more busyloops in stub plugins

This commit is contained in:
Devaev Maxim
2020-03-01 04:30:32 +03:00
parent ff6e284e64
commit 44b0ab19bf
3 changed files with 11 additions and 5 deletions

View File

@@ -20,11 +20,11 @@
# ========================================================================== #
import asyncio
from typing import Dict
from typing import AsyncGenerator
from ... import aiotools
from . import AtxOperationError
from . import BaseAtx
@@ -50,7 +50,7 @@ class Plugin(BaseAtx):
async def poll_state(self) -> AsyncGenerator[Dict, None]:
while True:
yield self.get_state()
await asyncio.sleep(60)
await aiotools.wait_infinite()
# =====