From 76f7875e3a9e09bcab561f22fc9094b149738860 Mon Sep 17 00:00:00 2001 From: linuswck Date: Tue, 10 Sep 2024 16:06:39 +0800 Subject: [PATCH] gui: await for hard rst and dfu action --- pykirdy/kirdy_qt.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pykirdy/kirdy_qt.py b/pykirdy/kirdy_qt.py index aa4417d..c8e71d0 100644 --- a/pykirdy/kirdy_qt.py +++ b/pykirdy/kirdy_qt.py @@ -563,15 +563,15 @@ class MainWindow(QtWidgets.QMainWindow): ) self.menu_action_about_gui.triggered.connect(about_gui) - @pyqtSlot(bool) - def dfu_mode(_): - self.kirdy.task_dispatcher(self.kirdy.device.dfu()) + @asyncSlot(bool) + async def dfu_mode(_): + await self.kirdy.device.dfu() self.kirdy_handler.end_session() self.menu_action_dfu_mode.triggered.connect(dfu_mode) - @pyqtSlot(bool) - def reset_kirdy(_): - self.kirdy.task_dispatcher(self.kirdy.device.hard_reset()) + @asyncSlot(bool) + async def reset_kirdy(_): + await self.kirdy.device.hard_reset() self.kirdy_handler.end_session() self.menu_action_hard_reset.triggered.connect(reset_kirdy)