diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index b08e680..b031fe3 100755 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -256,12 +256,13 @@ class MainWindow(QtWidgets.QMainWindow): @asyncSlot() async def on_connect_btn_clicked(self): if (self._connecting_task is None) and (not self.thermostat.connected()): - host = self.conn_menu.host_set_line.text() - port = self.conn_menu.port_set_spin.value() - await self._on_connection_changed(ThermostatConnectionState.CONNECTING) + self._connecting_task = asyncio.create_task( - self.thermostat.start_session(host=host, port=port) + self.thermostat.start_session( + host=self.conn_menu.host_set_line.text(), + port=self.conn_menu.port_set_spin.value(), + ) ) try: await self._connecting_task