Чуть больше логирования

This commit is contained in:
ftc
2025-12-26 15:09:49 +03:00
parent ff11153b36
commit 98cad51f78
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -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