From 41d4154a28a5227af591016c897e5ba518d55d65 Mon Sep 17 00:00:00 2001 From: atse Date: Tue, 3 Sep 2024 21:12:10 +0800 Subject: [PATCH] extra func out --- pytec/pytec/gui/model/thermostat.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pytec/pytec/gui/model/thermostat.py b/pytec/pytec/gui/model/thermostat.py index f6e5bd8..deae06d 100644 --- a/pytec/pytec/gui/model/thermostat.py +++ b/pytec/pytec/gui/model/thermostat.py @@ -41,8 +41,10 @@ class Thermostat(QObject, metaclass=PropertyMeta): async def start_session(self, host, port): self.connection_state = ThermostatConnectionState.CONNECTING + await self._client.connect(host, port) - self.hw_rev = await self.get_hw_rev() + self.hw_rev = await self._client.hw_rev() + self.connection_state = ThermostatConnectionState.CONNECTED self.start_watching() @@ -63,9 +65,6 @@ class Thermostat(QObject, metaclass=PropertyMeta): self._update_params_task = asyncio.create_task(self.update_params()) await asyncio.sleep(self._update_s) - async def get_hw_rev(self): - return await self._client.hw_rev() - async def update_params(self): if self._poll_for_report: (