common component interface

This commit is contained in:
Devaev Maxim
2020-06-06 06:29:29 +03:00
parent 4f3ebf0fd1
commit 1d7d4100a5
7 changed files with 60 additions and 53 deletions

View File

@@ -37,7 +37,7 @@ class AtxDisabledError(AtxOperationError):
# =====
class Plugin(BaseAtx):
def get_state(self) -> Dict:
async def get_state(self) -> Dict:
return {
"enabled": False,
"busy": False,
@@ -49,7 +49,7 @@ class Plugin(BaseAtx):
async def poll_state(self) -> AsyncGenerator[Dict, None]:
while True:
yield self.get_state()
yield (await self.get_state())
await aiotools.wait_infinite()
# =====