From 9900bb442153a27e2ceca0c8a188fe3c8d456b1f Mon Sep 17 00:00:00 2001 From: James Kirikland Garner Date: Thu, 15 Dec 2022 14:49:32 -0800 Subject: [PATCH] Oven watcher time hard coded, added test json --- config.py | 2 +- lib/oven.py | 2 +- lib/ovenWatcher.py | 4 +--- storage/profiles/test-fast.json | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 storage/profiles/test-fast.json diff --git a/config.py b/config.py index a3ac87c..1e3cd4c 100644 --- a/config.py +++ b/config.py @@ -82,7 +82,7 @@ max31856 = 0 # Every N seconds a decision is made about switching the relay[s] # on & off and for how long. The thermocouple is read # temperature_average_samples times during and the average value is used. -sensor_time_wait = 0.2 +sensor_time_wait = 2 ######################################################################## diff --git a/lib/oven.py b/lib/oven.py index 82c7bc7..411db71 100644 --- a/lib/oven.py +++ b/lib/oven.py @@ -573,7 +573,7 @@ class SimulatedOven(Oven): if heat_on > 0: self.heat = heat_on - log.info("simulation: -> %dW heater: %.0f -> %dW oven: %.0f -> %dW env" % (int(self.p_heat * pid), + log.info("simulation: -> %dW heater: %.0f -> %dW oven: %.0f -> %dW env" % (int(self.p_heat * pid), self.t_h, int(self.p_ho), self.t, diff --git a/lib/ovenWatcher.py b/lib/ovenWatcher.py index cd0b6ea..157a3be 100644 --- a/lib/ovenWatcher.py +++ b/lib/ovenWatcher.py @@ -35,10 +35,8 @@ class OvenWatcher(threading.Thread): self.recording = False self.notify_all(oven_state) + time.sleep(0.5) - time.sleep(self.oven.time_step) - - def lastlog_subset(self,maxpts=50): '''send about maxpts from lastlog by skipping unwanted data''' totalpts = len(self.last_log) diff --git a/storage/profiles/test-fast.json b/storage/profiles/test-fast.json new file mode 100644 index 0000000..b863af2 --- /dev/null +++ b/storage/profiles/test-fast.json @@ -0,0 +1 @@ +{"data": [[0, 200], [3600, 200], [10800, 2000], [14400, 2250], [16400, 2250], [19400, 70]], "type": "profile", "name": "test-fast"}