diff --git a/analysis.py b/analysis.py index 34f9565..fa76382 100644 --- a/analysis.py +++ b/analysis.py @@ -6,6 +6,7 @@ from sqlalchemy.orm import sessionmaker from fake_config import Settings from fake_models import MessageSql +import os def download_excel(house_alias, start_ms): settings = Settings(_env_file=dotenv.find_dotenv()) @@ -32,6 +33,8 @@ def download_excel(house_alias, start_ms): # for key, value in flo_params_msg.payload.items(): # print(f'{key}: {value}') + os.remove('result.xlsx') + print("Running Dijkstra and saving analysis to excel...") g = DGraph(flo_params) g.solve_dijkstra() diff --git a/index.html b/index.html index 0dc091c..b3a49cc 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,8 @@ const endUnixMilliseconds = endtime_luxon.toUTC().toMillis(); try { - const response = await fetch('http://localhost:8000/download_excel', { + const response = await fetch(`https://visualizer.electricity.works/download_excel`, { + // const response = await fetch('http://localhost:8000/download_excel', { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -151,8 +152,8 @@ const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; try { - //const response = await fetch(`https://visualizer.electricity.works/plots`, { - const response = await fetch(`http://localhost:8000/plots`, { + const response = await fetch(`https://visualizer.electricity.works/plots`, { + // const response = await fetch(`http://localhost:8000/plots`, { method: 'POST', headers: { 'Content-Type': 'application/json'