From 7c2f8687495f8478cf637c0f30f932947d1bfab2 Mon Sep 17 00:00:00 2001 From: "Ryan@pi02" Date: Wed, 17 Jan 2024 15:01:35 -0500 Subject: [PATCH] added peraccl, valve2, valve2, HV, boiler, and ionizer to the output data.txt --- Listen2Arduino.py | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Listen2Arduino.py b/Listen2Arduino.py index 2967930..845575c 100755 --- a/Listen2Arduino.py +++ b/Listen2Arduino.py @@ -34,7 +34,36 @@ while True: # print(f"{key} value={value}") with open(outFile, "w") as file: - for key, value in format_value.items(): - file.write(f"{key} value={value}\n") + for key, value in format_value.items(): + file.write(f"{key} value={value}\n") + if key == "State" : + if value == "0" or value == "1": + file.write(f"preaccl value=1\n") + file.write(f"valve1 value=1\n") + file.write(f"valve2 value=1\n") + file.write(f"hv value=1\n") + file.write(f"boiler value=1\n") + file.write(f"ion value=1\n") + if value == "2": + file.write(f"preaccl value=0\n") + file.write(f"valve1 value=1\n") + file.write(f"valve2 value=1\n") + file.write(f"hv value=0\n") + file.write(f"boiler value=1\n") + file.write(f"ion value=1\n") + if value == "3": + file.write(f"preaccl value=0\n") + file.write(f"valve1 value=0\n") + file.write(f"valve2 value=0\n") + file.write(f"hv value=0\n") + file.write(f"boiler value=1\n") + file.write(f"ion value=0\n") + if value == "4": + file.write(f"preaccl value=0\n") + file.write(f"valve1 value=0\n") + file.write(f"valve2 value=0\n") + file.write(f"hv value=0\n") + file.write(f"boiler value=0\n") + file.write(f"ion value=0\n") os.system(cmd)