From 98cad51f788937d0b920a3ed85571a01a25f5a44 Mon Sep 17 00:00:00 2001 From: Denis Denisov Date: Fri, 26 Dec 2025 15:09:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A7=D1=83=D1=82=D1=8C=20=D0=B1=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D1=88=D0=B5=20=D0=BB=D0=BE=D0=B3=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contour.py | 4 +++- heat_control.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/contour.py b/contour.py index 355d05a..bd0d36d 100644 --- a/contour.py +++ b/contour.py @@ -27,11 +27,13 @@ class Contour: def check_state(self, state_value, force = False): if self.state == state_value: - return + return False if (self.state is None) or (time.time() - self.state_change_time > self.CHANGE_FREQ) or force: self.state = state_value self.state_change_time = time.time() self.logger.info("Contour " + self.sensor_topic + " changed state to " + str(self.state)) + return True + return False def update_target(self, target_value): self.target_value = target_value diff --git a/heat_control.py b/heat_control.py index 8966846..8c1a5e5 100755 --- a/heat_control.py +++ b/heat_control.py @@ -152,10 +152,12 @@ def check_temperatures(): target_t = c.target_value if contour_t < target_t - hysteresis: # should turn on contour - c.check_state(True) + if c.check_state(True): + logger.info("target: " + str(target_t) + " current: " + str(contour_t) + " hyst: " + str(hysteresis)) if contour_t > target_t + hysteresis: # should turn off contour - c.check_state(False) + if c.check_state(False): + logger.info("target: " + str(target_t) + " current: " + str(contour_t) + " hyst: " + str(hysteresis)) if any_opened: any_opened = False