forked from M-Labs/thermostat
extra func out
This commit is contained in:
parent
6473905488
commit
41d4154a28
@ -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:
|
||||||
(
|
(
|
||||||
|
Loading…
Reference in New Issue
Block a user