forked from M-Labs/thermostat
No need extra function
This commit is contained in:
parent
b13f481381
commit
6473905488
@ -57,15 +57,12 @@ class Thermostat(QObject, metaclass=PropertyMeta):
|
|||||||
"Encountered an error while polling for information from Thermostat.",
|
"Encountered an error while polling for information from Thermostat.",
|
||||||
exc_info=True,
|
exc_info=True,
|
||||||
)
|
)
|
||||||
await self.handle_connection_error()
|
await self.end_session()
|
||||||
|
self.connection_error.emit()
|
||||||
return
|
return
|
||||||
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 handle_connection_error(self):
|
|
||||||
await self.end_session()
|
|
||||||
self.connection_error.emit()
|
|
||||||
|
|
||||||
async def get_hw_rev(self):
|
async def get_hw_rev(self):
|
||||||
return await self._client.hw_rev()
|
return await self._client.hw_rev()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user