From c43770ace513c7451057b058373c62d21379b1ba Mon Sep 17 00:00:00 2001 From: James Kirikland Garner Date: Sun, 18 Dec 2022 10:30:07 -0800 Subject: [PATCH] Removed changes not needed for PR --- Test/test_Profile.py | 49 -------------------------------------------- config.py | 4 ++-- lib/oven.py | 2 +- lib/ovenWatcher.py | 1 - 4 files changed, 3 insertions(+), 53 deletions(-) delete mode 100644 Test/test_Profile.py diff --git a/Test/test_Profile.py b/Test/test_Profile.py deleted file mode 100644 index 7c579b2..0000000 --- a/Test/test_Profile.py +++ /dev/null @@ -1,49 +0,0 @@ -from lib.oven import Profile -import os -import json - -def get_profile(): - profile_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'storage', 'profiles', "test-fast.json")) - print(profile_path) - with open(profile_path) as infile: - profile_json = json.dumps(json.load(infile)) - profile = Profile(profile_json) - - return profile - - -def test_get_target_temperature(): - profile = get_profile() - - temperature = profile.get_target_temperature(3000) - assert int(temperature) == 178 - - temperature = profile.get_target_temperature(6004) - assert temperature == 801.0 - - -def test_shift_remaining_segments(): - profile = get_profile() - - now = 6000 - shift_seconds = 100 - profile.shift_remaining_segments(now, shift_seconds) - - assert profile.data[0][0] == 0 - assert profile.data[1][0] == 3600 - assert profile.data[2][0] == 10900 - assert profile.data[3][0] == 14500 - assert profile.data[4][0] == 16500 - assert profile.data[5][0] == 19500 - - -def test_get_next_point(): - profile = get_profile() - - now = 6000 - segment = profile.get_next_point(now) - assert segment == 2 - - now = 14405 - segment = profile.get_next_point(now) - assert segment == 4 diff --git a/config.py b/config.py index 415d64a..472dfb0 100644 --- a/config.py +++ b/config.py @@ -149,7 +149,7 @@ kiln_must_catch_up = True # or 100% off because the kiln is too hot. No integral builds up # outside the window. The bigger you make the window, the more # integral you will accumulate. This should be a positive integer. -pid_control_window = 50 #degrees +pid_control_window = 5 #degrees # thermocouple offset # If you put your thermocouple in ice water and it reads 36F, you can @@ -205,7 +205,7 @@ ignore_tc_too_many_errors = False # cleaned up (deleted) by the OS on boot. # The state file is written to disk every sensor_time_wait seconds (2s by default) # and is written in the same directory as config.py. -automatic_restarts = False +automatic_restarts = True automatic_restart_window = 15 # max minutes since power outage automatic_restart_state_file = os.path.abspath(os.path.join(os.path.dirname( __file__ ),'state.json')) diff --git a/lib/oven.py b/lib/oven.py index 411db71..117b543 100644 --- a/lib/oven.py +++ b/lib/oven.py @@ -322,7 +322,7 @@ class Oven(threading.Thread): self.cost = 0 self.state = "IDLE" self.profile = None - self.start_time = datetime.datetime.now() + self.start_time = 0 self.runtime = 0 self.totaltime = 0 self.target = 0 diff --git a/lib/ovenWatcher.py b/lib/ovenWatcher.py index 157a3be..462e811 100644 --- a/lib/ovenWatcher.py +++ b/lib/ovenWatcher.py @@ -1,6 +1,5 @@ import threading,logging,json,time,datetime -import config from oven import Oven log = logging.getLogger(__name__)