From 10b9ece9c8e750a60023a0ae41b86fa67d76a43b Mon Sep 17 00:00:00 2001 From: akrherz Date: Mon, 2 Dec 2024 10:21:57 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Address=20lint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/onewire_runner.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/util/onewire_runner.py b/util/onewire_runner.py index 4e553f81..03e24d01 100644 --- a/util/onewire_runner.py +++ b/util/onewire_runner.py @@ -16,6 +16,10 @@ def work(): stderr=subprocess.PIPE, ) as proc: stdout, stderr = proc.communicate() + if stderr != b"": + print("Rut roh") + print(stderr.decode("ascii")) + return d = stdout.decode("ascii").split("\n") with open("onewire.txt", "w") as fh: fh.write("\n".join(d)) @@ -35,8 +39,8 @@ def work(): fp = f"ot0003_{now:%Y%m%d%H%M}.dat" with open(fp, "w") as fh: fh.write( - "104,%s,%s, %s, %s, %s,11.34\n" - % (now.strftime("%Y,%j,%H%M"), data[0], data[1], data[2], data[3]) + f"104,{now:%Y},{now:%j},{now:%%H%M},{data[0]}, " + f"{data[1]}, {data[2]}, {data[3]},11.34\n" ) subprocess.call(["/home/meteor_ldm/bin/pqinsert", fp]) os.remove(fp)