diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 8447d12..b395f52 100755 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -65,11 +65,12 @@ class MainWindow(QtWidgets.QMainWindow): ) 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?" ) - self.thermostat.end_session() + await self.thermostat.end_session() self.thermostat.connection_error.connect(handle_connection_error)