From 48907c02d194f0765a8d8719861cb4a8fca54ed3 Mon Sep 17 00:00:00 2001 From: atse Date: Tue, 3 Sep 2024 21:09:30 +0800 Subject: [PATCH] No need extra function --- pytec/pytec/gui/model/thermostat.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pytec/pytec/gui/model/thermostat.py b/pytec/pytec/gui/model/thermostat.py index 69ddd40..f6e5bd8 100644 --- a/pytec/pytec/gui/model/thermostat.py +++ b/pytec/pytec/gui/model/thermostat.py @@ -57,15 +57,12 @@ class Thermostat(QObject, metaclass=PropertyMeta): "Encountered an error while polling for information from Thermostat.", exc_info=True, ) - await self.handle_connection_error() + await self.end_session() + self.connection_error.emit() return self._update_params_task = asyncio.create_task(self.update_params()) await asyncio.sleep(self._update_s) - async def handle_connection_error(self): - await self.end_session() - self.connection_error.emit() - async def get_hw_rev(self): return await self._client.hw_rev()