From 2cbecc0d2c991a75c8735662056a0be540de2e25 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Sat, 8 May 2021 17:25:06 +0100 Subject: [PATCH] add save function for time-stamps with readings above threshold. This is not exactly encoded into the code itself. It's implied and needs to be used with that in mind. It's more of 'save list' function. I will probably rename/refactor this in the future depending on how the project develops. --- src/services/io_services.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/services/io_services.py b/src/services/io_services.py index c445645..03941c6 100644 --- a/src/services/io_services.py +++ b/src/services/io_services.py @@ -15,3 +15,9 @@ def save_rps_totals(totals, path): wtr = csv.writer(result) for k, v in totals.items(): wtr.writerow([k,v]) + +def save_rps_above_threshold(readings, path): + with open(path, mode="w", newline='') as result: + wtr = csv.writer(result) + for item in readings: + wtr.writerow([item])