1
0
forked from M-Labs/thermostat

extra func out

This commit is contained in:
atse 2024-09-03 21:12:10 +08:00
parent 7f62c6ae4f
commit 60672d9590

View File

@ -41,8 +41,10 @@ class Thermostat(QObject, metaclass=PropertyMeta):
async def start_session(self, host, port): async def start_session(self, host, port):
self.connection_state = ThermostatConnectionState.CONNECTING self.connection_state = ThermostatConnectionState.CONNECTING
await self._client.connect(host, port) 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.connection_state = ThermostatConnectionState.CONNECTED
self.start_watching() self.start_watching()
@ -63,9 +65,6 @@ class Thermostat(QObject, metaclass=PropertyMeta):
self._update_params_task = asyncio.create_task(self.update_params()) self._update_params_task = asyncio.create_task(self.update_params())
await asyncio.sleep(self._update_s) await asyncio.sleep(self._update_s)
async def get_hw_rev(self):
return await self._client.hw_rev()
async def update_params(self): async def update_params(self):
if self._poll_for_report: if self._poll_for_report:
( (