Skip to content

Commit

Permalink
frontend updates
Browse files Browse the repository at this point in the history
  • Loading branch information
beckf committed May 7, 2024
1 parent afc0499 commit f4429d9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions gps_schedule.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"begin": "05:06", "end": "18:05", "enabled": "on"}
5 changes: 5 additions & 0 deletions internal_temp_humidity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"temp": "25",
"humidity": "40",
"voltage": "12.35"
}
11 changes: 8 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,16 @@ def store_internal_enviro():
"""
Store information about control box envirmoent in text file for frontend to read.
:return:
:return: None
"""
threading.Timer(config.frontend_store_data_interval, store_internal_enviro).start()
with open('internal_temp_humidity.txt', 'w') as f:
f.write(str(str(ar.get_temperature()) + "|" + str(ar.get_humidity()) + "|" + str(ar.get_voltage())))
j = {
"temp": str(ar.get_temperature()),
"humidity": str(ar.get_humidity()),
"voltage": str(ar.get_voltage())
}
with open('internal_temp_humidity.json', 'w') as f:
f.write(json.dumps(j))
f.close()


Expand Down

0 comments on commit f4429d9

Please sign in to comment.