Fix not actually awaiting for load/save

This commit is contained in:
atse 2024-08-27 17:07:45 +08:00
parent 9910f935a9
commit df79d4d977

View File

@ -66,9 +66,9 @@ class ThermostatCtrlMenu(QtWidgets.QMenu):
self.actionnet_settings_input_diag.triggered.connect(self.net_settings_request) self.actionnet_settings_input_diag.triggered.connect(self.net_settings_request)
self.addAction(self.actionnet_settings_input_diag) self.addAction(self.actionnet_settings_input_diag)
@pyqtSlot(bool) @asyncSlot(bool)
def load(_): async def load(_):
self._thermostat.load_cfg() await self._thermostat.load_cfg()
self._info_box.display_info_box( self._info_box.display_info_box(
"Config loaded", "All channel configs have been loaded from flash." "Config loaded", "All channel configs have been loaded from flash."
@ -78,9 +78,9 @@ class ThermostatCtrlMenu(QtWidgets.QMenu):
self.actionLoad_all_configs.triggered.connect(load) self.actionLoad_all_configs.triggered.connect(load)
self.addAction(self.actionLoad_all_configs) self.addAction(self.actionLoad_all_configs)
@pyqtSlot(bool) @asyncSlot(bool)
def save(_): async def save(_):
self._thermostat.save_cfg() await self._thermostat.save_cfg()
self._info_box.display_info_box( self._info_box.display_info_box(
"Config saved", "All channel configs have been saved to flash." "Config saved", "All channel configs have been saved to flash."