From 764774fbce56661c2c33cdce5f63570c1705657b Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 18 Nov 2024 17:45:13 +0800 Subject: [PATCH] PyThermostat: Remove report mode in autotune.py --- pythermostat/autotune.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pythermostat/autotune.py b/pythermostat/autotune.py index e67c17a..dada469 100644 --- a/pythermostat/autotune.py +++ b/pythermostat/autotune.py @@ -1,5 +1,6 @@ import math import logging +import time from collections import deque, namedtuple from enum import Enum @@ -236,13 +237,14 @@ def main(): tec = Client() - data = next(tec.report_mode()) + data = tec.get_report() ch = data[channel] tuner = PIDAutotune(target_temperature, output_step, lookback, noiseband, ch['interval']) - for data in tec.report_mode(): + while True: + data = tec.get_report() ch = data[channel] @@ -255,6 +257,8 @@ def main(): tec.set_param("output", channel, "i_set", tuner_out) + time.sleep(0.05) + tec.set_param("output", channel, "i_set", 0) -- 2.47.0