From 322b97bd522c93262c21b33850b079a7db9ecc03 Mon Sep 17 00:00:00 2001
From: atse <atse@m-labs.hk>
Date: Wed, 28 Aug 2024 11:07:34 +0800
Subject: [PATCH] Assign connection_errored as well

---
 pytec/pytec/gui/model/thermostat.py | 5 +----
 pytec/tec_qt.py                     | 2 --
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/pytec/pytec/gui/model/thermostat.py b/pytec/pytec/gui/model/thermostat.py
index 6b97cab..d70872b 100644
--- a/pytec/pytec/gui/model/thermostat.py
+++ b/pytec/pytec/gui/model/thermostat.py
@@ -55,14 +55,11 @@ class Thermostat(QObject, metaclass=PropertyMeta):
                         exc_info=True,
                     )
                     self.connection_error.emit()
+                    self.connection_errored = True
                     return
                 self._update_params_task = asyncio.create_task(self.update_params())
             await asyncio.sleep(self._update_s)
 
-    @pyqtSlot()
-    def timed_out(self):
-        self.connection_errored = True
-
     async def get_hw_rev(self):
         return await self._client.hw_rev()
 
diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py
index 92d72eb..1df72b6 100755
--- a/pytec/tec_qt.py
+++ b/pytec/tec_qt.py
@@ -72,8 +72,6 @@ class MainWindow(QtWidgets.QMainWindow):
 
         self.thermostat.connection_error.connect(handle_connection_error)
 
-        self.thermostat.connection_error.connect(self.thermostat.timed_out)
-
         self.thermostat.connection_state_changed.connect(self._on_connection_changed)
 
         self.autotuners = PIDAutoTuner(self, self.thermostat, 2)