Attempt two at improving the kiln state logic

This commit is contained in:
Charles Descamps 2025-11-22 21:14:52 -07:00
parent 15daabd98f
commit 15742b07ca

View file

@ -97,12 +97,11 @@ def logger(hostname, csvfile, noprofilestats, pidstats, stdout):
if kiln_state == 'IDLE':
kiln_state = 'RUNNING'
prev_kiln_state = 'IDLE'
continue
if msg.get('state') == 'IDLE':
if kiln_state == 'RUNNING':
kiln_state = 'IDLE'
prev_kiln_state = 'RUNNING'
continue
if not noprofilestats:
msg['stamp'] = time.time()
@ -141,7 +140,8 @@ def logger(hostname, csvfile, noprofilestats, pidstats, stdout):
temp = round(msg['temperature'])
# time remaining for the display, calculated for rounded seconds
time_rem = msg['totaltime'] - msg['runtime']
if time_rem == -1 or kiln_state == 'IDLE':
if time_rem == -1:
if kiln_state == 'IDLE':
if prev_kiln_state == 'RUNNING':
seg.text = f"DONE....TEMP{temp:4.0f}"
else: