diff --git a/pytec/pytec/gui/model/thermostat.py b/pytec/pytec/gui/model/thermostat.py index 59d7fac..43122a9 100644 --- a/pytec/pytec/gui/model/thermostat.py +++ b/pytec/pytec/gui/model/thermostat.py @@ -41,15 +41,13 @@ class Thermostat(QObject, metaclass=PropertyMeta): self._update_params_task = asyncio.create_task(self.update_params()) while True: if self._update_params_task.done(): - if self._update_params_task.exception() is not None: - try: - raise self._update_params_task.exception() - except asyncio.TimeoutError: - logging.error( - "Encountered an error while polling for information from Thermostat.", - exc_info=True, - ) - _ = self._update_params_task.result() + try: + self._update_params_task.result() + except asyncio.TimeoutError: + logging.error( + "Encountered an error while polling for information from Thermostat.", + exc_info=True, + ) self._update_params_task = asyncio.create_task(self.update_params()) await asyncio.sleep(self._update_s)