From 46831917ba8a6c423711d9c5bed9ee21d80ebea4 Mon Sep 17 00:00:00 2001 From: atse Date: Wed, 28 Aug 2024 11:06:26 +0800 Subject: [PATCH] Back out --- pytec/tec_qt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index b97bca1..92d72eb 100755 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -63,15 +63,16 @@ class MainWindow(QtWidgets.QMainWindow): self.thermostat = Thermostat(self, self.report_refresh_spin.value()) self._connecting_task = None - def handle_connection_error(): + @asyncSlot() + async def handle_connection_error(): self.info_box.display_info_box( "Connection Error", "Thermostat connection lost. Is it unplugged?" ) + await self.thermostat.end_session() self.thermostat.connection_error.connect(handle_connection_error) self.thermostat.connection_error.connect(self.thermostat.timed_out) - self.thermostat.connection_error.connect(self.thermostat.end_session) self.thermostat.connection_state_changed.connect(self._on_connection_changed)