From e3a7053605ddac08ffb83050d20a31627b55dcda Mon Sep 17 00:00:00 2001 From: nils-s <28589333+nils-s@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:55:05 +0200 Subject: [PATCH] fix(#193): batch local readings by day when not uploading data, store readings locally, one file per day --- enviro/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enviro/__init__.py b/enviro/__init__.py index 236f280..275eb38 100644 --- a/enviro/__init__.py +++ b/enviro/__init__.py @@ -367,7 +367,7 @@ def get_sensor_readings(): def save_reading(readings): # open todays reading file and save readings helpers.mkdir_safe("readings") - readings_filename = f"readings/{helpers.datetime_file_string()}.txt" + readings_filename = f"readings/{helpers.date_string()}.txt" new_file = not helpers.file_exists(readings_filename) with open(readings_filename, "a") as f: if new_file: