adding state page

This commit is contained in:
jbruce12000
2024-07-23 15:23:28 -04:00
parent 168204bdb3
commit f2cf1675cb
5 changed files with 434 additions and 0 deletions
+7
View File
@@ -342,6 +342,7 @@ class Oven(threading.Thread):
self.heat_rate = 0
self.heat_rate_temps = []
self.pid = PID(ki=config.pid_ki, kd=config.pid_kd, kp=config.pid_kp)
self.catching_up = False
@staticmethod
def get_start_from_temperature(profile, temp):
@@ -407,10 +408,15 @@ class Oven(threading.Thread):
if self.target - temp > config.pid_control_window:
log.info("kiln must catch up, too cold, shifting schedule")
self.start_time = self.get_start_time()
self.catching_up = True;
return
# kiln too hot, wait for it to cool down
if temp - self.target > config.pid_control_window:
log.info("kiln must catch up, too hot, shifting schedule")
self.start_time = self.get_start_time()
self.catching_up = True;
return
self.catching_up = False;
def update_runtime(self):
@@ -473,6 +479,7 @@ class Oven(threading.Thread):
'currency_type': config.currency_type,
'profile': self.profile.name if self.profile else None,
'pidstats': self.pid.pidstats,
'catching_up': self.catching_up,
}
return state