Update of server table
This commit is contained in:
parent
219d3e250b
commit
1979672c62
@ -12,6 +12,9 @@ import hashlib
|
|||||||
with open("settings.json", "r") as f: # loading settings
|
with open("settings.json", "r") as f: # loading settings
|
||||||
settings = json.load(f)
|
settings = json.load(f)
|
||||||
|
|
||||||
|
with open("filesystem.json", "r") as f: # loading settings
|
||||||
|
filesystem = json.load(f)
|
||||||
|
|
||||||
IP = settings["IP"]
|
IP = settings["IP"]
|
||||||
ID = settings["ID"]
|
ID = settings["ID"]
|
||||||
location = settings["location"]
|
location = settings["location"]
|
||||||
@ -25,11 +28,6 @@ time_to_heartbeat_offline = settings[
|
|||||||
"time_to_heartbeat_offline"] # Raspberry will be requesting heartbeat every __ seconds from offline rpi
|
"time_to_heartbeat_offline"] # Raspberry will be requesting heartbeat every __ seconds from offline rpi
|
||||||
|
|
||||||
# json variables
|
# json variables
|
||||||
filesystem = { # Here will be files saved on this raspberry
|
|
||||||
"otvaracie_hod": ["t", {"pon": "10-25"}, {"uto": "10-25"}],
|
|
||||||
"prehliadka": ["pdf", "/files/prehliadka.pdf"],
|
|
||||||
"fotky_hrad": ["png_z", ["/files/hrad1.png", "/files/hrad2.png"]]
|
|
||||||
}
|
|
||||||
heartbeat_table = settings["heartbeat_table"]
|
heartbeat_table = settings["heartbeat_table"]
|
||||||
sensors = { # List of "live" data like tempeature, etc.
|
sensors = { # List of "live" data like tempeature, etc.
|
||||||
"teplota": 24,
|
"teplota": 24,
|
||||||
@ -140,7 +138,7 @@ def comparision(file: str):
|
|||||||
|
|
||||||
@app.get("/devices_list")
|
@app.get("/devices_list")
|
||||||
def get_devices_list():
|
def get_devices_list():
|
||||||
return heartbeat_table
|
return heartbeat_table["file_system"]
|
||||||
|
|
||||||
|
|
||||||
def send_heartbeat(ip, id):
|
def send_heartbeat(ip, id):
|
||||||
|
@ -12,5 +12,12 @@
|
|||||||
"save_message": false,
|
"save_message": false,
|
||||||
"print_message": true,
|
"print_message": true,
|
||||||
"enable_debug": false
|
"enable_debug": false
|
||||||
}
|
},
|
||||||
|
"heartbeat_table": {
|
||||||
|
"ID": [],
|
||||||
|
"IP": [],
|
||||||
|
"location": [],
|
||||||
|
"file_system": [],
|
||||||
|
"last_heartbeat": []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user