forked from M-Labs/thermostat
params update concurrently
This commit is contained in:
parent
067ab925dd
commit
f93e76eaa0
@ -64,16 +64,23 @@ class Thermostat(QObject, metaclass=PropertyMeta):
|
||||
return self.hw_rev
|
||||
|
||||
async def update_params(self):
|
||||
self.fan = await self._client.get_fan()
|
||||
self.pwm = await self._client.get_pwm()
|
||||
fan_task = asyncio.create_task(self._client.get_fan())
|
||||
pwm_task = asyncio.create_task(self._client.get_pwm())
|
||||
pid_task = asyncio.create_task(self._client.get_pid())
|
||||
report_task = asyncio.create_task(self._client.report())
|
||||
thermistor_task = asyncio.create_task(self._client.get_steinhart_hart())
|
||||
postfilter_task = asyncio.create_task(self._client.get_postfilter())
|
||||
|
||||
self.fan = await fan_task
|
||||
self.pwm = await pwm_task
|
||||
if self._poll_for_report:
|
||||
self.report = await self._client.report()
|
||||
self.report = await report_task
|
||||
self.interval = [
|
||||
self.report[i]["interval"] for i in range(len(self.report))
|
||||
]
|
||||
self.pid = await self._client.get_pid()
|
||||
self.thermistor = await self._client.get_steinhart_hart()
|
||||
self.postfilter = await self._client.get_postfilter()
|
||||
self.pid = await pid_task
|
||||
self.thermistor = await thermistor_task
|
||||
self.postfilter = await postfilter_task
|
||||
|
||||
def connected(self):
|
||||
return self._client.connected()
|
||||
|
Loading…
Reference in New Issue
Block a user