PyThermostat: Remove report mode in autotune.py

This commit is contained in:
atse 2024-11-18 17:45:13 +08:00
parent 4beeec6021
commit 764774fbce

View File

@ -1,5 +1,6 @@
import math import math
import logging import logging
import time
from collections import deque, namedtuple from collections import deque, namedtuple
from enum import Enum from enum import Enum
@ -236,13 +237,14 @@ def main():
tec = Client() tec = Client()
data = next(tec.report_mode()) data = tec.get_report()
ch = data[channel] ch = data[channel]
tuner = PIDAutotune(target_temperature, output_step, tuner = PIDAutotune(target_temperature, output_step,
lookback, noiseband, ch['interval']) lookback, noiseband, ch['interval'])
for data in tec.report_mode(): while True:
data = tec.get_report()
ch = data[channel] ch = data[channel]
@ -255,6 +257,8 @@ def main():
tec.set_param("output", channel, "i_set", tuner_out) tec.set_param("output", channel, "i_set", tuner_out)
time.sleep(0.05)
tec.set_param("output", channel, "i_set", 0) tec.set_param("output", channel, "i_set", 0)