diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 37828a9..ddadf72 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -46,9 +46,11 @@ class ClientWatcher(QObject): super().__init__(parent) async def run(self): + loop = asyncio.get_running_loop() while self.running: + time = loop.time() await self.update_params() - await asyncio.sleep(self.update_s) + await asyncio.sleep(self.update_s - (loop.time() - time)) async def update_params(self): self.fan_update.emit(await self._client.get_fan())