Skip to content

Commit

Permalink
fix(#193): batch local readings by day
Browse files Browse the repository at this point in the history
when not uploading data, store readings locally, one file per day
  • Loading branch information
nils-s committed Aug 9, 2023
1 parent 9acda53 commit e3a7053
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion enviro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e3a7053

Please sign in to comment.