From 969a7be0cc8aff970b2c1ca912113dbc32e3ff74 Mon Sep 17 00:00:00 2001 From: atse Date: Fri, 30 Aug 2024 12:10:01 +0800 Subject: [PATCH] Don't create report task if not polling for it --- pytec/pytec/gui/model/thermostat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytec/pytec/gui/model/thermostat.py b/pytec/pytec/gui/model/thermostat.py index fc5c7dc..d5edafd 100644 --- a/pytec/pytec/gui/model/thermostat.py +++ b/pytec/pytec/gui/model/thermostat.py @@ -69,7 +69,8 @@ class Thermostat(QObject, metaclass=PropertyMeta): 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()) + if self._poll_for_report: + 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())